Skip to content
Open
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/cloudnative-pg/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ Kubernetes: `>=1.29.0-0`
| commonAnnotations | object | `{}` | Annotations to be added to all other resources. |
| config.clusterWide | bool | `true` | This option determines if the operator is responsible for observing events across the entire Kubernetes cluster or if its focus should be narrowed down to the specific namespace within which it has been deployed. |
| config.create | bool | `true` | Specifies whether the secret should be created. |
| config.namespacedWebhooks | bool | `false` | When set to true, appends the operator namespace to webhook configuration names to avoid collisions when running multiple operators in namespaced mode. |
| config.data | object | `{}` | The content of the configmap/secret, see https://cloudnative-pg.io/documentation/current/operator_conf/#available-options for all the available options. |
| config.maxConcurrentReconciles | int | `10` | The maximum number of concurrent reconciles. Defaults to 10. |
| config.name | string | `"cnpg-controller-manager-config"` | The name of the configmap/secret to use. |
Expand Down
4 changes: 4 additions & 0 deletions charts/cloudnative-pg/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,10 @@ spec:
- name: WATCH_NAMESPACE
value: "{{ include "cloudnative-pg.namespace" . }}"
{{- end }}
{{- if .Values.config.namespacedWebhooks }}
- name: ENABLE_WEBHOOK_NAMESPACE_SUFFIX
value: "true"
{{- end }}
{{- if .Values.additionalEnv }}
{{- tpl (.Values.additionalEnv | toYaml) . | nindent 8 }}
{{- end }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
apiVersion: admissionregistration.k8s.io/v1
kind: MutatingWebhookConfiguration
metadata:
name: cnpg-mutating-webhook-configuration
name: cnpg-mutating-webhook-configuration{{- if .Values.config.namespacedWebhooks }}-{{ include "cloudnative-pg.namespace" . }}{{- end }}
{{- with .Values.commonAnnotations }}
annotations:
{{- toYaml . | nindent 4 }}
Expand All @@ -39,6 +39,11 @@ webhooks:
port: {{ .Values.service.port }}
failurePolicy: {{ .Values.webhook.mutating.failurePolicy }}
name: mbackup.cnpg.io
{{- if .Values.config.namespacedWebhooks }}
namespaceSelector:
matchLabels:
kubernetes.io/metadata.name: {{ include "cloudnative-pg.namespace" . }}
{{- end }}
rules:
- apiGroups:
- postgresql.cnpg.io
Expand All @@ -60,6 +65,11 @@ webhooks:
port: {{ .Values.service.port }}
failurePolicy: {{ .Values.webhook.mutating.failurePolicy }}
name: mcluster.cnpg.io
{{- if .Values.config.namespacedWebhooks }}
namespaceSelector:
matchLabels:
kubernetes.io/metadata.name: {{ include "cloudnative-pg.namespace" . }}
{{- end }}
rules:
- apiGroups:
- postgresql.cnpg.io
Expand All @@ -81,6 +91,11 @@ webhooks:
port: {{ .Values.service.port }}
failurePolicy: {{ .Values.webhook.mutating.failurePolicy }}
name: mdatabase.cnpg.io
{{- if .Values.config.namespacedWebhooks }}
namespaceSelector:
matchLabels:
kubernetes.io/metadata.name: {{ include "cloudnative-pg.namespace" . }}
{{- end }}
rules:
- apiGroups:
- postgresql.cnpg.io
Expand All @@ -102,6 +117,11 @@ webhooks:
port: {{ .Values.service.port }}
failurePolicy: {{ .Values.webhook.mutating.failurePolicy }}
name: mscheduledbackup.cnpg.io
{{- if .Values.config.namespacedWebhooks }}
namespaceSelector:
matchLabels:
kubernetes.io/metadata.name: {{ include "cloudnative-pg.namespace" . }}
{{- end }}
rules:
- apiGroups:
- postgresql.cnpg.io
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
apiVersion: admissionregistration.k8s.io/v1
kind: ValidatingWebhookConfiguration
metadata:
name: cnpg-validating-webhook-configuration
name: cnpg-validating-webhook-configuration{{- if .Values.config.namespacedWebhooks }}-{{ include "cloudnative-pg.namespace" . }}{{- end }}
labels:
{{- include "cloudnative-pg.labels" . | nindent 4 }}
{{- with .Values.rbac.annotations }}
Expand All @@ -39,6 +39,11 @@ webhooks:
port: {{ .Values.service.port }}
failurePolicy: {{ .Values.webhook.validating.failurePolicy }}
name: vbackup.cnpg.io
{{- if .Values.config.namespacedWebhooks }}
namespaceSelector:
matchLabels:
kubernetes.io/metadata.name: {{ include "cloudnative-pg.namespace" . }}
{{- end }}
rules:
- apiGroups:
- postgresql.cnpg.io
Expand All @@ -60,6 +65,11 @@ webhooks:
port: {{ .Values.service.port }}
failurePolicy: {{ .Values.webhook.validating.failurePolicy }}
name: vcluster.cnpg.io
{{- if .Values.config.namespacedWebhooks }}
namespaceSelector:
matchLabels:
kubernetes.io/metadata.name: {{ include "cloudnative-pg.namespace" . }}
{{- end }}
rules:
- apiGroups:
- postgresql.cnpg.io
Expand All @@ -81,6 +91,11 @@ webhooks:
port: {{ .Values.service.port }}
failurePolicy: {{ .Values.webhook.validating.failurePolicy }}
name: vscheduledbackup.cnpg.io
{{- if .Values.config.namespacedWebhooks }}
namespaceSelector:
matchLabels:
kubernetes.io/metadata.name: {{ include "cloudnative-pg.namespace" . }}
{{- end }}
rules:
- apiGroups:
- postgresql.cnpg.io
Expand All @@ -102,6 +117,11 @@ webhooks:
port: {{ .Values.service.port }}
failurePolicy: {{ .Values.webhook.validating.failurePolicy }}
name: vdatabase.cnpg.io
{{- if .Values.config.namespacedWebhooks }}
namespaceSelector:
matchLabels:
kubernetes.io/metadata.name: {{ include "cloudnative-pg.namespace" . }}
{{- end }}
rules:
- apiGroups:
- postgresql.cnpg.io
Expand All @@ -123,6 +143,11 @@ webhooks:
port: {{ .Values.service.port }}
failurePolicy: {{ .Values.webhook.validating.failurePolicy }}
name: vpooler.cnpg.io
{{- if .Values.config.namespacedWebhooks }}
namespaceSelector:
matchLabels:
kubernetes.io/metadata.name: {{ include "cloudnative-pg.namespace" . }}
{{- end }}
rules:
- apiGroups:
- postgresql.cnpg.io
Expand Down
3 changes: 3 additions & 0 deletions charts/cloudnative-pg/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,9 @@ config:
# events across the entire Kubernetes cluster or if its focus should be
# narrowed down to the specific namespace within which it has been deployed.
clusterWide: true
# -- When set to true, appends the operator namespace to webhook configuration
# names to avoid collisions when running multiple operators in namespaced mode.
namespacedWebhooks: false
# -- The content of the configmap/secret, see
# https://cloudnative-pg.io/documentation/current/operator_conf/#available-options
# for all the available options.
Expand Down