Skip to content

Commit da50a32

Browse files
authored
Merge pull request #2661 from harshad16/use-empty-dir
Use emptydir for db pg_dump
2 parents 4bdfe9e + f61292c commit da50a32

File tree

4 files changed

+28
-36
lines changed

4 files changed

+28
-36
lines changed

graph-backup-job/base/cronjob.yaml

+10-2
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@ spec:
2323
containers:
2424
- image: graph-backup-job:latest
2525
name: graph-backup
26-
volumeMounts: []
26+
volumeMounts:
27+
- name: postgresql-data
28+
mountPath: "/var/lib/pgsql"
2729
env:
2830
- name: THOTH_DEPLOYMENT_NAME
2931
valueFrom:
@@ -94,18 +96,24 @@ spec:
9496
secretKeyRef:
9597
name: postgresql
9698
key: database-name
99+
- name: THOTH_DATA_DUMP_PATH
100+
value: "/var/lib/pgsql/pg_dump.sql"
97101
resources:
98102
requests:
99103
memory: "1Gi"
100104
cpu: "1"
105+
ephemeral-storage: "1Gi"
101106
limits:
102107
memory: "1Gi"
103108
cpu: "1"
109+
ephemeral-storage: "1Gi"
104110
livenessProbe:
105111
tcpSocket:
106112
port: 80
107113
initialDelaySeconds: 7200
108114
failureThreshold: 1
109115
periodSeconds: 10
110116
restartPolicy: OnFailure
111-
volumes: []
117+
volumes:
118+
- name: "postgresql-data"
119+
emptyDir: {}

graph-backup-job/overlays/moc-prod/kustomization.yaml

+12
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,15 @@ patches:
2020
version: v1
2121
kind: Job
2222
annotationSelector: "operation=chat-notification"
23+
- patch: |-
24+
- op: replace
25+
path: "/spec/jobTemplate/spec/template/spec/containers/0/resources/requests/ephemeral-storage"
26+
value: "20Gi"
27+
- op: replace
28+
path: "/spec/jobTemplate/spec/template/spec/containers/0/resources/limits/ephemeral-storage"
29+
value: "20Gi"
30+
target:
31+
group: batch
32+
version: v1beta1
33+
kind: CronJob
34+
name: graph-backup

graph-backup-job/overlays/ocp4-stage/kustomization.yaml

+6-22
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ kind: Kustomization
33
resources:
44
- ../../base
55
- thoth-notification.yaml
6-
- pvc.yaml
76
images:
87
- name: graph-backup-job
98
newName: image-registry.openshift-image-registry.svc:5000/thoth-graph-stage/graph-backup-job
@@ -22,27 +21,12 @@ patches:
2221
kind: Job
2322
annotationSelector: "operation=chat-notification"
2423
- patch: |-
25-
- op: add
26-
path: "/spec/jobTemplate/spec/template/spec/containers/0/env/-1"
27-
value: {"name": "THOTH_DATA_DUMP_PATH", "value": "/var/lib/pgsql/pg_dump.sql"}
28-
target:
29-
group: batch
30-
version: v1beta1
31-
kind: CronJob
32-
name: graph-backup
33-
- patch: |-
34-
- op: add
35-
path: "/spec/jobTemplate/spec/template/spec/containers/0/volumeMounts/-1"
36-
value: {"name": "postgresql-data","mountPath": "/var/lib/pgsql"}
37-
target:
38-
group: batch
39-
version: v1beta1
40-
kind: CronJob
41-
name: graph-backup
42-
- patch: |-
43-
- op: add
44-
path: "/spec/jobTemplate/spec/template/spec/volumes/-1"
45-
value: {"name": "postgresql-data","persistentVolumeClaim":{"claimName": "dbbackup"}}
24+
- op: replace
25+
path: "/spec/jobTemplate/spec/template/spec/containers/0/resources/requests/ephemeral-storage"
26+
value: "20Gi"
27+
- op: replace
28+
path: "/spec/jobTemplate/spec/template/spec/containers/0/resources/limits/ephemeral-storage"
29+
value: "20Gi"
4630
target:
4731
group: batch
4832
version: v1beta1

graph-backup-job/overlays/ocp4-stage/pvc.yaml

-12
This file was deleted.

0 commit comments

Comments
 (0)