Skip to content

Commit

Permalink
Merge branch 'main' into fix(namespace)
Browse files Browse the repository at this point in the history
  • Loading branch information
itay-grudev authored Dec 10, 2024
2 parents 2296230 + 8f5349c commit 90035ad
Show file tree
Hide file tree
Showing 9 changed files with 42 additions and 5 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
2 changes: 1 addition & 1 deletion charts/cluster/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ name: cluster
description: Deploys and manages a CloudNativePG cluster and its associated resources.
icon: https://raw.githubusercontent.com/cloudnative-pg/artwork/main/cloudnativepg-logo.svg
type: application
version: 0.1.0
version: 0.1.1
sources:
- https://github.com/cloudnative-pg/charts
keywords:
Expand Down
4 changes: 3 additions & 1 deletion charts/cluster/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# cluster

![Version: 0.1.0](https://img.shields.io/badge/Version-0.1.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square)
![Version: 0.1.1](https://img.shields.io/badge/Version-0.1.1-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square)

> **Warning**
> ### This chart is under active development.
Expand Down Expand Up @@ -152,6 +152,7 @@ refer to the [CloudNativePG Documentation](https://cloudnative-pg.io/documentat
| cluster.affinity | object | `{"topologyKey":"topology.kubernetes.io/zone"}` | Affinity/Anti-affinity rules for Pods. See: https://cloudnative-pg.io/documentation/current/cloudnative-pg.v1/#postgresql-cnpg-io-v1-AffinityConfiguration |
| cluster.annotations | object | `{}` | |
| cluster.certificates | object | `{}` | The configuration for the CA and related certificates. See: https://cloudnative-pg.io/documentation/current/cloudnative-pg.v1/#postgresql-cnpg-io-v1-CertificatesConfiguration |
| cluster.enablePDB | bool | `true` | 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 |
| cluster.enableSuperuserAccess | bool | `true` | When this option is enabled, the operator will use the SuperuserSecret to update the postgres user password. If the secret is not present, the operator will automatically create one. When this option is disabled, the operator will ignore the SuperuserSecret content, delete it when automatically created, and then blank the password of the postgres user by setting it to NULL. |
| cluster.imageCatalogRef | object | `{}` | Reference to `ImageCatalog` of `ClusterImageCatalog`, if specified takes precedence over `cluster.imageName` |
| cluster.imageName | string | `""` | Name of the container image, supporting both tags (<image>:<tag>) and digests for deterministic and repeatable deployments: <image>:<tag>@sha256:<digestValue> |
Expand Down Expand Up @@ -180,6 +181,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 @@ -29,7 +29,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 @@ -52,6 +52,7 @@ spec:
superuserSecret:
name: {{ . }}
{{ end }}
enablePDB: {{ .Values.cluster.enablePDB }}
postgresql:
shared_preload_libraries:
{{- if eq .Values.type "timescaledb" }}
Expand All @@ -75,6 +76,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 @@ -31,8 +31,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
6 changes: 6 additions & 0 deletions charts/cluster/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,9 @@
"certificates": {
"type": "object"
},
"enablePDB": {
"type": "boolean"
},
"enableSuperuserAccess": {
"type": "boolean"
},
Expand Down Expand Up @@ -288,6 +291,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 @@ -203,6 +203,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 @@ -283,6 +287,9 @@ cluster:
# postInitApplicationSQL: []
# postInitTemplateSQL: []

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

additionalLabels: {}
annotations: {}

Expand Down

0 comments on commit 90035ad

Please sign in to comment.