diff --git a/charts/postgres-cluster/Chart.yaml b/charts/postgres-cluster/Chart.yaml index 800a294..c4f2ab5 100644 --- a/charts/postgres-cluster/Chart.yaml +++ b/charts/postgres-cluster/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v2 name: postgres-cluster -version: 6.18.0 +version: 6.19.0 description: Cloudnative-pg Cluster keywords: - database diff --git a/charts/postgres-cluster/README.md b/charts/postgres-cluster/README.md index 97c6a4b..d4aea64 100644 --- a/charts/postgres-cluster/README.md +++ b/charts/postgres-cluster/README.md @@ -1,6 +1,6 @@ # postgres-cluster -![Version: 6.18.0](https://img.shields.io/badge/Version-6.18.0-informational?style=flat-square) ![AppVersion: v1.28.0](https://img.shields.io/badge/AppVersion-v1.28.0-informational?style=flat-square) +![Version: 6.19.0](https://img.shields.io/badge/Version-6.19.0-informational?style=flat-square) ![AppVersion: v1.28.0](https://img.shields.io/badge/AppVersion-v1.28.0-informational?style=flat-square) Cloudnative-pg Cluster @@ -58,6 +58,7 @@ Cloudnative-pg Cluster | cluster.serviceAccountTemplate | object | `{}` | Configure the metadata of the generated service account | | cluster.services | object | `{}` | Customization of service definitions. Please refer to https://cloudnative-pg.io/documentation/current/service_management/ | | cluster.storage | object | `{"size":"10Gi","storageClass":""}` | Default storage size | +| databases | list | `[]` | Database management configuration | | mode | string | `"standalone"` | Cluster mode of operation. Available modes: * `standalone` - Default mode. Creates new or updates an existing CNPG cluster. * `recovery` - Same as standalone but creates a cluster from a backup, object store or via pg_basebackup | | nameOverride | string | `""` | Override the name of the cluster | | namespaceOverride | string | `""` | Override the namespace of the chart | diff --git a/charts/postgres-cluster/templates/databases.yaml b/charts/postgres-cluster/templates/databases.yaml new file mode 100644 index 0000000..5a117be --- /dev/null +++ b/charts/postgres-cluster/templates/databases.yaml @@ -0,0 +1,76 @@ +{{- range .Values.databases }} +--- +apiVersion: postgresql.cnpg.io/v1 +kind: Database +metadata: + name: {{ include "cluster.name" $ }}-database-{{ .name | replace "_" "-" }} + namespace: {{ include "cluster.namespace" $ }} + labels: + {{- include "cluster.labels" $ | nindent 4 }} +spec: + name: {{ .name }} + cluster: + name: {{ include "cluster.name" $ }} + ensure: {{ .ensure | default "present" }} + owner: {{ .owner }} + template: {{ .template | default "template1" }} + encoding: {{ .encoding | default "UTF8" }} + databaseReclaimPolicy: {{ .databaseReclaimPolicy | default "retain" }} + {{- with .isTemplate }} + isTemplate: {{ . }} + {{- end }} + {{- with .allowConnections }} + allowConnections: {{ . }} + {{- end }} + {{- with .connectionLimit }} + connectionLimit: {{ . }} + {{- end }} + {{- with .tablespace }} + tablespace: {{ . }} + {{- end }} + {{- with .locale }} + locale: {{ . }} + {{- end }} + {{- with .localeProvider }} + localeProvider: {{ . }} + {{- end }} + {{- with .localeCollate }} + localeCollate: {{ . }} + {{- end }} + {{- with .localeCType }} + localeCType: {{ . }} + {{- end }} + {{- with .icuLocale }} + icuLocale: {{ . }} + {{- end }} + {{- with .icuRules }} + icuRules: {{ . }} + {{- end }} + {{- with .builtinLocale }} + builtinLocale: {{ . }} + {{- end }} + {{- with .collationVersion }} + collationVersion: {{ . | quote }} + {{- end }} + {{- with .schemas }} + schemas: + {{- range . }} + - name: {{ .name }} + owner: {{ .owner }} + ensure: {{ .ensure | default "present" }} + {{- end }} + {{- end }} + {{- with .extensions }} + extensions: + {{- range . }} + - name: {{ .name }} + {{- with .version }} + version: {{ . }} + {{- end }} + {{- with .schema }} + schema: {{ . }} + {{- end }} + ensure: {{ .ensure | default "present" }} + {{- end }} + {{- end }} +{{- end }} diff --git a/charts/postgres-cluster/templates/poolers.yaml b/charts/postgres-cluster/templates/poolers.yaml index 10623f3..3941dd2 100644 --- a/charts/postgres-cluster/templates/poolers.yaml +++ b/charts/postgres-cluster/templates/poolers.yaml @@ -3,7 +3,7 @@ apiVersion: postgresql.cnpg.io/v1 kind: Pooler metadata: - name: {{ include "cluster.name" $ }}-pooler-{{ .name }} + name: {{ include "cluster.name" $ }}-pooler-{{ .name }} namespace: {{ include "cluster.namespace" $ }} labels: {{- include "cluster.labels" $ | nindent 4 }} diff --git a/charts/postgres-cluster/values.yaml b/charts/postgres-cluster/values.yaml index 3f42437..b1ebf3a 100644 --- a/charts/postgres-cluster/values.yaml +++ b/charts/postgres-cluster/values.yaml @@ -507,6 +507,35 @@ backup: # # -- Name of backup target # backupName: external +# -- Database management configuration +databases: [] + # - name: app # -- Name of the database to be created. + # ensure: present # -- Ensure the PostgreSQL database is present or absent - defaults to "present". + # owner: app # -- Owner of the database, defaults to the value of the `name` key. + # template: template1 # -- Maps to the TEMPLATE parameter. + # encoding: UTF8 # -- Maps to the ENCODING parameter. + # connectionLimit: -1 # -- Maps to the CONNECTION LIMIT parameter. -1 (the default) means no limit. + # tablespace: "" # -- Maps to the TABLESPACE parameter and ALTER DATABASE. + # databaseReclaimPolicy: retain # -- One of: retain / delete (retain by default). + # schemas: [] # -- List of schemas to be created in the database. + # # - name: myschema + # # owner: app # -- Owner of the schema, defaults to the database owner. + # # ensure: present # -- Ensure the PostgreSQL schema is present or absent - defaults to "present". + # extensions: [] # -- List of extensions to be created in the database. + # # - name: pg_search + # # ensure: present # -- Ensure the PostgreSQL extension is present or absent - defaults to "present". + # # version: "0.15.21" # -- Version of the extension to be installed, if not specified the latest version will be used. + # # schema: "" # -- Schema where the extension will be installed, if not specified the extensions or current default object creation schema will be used. + # isTemplate: false # -- Maps to the IS_TEMPLATE parameter. If true, the database is considered a template for new databases. + # locale: "" # -- Maps to the LC_COLLATE and LC_CTYPE parameters + # localeProvider: "" # -- Maps to the LOCALE_PROVIDER parameter. Available from PostgreSQL 16. + # localeCollate: "" # -- Maps to the LC_COLLATE parameter + # localeCType: "" # -- Maps to the LC_CTYPE parameter + # icuLocale: "" # -- Maps to the ICU_LOCALE parameter. Available from PostgreSQL 15. + # icuRules: "" # -- Maps to the ICU_RULES parameter. Available from PostgreSQL 16. + # builtinLocale: "" # -- Maps to the BUILTIN_LOCALE parameter. Available from PostgreSQL 17. + # collationVersion: "" # -- Maps to the COLLATION_VERSION parameter. + # -- List of PgBouncer poolers poolers: [] # -