Skip to content

Commit

Permalink
update the changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Neha Sharma committed Feb 11, 2025
1 parent 3a1e48c commit 39044f6
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 34 deletions.
12 changes: 7 additions & 5 deletions charts/devtron-backups/templates/backup-on-azure.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ spec:
spec:
initContainers:
- name: postgres-app-backup-cronjob
image: {{ .Values.postgres_backup.postgresImage | default "postgres:12" }}
image: {{ .Values.postgres_backup.postgresImage | default "postgres:14" }}
volumeMounts:
- mountPath: /postgres
name: psql-volume
Expand All @@ -61,7 +61,7 @@ spec:
- -c
- set -ex ; pg_dumpall -h {{ .Values.postgres_backup.host | default "postgresql-postgresql.devtroncd" }} --exclude-database=clairv4 -p 5432 -U postgres --no-privileges > /postgres/backup.tar; echo $? ; du -sh /postgres/backup.tar
resources:
{{ toYaml .Values.postgres_backup.resources | indent 12 }}
{{ toYaml .Values.postgres_backup.resources | indent 14 }}
containers:
- name: az-cli-for-upload
image: {{ .Values.global.AZURE.image | default "quay.io/devtron/k8s-utils:az-cli-ubuntu" }}
Expand All @@ -84,14 +84,16 @@ spec:
secretKeyRef:
name: devtron-azure-backup-secret
key: AZURE_BLOB_CONTAINER_FOR_POSTGRES
{{- if .Values.argocd_backup.enabled }}
- name: AZURE_BLOB_CONTAINER_FOR_ARGOCD
valueFrom:
secretKeyRef:
name: devtron-azure-backup-secret
key: AZURE_BLOB_CONTAINER_FOR_ARGOCD
{{- end }}
imagePullPolicy: Always
resources:
{{ toYaml .Values.postgres_backup.resources | indent 12 }}
{{ toYaml .Values.postgres_backup.resources | indent 14 }}
args:
- /bin/bash
- -c
Expand Down Expand Up @@ -155,7 +157,7 @@ spec:
- -c
- {{ .Values.argocd_backup.args | default "argocd admin export -n devtroncd > /argocd/backup.yaml" }}
resources:
{{ toYaml .Values.argocd_backup.resources | indent 12 }}
{{ toYaml .Values.argocd_backup.resources | indent 14 }}
containers:
- name: az-cli-for-upload
image: {{ .Values.global.AZURE.image | default "quay.io/devtron/k8s-utils:az-cli-ubuntu" }}
Expand Down Expand Up @@ -185,7 +187,7 @@ spec:
key: AZURE_BLOB_CONTAINER_FOR_ARGOCD
imagePullPolicy: Always
resources:
{{ toYaml .Values.argocd_backup.resources | indent 12 }}
{{ toYaml .Values.argocd_backup.resources | indent 14 }}
args:
- /bin/bash
- -c
Expand Down
32 changes: 16 additions & 16 deletions charts/devtron-backups/templates/backup-on-gcp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ spec:
spec:
initContainers:
- name: postgres-app-backup-cronjob
image: {{ .Values.postgres_backup.postgresImage | default "postgres:12" }}
image: {{ .Values.postgres_backup.postgresImage | default "postgres:14" }}
volumeMounts:
- mountPath: /postgres
name: psql-volume
Expand All @@ -59,7 +59,7 @@ spec:
- -c
- set -ex; pg_dumpall -h {{ .Values.postgres_backup.host | default "postgresql-postgresql.devtroncd" }} --exclude-database=clairv4 -p 5432 -U postgres --no-privileges > /postgres/backup.tar; echo $? ; du -sh /postgres/backup.tar
resources:
{{ toYaml .Values.postgres_backup.resources | indent 12 }}
{{ toYaml .Values.postgres_backup.resources | indent 14 }}
containers:
- name: gcloud-cli-for-cloud-storage-upload
image: {{ .Values.global.GCP.image | default "google/cloud-sdk:alpine" }}
Expand All @@ -81,7 +81,7 @@ spec:
{{- end }}
imagePullPolicy: Always
resources:
{{ toYaml .Values.postgres_backup.resources | indent 12 }}
{{ toYaml .Values.postgres_backup.resources | indent 14 }}
args:
- /bin/bash
- -c
Expand Down Expand Up @@ -121,18 +121,18 @@ spec:
jobTemplate:
spec:
template:
spec:
{{- if or $.Values.postgres_backup.labels $.Values.postgres_backup.annotations }}
metadata:
{{- if $.Values.postgres_backup.labels }}
labels:
{{ toYaml .Values.postgres_backup.labels | indent 4 }}
{{- end }}
{{- if $.Values.postgres_backup.annotations }}
annotations:
{{ toYaml .Values.postgres_backup.annotations | indent 4 }}
{{- end }}
{{- if or $.Values.postgres_backup.labels $.Values.postgres_backup.annotations }}
metadata:
{{- if $.Values.postgres_backup.labels }}
labels:
{{ toYaml .Values.postgres_backup.labels | indent 4 }}
{{- end }}
{{- if $.Values.postgres_backup.annotations }}
annotations:
{{ toYaml .Values.postgres_backup.annotations | indent 4 }}
{{- end }}
{{- end }}
spec:
initContainers:
- name: argocd-app-backup-job
image: {{ .Values.argocd_backup.argocdImage | default "quay.io/argoproj/argocd:v2.4.0" }}
Expand All @@ -146,7 +146,7 @@ spec:
- -c
- {{ .Values.argocd_backup.args | default "argocd admin export -n devtroncd > /argocd/backup.yaml" }}
resources:
{{ toYaml .Values.argocd_backup.resources | indent 12 }}
{{ toYaml .Values.argocd_backup.resources | indent 14 }}
containers:
- name: gcloud-cli-for-cloud-storage-upload
image: {{ .Values.global.GCP.image | default "google/cloud-sdk:alpine" }}
Expand All @@ -168,7 +168,7 @@ spec:
{{- end }}
imagePullPolicy: Always
resources:
{{ toYaml .Values.argocd_backup.resources | indent 12 }}
{{ toYaml .Values.argocd_backup.resources | indent 14 }}
args:
- /bin/bash
- -c
Expand Down
2 changes: 1 addition & 1 deletion charts/devtron-backups/templates/backup-on-pvc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ spec:
spec:
containers:
- name: postgres-app-backup-cronjob
image: {{ .Values.postgres_backup.postgresImage | default "postgres:12" }}
image: {{ .Values.postgres_backup.postgresImage | default "postgres:14" }}
volumeMounts:
- mountPath: /postgres
name: psql-volume
Expand Down
10 changes: 5 additions & 5 deletions charts/devtron-backups/templates/backup-on-s3.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ spec:
spec:
initContainers:
- name: postgres-app-backup-cronjob
image: {{ .Values.postgres_backup.postgresImage | default "postgres:12" }}
image: {{ .Values.postgres_backup.postgresImage | default "postgres:14" }}
volumeMounts:
- mountPath: /postgres
name: psql-volume
Expand All @@ -64,7 +64,7 @@ spec:
- -c
- set -ex; pg_dumpall -h {{ .Values.postgres_backup.host | default "postgresql-postgresql.devtroncd" }} --exclude-database=clairv4 -p 5432 -U postgres --no-privileges > /postgres/backup.tar; echo $? ; du -sh /postgres/backup.tar
resources:
{{ toYaml .Values.postgres_backup.resources | indent 12 }}
{{ toYaml .Values.postgres_backup.resources | indent 14 }}
containers:
- name: aws-cli-for-s3-download
image: {{ .Values.global.S3.image | default "quay.io/devtron/k8s-utils:ubuntu-aws-cli-multi-arch-1" }}
Expand Down Expand Up @@ -103,7 +103,7 @@ spec:
{{- end }}
imagePullPolicy: Always
resources:
{{ toYaml .Values.postgres_backup.resources | indent 12 }}
{{ toYaml .Values.postgres_backup.resources | indent 14 }}
args:
- /bin/bash
- -c
Expand Down Expand Up @@ -163,7 +163,7 @@ spec:
- -c
- {{ .Values.argocd_backup.args | default "argocd admin export -n devtroncd > /argocd/backup.yaml" }}
resources:
{{ toYaml .Values.argocd_backup.resources | indent 12 }}
{{ toYaml .Values.argocd_backup.resources | indent 14 }}
containers:
- name: aws-cli-for-s3-upload
image: {{ .Values.global.S3.image | default "quay.io/devtron/k8s-utils:ubuntu-aws-cli-multi-arch-1" }}
Expand Down Expand Up @@ -202,7 +202,7 @@ spec:
{{- end }}
imagePullPolicy: Always
resources:
{{ toYaml .Values.argocd_backup.resources | indent 12 }}
{{ toYaml .Values.argocd_backup.resources | indent 14 }}
args:
- /bin/bash
- -c
Expand Down
14 changes: 7 additions & 7 deletions charts/devtron-backups/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ global:
# image: quay.io/devtron/k8s-utils:ubuntu-aws-cli #default amd
# image: quay.io/devtron/k8s-utils:0b9f5ba5-395-11405 #arm
AZURE:
enabled: false
enabled: true
AZURE_BLOB_ACCOUNT_NAME: ""
AZURE_ACCOUNT_KEY: ""
AZURE_BLOB_CONTAINER_FOR_POSTGRES: ""
Expand All @@ -36,7 +36,7 @@ global:
enabled: false
GCS_BUCKET_NAME: "" # Required if GCP is enabled
CREDENTIALS: # Optional. Use only if in case node doesn't have permission to push over GCS.
enabled: false
enabled: true
# Only base64 Encoded JSON CREDENTIALS allowed. Example shown below.
# GCP_CREDENTIALS_JSON: "eyJ0eXBlIjogInNlcnZpY2VfYWNjb3VudCIsInByb2plY3RfaWQiOiAiPHlvdXItcHJvamVjdC1pZD4iLCJwcml2YXRlX2tleV9pZCI6ICI8eW91ci1wcml2YXRlLWtleS1pZD4iLCJwcml2YXRlX2tleSI6ICI8eW91ci1wcml2YXRlLWtleT4iLCJjbGllbnRfZW1haWwiOiAiPHlvdXItY2xpZW50LWVtYWlsPiIsImNsaWVudF9pZCI6ICI8eW91ci1jbGllbnQtaWQ+IiwiYXV0aF91cmkiOiAiaHR0cHM6Ly9hY2NvdW50cy5nb29nbGUuY29tL28vb2F1dGgyL2F1dGgiLCJ0b2tlbl91cmkiOiAiaHR0cHM6Ly9vYXV0aDIuZ29vZ2xlYXBpcy5jb20vdG9rZW4iLCJhdXRoX3Byb3ZpZGVyX3g1MDlfY2VydF91cmwiOiAiaHR0cHM6Ly93d3cuZ29vZ2xlYXBpcy5jb20vb2F1dGgyL3YxL2NlcnRzIiwiY2xpZW50X3g1MDlfY2VydF91cmwiOiAiPHlvdXItY2xpZW50LWNlcnQtdXJsPiJ9Cg=="
GCP_CREDENTIALS_JSON: ""
Expand All @@ -56,13 +56,13 @@ global:
passphrase: "" # Required if encryption is enabled

# Taints and tolerations for both backups
tolerations: []
tolerations: {}
# - key: "example-key"
# operator: "Equal"
# value: "example-value"
# effect: "NoSchedule"
nodeSelector: {}
# kubernetes.io?/hostnam e: "worker-node-1"
# kubernetes.io/hostname: "worker-node-1"

timezone: "" #Set the timezone for scheduling the cronJob. # default UTC

Expand All @@ -79,7 +79,7 @@ postgres_backup:
limits:
cpu: 100m
memory: 100Mi
labels: {}
labels: []
# key: "example-value"
annotations: {}
# key: "example-value"
Expand All @@ -89,15 +89,15 @@ postgres_backup:

argocd_backup:
serviceAccountName: "argocd-backup"
enabled: false
enabled: true
resources:
requests:
cpu: 100m
memory: 100Mi
limits:
cpu: 100m
memory: 100Mi
labels: {}
labels: []
# key: "example-value"
annotations: {}
# key: "example-value"
Expand Down

0 comments on commit 39044f6

Please sign in to comment.