Skip to content

Commit

Permalink
Merge branch 'main' into allow-update-strategy
Browse files Browse the repository at this point in the history
  • Loading branch information
itay-grudev authored Dec 7, 2024
2 parents 6b5430b + 6198524 commit a4228ab
Show file tree
Hide file tree
Showing 8 changed files with 36 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/tests-cluster-chainsaw.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
helm install prometheus-crds prometheus-community/prometheus-operator-crds
- name: Install Chainsaw
uses: kyverno/action-install-chainsaw@d311eacde764f806c9658574ff64c9c3b21f8397 # v0.2.11
uses: kyverno/action-install-chainsaw@f2b47b97dc889c12702113753d713f01ec268de5 # v0.2.12
with:
verify: true

Expand Down
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
8 changes: 7 additions & 1 deletion charts/cluster/templates/cluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ spec:
walStorage:
size: {{ .Values.cluster.walStorage.size }}
storageClass: {{ .Values.cluster.walStorage.storageClass }}
{{- end }}
{{- end }}
{{- with .Values.cluster.resources }}
resources:
{{- toYaml . | nindent 4 }}
Expand All @@ -51,6 +51,7 @@ spec:
superuserSecret:
name: {{ . }}
{{ end }}
enablePDB: {{ .Values.cluster.enablePDB }}
postgresql:
shared_preload_libraries:
{{- if eq .Values.type "timescaledb" }}
Expand All @@ -74,6 +75,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
8 changes: 7 additions & 1 deletion charts/cluster/templates/tests/ping.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,14 @@ spec:
secretKeyRef:
name: {{ include "cluster.fullname" . }}-app
key: password
- name: PGDBNAME
valueFrom:
secretKeyRef:
name: {{ include "cluster.fullname" . }}-app
key: dbname
optional: true
args:
- "-c"
- >-
apk add postgresql-client &&
psql "postgresql://$PGUSER:$PGPASS@{{ include "cluster.fullname" . }}-rw.{{ .Release.Namespace }}.svc.cluster.local:5432" -c 'SELECT 1'
psql "postgresql://$PGUSER:$PGPASS@{{ include "cluster.fullname" . }}-rw.{{ .Release.Namespace }}.svc.cluster.local:5432/${PGDBNAME:-$PGUSER}" -c 'SELECT 1'
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ spec:
superuserSecret:
name: supersecret-secret
enableSuperuserAccess: true
enablePDB: false
certificates:
serverCASecret: ca-secret
serverTLSSecret: tls-secret
Expand Down Expand Up @@ -80,3 +81,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 @@ -44,6 +44,7 @@ cluster:
clientCASecret: client-ca-secret
enableSuperuserAccess: true
superuserSecret: supersecret-secret
enablePDB: false
roles:
- name: dante
ensure: present
Expand Down Expand Up @@ -76,6 +77,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
7 changes: 7 additions & 0 deletions charts/cluster/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,10 @@ cluster:
enableSuperuserAccess: true
superuserSecret: ""

# -- Allow to disable PDB, mainly useful for upgrade of single-instance clusters or development purposes
# See: https://cloudnative-pg.io/documentation/current/kubernetes_upgrade/#pod-disruption-budgets
enablePDB: true

# -- 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/
Expand Down Expand Up @@ -281,6 +285,9 @@ cluster:
# postInitApplicationSQL: []
# postInitTemplateSQL: []

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

additionalLabels: {}
annotations: {}

Expand Down

0 comments on commit a4228ab

Please sign in to comment.