Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use emptydir for db pg_dump #2661

Merged
merged 1 commit into from
Oct 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions graph-backup-job/base/cronjob.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ spec:
containers:
- image: graph-backup-job:latest
name: graph-backup
volumeMounts: []
volumeMounts:
- name: postgresql-data
mountPath: "/var/lib/pgsql"
env:
- name: THOTH_DEPLOYMENT_NAME
valueFrom:
Expand Down Expand Up @@ -94,18 +96,24 @@ spec:
secretKeyRef:
name: postgresql
key: database-name
- name: THOTH_DATA_DUMP_PATH
value: "/var/lib/pgsql/pg_dump.sql"
resources:
requests:
memory: "1Gi"
cpu: "1"
ephemeral-storage: "1Gi"
limits:
memory: "1Gi"
cpu: "1"
ephemeral-storage: "1Gi"
livenessProbe:
tcpSocket:
port: 80
initialDelaySeconds: 7200
failureThreshold: 1
periodSeconds: 10
restartPolicy: OnFailure
volumes: []
volumes:
- name: "postgresql-data"
emptyDir: {}
12 changes: 12 additions & 0 deletions graph-backup-job/overlays/moc-prod/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,15 @@ patches:
version: v1
kind: Job
annotationSelector: "operation=chat-notification"
- patch: |-
- op: replace
path: "/spec/jobTemplate/spec/template/spec/containers/0/resources/requests/ephemeral-storage"
value: "20Gi"
- op: replace
path: "/spec/jobTemplate/spec/template/spec/containers/0/resources/limits/ephemeral-storage"
value: "20Gi"
target:
group: batch
version: v1beta1
kind: CronJob
name: graph-backup
28 changes: 6 additions & 22 deletions graph-backup-job/overlays/ocp4-stage/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ kind: Kustomization
resources:
- ../../base
- thoth-notification.yaml
- pvc.yaml
images:
- name: graph-backup-job
newName: image-registry.openshift-image-registry.svc:5000/thoth-graph-stage/graph-backup-job
Expand All @@ -22,27 +21,12 @@ patches:
kind: Job
annotationSelector: "operation=chat-notification"
- patch: |-
- op: add
path: "/spec/jobTemplate/spec/template/spec/containers/0/env/-1"
value: {"name": "THOTH_DATA_DUMP_PATH", "value": "/var/lib/pgsql/pg_dump.sql"}
target:
group: batch
version: v1beta1
kind: CronJob
name: graph-backup
- patch: |-
- op: add
path: "/spec/jobTemplate/spec/template/spec/containers/0/volumeMounts/-1"
value: {"name": "postgresql-data","mountPath": "/var/lib/pgsql"}
target:
group: batch
version: v1beta1
kind: CronJob
name: graph-backup
- patch: |-
- op: add
path: "/spec/jobTemplate/spec/template/spec/volumes/-1"
value: {"name": "postgresql-data","persistentVolumeClaim":{"claimName": "dbbackup"}}
- op: replace
path: "/spec/jobTemplate/spec/template/spec/containers/0/resources/requests/ephemeral-storage"
value: "20Gi"
- op: replace
path: "/spec/jobTemplate/spec/template/spec/containers/0/resources/limits/ephemeral-storage"
value: "20Gi"
target:
group: batch
version: v1beta1
Expand Down
12 changes: 0 additions & 12 deletions graph-backup-job/overlays/ocp4-stage/pvc.yaml

This file was deleted.