From 70bd926d568838f9f89bff3c8e6012e7bf38d2aa Mon Sep 17 00:00:00 2001 From: Guillaume Pothier Date: Thu, 4 Apr 2024 00:34:51 -0300 Subject: [PATCH] Make roles configurable Signed-off-by: Guillaume Pothier --- charts/cluster/templates/cluster.yaml | 6 ++++++ charts/cluster/values.schema.json | 3 +++ charts/cluster/values.yaml | 13 +++++++++++++ 3 files changed, 22 insertions(+) diff --git a/charts/cluster/templates/cluster.yaml b/charts/cluster/templates/cluster.yaml index 9634dc8f0..5ff0bb2fa 100644 --- a/charts/cluster/templates/cluster.yaml +++ b/charts/cluster/templates/cluster.yaml @@ -57,6 +57,12 @@ spec: {{- toYaml . | nindent 6 }} {{ end }} + managed: + {{- with .Values.cluster.roles }} + roles: + {{- toYaml . | nindent 6 }} + {{ end }} + monitoring: enablePodMonitor: {{ and .Values.cluster.monitoring.enabled .Values.cluster.monitoring.podMonitor.enabled }} {{- if not (empty .Values.cluster.monitoring.customQueries) }} diff --git a/charts/cluster/values.schema.json b/charts/cluster/values.schema.json index 0c7c1bbe0..8bbb07239 100644 --- a/charts/cluster/values.schema.json +++ b/charts/cluster/values.schema.json @@ -242,6 +242,9 @@ "resources": { "type": "object" }, + "roles": { + "type": "array" + }, "storage": { "type": "object", "properties": { diff --git a/charts/cluster/values.yaml b/charts/cluster/values.yaml index 325d5f3cd..7ff77dfbe 100644 --- a/charts/cluster/values.yaml +++ b/charts/cluster/values.yaml @@ -144,6 +144,19 @@ cluster: enableSuperuserAccess: true superuserSecret: "" + # -- This feature enables declarative management of existing roles, as well as the creation of new roles if they are not + # already present in the database. + # See: https://cloudnative-pg.io/documentation/current/declarative_role_management/ + roles: [] + # - name: dante + # ensure: present + # comment: Dante Alighieri + # login: true + # superuser: false + # inRoles: + # - pg_monitor + # - pg_signal_backend + monitoring: # -- Whether to enable monitoring enabled: false