Skip to content

Commit

Permalink
Adds serviceAccountTemplate to cluster configuration (cloudnative-pg#463
Browse files Browse the repository at this point in the history
)

Signed-off-by: Dariusch Ochlast <[email protected]>
Signed-off-by: Itay Grudev <[email protected]>
Co-authored-by: Dariusch Ochlast <[email protected]>
  • Loading branch information
2 people authored and Yannic Remmet-Zarotiadis committed Dec 9, 2024
1 parent 3f15995 commit 18fc19f
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 0 deletions.
4 changes: 4 additions & 0 deletions charts/cluster/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,11 @@ refer to the [CloudNativePG Documentation](https://cloudnative-pg.io/documentat
| cluster.projectedVolumeSources| list | `[]` | Configure Projected Volumes from Secrets / ConfigMaps. See: https://cloudnative-pg.io/documentation/1.24/cluster_conf/#projected-volumes |
| 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/ |
<<<<<<< HEAD
| cluster.services | object | `{}` | Customization of service definions. Please refer to https://cloudnative-pg.io/documentation/1.24/service_management/ |
=======
| cluster.serviceAccountTemplate | object | `{}` | Configure the metadata of the generated service account |
>>>>>>> b849139 (Adds serviceAccountTemplate to cluster configuration (#463))
| 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 @@ -87,6 +87,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
4 changes: 4 additions & 0 deletions charts/cluster/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,11 @@
"roles": {
"type": "array"
},
<<<<<<< HEAD
"services": {
=======
"serviceAccountTemplate": {
>>>>>>> b849139 (Adds serviceAccountTemplate to cluster configuration (#463))
"type": "object"
},
"storage": {
Expand Down
3 changes: 3 additions & 0 deletions charts/cluster/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,9 @@ cluster:
# postInitApplicationSQL: []
# postInitTemplateSQL: []

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

additionalLabels: {}
annotations: {}

Expand Down

0 comments on commit 18fc19f

Please sign in to comment.