Skip to content

Commit b20e8ee

Browse files
committed
fix(postgres-operator): bump CloudNativePG to 1.30.0 for the Cluster scale-subresource selector
Bump the vendored cloudnative-pg chart 0.27.1 -> 0.29.0 (operator + CRDs 1.28.1-patched-to-1.28.2 -> 1.30.0) and drop the hand-maintained cloudnative-pg-1.28.2.patch entirely — 0.29.0 is a published chart, so no version-alignment patch is needed. Why this is required -------------------- Database read-replica autoscaling (community proposal design-proposals/database-horizontal-autoscaling) drives the CNPG Cluster scale subresource with a stock HPA (via KEDA). That only works when the subresource serves status.selector, which cloudnative-pg#8996 added and shipped in CNPG 1.28.4 / 1.29.2 / 1.30.0. cozystack shipped 1.28.2, whose scale subresource has no selector, so the HPA fails with InvalidSelector. Why 1.30.0 and not 1.28.4 ------------------------- The floor is >= 1.28.4, but the upstream chart repo publishes no chart for 1.28.4 (the 1.28 line stops at chart 0.27.1 / appVersion 1.28.1), so 1.28.4 could only be reached by hand-patching the 0.27.1 chart's operator image and CRDs up to the backport. A live PoC on a dev cluster proved that path is broken: the 1.28.4 operator running under the 0.27.1 (1.28.1) chart templates crash-loops on a missing RBAC grant it needs but the older chart does not provide — endpointslices.discovery.k8s.io is forbidden: ... cannot list resource "endpointslices" — so status.selector is never populated and the HPA still cannot scale. The hand-patch would have to port the operator's RBAC (and any other template delta) from 1.28.1 to 1.28.4 by hand, with no published chart to diff against. 1.30.0 (chart 0.29.0) is the only published chart that carries the selector together with matching RBAC/CRDs/templates, and the 1.28 line is EOL (2026-06-30), so 1.30.0 also keeps us on a supported release. cozystack uses the barman-cloud plugin (not native barman, removed in 1.31) and no CNPG Poolers, so the 1.30 deprecations and the known pooler bug do not apply. Update the version-guard unittest to 1.30.0 and assert the clusters CRD scale subresource carries labelSelectorPath: .status.selector. Signed-off-by: Alexey Artamonov <[email protected]>
1 parent 334e2d8 commit b20e8ee

11 files changed

Lines changed: 1855 additions & 892 deletions

File tree

‎packages/system/postgres-operator/Makefile‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@ update:
1010
rm -rf charts
1111
helm repo add cnpg https://cloudnative-pg.github.io/charts
1212
helm repo update cnpg
13-
helm pull cnpg/cloudnative-pg --untar --untardir charts --version 0.27.1
13+
helm pull cnpg/cloudnative-pg --untar --untardir charts --version 0.29.0
1414
rm -rf charts/cloudnative-pg/charts
15-
patch --no-backup-if-mismatch -p4 < patches/cloudnative-pg-1.28.2.patch
1615
helm pull cnpg/plugin-barman-cloud --untar --untardir charts --version 0.7.0
1716
rm -rf charts/plugin-barman-cloud/charts

‎packages/system/postgres-operator/charts/cloudnative-pg/Chart.yaml‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
apiVersion: v2
2-
appVersion: 1.28.2
2+
appVersion: 1.30.0
33
dependencies:
44
- alias: monitoring
55
condition: monitoring.grafanaDashboard.create
@@ -15,11 +15,12 @@ keywords:
1515
- postgresql
1616
- postgres
1717
- database
18+
kubeVersion: '>=1.29.0-0'
1819
maintainers:
1920
2021
name: phisco
2122
name: cloudnative-pg
2223
sources:
2324
- https://github.com/cloudnative-pg/charts
2425
type: application
25-
version: 0.27.1
26+
version: 0.29.0

‎packages/system/postgres-operator/charts/cloudnative-pg/README.md‎

