From 363b3d8f590cfb1206e9d79ce4b2b59586600152 Mon Sep 17 00:00:00 2001 From: Felix Kunde Date: Tue, 30 Jul 2024 13:45:42 +0200 Subject: [PATCH 1/3] bump spilo to 16-3.3, drop support for pg11 --- charts/postgres-operator/crds/operatorconfigurations.yaml | 2 +- charts/postgres-operator/crds/postgresqls.yaml | 1 - charts/postgres-operator/values.yaml | 2 +- manifests/complete-postgres-manifest.yaml | 2 +- manifests/configmap.yaml | 2 +- manifests/minimal-postgres-manifest.yaml | 5 +++-- manifests/operatorconfiguration.crd.yaml | 2 +- manifests/postgresql-operator-default-configuration.yaml | 2 +- manifests/postgresql.crd.yaml | 1 - pkg/apis/acid.zalan.do/v1/crds.go | 3 --- pkg/cluster/majorversionupgrade.go | 1 - pkg/controller/operator_config.go | 2 +- pkg/util/config/config.go | 2 +- ui/operator_ui/spiloutils.py | 2 +- 14 files changed, 12 insertions(+), 17 deletions(-) diff --git a/charts/postgres-operator/crds/operatorconfigurations.yaml b/charts/postgres-operator/crds/operatorconfigurations.yaml index bf4ae34b1..5c08687d9 100644 --- a/charts/postgres-operator/crds/operatorconfigurations.yaml +++ b/charts/postgres-operator/crds/operatorconfigurations.yaml @@ -68,7 +68,7 @@ spec: type: string docker_image: type: string - default: "ghcr.io/zalando/spilo-16:3.2-p3" + default: "ghcr.io/zalando/spilo-16:3.3-p1" enable_crd_registration: type: boolean default: true diff --git a/charts/postgres-operator/crds/postgresqls.yaml b/charts/postgres-operator/crds/postgresqls.yaml index 0498625f2..8265f29e2 100644 --- a/charts/postgres-operator/crds/postgresqls.yaml +++ b/charts/postgres-operator/crds/postgresqls.yaml @@ -375,7 +375,6 @@ spec: version: type: string enum: - - "11" - "12" - "13" - "14" diff --git a/charts/postgres-operator/values.yaml b/charts/postgres-operator/values.yaml index 5700ff783..35c1ae2f2 100644 --- a/charts/postgres-operator/values.yaml +++ b/charts/postgres-operator/values.yaml @@ -38,7 +38,7 @@ configGeneral: # etcd connection string for Patroni. Empty uses K8s-native DCS. etcd_host: "" # Spilo docker image - docker_image: ghcr.io/zalando/spilo-16:3.2-p3 + docker_image: ghcr.io/zalando/spilo-16:3.3-p1 # key name for annotation to ignore globally configured instance limits # ignore_instance_limits_annotation_key: "" diff --git a/manifests/complete-postgres-manifest.yaml b/manifests/complete-postgres-manifest.yaml index f874123e6..0b3dc4aa7 100644 --- a/manifests/complete-postgres-manifest.yaml +++ b/manifests/complete-postgres-manifest.yaml @@ -10,7 +10,7 @@ metadata: # "delete-date": "2020-08-31" # can only be deleted on that day if "delete-date "key is configured # "delete-clustername": "acid-test-cluster" # can only be deleted when name matches if "delete-clustername" key is configured spec: - dockerImage: ghcr.io/zalando/spilo-16:3.2-p3 + dockerImage: ghcr.io/zalando/spilo-16:3.3-p1 teamId: "acid" numberOfInstances: 2 users: # Application/Robot users diff --git a/manifests/configmap.yaml b/manifests/configmap.yaml index 7f76d0b33..d8cb84e4e 100644 --- a/manifests/configmap.yaml +++ b/manifests/configmap.yaml @@ -34,7 +34,7 @@ data: default_memory_request: 100Mi # delete_annotation_date_key: delete-date # delete_annotation_name_key: delete-clustername - docker_image: ghcr.io/zalando/spilo-16:3.2-p3 + docker_image: ghcr.io/zalando/spilo-16:3.3-p1 # downscaler_annotations: "deployment-time,downscaler/*" # enable_admin_role_for_users: "true" # enable_crd_registration: "true" diff --git a/manifests/minimal-postgres-manifest.yaml b/manifests/minimal-postgres-manifest.yaml index d22327905..9f8f0b208 100644 --- a/manifests/minimal-postgres-manifest.yaml +++ b/manifests/minimal-postgres-manifest.yaml @@ -15,6 +15,7 @@ spec: databases: foo: zalando # dbname: owner preparedDatabases: - bar: {} + bar: + defaultUsers: true postgresql: - version: "16" + version: "14" diff --git a/manifests/operatorconfiguration.crd.yaml b/manifests/operatorconfiguration.crd.yaml index 887577940..4f9179971 100644 --- a/manifests/operatorconfiguration.crd.yaml +++ b/manifests/operatorconfiguration.crd.yaml @@ -66,7 +66,7 @@ spec: type: string docker_image: type: string - default: "ghcr.io/zalando/spilo-16:3.2-p3" + default: "ghcr.io/zalando/spilo-16:3.3-p1" enable_crd_registration: type: boolean default: true diff --git a/manifests/postgresql-operator-default-configuration.yaml b/manifests/postgresql-operator-default-configuration.yaml index ee3123e32..cf1e6e06c 100644 --- a/manifests/postgresql-operator-default-configuration.yaml +++ b/manifests/postgresql-operator-default-configuration.yaml @@ -3,7 +3,7 @@ kind: OperatorConfiguration metadata: name: postgresql-operator-default-configuration configuration: - docker_image: ghcr.io/zalando/spilo-16:3.2-p3 + docker_image: ghcr.io/zalando/spilo-16:3.3-p1 # enable_crd_registration: true # crd_categories: # - all diff --git a/manifests/postgresql.crd.yaml b/manifests/postgresql.crd.yaml index 4bd757f38..75e8ab342 100644 --- a/manifests/postgresql.crd.yaml +++ b/manifests/postgresql.crd.yaml @@ -373,7 +373,6 @@ spec: version: type: string enum: - - "11" - "12" - "13" - "14" diff --git a/pkg/apis/acid.zalan.do/v1/crds.go b/pkg/apis/acid.zalan.do/v1/crds.go index 9e65869e7..6ee1a9f42 100644 --- a/pkg/apis/acid.zalan.do/v1/crds.go +++ b/pkg/apis/acid.zalan.do/v1/crds.go @@ -595,9 +595,6 @@ var PostgresCRDResourceValidation = apiextv1.CustomResourceValidation{ "version": { Type: "string", Enum: []apiextv1.JSON{ - { - Raw: []byte(`"11"`), - }, { Raw: []byte(`"12"`), }, diff --git a/pkg/cluster/majorversionupgrade.go b/pkg/cluster/majorversionupgrade.go index 5a1599cda..62a0dc82b 100644 --- a/pkg/cluster/majorversionupgrade.go +++ b/pkg/cluster/majorversionupgrade.go @@ -11,7 +11,6 @@ import ( // VersionMap Map of version numbers var VersionMap = map[string]int{ - "11": 110000, "12": 120000, "13": 130000, "14": 140000, diff --git a/pkg/controller/operator_config.go b/pkg/controller/operator_config.go index 88f1d73c0..533e80735 100644 --- a/pkg/controller/operator_config.go +++ b/pkg/controller/operator_config.go @@ -39,7 +39,7 @@ func (c *Controller) importConfigurationFromCRD(fromCRD *acidv1.OperatorConfigur result.EnableTeamIdClusternamePrefix = fromCRD.EnableTeamIdClusternamePrefix result.EtcdHost = fromCRD.EtcdHost result.KubernetesUseConfigMaps = fromCRD.KubernetesUseConfigMaps - result.DockerImage = util.Coalesce(fromCRD.DockerImage, "ghcr.io/zalando/spilo-16:3.2-p3") + result.DockerImage = util.Coalesce(fromCRD.DockerImage, "ghcr.io/zalando/spilo-16:3.3-p1") result.Workers = util.CoalesceUInt32(fromCRD.Workers, 8) result.MinInstances = fromCRD.MinInstances result.MaxInstances = fromCRD.MaxInstances diff --git a/pkg/util/config/config.go b/pkg/util/config/config.go index 829c1d19e..d56db853f 100644 --- a/pkg/util/config/config.go +++ b/pkg/util/config/config.go @@ -174,7 +174,7 @@ type Config struct { WatchedNamespace string `name:"watched_namespace"` // special values: "*" means 'watch all namespaces', the empty string "" means 'watch a namespace where operator is deployed to' KubernetesUseConfigMaps bool `name:"kubernetes_use_configmaps" default:"false"` EtcdHost string `name:"etcd_host" default:""` // special values: the empty string "" means Patroni will use K8s as a DCS - DockerImage string `name:"docker_image" default:"ghcr.io/zalando/spilo-16:3.2-p3"` + DockerImage string `name:"docker_image" default:"ghcr.io/zalando/spilo-16:3.3-p1"` SidecarImages map[string]string `name:"sidecar_docker_images"` // deprecated in favour of SidecarContainers SidecarContainers []v1.Container `name:"sidecars"` PodServiceAccountName string `name:"pod_service_account_name" default:"postgres-pod"` diff --git a/ui/operator_ui/spiloutils.py b/ui/operator_ui/spiloutils.py index c2ac7118e..9de072fca 100644 --- a/ui/operator_ui/spiloutils.py +++ b/ui/operator_ui/spiloutils.py @@ -305,7 +305,7 @@ def read_versions( if uid == 'wal' or defaulting(lambda: UUID(uid)) ] -BACKUP_VERSION_PREFIXES = ['', '9.6/', '10/', '11/', '12/', '13/', '14/', '15/', '16/'] +BACKUP_VERSION_PREFIXES = ['', '10/', '11/', '12/', '13/', '14/', '15/', '16/'] def read_basebackups( pg_cluster, From ea92f317329cca14ff0cc0cc7d86b013f4e28bd5 Mon Sep 17 00:00:00 2001 From: Felix Kunde Date: Tue, 30 Jul 2024 13:48:00 +0200 Subject: [PATCH 2/3] revert changes from local test --- manifests/minimal-postgres-manifest.yaml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/manifests/minimal-postgres-manifest.yaml b/manifests/minimal-postgres-manifest.yaml index 9f8f0b208..d22327905 100644 --- a/manifests/minimal-postgres-manifest.yaml +++ b/manifests/minimal-postgres-manifest.yaml @@ -15,7 +15,6 @@ spec: databases: foo: zalando # dbname: owner preparedDatabases: - bar: - defaultUsers: true + bar: {} postgresql: - version: "14" + version: "16" From f612443c146084e82366452a9814f1fb728c2bcf Mon Sep 17 00:00:00 2001 From: Felix Kunde Date: Tue, 6 Aug 2024 13:08:06 +0200 Subject: [PATCH 3/3] update README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 6b12fe376..2e46c6339 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,7 @@ pipelines with no access to Kubernetes API directly, promoting infrastructure as ### PostgreSQL features -* Supports PostgreSQL 16, starting from 11+ +* Supports PostgreSQL 16, starting from 12+ * Streaming replication cluster via Patroni * Point-In-Time-Recovery with [pg_basebackup](https://www.postgresql.org/docs/16/app-pgbasebackup.html) /