-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpostgresql-writer-job.yaml
59 lines (59 loc) · 1.78 KB
/
postgresql-writer-job.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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
apiVersion: batch/v1
kind: Job
metadata:
name: postgres-writer-job
spec:
template:
metadata:
name: postgres-writer-pod
spec:
restartPolicy: Never
containers:
- name: postgres-writer
image: registry.cloud-garage.net/rguske/postgres-writer-app:1.0
env:
- name: POSTGRES_HOST
valueFrom:
secretKeyRef:
name: postgres-secret
key: host
- name: POSTGRES_PORT
valueFrom:
secretKeyRef:
name: postgres-secret
key: port
- name: POSTGRES_USERNAME
valueFrom:
secretKeyRef:
name: postgres-secret
key: username
- name: POSTGRES_PASSWORD
valueFrom:
secretKeyRef:
name: postgres-secret
key: password
- name: POSTGRES_DB
valueFrom:
secretKeyRef:
name: postgres-secret
key: database
- name: TABLE
valueFrom:
secretKeyRef:
name: postgres-secret
key: table
- name: COLUMN1
valueFrom:
secretKeyRef:
name: postgres-secret
key: column1
- name: COLUMN2
valueFrom:
secretKeyRef:
name: postgres-secret
key: column2
command: ["python", "postgresql-app.py"]
# imagePullSecrets:
# - name: # Optional: If your image is in a private registry
imagePullPolicy: Always
backoffLimit: 0 # Ensures that the job doesn't retry in case of failure