Lines changed: 117 additions & 11 deletions
Large diffs are not rendered by default.
Lines changed: 139 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,139 @@
1+
{{ template "chart.header" . }}
2+
3+
4+
{{ template "chart.deprecationWarning" . }}
5+
6+
7+
{{ template "chart.badgesSection" . }}
8+
9+
10+
{{ template "chart.description" . }}
11+
12+
13+
{{ template "chart.homepageLine" . }}
14+
15+
16+
About this chart
17+
----------------
18+
19+
Helm chart to install the [CloudNativePG operator](https://cloudnative-pg.io), originally created and sponsored
20+
by [EDB](https://www.enterprisedb.com/) to manage PostgreSQL workloads on any supported Kubernetes cluster
21+
running in private, public, or hybrid cloud environments.
22+
23+
**NOTE**: this chart supports only the latest point release of the CloudNativePG operator.
24+
25+
The chart installs only the operator (controller manager, webhooks, RBAC and CRDs). To provision a PostgreSQL
26+
`Cluster` resource, use the companion [`cluster`](https://github.com/cloudnative-pg/charts/tree/main/charts/cluster) chart
27+
(see the [Cluster chart README](https://github.com/cloudnative-pg/charts/blob/main/charts/cluster/README.md) for details)
28+
or apply your own `Cluster` manifest.
29+
30+
31+
Getting Started
32+
---------------
33+
34+
### Add the chart repository
35+
36+
```console
37+
helm repo add cnpg https://cloudnative-pg.github.io/charts
38+
helm repo update
39+
```
40+
41+
### Install the operator
42+
43+
```console
44+
helm upgrade --install cnpg \
45+
--namespace cnpg-system \
46+
--create-namespace \
47+
cnpg/cloudnative-pg
48+
```
49+
50+
### Install with custom parameters
51+
52+
You can override individual chart values from the command line with `--set`.
53+
For example, to enable the Prometheus `PodMonitor`:
54+
55+
```console
56+
helm upgrade --install cnpg \
57+
--namespace cnpg-system \
58+
--create-namespace \
59+
--set monitoring.podMonitorEnabled=true \
60+
cnpg/cloudnative-pg
61+
```
62+
63+
> **Note**
64+
> Enabling the `PodMonitor` requires the Prometheus Operator CRDs to be installed in the cluster.
65+
> Without them the install fails with `no matches for kind "PodMonitor"`.
66+
67+
See the [Values](#values) section below for the full list of configurable parameters.
68+
69+
### Verify the installation
70+
71+
```console
72+
kubectl -n cnpg-system get deploy
73+
kubectl -n cnpg-system rollout status deploy/cnpg-cloudnative-pg
74+
```
75+
76+
77+
Single namespace installation
78+
-----------------------------
79+
80+
It is possible to limit the operator's capabilities to solely the namespace in which it has been installed.
81+
With this restriction, the cluster-level permissions required by the operator will be substantially reduced,
82+
and the security profile of the installation will be enhanced.
83+
84+
You can install the operator in single-namespace mode by setting the `config.clusterWide` flag to `false`,
85+
as in the following example:
86+
87+
```console
88+
helm upgrade --install cnpg \
89+
--namespace cnpg-system \
90+
--create-namespace \
91+
--set config.clusterWide=false \
92+
cnpg/cloudnative-pg
93+
```
94+
95+
**IMPORTANT**: the single-namespace installation mode can't coexist with the cluster-wide operator. Otherwise
96+
there would be collisions when managing the resources in the namespace watched by the single-namespace
97+
operator. It is up to the user to ensure there is no collision between operators.
98+
99+
100+
Uninstalling
101+
------------
102+
103+
```console
104+
helm uninstall cnpg --namespace cnpg-system
105+
```
106+
107+
> **Warning**
108+
> Uninstalling the chart does not remove the CRDs. Deleting them cascade-deletes every `Cluster` (and other
109+
> CloudNativePG) resource across the whole cluster, together with the PostgreSQL data stored in their PVCs.
110+
> This is irreversible, so only delete the CRDs if you intend to permanently remove all managed databases.
111+
112+
113+
{{ template "chart.sourcesSection" . }}
114+
115+
116+
{{ template "chart.requirementsSection" . }}
117+
118+
119+
{{ template "chart.valuesSection" . }}
120+
121+
122+
{{ template "chart.maintainersSection" . }}
123+
124+
Contributing
125+
------------
126+
127+
Please read the [code of conduct](https://github.com/cloudnative-pg/charts/blob/main/CODE-OF-CONDUCT.md) and the
128+
[guidelines](https://github.com/cloudnative-pg/charts/blob/main/CONTRIBUTING.md) to contribute to the project.
129+
130+
131+
Copyright
132+
---------
133+
134+
Helm charts for CloudNativePG are distributed under [Apache License 2.0](./LICENSE).
135+
136+
137+
{{- if not .SkipVersionFooter }}
138+
{{ template "helm-docs.versionFooter" . }}
139+
{{- end }}

‎packages/system/postgres-operator/charts/cloudnative-pg/templates/_helpers.tpl‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,17 @@ namespace scope or clusterwide
167167
verbs:
168168
- create
169169
- get
170+
- list
170171
- update
172+
- watch
173+
- apiGroups:
174+
- discovery.k8s.io
175+
resources:
176+
- endpointslices
177+
verbs:
178+
- get
179+
- list
180+
- watch
171181
- apiGroups:
172182
- monitoring.coreos.com
173183
resources:
@@ -196,6 +206,7 @@ namespace scope or clusterwide
196206
resources:
197207
- backups
198208
- clusters
209+
- databaseroles
199210
- databases
200211
- poolers
201212
- publications
@@ -243,13 +254,15 @@ namespace scope or clusterwide
243254
- postgresql.cnpg.io
244255
resources:
245256
- clusters/finalizers
257+
- databaseroles/finalizers
246258
- poolers/finalizers
247259
verbs:
248260
- update
249261
- apiGroups:
250262
- postgresql.cnpg.io
251263
resources:
252264
- clusters/status
265+
- databaseroles/status
253266
- poolers/status
254267
- failoverquorums/status
255268
verbs:

0 commit comments

Comments
 (0)