mirror of
https://github.com/cozystack/cozystack.git
synced 2026-11-30 12:16:03 +09:00
fix(postgres): rebuild indexes on C.UTF-8 when the Debian release changes (#5478)
## What this PR does Refs #5459 (item 1: `C.UTF-8` is not repaired and nobody is warned). After the move to the `-standard-trixie` operand images, an index on a `COLLATE "C.UTF-8"` column, or any text index in a database created with `LC_COLLATE 'C.UTF-8'`, is silently corrupt: Debian bullseye's patched `C.UTF-8` and the glibc 2.35+ `C.UTF-8` order characters differently, but PostgreSQL records no collation version for `C.*` locales, so the collation repair in the init Job never selected those indexes. On PostgreSQL 15+ there was not even a warning. Lookups through such an index miss rows, and a unique index on it stops seeing duplicates. One commit. The repair pass now treats libc `C.<codeset>` collations, and a libc `C.<codeset>` database default, as versioned by the Debian release of the server's build (the `pgdgNN` suffix of `server_version`). Their indexes then go through the existing resumable rebuild path (OID mark, in-place handling for exclusion constraints, `_ccnew` leftovers, unique-duplicate failure reporting), which this PR leaves unchanged. Because PostgreSQL stores nothing to compare with, the release each database was last repaired for is stored in a new per-database setting, `cozystack.collation_release`, next to the existing `cozystack.collation_repair`: - a database without the setting gets the release of the server the pass first sees it on. The pass looks before it waits for the rollout, so the old release is persisted even if that run fails, and a retry that runs after the primary restarted still rebuilds; - if the server already runs the new glibc when the pass first sees the database, a libc collation whose recorded version differs from the server's (`en_US.utf8` 2.31 vs 2.41, present in every database created from these images) marks it as not repaired for any release; - otherwise (a new cluster, a database added later) the current release is recorded and nothing is rebuilt; - the setting is updated to the current release only when the database is repaired without failures. The PG<15 warning `database ... uses the locale C.UTF-8, for which this PostgreSQL major records no collation version ...` no longer fires for `C.*` locales, since those are now repaired. The range-partition warning says for a `C.*` key that it is reported only once, instead of claiming that a collation version was left as recorded. The e2e postgres suite now also sets another release on its database, creates a unique `C.utf8` column, and checks that the upgrade rebuilds that index, that amcheck passes on it, and that the setting ends at the server's release. The change stays inside the `== refresh collation versions` SQL prelude and its final block. It does not touch the rollout wait, the per-index rebuild session or the extension section, which other open fixes for #5459 change. ### What it cannot see A cluster where a pass without this change already ran on the new glibc (v1.7.2-rc.1, or `main` since #5405) has already refreshed its libc collation versions, so no trace of the move is left. This pass then records the current release for it and does not rebuild its `C.*` indexes. Rebuild those by hand with `REINDEX INDEX CONCURRENTLY` (or `REINDEX DATABASE`), as the release note says. ### Coordination with #5472 #5472, now merged, told operators in the `allowCollationChange` description to rebuild indexes on `C.UTF-8` by hand. This PR merges second, so it drops that sentence from `values.yaml`, `types.go`, the README, the schema and the cozyrd: the init Job now rebuilds those indexes itself. ### Testing Docker, no Kubernetes: data written on `ghcr.io/cloudnative-pg/postgresql:17.7` / `13.22` (bullseye, glibc 2.31, `pgdg11`), then the same data directory started on `17.12-standard-trixie` / `13.22-standard-trixie` (glibc 2.41, `pgdg13`). The repair section was rendered with `helm template`, extracted from the init-script Secret, and run from a container of the trixie image with the env the Job sets (`PGHOST`, `PGUSER`, `JOB_DEADLINE`). Data: 200,000 distinct keys mixing ASCII punctuation, `é`, U+FFFD, U+FFFF, U+1D400 and U+1F600. Tables: a `UNIQUE` column `COLLATE "C.UTF-8"`, an `en_US.utf8` column, a plain `C` column, and a `cutf8db` database with `LC_COLLATE 'C.UTF-8'`. | Scenario | Result | | --- | --- | | Pass from `main`, PG17 and PG13 | rebuilds only the `en_US.utf8` index; `t_c_k_key`: `item order invariant violated`, 178,162 of 200,000 keys not found; `cutf8db.t_d_k`: 179,426 not found | | This PR, Job starts on bullseye, server then restarts on trixie (PG17, PG13) | `pgdg11` recorded while waiting; `C.UTF-8` column index, `C.UTF-8` database default index and `en_US.utf8` index rebuilt; amcheck ok, 0 misses; plain `C` index keeps its OID | | This PR, first run times out waiting for the rollout, retry after the restart (libc versions refreshed by hand in between so only the persisted release can trigger) | retry rebuilds both `C.*` indexes; amcheck ok, 0 misses | | This PR, server already on trixie at first run | detected through the stale libc collation versions; both `C.*` indexes rebuilt | | Second and third run | nothing rebuilt, setting stays `pgdg13` | | New cluster created on trixie | nothing rebuilt, `pgdg13` recorded | | Range partitions on `C.UTF-8` and on `en_US.utf8` | partition indexes rebuilt once; the `C.*` partition warned once; later runs rebuild nothing | `helm unittest packages/apps/postgres`: 31 suites, 247 tests passed. Dev cluster (cozystack v1.7.0): - Setup: an app installed from the v1.7.1 chart (`postgresql:17.7`, bullseye, 2 instances). In `appdb`, a `UNIQUE` column `COLLATE "C.UTF-8"` with 50,000 keys built from ASCII letters and punctuation, `é`, U+FFFD, U+1D400 and U+1F600. - `helm upgrade` to this branch passed on the first attempt. The init Job logged `rebuilding index public.t_c_k_key in database appdb: its collation changed version`. - Afterwards: - the Cluster runs `17.12-standard-trixie`; - the index OID changed (16424 → 16507); - `bt_index_check(t_c_k_key, true)` is clean on the primary, on the replica and through `-ro`, with 0 lookup misses; - `cozystack.collation_release` is `pgdg13`. - A second upgrade rebuilt nothing. The extended chainsaw e2e step has not run yet, so CI will be its first run. Docker, with the rendered repair pass run against `17.12-standard-trixie` and `UNIQUE` columns `COLLATE "C.utf8"`: - A database with no recorded release and a stale libc collation (`CREATE COLLATION ... (provider = libc, locale = 'en_US.utf8', version = '0')`): the index is rebuilt and `pgdg13` is recorded. - A database whose only stale piece is its libc default collation (`datcollversion` changed): the index is rebuilt, and `pgdg13` is recorded. - A fresh database: nothing is rebuilt, and `pgdg13` is recorded. - A second run rebuilds nothing. The e2e suite now also covers a database with no recorded release, the state every existing cluster starts from. That database holds a stale `en_US.utf8` libc collation and a `UNIQUE` column on `C.utf8`, and the test asserts the new index OID, `bt_index_check`, and the recorded release. A libc collation on locale `C` with an explicit version cannot serve as the probe: `ALTER COLLATION ... REFRESH VERSION` refuses to move it to the NULL version of a `C` locale. ### Downstream repositories - [ ] No downstream repository is affected by this change - [ ] [cozystack/website](https://github.com/cozystack/website) - follow-up: - [ ] [cozystack/terraform-provider-cozystack](https://github.com/cozystack/terraform-provider-cozystack) - follow-up: - [ ] [cozystack/ansible-cozystack](https://github.com/cozystack/ansible-cozystack) - follow-up: - [ ] [cozystack/ccp](https://github.com/cozystack/ccp) - follow-up: - [ ] [cozystack/talm](https://github.com/cozystack/talm) - follow-up: - [ ] [cozystack/cozyhr](https://github.com/cozystack/cozyhr) - follow-up: - [ ] [cozystack/cozy-proxy](https://github.com/cozystack/cozy-proxy) - follow-up: - [ ] [cozystack/cozystack-telemetry-server](https://github.com/cozystack/cozystack-telemetry-server) - follow-up: - [ ] [cozystack/external-apps-example](https://github.com/cozystack/external-apps-example) - follow-up: - [ ] [cozystack/examples](https://github.com/cozystack/examples) - follow-up: - [ ] [cozystack/community](https://github.com/cozystack/community) - follow-up: The diff touches only `packages/apps/postgres/templates/init-script.yaml` and the postgres e2e test. No values, schema, README, API or CRD change, so none of the generated reference docs move. Boxes are left empty for a maintainer to decide: the website may describe the trixie move and its collation repair in upgrade notes, and if it lists which collations get repaired, `C.UTF-8` should be added there. I did not check that. ### Release note ```release-note [postgres] The init Job now also rebuilds indexes on libc `C.UTF-8` (and other `C.<codeset>`) collations, and on databases whose default collation is such a locale, when the server moves to an image built on another Debian release. PostgreSQL records no version for these collations, so before this fix such indexes stayed corrupt after the move to the standard-trixie images, with no warning. The Debian release each database was repaired for is kept in the `cozystack.collation_release` database setting. A cluster that already ran the previous repair on a trixie image (v1.7.2-rc.1 or a `main` build since the move) is not recognised: rebuild its indexes on `C.*` collations by hand with `REINDEX`. ``` <!-- This is an auto-generated comment: release notes by coderabbit.ai --> <!-- coderabbit-ai-generated:v1 --> ## Summary by CodeRabbit * **Bug Fixes** * PostgreSQL collation repair now detects changes affecting `C.<codeset>` collations across PostgreSQL build releases, including cases where PostgreSQL does not record collation versions. Affected indexes are identified and rebuilt during repair. * Partition-related warnings clarify when collation changes can or cannot be detected. After repair, the process records the PostgreSQL release to help identify when a later repair may be needed. * **Documentation** * Updated `allowCollationChange` guidance to explain that the initialization process rebuilds indexes for `C.UTF-8` and other `C.*` locales, removing the instruction to rebuild those indexes manually. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
7 files changed
+106
-26
No files matched your search
Generated
+1
-1
@@ -47,7 +47,7 @@ type ConfigSpec struct {
|
||||
// PostgreSQL image flavor, fixed when the cluster is created. `postgresql` uses the CloudNativePG PostgreSQL image. `postgis` uses the CloudNativePG PostGIS image, which adds postgis, postgis_raster, postgis_topology, postgis_sfcgal, postgis_tiger_geocoder and address_standardizer; enable them per database in `databases.<name>.extensions`. Changing the flavor of an existing cluster is refused, and a backup restores only into a cluster of the flavor it was taken from: to change flavor, create a new cluster and move the data with a logical dump (pg_dump / pg_restore).
|
||||
// +kubebuilder:default:="postgresql"
|
||||
Flavor Flavor `json:"flavor"`
|
||||
// Allow a cluster created on a Debian bullseye image (before the move to standard-trixie) to move to the new image without a clean locale check. Such a cluster is checked before each upgrade, except while `bootstrap.enabled` is set (set it back to false once a restore set up by hand has finished), and stays on its current image until the check finds nothing that depends on a collation other than C, POSIX or builtin: while this is false, a cluster the check found affected (an ICU or libc locale, or C.UTF-8) or could not finish on stays put, because glibc and ICU on the new image sort text differently and every index on such text must be rebuilt. A held cluster runs the bare bullseye tag it has, gets no further PostgreSQL minors and so none of their security fixes, and refuses a change of `version`, since new majors are built only on the new images. To leave that state, either remove the dependency (move such columns and indexes to C, or to the builtin `pg_c_utf8` on PostgreSQL 17 and later) and let the next upgrade check again, or set this to true in a maintenance window: the cluster moves on the next upgrade, replicas restart on the new image first and can return wrong results through `-ro`, and unique indexes can accept duplicates, until the indexes are rebuilt on the primary. The init Job rebuilds only indexes on collations that record a version (ICU, and libc locales other than C.*): rebuild indexes on C.UTF-8 or another C.* locale by hand with REINDEX, and check range partitions, CHECK constraints and materialized views on such text, which a rebuild does not fix. A held cluster shows the hold only as an unchanged image; the result and the objects found are in the `postgres.cozystack.io/locale-data` and `postgres.cozystack.io/locale-data-objects` annotations of the cnpg.io Cluster, which an administrator can read. A restore of a backup taken on one of those bullseye images comes back on that image and is checked by the next upgrade.
|
||||
// Allow a cluster created on a Debian bullseye image (before the move to standard-trixie) to move to the new image without a clean locale check. Such a cluster is checked before each upgrade, except while `bootstrap.enabled` is set (set it back to false once a restore set up by hand has finished), and stays on its current image until the check finds nothing that depends on a collation other than C, POSIX or builtin: while this is false, a cluster the check found affected (an ICU or libc locale, or C.UTF-8) or could not finish on stays put, because glibc and ICU on the new image sort text differently and every index on such text must be rebuilt. A held cluster runs the bare bullseye tag it has, gets no further PostgreSQL minors and so none of their security fixes, and refuses a change of `version`, since new majors are built only on the new images. To leave that state, either remove the dependency (move such columns and indexes to C, or to the builtin `pg_c_utf8` on PostgreSQL 17 and later) and let the next upgrade check again, or set this to true in a maintenance window: the cluster moves on the next upgrade, replicas restart on the new image first and can return wrong results through `-ro`, and unique indexes can accept duplicates, until the indexes are rebuilt on the primary. The init Job rebuilds the indexes on such text, those on C.UTF-8 and other C.* locales included; check range partitions, CHECK constraints and materialized views on it, which a rebuild does not fix. A held cluster shows the hold only as an unchanged image; the result and the objects found are in the `postgres.cozystack.io/locale-data` and `postgres.cozystack.io/locale-data-objects` annotations of the cnpg.io Cluster, which an administrator can read. A restore of a backup taken on one of those bullseye images comes back on that image and is checked by the next upgrade.
|
||||
// +kubebuilder:default:=false
|
||||
AllowCollationChange bool `json:"allowCollationChange"`
|
||||
// TLS configuration for server connections.
|
||||
|
||||
@@ -253,8 +253,12 @@ spec:
|
||||
# The init Job rebuilds an index whose collation changed library version.
|
||||
# The pass is SQL run by a Helm hook, so only a real server can say whether
|
||||
# it works. A collation created with an explicit version reads as stale
|
||||
# without swapping the operand image, which makes one more upgrade of the
|
||||
# release enough to run the pass over it.
|
||||
# without swapping the operand image, and so does a C.<codeset> collation
|
||||
# once the database records another Debian release as the one it was
|
||||
# repaired for, which makes one more upgrade of the release enough to run
|
||||
# the pass over both. A database created after the last run records no
|
||||
# release, the state every existing cluster starts from; there a stale libc
|
||||
# collation is what tells the pass that glibc moved.
|
||||
- name: rebuild-index-after-collation-version-change
|
||||
try:
|
||||
- script:
|
||||
@@ -273,9 +277,19 @@ spec:
|
||||
CREATE EXTENSION IF NOT EXISTS btree_gist;
|
||||
CREATE TABLE collation_probe_excl (s text COLLATE stale_icu, EXCLUDE USING gist (s WITH =));
|
||||
INSERT INTO collation_probe_excl SELECT 'k' || g FROM generate_series(1, 200) g;
|
||||
CREATE TABLE collation_probe_c (s text COLLATE "C.utf8" UNIQUE);
|
||||
INSERT INTO collation_probe_c SELECT 'c' || g FROM generate_series(1, 1000) g;
|
||||
ALTER DATABASE testdb SET cozystack.collation_release = 'pgdg11';
|
||||
CREATE TABLE collation_probe_before AS
|
||||
SELECT 'collation_probe_s'::regclass::oid AS index,
|
||||
(SELECT relfilenode FROM pg_class WHERE oid = 'collation_probe_excl_s_excl'::regclass) AS in_place_file;
|
||||
(SELECT relfilenode FROM pg_class WHERE oid = 'collation_probe_excl_s_excl'::regclass) AS in_place_file,
|
||||
'collation_probe_c_s_key'::regclass::oid AS c_index;
|
||||
CREATE DATABASE collation_probe_unrecorded;
|
||||
\c collation_probe_unrecorded
|
||||
CREATE COLLATION stale_libc (provider = libc, locale = 'en_US.utf8', version = '0');
|
||||
CREATE TABLE collation_probe_c (s text COLLATE "C.utf8" UNIQUE);
|
||||
INSERT INTO collation_probe_c SELECT 'c' || g FROM generate_series(1, 1000) g;
|
||||
CREATE TABLE collation_probe_before AS SELECT 'collation_probe_c_s_key'::regclass::oid AS c_index;
|
||||
EOF
|
||||
check:
|
||||
($error == null): true
|
||||
@@ -335,6 +349,33 @@ spec:
|
||||
echo "the init Job did not rebuild the exclusion constraint's index" >&2
|
||||
exit 1
|
||||
fi
|
||||
rebuilt_c=$(q "SELECT 'collation_probe_c_s_key'::regclass::oid <> c_index FROM collation_probe_before")
|
||||
if [ "$rebuilt_c" != t ]; then
|
||||
echo "the init Job did not rebuild the index on a C.<codeset> collation after the Debian release changed" >&2
|
||||
exit 1
|
||||
fi
|
||||
q "SELECT bt_index_check('collation_probe_c_s_key', true)"
|
||||
release=$(q "SELECT current_setting('cozystack.collation_release', true) = substring(current_setting('server_version') from 'pgdg[0-9]+')")
|
||||
if [ "$release" != t ]; then
|
||||
echo "the init Job did not record the Debian release it repaired the database for" >&2
|
||||
exit 1
|
||||
fi
|
||||
qu() {
|
||||
kubectl -n "$NAMESPACE" exec "$pod" -c postgres -- \
|
||||
psql -U postgres -d collation_probe_unrecorded -v ON_ERROR_STOP=1 -tAc "$1"
|
||||
}
|
||||
rebuilt_unrecorded=$(qu "SELECT 'collation_probe_c_s_key'::regclass::oid <> c_index FROM collation_probe_before")
|
||||
if [ "$rebuilt_unrecorded" != t ]; then
|
||||
echo "the init Job did not rebuild the index on a C.<codeset> collation in a database that recorded no release and holds a stale libc collation" >&2
|
||||
exit 1
|
||||
fi
|
||||
qu "CREATE EXTENSION IF NOT EXISTS amcheck"
|
||||
qu "SELECT bt_index_check('collation_probe_c_s_key', true)"
|
||||
release=$(qu "SELECT current_setting('cozystack.collation_release', true) = substring(current_setting('server_version') from 'pgdg[0-9]+')")
|
||||
if [ "$release" != t ]; then
|
||||
echo "the init Job did not record the Debian release it repaired the unrecorded database for" >&2
|
||||
exit 1
|
||||
fi
|
||||
# The pass keeps its progress in a setting of the database and
|
||||
# removes it once nothing is left to repair.
|
||||
progress=$(q "SELECT count(*) FROM pg_db_role_setting s JOIN pg_database d ON d.oid = s.setdatabase, unnest(s.setconfig) AS c WHERE d.datname = current_database() AND c LIKE 'cozystack.collation_repair=%'")
|
||||
|
||||
@@ -207,20 +207,20 @@ For `sslmode=verify-full` to work, the CA bundle retrieved above must be saved t
|
||||
|
||||
### Common parameters
|
||||
|
||||
| Name | Description | Type | Value |
|
||||
| ---------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------- | ------------ |
|
||||
| `replicas` | Number of Postgres replicas. Under active autoscaling this is the resting/seed count, not the live count — KEDA drives the live count via `/scale`. Disabling autoscaling does NOT automatically bring the live count back to `replicas`: the client-side merge writes `instances` only when the rendered value changes, so a cluster KEDA grew past `replicas` stays there with no autoscaler left to reduce it — lower `replicas` to the count you want and it rebases down (shedding the surplus replicas + PVCs). Lowering it below the live count, or disabling/dry-running while it sits below the live count, sheds in one step past the scaleDown pacing; stage it to the live count first (suspend the HelmRelease and `kubectl scale` if needed) to avoid a transient. Must stay greater than `quorum.maxSyncReplicas`. | `int` | `2` |
|
||||
| `resources` | Explicit CPU and memory configuration for each PostgreSQL replica. When omitted, the preset defined in `resourcesPreset` is applied. | `object` | `{}` |
|
||||
| `resources.cpu` | CPU available to each replica. | `quantity` | `""` |
|
||||
| `resources.memory` | Memory (RAM) available to each replica. | `quantity` | `""` |
|
||||
| `resourcesPreset` | Default sizing preset used when `resources` is omitted. | `string` | `t1.micro` |
|
||||
| `size` | Persistent Volume Claim size available for application data. | `quantity` | `10Gi` |
|
||||
| `storageClass` | StorageClass used to store the data. | `string` | `""` |
|
||||
| `external` | Enable external access from outside the cluster. | `bool` | `false` |
|
||||
| `schedulingClass` | Name of a SchedulingClass CR (cluster-scoped, group cozystack.io) used in place of the tenant's for this application's pods. A pod gets its class when it is created, so running pods keep theirs until they are recreated. Must be the tenant's own class or one listed in the tenant's `allowedSchedulingClasses`. Setting any other value is refused, and the pods of an application whose class is not, or no longer, in that list get the tenant's class. Empty means inherit from the tenant. | `string` | `""` |
|
||||
| `version` | PostgreSQL major version to deploy | `string` | `v18` |
|
||||
| `flavor` | PostgreSQL image flavor, fixed when the cluster is created. `postgresql` uses the CloudNativePG PostgreSQL image. `postgis` uses the CloudNativePG PostGIS image, which adds postgis, postgis_raster, postgis_topology, postgis_sfcgal, postgis_tiger_geocoder and address_standardizer; enable them per database in `databases.<name>.extensions`. Changing the flavor of an existing cluster is refused, and a backup restores only into a cluster of the flavor it was taken from: to change flavor, create a new cluster and move the data with a logical dump (pg_dump / pg_restore). | `string` | `postgresql` |
|
||||
| `allowCollationChange` | Allow a cluster created on a Debian bullseye image (before the move to standard-trixie) to move to the new image without a clean locale check. Such a cluster is checked before each upgrade, except while `bootstrap.enabled` is set (set it back to false once a restore set up by hand has finished), and stays on its current image until the check finds nothing that depends on a collation other than C, POSIX or builtin: while this is false, a cluster the check found affected (an ICU or libc locale, or C.UTF-8) or could not finish on stays put, because glibc and ICU on the new image sort text differently and every index on such text must be rebuilt. A held cluster runs the bare bullseye tag it has, gets no further PostgreSQL minors and so none of their security fixes, and refuses a change of `version`, since new majors are built only on the new images. To leave that state, either remove the dependency (move such columns and indexes to C, or to the builtin `pg_c_utf8` on PostgreSQL 17 and later) and let the next upgrade check again, or set this to true in a maintenance window: the cluster moves on the next upgrade, replicas restart on the new image first and can return wrong results through `-ro`, and unique indexes can accept duplicates, until the indexes are rebuilt on the primary. The init Job rebuilds only indexes on collations that record a version (ICU, and libc locales other than C.*): rebuild indexes on C.UTF-8 or another C.* locale by hand with REINDEX, and check range partitions, CHECK constraints and materialized views on such text, which a rebuild does not fix. A held cluster shows the hold only as an unchanged image; the result and the objects found are in the `postgres.cozystack.io/locale-data` and `postgres.cozystack.io/locale-data-objects` annotations of the cnpg.io Cluster, which an administrator can read. A restore of a backup taken on one of those bullseye images comes back on that image and is checked by the next upgrade. | `bool` | `false` |
|
||||
| Name | Description | Type | Value |
|
||||
| ---------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------- | ------------ |
|
||||
| `replicas` | Number of Postgres replicas. Under active autoscaling this is the resting/seed count, not the live count — KEDA drives the live count via `/scale`. Disabling autoscaling does NOT automatically bring the live count back to `replicas`: the client-side merge writes `instances` only when the rendered value changes, so a cluster KEDA grew past `replicas` stays there with no autoscaler left to reduce it — lower `replicas` to the count you want and it rebases down (shedding the surplus replicas + PVCs). Lowering it below the live count, or disabling/dry-running while it sits below the live count, sheds in one step past the scaleDown pacing; stage it to the live count first (suspend the HelmRelease and `kubectl scale` if needed) to avoid a transient. Must stay greater than `quorum.maxSyncReplicas`. | `int` | `2` |
|
||||
| `resources` | Explicit CPU and memory configuration for each PostgreSQL replica. When omitted, the preset defined in `resourcesPreset` is applied. | `object` | `{}` |
|
||||
| `resources.cpu` | CPU available to each replica. | `quantity` | `""` |
|
||||
| `resources.memory` | Memory (RAM) available to each replica. | `quantity` | `""` |
|
||||
| `resourcesPreset` | Default sizing preset used when `resources` is omitted. | `string` | `t1.micro` |
|
||||
| `size` | Persistent Volume Claim size available for application data. | `quantity` | `10Gi` |
|
||||
| `storageClass` | StorageClass used to store the data. | `string` | `""` |
|
||||
| `external` | Enable external access from outside the cluster. | `bool` | `false` |
|
||||
| `schedulingClass` | Name of a SchedulingClass CR (cluster-scoped, group cozystack.io) used in place of the tenant's for this application's pods. A pod gets its class when it is created, so running pods keep theirs until they are recreated. Must be the tenant's own class or one listed in the tenant's `allowedSchedulingClasses`. Setting any other value is refused, and the pods of an application whose class is not, or no longer, in that list get the tenant's class. Empty means inherit from the tenant. | `string` | `""` |
|
||||
| `version` | PostgreSQL major version to deploy | `string` | `v18` |
|
||||
| `flavor` | PostgreSQL image flavor, fixed when the cluster is created. `postgresql` uses the CloudNativePG PostgreSQL image. `postgis` uses the CloudNativePG PostGIS image, which adds postgis, postgis_raster, postgis_topology, postgis_sfcgal, postgis_tiger_geocoder and address_standardizer; enable them per database in `databases.<name>.extensions`. Changing the flavor of an existing cluster is refused, and a backup restores only into a cluster of the flavor it was taken from: to change flavor, create a new cluster and move the data with a logical dump (pg_dump / pg_restore). | `string` | `postgresql` |
|
||||
| `allowCollationChange` | Allow a cluster created on a Debian bullseye image (before the move to standard-trixie) to move to the new image without a clean locale check. Such a cluster is checked before each upgrade, except while `bootstrap.enabled` is set (set it back to false once a restore set up by hand has finished), and stays on its current image until the check finds nothing that depends on a collation other than C, POSIX or builtin: while this is false, a cluster the check found affected (an ICU or libc locale, or C.UTF-8) or could not finish on stays put, because glibc and ICU on the new image sort text differently and every index on such text must be rebuilt. A held cluster runs the bare bullseye tag it has, gets no further PostgreSQL minors and so none of their security fixes, and refuses a change of `version`, since new majors are built only on the new images. To leave that state, either remove the dependency (move such columns and indexes to C, or to the builtin `pg_c_utf8` on PostgreSQL 17 and later) and let the next upgrade check again, or set this to true in a maintenance window: the cluster moves on the next upgrade, replicas restart on the new image first and can return wrong results through `-ro`, and unique indexes can accept duplicates, until the indexes are rebuilt on the primary. The init Job rebuilds the indexes on such text, those on C.UTF-8 and other C.* locales included; check range partitions, CHECK constraints and materialized views on it, which a rebuild does not fix. A held cluster shows the hold only as an unchanged image; the result and the objects found are in the `postgres.cozystack.io/locale-data` and `postgres.cozystack.io/locale-data-objects` annotations of the cnpg.io Cluster, which an administrator can read. A restore of a backup taken on one of those bullseye images comes back on that image and is checked by the next upgrade. | `bool` | `false` |
|
||||
|
||||
|
||||
### TLS configuration
|
||||
|
||||
@@ -683,6 +683,29 @@ stringData:
|
||||
the codeset or a hyphen in it. A locale with no such collation cannot
|
||||
be checked, which a run that saw the image change says in a warning.
|
||||
|
||||
PostgreSQL records no version for a libc locale named C.<codeset>
|
||||
either, yet the one Debian patched into the glibc of bullseye and the
|
||||
one glibc ships since 2.35 order some characters differently. Such a
|
||||
collation, and a database whose default collation is such a locale,
|
||||
therefore take the Debian release of the server's build as their
|
||||
version. The release a database was last repaired for is another
|
||||
setting of it, written once a run repairs the database without a
|
||||
failure. A database without that setting gets the release of the
|
||||
server the pass first finds it on: that is the previous image whenever
|
||||
the pass sees the image change, since it looks before it waits for the
|
||||
rollout, so a retry after the primary has restarted still rebuilds
|
||||
those indexes. A database that already runs on a new glibc by then is
|
||||
recognised by a libc collation, or a libc database default, whose
|
||||
recorded version differs from the server's, and is taken as repaired
|
||||
for no release. Anything else, a new cluster included, is taken as
|
||||
repaired for the release it runs. That includes a database a pass
|
||||
without this rule already repaired on the new glibc: it refreshed the
|
||||
libc versions and left no sign of the move behind, so its indexes on a
|
||||
C.<codeset> collation have to be rebuilt by hand with REINDEX.
|
||||
With no version for PostgreSQL to complain about, a range partition key
|
||||
of such a collation is reported only by the run that rebuilds its
|
||||
indexes.
|
||||
|
||||
Every session of the pass pins search_path to pg_catalog: the Job
|
||||
connects as the superuser, and a function or operator a tenant defined
|
||||
in public would otherwise be picked wherever its argument types match
|
||||
@@ -696,17 +719,25 @@ stringData:
|
||||
SET search_path = pg_catalog, pg_temp;
|
||||
SELECT current_setting('server_version_num')::int >= 150000 AS tracks_database \gset
|
||||
\if :tracks_database
|
||||
SELECT datcollversion IS NOT NULL AS db_versioned, coalesce(pg_database_collation_actual_version(oid), '') AS db_actual, datcollversion IS NOT NULL AND datcollversion IS DISTINCT FROM pg_database_collation_actual_version(oid) AS db_stale, false AS db_unmatched FROM pg_database WHERE datname = current_database() \gset
|
||||
SELECT datcollversion IS NOT NULL AS db_versioned, coalesce(pg_database_collation_actual_version(oid), '') AS db_actual, datcollversion IS NOT NULL AND datcollversion IS DISTINCT FROM pg_database_collation_actual_version(oid) AS db_stale, false AS db_unmatched, datlocprovider = 'c' AND datcollate ~* '^C\.' AS db_c, datlocprovider = 'c' AND datcollversion IS NOT NULL AND datcollversion IS DISTINCT FROM pg_database_collation_actual_version(oid) AS db_libc_stale FROM pg_database WHERE datname = current_database() \gset
|
||||
\else
|
||||
SELECT d.datcollate NOT IN ('C', 'POSIX') AS db_versioned,
|
||||
SELECT d.datcollate NOT IN ('C', 'POSIX') AND d.datcollate !~* '^C\.' AS db_versioned,
|
||||
coalesce(max(pg_collation_actual_version(c.oid)), '') AS db_actual,
|
||||
coalesce(bool_or(c.collversion IS DISTINCT FROM pg_collation_actual_version(c.oid)), false) AS db_stale,
|
||||
d.datcollate NOT IN ('C', 'POSIX') AND count(c.oid) = 0 AS db_unmatched
|
||||
d.datcollate NOT IN ('C', 'POSIX') AND d.datcollate !~* '^C\.' AND count(c.oid) = 0 AS db_unmatched,
|
||||
d.datcollate ~* '^C\.' AS db_c,
|
||||
false AS db_libc_stale
|
||||
FROM pg_database d
|
||||
LEFT JOIN pg_collation c ON c.collprovider = 'c' AND lower(replace(c.collcollate, '-', '')) = lower(replace(d.datcollate, '-', '')) AND c.collversion IS NOT NULL AND c.collencoding IN (-1, d.encoding)
|
||||
WHERE d.datname = current_database()
|
||||
GROUP BY d.datcollate \gset
|
||||
\endif
|
||||
SELECT coalesce(substring(current_setting('server_version') from 'pgdg[0-9]+'), '') AS release, coalesce(current_setting('cozystack.collation_release', true), '') AS repaired \gset
|
||||
SELECT :'repaired' = '' AND :'release' <> '' AS unrecorded \gset
|
||||
\if :unrecorded
|
||||
SELECT CASE WHEN :'db_libc_stale'::boolean OR EXISTS (SELECT FROM pg_collation c WHERE c.collprovider = 'c' AND c.collversion IS NOT NULL AND c.collversion IS DISTINCT FROM pg_collation_actual_version(c.oid)) THEN 'unknown' ELSE :'release' END AS repaired \gset
|
||||
SELECT format('ALTER DATABASE %I SET cozystack.collation_release = %L', current_database(), :'repaired') \gexec
|
||||
\endif
|
||||
CREATE TEMP TABLE cozystack_collation AS
|
||||
SELECT v.oid, v.actual, v.stale,
|
||||
EXISTS (SELECT FROM pg_partitioned_table p WHERE p.partstrat = 'r' AND v.oid = ANY (p.partcollation::oid[])) AS held
|
||||
@@ -717,7 +748,14 @@ stringData:
|
||||
AND c.collencoding IN (-1, (SELECT encoding FROM pg_database WHERE datname = current_database()))
|
||||
UNION ALL
|
||||
SELECT 100, :'db_actual', :'db_stale'::boolean WHERE :'db_versioned'::boolean
|
||||
) v;
|
||||
) v
|
||||
UNION ALL
|
||||
SELECT c.oid, :'release', :'repaired' <> :'release', false
|
||||
FROM pg_collation c
|
||||
WHERE :'release' <> '' AND c.collprovider = 'c' AND c.collversion IS NULL AND c.collcollate ~* '^C\.'
|
||||
AND c.collencoding IN (-1, (SELECT encoding FROM pg_database WHERE datname = current_database()))
|
||||
UNION ALL
|
||||
SELECT 100, :'release', :'repaired' <> :'release', false WHERE :'release' <> '' AND :'db_c'::boolean;
|
||||
CREATE TEMP TABLE cozystack_collation_index AS
|
||||
SELECT i.indexrelid AS index, bool_or(c.stale) AS stale
|
||||
FROM (
|
||||
@@ -833,7 +871,7 @@ stringData:
|
||||
else
|
||||
collation_run "$db" <<\EOT
|
||||
SELECT format('WARNING: database %s uses the locale %s, for which this PostgreSQL major records no collation version and the catalog has no collation to stand in; the indexes on its default collation were not checked. If this upgrade moved the image to another Debian release, rebuild them with REINDEX DATABASE', datname, datcollate) FROM pg_database WHERE datname = current_database() AND :'db_unmatched'::boolean AND :'moved'::boolean;
|
||||
SELECT format('WARNING: %s in database %s is range-partitioned on a key whose collation changed version; rows stored before the change may now belong to another partition, and the collation version is left as recorded until that is checked', p.partrelid::regclass, current_database()) FROM pg_partitioned_table p WHERE p.partstrat = 'r' AND EXISTS (SELECT FROM cozystack_collation c WHERE c.stale AND c.oid = ANY (p.partcollation::oid[]));
|
||||
SELECT format('WARNING: %s in database %s is range-partitioned on a key whose collation changed version; rows stored before the change may now belong to another partition, %s', p.partrelid::regclass, current_database(), CASE WHEN bool_or(c.held) THEN 'and the collation version is left as recorded until that is checked' ELSE 'and no later run says so again: PostgreSQL records no version for that collation' END) FROM pg_partitioned_table p JOIN cozystack_collation c ON c.stale AND c.oid = ANY (p.partcollation::oid[]) WHERE p.partstrat = 'r' GROUP BY p.partrelid;
|
||||
DO $$
|
||||
DECLARE
|
||||
entry record;
|
||||
@@ -846,6 +884,7 @@ stringData:
|
||||
END LOOP;
|
||||
END$$;
|
||||
SELECT format('ALTER DATABASE %I REFRESH COLLATION VERSION', current_database()) FROM cozystack_collation WHERE oid = 100 AND stale AND NOT held AND current_setting('server_version_num')::int >= 150000 \gexec
|
||||
SELECT format('ALTER DATABASE %I SET cozystack.collation_release = %L', current_database(), :'release') WHERE :'release' NOT IN ('', :'repaired') \gexec
|
||||
SELECT coalesce(md5(string_agg(oid || '=' || actual, ',' ORDER BY oid)), '') AS remaining FROM cozystack_collation WHERE stale AND held \gset
|
||||
SELECT CASE WHEN :'remaining' = '' THEN '' ELSE :'remaining' || ':0' END AS settled \gset
|
||||
SELECT CASE WHEN :'settled' = '' THEN format('ALTER DATABASE %I RESET cozystack.collation_repair', current_database()) ELSE format('ALTER DATABASE %I SET cozystack.collation_repair = %L', current_database(), :'settled') END WHERE coalesce(current_setting('cozystack.collation_repair', true), '') <> :'settled' \gexec
|
||||
|
||||
@@ -156,7 +156,7 @@
|
||||
]
|
||||
},
|
||||
"allowCollationChange": {
|
||||
"description": "Allow a cluster created on a Debian bullseye image (before the move to standard-trixie) to move to the new image without a clean locale check. Such a cluster is checked before each upgrade, except while `bootstrap.enabled` is set (set it back to false once a restore set up by hand has finished), and stays on its current image until the check finds nothing that depends on a collation other than C, POSIX or builtin: while this is false, a cluster the check found affected (an ICU or libc locale, or C.UTF-8) or could not finish on stays put, because glibc and ICU on the new image sort text differently and every index on such text must be rebuilt. A held cluster runs the bare bullseye tag it has, gets no further PostgreSQL minors and so none of their security fixes, and refuses a change of `version`, since new majors are built only on the new images. To leave that state, either remove the dependency (move such columns and indexes to C, or to the builtin `pg_c_utf8` on PostgreSQL 17 and later) and let the next upgrade check again, or set this to true in a maintenance window: the cluster moves on the next upgrade, replicas restart on the new image first and can return wrong results through `-ro`, and unique indexes can accept duplicates, until the indexes are rebuilt on the primary. The init Job rebuilds only indexes on collations that record a version (ICU, and libc locales other than C.*): rebuild indexes on C.UTF-8 or another C.* locale by hand with REINDEX, and check range partitions, CHECK constraints and materialized views on such text, which a rebuild does not fix. A held cluster shows the hold only as an unchanged image; the result and the objects found are in the `postgres.cozystack.io/locale-data` and `postgres.cozystack.io/locale-data-objects` annotations of the cnpg.io Cluster, which an administrator can read. A restore of a backup taken on one of those bullseye images comes back on that image and is checked by the next upgrade.",
|
||||
"description": "Allow a cluster created on a Debian bullseye image (before the move to standard-trixie) to move to the new image without a clean locale check. Such a cluster is checked before each upgrade, except while `bootstrap.enabled` is set (set it back to false once a restore set up by hand has finished), and stays on its current image until the check finds nothing that depends on a collation other than C, POSIX or builtin: while this is false, a cluster the check found affected (an ICU or libc locale, or C.UTF-8) or could not finish on stays put, because glibc and ICU on the new image sort text differently and every index on such text must be rebuilt. A held cluster runs the bare bullseye tag it has, gets no further PostgreSQL minors and so none of their security fixes, and refuses a change of `version`, since new majors are built only on the new images. To leave that state, either remove the dependency (move such columns and indexes to C, or to the builtin `pg_c_utf8` on PostgreSQL 17 and later) and let the next upgrade check again, or set this to true in a maintenance window: the cluster moves on the next upgrade, replicas restart on the new image first and can return wrong results through `-ro`, and unique indexes can accept duplicates, until the indexes are rebuilt on the primary. The init Job rebuilds the indexes on such text, those on C.UTF-8 and other C.* locales included; check range partitions, CHECK constraints and materialized views on it, which a rebuild does not fix. A held cluster shows the hold only as an unchanged image; the result and the objects found are in the `postgres.cozystack.io/locale-data` and `postgres.cozystack.io/locale-data-objects` annotations of the cnpg.io Cluster, which an administrator can read. A restore of a backup taken on one of those bullseye images comes back on that image and is checked by the next upgrade.",
|
||||
"type": "boolean",
|
||||
"default": false
|
||||
},
|
||||
|
||||
@@ -99,7 +99,7 @@ version: v18
|
||||
## @param {Flavor} flavor - PostgreSQL image flavor, fixed when the cluster is created. `postgresql` uses the CloudNativePG PostgreSQL image. `postgis` uses the CloudNativePG PostGIS image, which adds postgis, postgis_raster, postgis_topology, postgis_sfcgal, postgis_tiger_geocoder and address_standardizer; enable them per database in `databases.<name>.extensions`. Changing the flavor of an existing cluster is refused, and a backup restores only into a cluster of the flavor it was taken from: to change flavor, create a new cluster and move the data with a logical dump (pg_dump / pg_restore).
|
||||
flavor: postgresql
|
||||
|
||||
## @param {bool} allowCollationChange - Allow a cluster created on a Debian bullseye image (before the move to standard-trixie) to move to the new image without a clean locale check. Such a cluster is checked before each upgrade, except while `bootstrap.enabled` is set (set it back to false once a restore set up by hand has finished), and stays on its current image until the check finds nothing that depends on a collation other than C, POSIX or builtin: while this is false, a cluster the check found affected (an ICU or libc locale, or C.UTF-8) or could not finish on stays put, because glibc and ICU on the new image sort text differently and every index on such text must be rebuilt. A held cluster runs the bare bullseye tag it has, gets no further PostgreSQL minors and so none of their security fixes, and refuses a change of `version`, since new majors are built only on the new images. To leave that state, either remove the dependency (move such columns and indexes to C, or to the builtin `pg_c_utf8` on PostgreSQL 17 and later) and let the next upgrade check again, or set this to true in a maintenance window: the cluster moves on the next upgrade, replicas restart on the new image first and can return wrong results through `-ro`, and unique indexes can accept duplicates, until the indexes are rebuilt on the primary. The init Job rebuilds only indexes on collations that record a version (ICU, and libc locales other than C.*): rebuild indexes on C.UTF-8 or another C.* locale by hand with REINDEX, and check range partitions, CHECK constraints and materialized views on such text, which a rebuild does not fix. A held cluster shows the hold only as an unchanged image; the result and the objects found are in the `postgres.cozystack.io/locale-data` and `postgres.cozystack.io/locale-data-objects` annotations of the cnpg.io Cluster, which an administrator can read. A restore of a backup taken on one of those bullseye images comes back on that image and is checked by the next upgrade.
|
||||
## @param {bool} allowCollationChange - Allow a cluster created on a Debian bullseye image (before the move to standard-trixie) to move to the new image without a clean locale check. Such a cluster is checked before each upgrade, except while `bootstrap.enabled` is set (set it back to false once a restore set up by hand has finished), and stays on its current image until the check finds nothing that depends on a collation other than C, POSIX or builtin: while this is false, a cluster the check found affected (an ICU or libc locale, or C.UTF-8) or could not finish on stays put, because glibc and ICU on the new image sort text differently and every index on such text must be rebuilt. A held cluster runs the bare bullseye tag it has, gets no further PostgreSQL minors and so none of their security fixes, and refuses a change of `version`, since new majors are built only on the new images. To leave that state, either remove the dependency (move such columns and indexes to C, or to the builtin `pg_c_utf8` on PostgreSQL 17 and later) and let the next upgrade check again, or set this to true in a maintenance window: the cluster moves on the next upgrade, replicas restart on the new image first and can return wrong results through `-ro`, and unique indexes can accept duplicates, until the indexes are rebuilt on the primary. The init Job rebuilds the indexes on such text, those on C.UTF-8 and other C.* locales included; check range partitions, CHECK constraints and materialized views on it, which a rebuild does not fix. A held cluster shows the hold only as an unchanged image; the result and the objects found are in the `postgres.cozystack.io/locale-data` and `postgres.cozystack.io/locale-data-objects` annotations of the cnpg.io Cluster, which an administrator can read. A restore of a backup taken on one of those bullseye images comes back on that image and is checked by the next upgrade.
|
||||
allowCollationChange: false
|
||||
|
||||
##
|
||||
|
||||
+1
-1
@@ -30,7 +30,7 @@ spec:
|
||||
singular: postgres
|
||||
plural: postgreses
|
||||
openAPISchema: |-
|
||||
{"title":"Chart Values","type":"object","properties":{"replicas":{"description":"Number of Postgres replicas. Under active autoscaling this is the resting/seed count, not the live count — KEDA drives the live count via `/scale`. Disabling autoscaling does NOT automatically bring the live count back to `replicas`: the client-side merge writes `instances` only when the rendered value changes, so a cluster KEDA grew past `replicas` stays there with no autoscaler left to reduce it — lower `replicas` to the count you want and it rebases down (shedding the surplus replicas + PVCs). Lowering it below the live count, or disabling/dry-running while it sits below the live count, sheds in one step past the scaleDown pacing; stage it to the live count first (suspend the HelmRelease and `kubectl scale` if needed) to avoid a transient. Must stay greater than `quorum.maxSyncReplicas`.","type":"integer","default":2},"resources":{"description":"Explicit CPU and memory configuration for each PostgreSQL replica. When omitted, the preset defined in `resourcesPreset` is applied.","type":"object","default":{},"properties":{"cpu":{"description":"CPU available to each replica.","pattern":"^(\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))))?$","anyOf":[{"type":"integer"},{"type":"string"}],"x-kubernetes-int-or-string":true},"memory":{"description":"Memory (RAM) available to each replica.","pattern":"^(\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))))?$","anyOf":[{"type":"integer"},{"type":"string"}],"x-kubernetes-int-or-string":true}}},"resourcesPreset":{"description":"Default sizing preset used when `resources` is omitted.","type":"string","default":"t1.micro","enum":["t1.nano","t1.micro","t1.small","t1.medium","t1.large","t1.xlarge","t1.2xlarge","t1.4xlarge","c1.nano","c1.micro","c1.small","c1.medium","c1.large","c1.xlarge","c1.2xlarge","c1.4xlarge","s1.nano","s1.micro","s1.small","s1.medium","s1.large","s1.xlarge","s1.2xlarge","s1.4xlarge","u1.nano","u1.micro","u1.small","u1.medium","u1.large","u1.xlarge","u1.2xlarge","u1.4xlarge","m1.nano","m1.micro","m1.small","m1.medium","m1.large","m1.xlarge","m1.2xlarge","m1.4xlarge","nano","micro","small","medium","large","xlarge","2xlarge"]},"size":{"description":"Persistent Volume Claim size available for application data.","default":"10Gi","pattern":"^(\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))))?$","anyOf":[{"type":"integer"},{"type":"string"}],"x-kubernetes-int-or-string":true},"storageClass":{"description":"StorageClass used to store the data.","type":"string","default":"","x-kubernetes-validations":[{"rule":"self == oldSelf","message":"storageClass is immutable"}],"x-cozystack-options":{"source":"storageclass"}},"external":{"description":"Enable external access from outside the cluster.","type":"boolean","default":false},"schedulingClass":{"description":"Name of a SchedulingClass CR (cluster-scoped, group cozystack.io) used in place of the tenant's for this application's pods. A pod gets its class when it is created, so running pods keep theirs until they are recreated. Must be the tenant's own class or one listed in the tenant's `allowedSchedulingClasses`. Setting any other value is refused, and the pods of an application whose class is not, or no longer, in that list get the tenant's class. Empty means inherit from the tenant.","type":"string","default":"","maxLength":63},"version":{"description":"PostgreSQL major version to deploy","type":"string","default":"v18","enum":["v18","v17","v16","v15","v14","v13"]},"flavor":{"description":"PostgreSQL image flavor, fixed when the cluster is created. `postgresql` uses the CloudNativePG PostgreSQL image. `postgis` uses the CloudNativePG PostGIS image, which adds postgis, postgis_raster, postgis_topology, postgis_sfcgal, postgis_tiger_geocoder and address_standardizer; enable them per database in `databases.<name>.extensions`. Changing the flavor of an existing cluster is refused, and a backup restores only into a cluster of the flavor it was taken from: to change flavor, create a new cluster and move the data with a logical dump (pg_dump / pg_restore).","type":"string","default":"postgresql","enum":["postgresql","postgis"]},"allowCollationChange":{"description":"Allow a cluster created on a Debian bullseye image (before the move to standard-trixie) to move to the new image without a clean locale check. Such a cluster is checked before each upgrade, except while `bootstrap.enabled` is set (set it back to false once a restore set up by hand has finished), and stays on its current image until the check finds nothing that depends on a collation other than C, POSIX or builtin: while this is false, a cluster the check found affected (an ICU or libc locale, or C.UTF-8) or could not finish on stays put, because glibc and ICU on the new iLine truncated
|
||||
{"title":"Chart Values","type":"object","properties":{"replicas":{"description":"Number of Postgres replicas. Under active autoscaling this is the resting/seed count, not the live count — KEDA drives the live count via `/scale`. Disabling autoscaling does NOT automatically bring the live count back to `replicas`: the client-side merge writes `instances` only when the rendered value changes, so a cluster KEDA grew past `replicas` stays there with no autoscaler left to reduce it — lower `replicas` to the count you want and it rebases down (shedding the surplus replicas + PVCs). Lowering it below the live count, or disabling/dry-running while it sits below the live count, sheds in one step past the scaleDown pacing; stage it to the live count first (suspend the HelmRelease and `kubectl scale` if needed) to avoid a transient. Must stay greater than `quorum.maxSyncReplicas`.","type":"integer","default":2},"resources":{"description":"Explicit CPU and memory configuration for each PostgreSQL replica. When omitted, the preset defined in `resourcesPreset` is applied.","type":"object","default":{},"properties":{"cpu":{"description":"CPU available to each replica.","pattern":"^(\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))))?$","anyOf":[{"type":"integer"},{"type":"string"}],"x-kubernetes-int-or-string":true},"memory":{"description":"Memory (RAM) available to each replica.","pattern":"^(\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))))?$","anyOf":[{"type":"integer"},{"type":"string"}],"x-kubernetes-int-or-string":true}}},"resourcesPreset":{"description":"Default sizing preset used when `resources` is omitted.","type":"string","default":"t1.micro","enum":["t1.nano","t1.micro","t1.small","t1.medium","t1.large","t1.xlarge","t1.2xlarge","t1.4xlarge","c1.nano","c1.micro","c1.small","c1.medium","c1.large","c1.xlarge","c1.2xlarge","c1.4xlarge","s1.nano","s1.micro","s1.small","s1.medium","s1.large","s1.xlarge","s1.2xlarge","s1.4xlarge","u1.nano","u1.micro","u1.small","u1.medium","u1.large","u1.xlarge","u1.2xlarge","u1.4xlarge","m1.nano","m1.micro","m1.small","m1.medium","m1.large","m1.xlarge","m1.2xlarge","m1.4xlarge","nano","micro","small","medium","large","xlarge","2xlarge"]},"size":{"description":"Persistent Volume Claim size available for application data.","default":"10Gi","pattern":"^(\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))))?$","anyOf":[{"type":"integer"},{"type":"string"}],"x-kubernetes-int-or-string":true},"storageClass":{"description":"StorageClass used to store the data.","type":"string","default":"","x-kubernetes-validations":[{"rule":"self == oldSelf","message":"storageClass is immutable"}],"x-cozystack-options":{"source":"storageclass"}},"external":{"description":"Enable external access from outside the cluster.","type":"boolean","default":false},"schedulingClass":{"description":"Name of a SchedulingClass CR (cluster-scoped, group cozystack.io) used in place of the tenant's for this application's pods. A pod gets its class when it is created, so running pods keep theirs until they are recreated. Must be the tenant's own class or one listed in the tenant's `allowedSchedulingClasses`. Setting any other value is refused, and the pods of an application whose class is not, or no longer, in that list get the tenant's class. Empty means inherit from the tenant.","type":"string","default":"","maxLength":63},"version":{"description":"PostgreSQL major version to deploy","type":"string","default":"v18","enum":["v18","v17","v16","v15","v14","v13"]},"flavor":{"description":"PostgreSQL image flavor, fixed when the cluster is created. `postgresql` uses the CloudNativePG PostgreSQL image. `postgis` uses the CloudNativePG PostGIS image, which adds postgis, postgis_raster, postgis_topology, postgis_sfcgal, postgis_tiger_geocoder and address_standardizer; enable them per database in `databases.<name>.extensions`. Changing the flavor of an existing cluster is refused, and a backup restores only into a cluster of the flavor it was taken from: to change flavor, create a new cluster and move the data with a logical dump (pg_dump / pg_restore).","type":"string","default":"postgresql","enum":["postgresql","postgis"]},"allowCollationChange":{"description":"Allow a cluster created on a Debian bullseye image (before the move to standard-trixie) to move to the new image without a clean locale check. Such a cluster is checked before each upgrade, except while `bootstrap.enabled` is set (set it back to false once a restore set up by hand has finished), and stays on its current image until the check finds nothing that depends on a collation other than C, POSIX or builtin: while this is false, a cluster the check found affected (an ICU or libc locale, or C.UTF-8) or could not finish on stays put, because glibc and ICU on the new iLine truncated
|
||||
release:
|
||||
prefix: postgres-
|
||||
labels:
|
||||
|
||||
Reference in new issue
Block a user