ebs/helm/chart/templates/cnpg-cluster.yaml
Thomas SAMSON c2b3d30640
Staging (#63)
* Add/preprod (#61)

* Enable preprod and cd on pr

* Replace bitnami psql with CNPG

* Update env name

* Fix build

* fix CVE-2026-27135

* Fix main condition

* add cleanup

* purge old vars

* Set vars for build

* Add PG_PWD for CNPG

* Fix CVE for caddy

* Fix caddy build

* Fix environment name

* Fix namespace

* fix domain

* Add nonprod domain

* Fix sharded buffer

* Fix secret

* Revert secret

* grant creat db for fixture

---------

Co-authored-by: ThomasSamson <thomas@samson-pro.fr>

* Update storage bucket variables for production and nonprod

* fix nonprod trusted host

---------

Co-authored-by: ThomasSamson <thomas@samson-pro.fr>
2026-05-05 13:32:03 +02:00

38 lines
1.2 KiB
YAML

{{- if .Values.cnpg.enabled }}
apiVersion: v1
kind: Secret
metadata:
name: {{ include "plateforme-ebs.cnpgClusterName" . }}-credentials
labels:
{{- include "plateforme-ebs.labels" . | nindent 4 }}
type: kubernetes.io/basic-auth
stringData:
username: {{ .Values.cnpg.owner | quote }}
password: {{ .Values.cnpg.credentials.password | quote }}
---
apiVersion: postgresql.cnpg.io/v1
kind: Cluster
metadata:
name: {{ include "plateforme-ebs.cnpgClusterName" . }}
labels:
{{- include "plateforme-ebs.labels" . | nindent 4 }}
spec:
instances: {{ .Values.cnpg.instances }}
bootstrap:
initdb:
database: {{ .Values.cnpg.database | quote }}
owner: {{ .Values.cnpg.owner | quote }}
secret:
name: {{ include "plateforme-ebs.cnpgClusterName" . }}-credentials
postInitApplicationSQL:
- ALTER ROLE {{ .Values.cnpg.owner }} CREATEDB;
storage:
size: {{ .Values.cnpg.storage.size | quote }}
{{- if .Values.cnpg.storage.storageClass }}
storageClass: {{ .Values.cnpg.storage.storageClass | quote }}
{{- end }}
{{- with .Values.cnpg.resources }}
resources:
{{- toYaml . | nindent 4 }}
{{- end }}
{{- end }}