Skip to content

Commit

Permalink
feat(cluster): Make roles configurable (cloudnative-pg#247)
Browse files Browse the repository at this point in the history
Signed-off-by: Guillaume Pothier <[email protected]>
Co-authored-by: Itay Grudev <[email protected]>
  • Loading branch information
gpothier and itay-grudev authored Apr 20, 2024
1 parent a6fa967 commit 2728793
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 0 deletions.
1 change: 1 addition & 0 deletions charts/cluster/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ refer to the [CloudNativePG Documentation](https://cloudnative-pg.io/documentat
| 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) |
| cluster.priorityClassName | string | `""` | |
| cluster.resources | object | `{}` | 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. See: https://kubernetes.io/docs/concepts/workloads/pods/pod-qos/ |
| cluster.roles | list | `[]` | 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/ |
| cluster.storage.size | string | `"8Gi"` | |
| cluster.storage.storageClass | string | `""` | |
| cluster.superuserSecret | string | `""` | |
Expand Down
6 changes: 6 additions & 0 deletions charts/cluster/templates/cluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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) }}
Expand Down
3 changes: 3 additions & 0 deletions charts/cluster/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,9 @@
"resources": {
"type": "object"
},
"roles": {
"type": "array"
},
"storage": {
"type": "object",
"properties": {
Expand Down
13 changes: 13 additions & 0 deletions charts/cluster/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 2728793

Please sign in to comment.