Skip to content

Commit

Permalink
Update CNPG postgres-operator v1.25.0
Browse files Browse the repository at this point in the history
Signed-off-by: Andrei Kvapil <[email protected]>
  • Loading branch information
kvaps committed Jan 15, 2025
1 parent 34d6ab0 commit 40eb844
Show file tree
Hide file tree
Showing 13 changed files with 1,733 additions and 808 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
apiVersion: v2
appVersion: 1.24.0
appVersion: 1.25.0
dependencies:
- alias: monitoring
condition: monitoring.grafanaDashboard.create
Expand All @@ -22,4 +22,4 @@ name: cloudnative-pg
sources:
- https://github.com/cloudnative-pg/charts
type: application
version: 0.22.0
version: 0.23.0

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@

CloudNativePG operator should be installed in namespace "{{ .Release.Namespace }}".
You can now create a PostgreSQL cluster with 3 nodes in the current namespace as follows:
You can now create a PostgreSQL cluster with 3 nodes as follows:

cat <<EOF | kubectl apply -f -
# Example of PostgreSQL cluster
apiVersion: postgresql.cnpg.io/v1
kind: Cluster
metadata:
name: cluster-example
{{if not .Values.config.clusterWide -}}
namespace: {{ .Release.Namespace }}
{{- end }}
spec:
instances: 3
storage:
size: 1Gi
EOF

kubectl get cluster
kubectl get -A cluster

Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
{{/*
Allow the release namespace to be overridden for multi-namespace deployments in combined charts
*/}}
{{- define "cloudnative-pg.namespace" -}}
{{- if .Values.namespaceOverride -}}
{{- .Values.namespaceOverride -}}
{{- else -}}
{{- .Release.Namespace -}}
{{- end -}}
{{- end -}}

{{/*
Expand the name of the chart.
*/}}
Expand Down Expand Up @@ -60,3 +71,231 @@ Create the name of the service account to use
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}

{{/*
Define the common set of rules that can be applied either with
namespace scope or clusterwide
*/}}
{{- define "cloudnative-pg.commonRules" }}
- apiGroups:
- ""
resources:
- configmaps
- secrets
- services
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- ""
resources:
- configmaps/status
- secrets/status
verbs:
- get
- patch
- update
- apiGroups:
- ""
resources:
- events
verbs:
- create
- patch
- apiGroups:
- ""
resources:
- persistentvolumeclaims
- pods
- pods/exec
verbs:
- create
- delete
- get
- list
- patch
- watch
- apiGroups:
- ""
resources:
- pods/status
verbs:
- get
- apiGroups:
- ""
resources:
- serviceaccounts
verbs:
- create
- get
- list
- patch
- update
- watch
- apiGroups:
- apps
resources:
- deployments
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- batch
resources:
- jobs
verbs:
- create
- delete
- get
- list
- patch
- watch
- apiGroups:
- coordination.k8s.io
resources:
- leases
verbs:
- create
- get
- update
- apiGroups:
- monitoring.coreos.com
resources:
- podmonitors
verbs:
- create
- delete
- get
- list
- patch
- watch
- apiGroups:
- policy
resources:
- poddisruptionbudgets
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- postgresql.cnpg.io
resources:
- backups
- clusters
- databases
- poolers
- publications
- scheduledbackups
- subscriptions
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- postgresql.cnpg.io
resources:
- backups/status
- databases/status
- publications/status
- scheduledbackups/status
- subscriptions/status
verbs:
- get
- patch
- update
- apiGroups:
- postgresql.cnpg.io
resources:
- imagecatalogs
verbs:
- get
- list
- watch
- apiGroups:
- postgresql.cnpg.io
resources:
- clusters/finalizers
- poolers/finalizers
verbs:
- update
- apiGroups:
- postgresql.cnpg.io
resources:
- clusters/status
- poolers/status
verbs:
- get
- patch
- update
- watch
- apiGroups:
- rbac.authorization.k8s.io
resources:
- rolebindings
- roles
verbs:
- create
- get
- list
- patch
- update
- watch
- apiGroups:
- snapshot.storage.k8s.io
resources:
- volumesnapshots
verbs:
- create
- get
- list
- patch
- watch
{{- end }}

{{/*
Define the set of rules that must be applied clusterwide
*/}}
{{- define "cloudnative-pg.clusterwideRules" }}
- apiGroups:
- ""
resources:
- nodes
verbs:
- get
- list
- watch
- apiGroups:
- admissionregistration.k8s.io
resources:
- mutatingwebhookconfigurations
- validatingwebhookconfigurations
verbs:
- get
- patch
- apiGroups:
- postgresql.cnpg.io
resources:
- clusterimagecatalogs
verbs:
- get
- list
- watch
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,21 @@ apiVersion: v1
kind: ConfigMap
metadata:
name: {{ .Values.config.name }}
namespace: {{ include "cloudnative-pg.namespace" . }}
labels:
{{- include "cloudnative-pg.labels" . | nindent 4 }}
{{- with .Values.commonAnnotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
data:
{{- if .Values.config.clusterWide -}}
{{- toYaml .Values.config.data | nindent 2 }}
{{- else -}}
{{- $watchNamespaceMap := dict "WATCH_NAMESPACE" .Release.Namespace -}}
{{- $fullConfiguration := merge .Values.config.data $watchNamespaceMap -}}
{{- toYaml $fullConfiguration | nindent 2 }}
{{- end -}}
{{- else }}
apiVersion: v1
kind: Secret
Expand All @@ -40,6 +47,12 @@ metadata:
{{- toYaml . | nindent 4 }}
{{- end }}
stringData:
{{- if .Values.config.clusterWide -}}
{{- toYaml .Values.config.data | nindent 2 }}
{{- else -}}
{{- $watchNamespaceMap := dict "WATCH_NAMESPACE" .Release.Namespace -}}
{{- $fullConfiguration := merge .Values.config.data $watchNamespaceMap -}}
{{- toYaml $fullConfiguration | nindent 2 }}
{{- end -}}
{{- end }}
{{- end }}
Loading

0 comments on commit 40eb844

Please sign in to comment.