Skip to content

Commit

Permalink
Adds serviceAccountTemplate to cluster configuration
Browse files Browse the repository at this point in the history
Co-authored-by: Dariusch Ochlast <[email protected]>
Signed-off-by: Dariusch Ochlast <[email protected]>
Signed-off-by: Itay Grudev <[email protected]>
  • Loading branch information
itay-grudev and Dariusch committed Dec 7, 2024
1 parent 7b388ba commit 9cb6f05
Show file tree
Hide file tree
Showing 6 changed files with 20 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 @@ -180,6 +180,7 @@ refer to the [CloudNativePG Documentation](https://cloudnative-pg.io/documentat
| 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.serviceAccountTemplate | object | `{}` | Configure the metadata of the generated service account |
| cluster.storage.size | string | `"8Gi"` | |
| cluster.storage.storageClass | string | `""` | |
| cluster.superuserSecret | string | `""` | |
Expand Down
5 changes: 5 additions & 0 deletions charts/cluster/templates/cluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,11 @@ spec:
{{- toYaml . | nindent 6 }}
{{ end }}

{{- with .Values.cluster.serviceAccountTemplate }}
serviceAccountTemplate:
{{- toYaml . | nindent 4 }}
{{- end }}

monitoring:
enablePodMonitor: {{ and .Values.cluster.monitoring.enabled .Values.cluster.monitoring.podMonitor.enabled }}
disableDefaultQueries: {{ .Values.cluster.monitoring.disableDefaultQueries }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,3 +80,7 @@ spec:
inRoles:
- pg_monitor
- pg_signal_backend
serviceAccountTemplate:
metadata:
annotations:
my-annotation: my-service-account
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,10 @@ cluster:
foo: bar
annotations:
foo: bar
serviceAccountTemplate:
metadata:
annotations:
my-annotation: my-service-account

backups:
enabled: false
3 changes: 3 additions & 0 deletions charts/cluster/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,9 @@
"roles": {
"type": "array"
},
"serviceAccountTemplate": {
"type": "object"
},
"storage": {
"type": "object",
"properties": {
Expand Down
3 changes: 3 additions & 0 deletions charts/cluster/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,9 @@ cluster:
# postInitApplicationSQL: []
# postInitTemplateSQL: []

# -- Configure the metadata of the generated service account
serviceAccountTemplate: {}

additionalLabels: {}
annotations: {}

Expand Down

0 comments on commit 9cb6f05

Please sign in to comment.