-
Notifications
You must be signed in to change notification settings - Fork 13
/
postgres-import.yaml
43 lines (43 loc) · 1.08 KB
/
postgres-import.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
apiVersion: batch/v1
kind: Job
metadata:
name: postgresdb-import
spec:
activeDeadlineSeconds: 180
ttlSecondsAfterFinished: 3600
template:
spec:
containers:
- image: postgres
name: postgresdb-import
command:
- bash
- -c
- cd && echo "*:*:*:*:$PGPASS" > .pgpass && chmod 600 .pgpass && psql --host=postgresdb --command="\copy todo from '------'"
env:
- name: PGUSER
valueFrom:
secretKeyRef:
name: db-security
key: ------
- name: PGPASS
valueFrom:
secretKeyRef:
name: db-security
key: ------
- name: PGDATABASE
valueFrom:
configMapKeyRef:
name: postgres-config
key: ------
volumeMounts:
- name: postgresdb-importdata
mountPath: /importdata
volumes:
- name: postgresdb-importdata
configMap:
name: postgresdb-importdata
items:
- key: importdata
path: csv
restartPolicy: Never