From 110c42e9c140ca405f2068b89e31a732ae47dda1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nguy=E1=BB=85n=20=C4=90=E1=BB=A9c=20Chi=E1=BA=BFn?= Date: Thu, 11 Aug 2022 21:00:32 +0700 Subject: [PATCH] [bitnami/postgresql] Allow custom role name for postgresql (#11626) * [bitnami/postgresql] Allow custom role name for postgresql Signed-off-by: Nobi * Update README.md Signed-off-by: Nobi Signed-off-by: Nobi --- bitnami/postgresql/Chart.yaml | 2 +- bitnami/postgresql/README.md | 2 ++ bitnami/postgresql/templates/_helpers.tpl | 4 ++-- bitnami/postgresql/values.yaml | 6 ++++++ 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/bitnami/postgresql/Chart.yaml b/bitnami/postgresql/Chart.yaml index 3f24259212..fc38a878f5 100644 --- a/bitnami/postgresql/Chart.yaml +++ b/bitnami/postgresql/Chart.yaml @@ -26,4 +26,4 @@ name: postgresql sources: - https://github.com/bitnami/containers/tree/main/bitnami/postgresql - https://www.postgresql.org/ -version: 11.6.26 +version: 11.7.0 diff --git a/bitnami/postgresql/README.md b/bitnami/postgresql/README.md index debeb49cd1..ba851cd233 100644 --- a/bitnami/postgresql/README.md +++ b/bitnami/postgresql/README.md @@ -161,6 +161,7 @@ kubectl delete pvc -l release=my-release | Name | Description | Value | | -------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------ | --------------------- | +| `primary.name` | Name of the primary database (eg primary, master, leader, ...) | `primary` | | `primary.configuration` | PostgreSQL Primary main configuration to be injected as ConfigMap | `""` | | `primary.pgHbaConfiguration` | PostgreSQL Primary client authentication configuration | `""` | | `primary.existingConfigmap` | Name of an existing ConfigMap with PostgreSQL Primary configuration | `""` | @@ -263,6 +264,7 @@ kubectl delete pvc -l release=my-release | Name | Description | Value | | ------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------ | --------------------- | +| `readReplicas.name` | Name of the read replicas database (eg secondary, slave, ...) | `read` | | `readReplicas.replicaCount` | Number of PostgreSQL read only replicas | `1` | | `readReplicas.extendedConfiguration` | Extended PostgreSQL read only replicas configuration (appended to main or default configuration) | `""` | | `readReplicas.extraEnvVars` | Array with extra environment variables to add to PostgreSQL read only nodes | `[]` | diff --git a/bitnami/postgresql/templates/_helpers.tpl b/bitnami/postgresql/templates/_helpers.tpl index 99e3c43772..fe123f5f5d 100644 --- a/bitnami/postgresql/templates/_helpers.tpl +++ b/bitnami/postgresql/templates/_helpers.tpl @@ -6,7 +6,7 @@ We truncate at 63 chars because some Kubernetes name fields are limited to this */}} {{- define "postgresql.primary.fullname" -}} {{- if eq .Values.architecture "replication" }} - {{- printf "%s-primary" (include "common.names.fullname" .) | trunc 63 | trimSuffix "-" -}} + {{- printf "%s-%s" (include "common.names.fullname" .) .Values.primary.name | trunc 63 | trimSuffix "-" -}} {{- else -}} {{- include "common.names.fullname" . -}} {{- end -}} @@ -17,7 +17,7 @@ Create a default fully qualified app name for PostgreSQL read-only replicas obje We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). */}} {{- define "postgresql.readReplica.fullname" -}} -{{- printf "%s-read" (include "common.names.fullname" .) | trunc 63 | trimSuffix "-" -}} +{{- printf "%s-%s" (include "common.names.fullname" .) .Values.readReplicas.name | trunc 63 | trimSuffix "-" -}} {{- end -}} {{/* diff --git a/bitnami/postgresql/values.yaml b/bitnami/postgresql/values.yaml index 905c6350f8..1f22e71ff3 100644 --- a/bitnami/postgresql/values.yaml +++ b/bitnami/postgresql/values.yaml @@ -284,6 +284,9 @@ tls: ## @section PostgreSQL Primary parameters ## primary: + ## @param primary.name Name of the primary database (eg primary, master, leader, ...) + ## + name: primary ## @param primary.configuration PostgreSQL Primary main configuration to be injected as ConfigMap ## ref: https://www.postgresql.org/docs/current/static/runtime-config.html ## @@ -671,6 +674,9 @@ primary: ## @section PostgreSQL read only replica parameters (only used when `architecture` is set to `replication`) ## readReplicas: + ## @param readReplicas.name Name of the read replicas database (eg secondary, slave, ...) + ## + name: read ## @param readReplicas.replicaCount Number of PostgreSQL read only replicas ## replicaCount: 1