Skip to content

Commit

Permalink
update from pg operator from zalando to cncf for relate in kbm
Browse files Browse the repository at this point in the history
  • Loading branch information
mdasif authored and ashish1099 committed Dec 17, 2024
1 parent 75ecc54 commit 66d3c0a
Show file tree
Hide file tree
Showing 2 changed files with 108 additions and 20 deletions.
10 changes: 10 additions & 0 deletions argocd-helm-charts/relate/charts/relate/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,23 @@ spec:
httpHeaders:
- name: Host
value: relate
initialDelaySeconds: 500
periodSeconds: 100
timeoutSeconds: 300
failureThreshold: 3
successThreshold: 1
readinessProbe:
httpGet:
path: /
port: http
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 }}
Expand Down
118 changes: 98 additions & 20 deletions argocd-helm-charts/relate/charts/relate/templates/postgres.yaml
Original file line number Diff line number Diff line change
@@ -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 }}

0 comments on commit 66d3c0a

Please sign in to comment.