diff --git a/argocd-helm-charts/relate/charts/relate/templates/deployment.yaml b/argocd-helm-charts/relate/charts/relate/templates/deployment.yaml index e8885be88..43c85ef95 100644 --- a/argocd-helm-charts/relate/charts/relate/templates/deployment.yaml +++ b/argocd-helm-charts/relate/charts/relate/templates/deployment.yaml @@ -49,6 +49,11 @@ spec: httpHeaders: - name: Host value: relate + initialDelaySeconds: 500 + periodSeconds: 100 + timeoutSeconds: 300 + failureThreshold: 3 + successThreshold: 1 readinessProbe: httpGet: path: / @@ -56,6 +61,11 @@ spec: httpHeaders: - name: Host value: relate + initialDelaySeconds: 500 + periodSeconds: 100 + timeoutSeconds: 300 + failureThreshold: 3 + successThreshold: 1 {{- if .Values.resources }} resources: {{- toYaml .Values.resources | nindent 12 }} {{- end }} diff --git a/argocd-helm-charts/relate/charts/relate/templates/postgres.yaml b/argocd-helm-charts/relate/charts/relate/templates/postgres.yaml index a14ed0df4..399d8ef66 100644 --- a/argocd-helm-charts/relate/charts/relate/templates/postgres.yaml +++ b/argocd-helm-charts/relate/charts/relate/templates/postgres.yaml @@ -1,22 +1,100 @@ -apiVersion: "acid.zalan.do/v1" -kind: postgresql +{{- if not (.Values.postgresql).enabled }} + +apiVersion: postgresql.cnpg.io/v1 +kind: Cluster metadata: - name: obmondo-postgresql - namespace: relate - labels: - velero.io/exclude-from-backup: "true" + {{ if (.Values.cnpg).recover }} + name: relate-pgsql-recover + {{ else }} + name: relate-pgsql + {{ end }} spec: - enableLogicalBackup: {{ .Values.postgresql.logicalBackup | default "true" }} - teamId: obmondo - volume: - size: {{ .Values.postgresql.size }} - numberOfInstances: 1 - users: - relate_admin: # database owner - - superuser - - createdb - databases: - relate: relate_admin - postgresql: - version: "14" - enableMasterLoadBalancer: false + instances: {{ ((.Values.cnpg).instance) | default 1 }} + {{ if (.Values.cnpg).recover }} + bootstrap: + recovery: relate-pgsql + {{ else }} + bootstrap: + initdb: + database: relate + owner: relate + {{ end }} + resources: + limits: + memory: {{ (((.Values.cnpg).resources).limits).memory | default "800Mi" }} + requests: + memory: {{ (((.Values.cnpg).resources).requests).memory | default "500Mi" }} + cpu: {{ (((.Values.cnpg).resources).requests).cpu | default "100m" }} + storage: + size: {{ (.Values.cnpg).size | default "4Gi" }} + {{- if (.Values.cnpg).storageClass }} + storageClass: {{ (.Values.cnpg).storageClass }} + {{- end }} + {{- if (.Values.cnpg).recover }} + externalClusters: + name: relate-pgsql + barmanObjectStore: + destinationPath: {{ ((.Values.cnpg).backup).destinationPath }} + endpointURL: {{ ((.Values.cnpg).backup).endpointURL }} + {{- if eq ((.Values.cnpg).backup).cloud "aws" }} + s3Credentials: + accessKeyId: + name: relate-pgsql-backup-creds + key: ACCESS_KEY_ID + secretAccessKey: + name: relate-pgsql-backup-creds + key: ACCESS_SECRET_KEY + {{- end }} + {{- if eq ((.Values.cnpg).backup).cloud "azure" }} + azureCredentials: + connectionString: + name: relate-pgsql-backup-creds + key: AZURE_CONNECTION_STRING + storageAccount: + name: relate-pgsql-backup-creds + key: AZURE_STORAGE_ACCOUNT + storageKey: + name: relate-pgsql-backup-creds + key: AZURE_STORAGE_KEY + storageSasToken: + name: relate-pgsql-backup-creds + key: AZURE_STORAGE_SAS_TOKEN + {{- end }} + wal: + maxParallel: 8 + {{- end }} + {{- if (.Values.cnpg).backup }} + backup: + barmanObjectStore: + destinationPath: {{ ((.Values.cnpg).backup).destinationPath }} + endpointURL: {{ ((.Values.cnpg).backup).endpointURL }} + {{- if eq ((.Values.cnpg).backup).cloud "aws" }} + s3Credentials: + accessKeyId: + name: relate-pgsql-backup-creds + key: ACCESS_KEY_ID + secretAccessKey: + name: relate-pgsql-backup-creds + key: ACCESS_SECRET_KEY + {{- end }} + {{- if eq ((.Values.cnpg).backup).cloud "azure" }} + azureCredentials: + connectionString: + name: relate-pgsql-backup-creds + key: AZURE_CONNECTION_STRING + storageAccount: + name: relate-pgsql-backup-creds + key: AZURE_STORAGE_ACCOUNT + storageKey: + name: relate-pgsql-backup-creds + key: AZURE_STORAGE_KEY + storageSasToken: + name: relate-pgsql-backup-creds + key: AZURE_STORAGE_SAS_TOKEN + {{- end }} + wal: + compression: gzip + encryption: AES256 + retentionPolicy: "30d" + {{ end }} +{{ end }}