Skip to content

Commit 33f8f57

Browse files
committed
Use emptydir for db pg_dump
Signed-off-by: Harshad Reddy Nalla <[email protected]>
1 parent 7b35363 commit 33f8f57

File tree

7 files changed

+31
-67
lines changed

7 files changed

+31
-67
lines changed

graph-backup-job/base/cronjob.yaml

+8-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,6 +96,8 @@ 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"
@@ -108,4 +112,6 @@ spec:
108112
failureThreshold: 1
109113
periodSeconds: 10
110114
restartPolicy: OnFailure
111-
volumes: []
115+
volumes:
116+
- name: "postgresql-data"
117+
emptyDir: {}

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

+2-21
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-prod/graph-backup-job
@@ -23,26 +22,8 @@ patches:
2322
annotationSelector: "operation=chat-notification"
2423
- patch: |-
2524
- 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"}}
25+
path: "/spec/jobTemplate/spec/template/spec/containers/0/resources"
26+
value: {"requests": {"memory":"1Gi", "cpu": "1", "ephemeral-storage": "20Gi"}, "limits": {"memory":"1Gi", "cpu": "1", "ephemeral-storage": "20Gi"}}
4627
target:
4728
group: batch
4829
version: v1beta1

graph-backup-job/overlays/aws-prod/pvc.yaml

-11
This file was deleted.

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

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

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

+2-21
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
@@ -23,26 +22,8 @@ patches:
2322
annotationSelector: "operation=chat-notification"
2423
- patch: |-
2524
- 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"}}
25+
path: "/spec/jobTemplate/spec/template/spec/containers/0/resources"
26+
value: {"requests": {"memory":"1Gi", "cpu": "1", "ephemeral-storage": "20Gi"}, "limits": {"memory":"1Gi", "cpu": "1", "ephemeral-storage": "20Gi"}}
4627
target:
4728
group: batch
4829
version: v1beta1

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

-12
This file was deleted.

graph-backup-job/overlays/test/kustomization.yaml

+10
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,13 @@ images:
1010
patchesStrategicMerge:
1111
- cronjob.yaml
1212
- imagestreamtag.yaml
13+
patches:
14+
- patch: |-
15+
- op: add
16+
path: "/spec/jobTemplate/spec/template/spec/containers/0/resources"
17+
value: {"requests": {"memory":"1Gi", "cpu": "1", "ephemeral-storage": "1Gi"}, "limits": {"memory":"1Gi", "cpu": "1", "ephemeral-storage": "1Gi"}}
18+
target:
19+
group: batch
20+
version: v1beta1
21+
kind: CronJob
22+
name: graph-backup

0 commit comments

Comments
 (0)