Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds serviceAccountTemplate to cluster configuration for IAM support #463

Merged
merged 2 commits into from
Dec 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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