From 3d88ae3dc1ad22ff873533e35d1c3c5c5c09a3c0 Mon Sep 17 00:00:00 2001 From: NigelVanHattum Date: Tue, 12 Mar 2024 08:30:45 +0100 Subject: [PATCH] feat(cluster): Added support for specifying user UID & GID (#207) Closes #206 --- charts/cluster/README.md | 2 ++ charts/cluster/templates/cluster.yaml | 2 ++ charts/cluster/values.schema.json | 6 ++++++ charts/cluster/values.yaml | 6 ++++++ 4 files changed, 16 insertions(+) diff --git a/charts/cluster/README.md b/charts/cluster/README.md index 3c1f33995..0b882f2f8 100644 --- a/charts/cluster/README.md +++ b/charts/cluster/README.md @@ -152,6 +152,8 @@ refer to the [CloudNativePG Documentation](https://cloudnative-pg.io/documentat | cluster.monitoring.enabled | bool | `false` | | | cluster.monitoring.podMonitor.enabled | bool | `true` | | | cluster.monitoring.prometheusRule.enabled | bool | `true` | | +| cluster.postgresGID | int | `26` | The GID of the postgres user inside the image, defaults to 26 | +| cluster.postgresUID | int | `26` | The UID of the postgres user inside the image, defaults to 26 | | cluster.postgresql | object | `{}` | Configuration of the PostgreSQL server See: https://cloudnative-pg.io/documentation/current/cloudnative-pg.v1/#postgresql-cnpg-io-v1-PostgresConfiguration | | cluster.primaryUpdateMethod | string | `"switchover"` | Method to follow to upgrade the primary server during a rolling update procedure, after all replicas have been successfully updated. It can be switchover (default) or in-place (restart). | | cluster.primaryUpdateStrategy | string | `"unsupervised"` | Strategy to follow to upgrade the primary server during a rolling update procedure, after all replicas have been successfully updated: it can be automated (unsupervised - default) or manual (supervised) | diff --git a/charts/cluster/templates/cluster.yaml b/charts/cluster/templates/cluster.yaml index 1410ded56..4c40a12d0 100644 --- a/charts/cluster/templates/cluster.yaml +++ b/charts/cluster/templates/cluster.yaml @@ -19,6 +19,8 @@ spec: imagePullSecrets: {{- . | toYaml | nindent 4 }} {{- end }} + postgresUID: {{ .Values.cluster.postgresUID }} + postgresGID: {{ .Values.cluster.postgresGID }} storage: size: {{ .Values.cluster.storage.size }} storageClass: {{ .Values.cluster.storage.storageClass }} diff --git a/charts/cluster/values.schema.json b/charts/cluster/values.schema.json index 49550780b..75a9551b1 100644 --- a/charts/cluster/values.schema.json +++ b/charts/cluster/values.schema.json @@ -176,6 +176,12 @@ "postgresql": { "type": "object" }, + "postgresUID": { + "type": "integer" + }, + "postgresGID": { + "type": "integer" + }, "primaryUpdateMethod": { "type": "string" }, diff --git a/charts/cluster/values.yaml b/charts/cluster/values.yaml index 02f967133..ff3c79a19 100644 --- a/charts/cluster/values.yaml +++ b/charts/cluster/values.yaml @@ -90,6 +90,12 @@ cluster: size: 8Gi storageClass: "" + # -- The UID of the postgres user inside the image, defaults to 26 + postgresUID: 26 + + # -- The GID of the postgres user inside the image, defaults to 26 + postgresGID: 26 + # -- Resources requirements of every generated Pod. # Please refer to https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ for more information. # We strongly advise you use the same setting for limits and requests so that your cluster pods are given a Guaranteed QoS.