Skip to content

Commit

Permalink
Add service magement to chart
Browse files Browse the repository at this point in the history
Signed-off-by: Robert Raicu <[email protected]>
  • Loading branch information
RaicuRobert committed Dec 27, 2024
1 parent 037bb1a commit f2ac247
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 1 deletion.
1 change: 1 addition & 0 deletions charts/cluster/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,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.services | object | `{}` | Customization of service definions. Please refer to https://cloudnative-pg.io/documentation/current/service_management/ |
| 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"` | |
Expand Down
6 changes: 5 additions & 1 deletion charts/cluster/templates/cluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,12 @@ spec:
{{- toYaml . | nindent 6 }}
{{- end }}

{{- if not (empty .Values.cluster.roles) }}
{{- if not (and (empty .Values.cluster.roles) (empty .Values.cluster.services)) }}
managed:
{{- with .Values.cluster.services }}
services:
{{- toYaml . | nindent 6 }}
{{ end }}
{{- with .Values.cluster.roles }}
roles:
{{- toYaml . | nindent 6 }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,18 @@ spec:
inRoles:
- pg_monitor
- pg_signal_backend
services:
additional:
- selectorType: rw
serviceTemplate:
metadata:
name: "test-lb"
labels:
test-label: "true"
annotations:
test-annotation: "true"
spec:
type: LoadBalancer
serviceAccountTemplate:
metadata:
annotations:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,18 @@ cluster:
enableSuperuserAccess: true
superuserSecret: supersecret-secret
enablePDB: false
services:
additional:
- selectorType: rw
serviceTemplate:
metadata:
name: "test-lb"
labels:
test-label: "true"
annotations:
test-annotation: "true"
spec:
type: LoadBalancer
roles:
- name: dante
ensure: present
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 @@ -294,6 +294,9 @@
"roles": {
"type": "array"
},
"services": {
"type": "object"
},
"serviceAccountTemplate": {
"type": "object"
},
Expand Down
3 changes: 3 additions & 0 deletions charts/cluster/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,9 @@ cluster:
# -- The GID of the postgres user inside the image, defaults to 26
postgresGID: -1

# -- Customization of service definions. Please refer to https://cloudnative-pg.io/documentation/1.24/service_management/
services: {}

# -- 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.
Expand Down

0 comments on commit f2ac247

Please sign in to comment.