From becf8a4715bc87c71346e32745c02c9f1ceb3eb8 Mon Sep 17 00:00:00 2001 From: yoshihikoueno <38683757+yoshihikoueno@users.noreply.github.com> Date: Wed, 4 Jan 2023 20:01:30 +0900 Subject: [PATCH] Bump spilo and target version for PostgreSQL 15 (#2139) * Bumped Spilo image tag to the one that supports PostgreSQL 15. Using CDP version temporarily until non-CDP one is released. * Added support for PostgreSQL 15 and made it default. 9.5 and 9.6 are now no longer supported * Bumped spilo image tag to 2.1-p9 * Bumped spilo image in test launcher Co-authored-by: yoshihiko Co-authored-by: Felix Kunde --- README.md | 4 ++-- charts/postgres-operator-ui/templates/deployment.yaml | 1 + charts/postgres-operator/crds/operatorconfigurations.yaml | 4 ++-- charts/postgres-operator/values.yaml | 4 ++-- docs/reference/operator_parameters.md | 2 +- docs/user.md | 4 ++-- e2e/run.sh | 2 +- e2e/tests/test_e2e.py | 4 ++-- manifests/complete-postgres-manifest.yaml | 4 ++-- manifests/configmap.yaml | 4 ++-- manifests/minimal-postgres-manifest.yaml | 2 +- manifests/operatorconfiguration.crd.yaml | 4 ++-- manifests/postgresql-operator-default-configuration.yaml | 4 ++-- manifests/standby-manifest.yaml | 2 +- pkg/apis/acid.zalan.do/v1/operator_configuration_type.go | 2 +- pkg/cluster/majorversionupgrade.go | 3 ++- pkg/controller/operator_config.go | 4 ++-- pkg/util/config/config.go | 4 ++-- ui/operator_ui/main.py | 2 +- 19 files changed, 31 insertions(+), 29 deletions(-) diff --git a/README.md b/README.md index 99be3845a..660665ea3 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ pipelines with no access to Kubernetes API directly, promoting infrastructure as ### PostgreSQL features -* Supports PostgreSQL 14, starting from 10+ +* Supports PostgreSQL 15, starting from 10+ * Streaming replication cluster via Patroni * Point-In-Time-Recovery with [pg_basebackup](https://www.postgresql.org/docs/11/app-pgbasebackup.html) / @@ -61,7 +61,7 @@ We introduce the major version into the backup path to smoothen the [major versi The new operator configuration can set a compatibility flag *enable_spilo_wal_path_compat* to make Spilo look for wal segments in the current path but also old format paths. This comes at potential performance costs and should be disabled after a few days. -The newest Spilo image is: `registry.opensource.zalan.do/acid/spilo-14:2.1-p7` +The newest Spilo image is: `ghcr.io/zalando/spilo-15:2.1-p9` The last Spilo 12 image is: `registry.opensource.zalan.do/acid/spilo-12:1.6-p5` diff --git a/charts/postgres-operator-ui/templates/deployment.yaml b/charts/postgres-operator-ui/templates/deployment.yaml index c82d38c70..d9f0725a9 100644 --- a/charts/postgres-operator-ui/templates/deployment.yaml +++ b/charts/postgres-operator-ui/templates/deployment.yaml @@ -76,6 +76,7 @@ spec: "cost_core": 0.0575, "cost_memory": 0.014375, "postgresql_versions": [ + "15", "14", "13", "12", diff --git a/charts/postgres-operator/crds/operatorconfigurations.yaml b/charts/postgres-operator/crds/operatorconfigurations.yaml index f1589b92d..aaadce0c3 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: "registry.opensource.zalan.do/acid/spilo-14:2.1-p7" + default: "ghcr.io/zalando/spilo-15:2.1-p9" enable_crd_registration: type: boolean default: true @@ -170,7 +170,7 @@ spec: default: "11" target_major_version: type: string - default: "14" + default: "15" kubernetes: type: object properties: diff --git a/charts/postgres-operator/values.yaml b/charts/postgres-operator/values.yaml index 20f961ca1..36c09c3ee 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: registry.opensource.zalan.do/acid/spilo-14:2.1-p7 + docker_image: ghcr.io/zalando/spilo-15:2.1-p9 # key name for annotation to ignore globally configured instance limits # ignore_instance_limits_annotation_key: "" @@ -91,7 +91,7 @@ configMajorVersionUpgrade: # minimal Postgres major version that will not automatically be upgraded minimal_major_version: "11" # target Postgres major version when upgrading clusters automatically - target_major_version: "14" + target_major_version: "15" configKubernetes: # list of additional capabilities for postgres container diff --git a/docs/reference/operator_parameters.md b/docs/reference/operator_parameters.md index 16ec7320f..ca5d7b055 100644 --- a/docs/reference/operator_parameters.md +++ b/docs/reference/operator_parameters.md @@ -251,7 +251,7 @@ CRD-configuration, they are grouped under the `major_version_upgrade` key. * **target_major_version** The target Postgres major version when upgrading clusters automatically which violate the configured allowed `minimal_major_version` when - `major_version_upgrade_mode` is set to `"full"`. The default is `"14"`. + `major_version_upgrade_mode` is set to `"full"`. The default is `"15"`. ## Kubernetes resources diff --git a/docs/user.md b/docs/user.md index c5fcfda87..fa82e3344 100644 --- a/docs/user.md +++ b/docs/user.md @@ -30,7 +30,7 @@ spec: databases: foo: zalando postgresql: - version: "14" + version: "15" ``` Once you cloned the Postgres Operator [repository](https://github.com/zalando/postgres-operator) @@ -109,7 +109,7 @@ metadata: spec: [...] postgresql: - version: "14" + version: "15" parameters: password_encryption: scram-sha-256 ``` diff --git a/e2e/run.sh b/e2e/run.sh index f5ca56a05..12581a26a 100755 --- a/e2e/run.sh +++ b/e2e/run.sh @@ -8,7 +8,7 @@ IFS=$'\n\t' readonly cluster_name="postgres-operator-e2e-tests" readonly kubeconfig_path="/tmp/kind-config-${cluster_name}" -readonly spilo_image="registry.opensource.zalan.do/acid/spilo-14-e2e:0.1" +readonly spilo_image="registry.opensource.zalan.do/acid/spilo-15-e2e:0.1" readonly e2e_test_runner_image="registry.opensource.zalan.do/acid/postgres-operator-e2e-tests-runner:0.4" export GOPATH=${GOPATH-~/go} diff --git a/e2e/tests/test_e2e.py b/e2e/tests/test_e2e.py index 39fd45323..6b46dd7db 100644 --- a/e2e/tests/test_e2e.py +++ b/e2e/tests/test_e2e.py @@ -12,8 +12,8 @@ from tests.k8s_api import K8s from kubernetes.client.rest import ApiException -SPILO_CURRENT = "registry.opensource.zalan.do/acid/spilo-14-e2e:0.3" -SPILO_LAZY = "registry.opensource.zalan.do/acid/spilo-14-e2e:0.4" +SPILO_CURRENT = "registry.opensource.zalan.do/acid/spilo-15-e2e:0.1" +SPILO_LAZY = "registry.opensource.zalan.do/acid/spilo-15-e2e:0.2" def to_selector(labels): diff --git a/manifests/complete-postgres-manifest.yaml b/manifests/complete-postgres-manifest.yaml index bc8309684..8d4353bcb 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: registry.opensource.zalan.do/acid/spilo-14:2.1-p7 + dockerImage: ghcr.io/zalando/spilo-15:2.1-p9 teamId: "acid" numberOfInstances: 2 users: # Application/Robot users @@ -44,7 +44,7 @@ spec: defaultRoles: true defaultUsers: false postgresql: - version: "14" + version: "15" parameters: # Expert section shared_buffers: "32MB" max_connections: "10" diff --git a/manifests/configmap.yaml b/manifests/configmap.yaml index 831a00341..9485331de 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: registry.opensource.zalan.do/acid/spilo-14:2.1-p7 + docker_image: ghcr.io/zalando/spilo-15:2.1-p9 # downscaler_annotations: "deployment-time,downscaler/*" # enable_admin_role_for_users: "true" # enable_crd_registration: "true" @@ -145,7 +145,7 @@ data: spilo_privileged: "false" storage_resize_mode: "pvc" super_username: postgres - # target_major_version: "14" + # target_major_version: "15" # team_admin_role: "admin" # team_api_role_configuration: "log_statement:all" # teams_api_url: http://fake-teams-api.default.svc.cluster.local diff --git a/manifests/minimal-postgres-manifest.yaml b/manifests/minimal-postgres-manifest.yaml index b2a8fa2c8..00f11ebf7 100644 --- a/manifests/minimal-postgres-manifest.yaml +++ b/manifests/minimal-postgres-manifest.yaml @@ -17,4 +17,4 @@ spec: preparedDatabases: bar: {} postgresql: - version: "14" + version: "15" diff --git a/manifests/operatorconfiguration.crd.yaml b/manifests/operatorconfiguration.crd.yaml index 4e5ab803f..2f10f7be9 100644 --- a/manifests/operatorconfiguration.crd.yaml +++ b/manifests/operatorconfiguration.crd.yaml @@ -66,7 +66,7 @@ spec: type: string docker_image: type: string - default: "registry.opensource.zalan.do/acid/spilo-14:2.1-p7" + default: "ghcr.io/zalando/spilo-15:2.1-p9" enable_crd_registration: type: boolean default: true @@ -168,7 +168,7 @@ spec: default: "11" target_major_version: type: string - default: "14" + default: "15" kubernetes: type: object properties: diff --git a/manifests/postgresql-operator-default-configuration.yaml b/manifests/postgresql-operator-default-configuration.yaml index 4c7737d13..6939ec4d7 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: registry.opensource.zalan.do/acid/spilo-14:2.1-p7 + docker_image: ghcr.io/zalando/spilo-15:2.1-p9 # enable_crd_registration: true # crd_categories: # - all @@ -40,7 +40,7 @@ configuration: # major_version_upgrade_team_allow_list: # - acid minimal_major_version: "11" - target_major_version: "14" + target_major_version: "15" kubernetes: # additional_pod_capabilities: # - "SYS_NICE" diff --git a/manifests/standby-manifest.yaml b/manifests/standby-manifest.yaml index ac94fe897..2db4d489b 100644 --- a/manifests/standby-manifest.yaml +++ b/manifests/standby-manifest.yaml @@ -8,7 +8,7 @@ spec: size: 1Gi numberOfInstances: 1 postgresql: - version: "14" + version: "15" # Make this a standby cluster and provide either the s3 bucket path of source cluster or the remote primary host for continuous streaming. standby: # s3_wal_path: "s3://mybucket/spilo/acid-minimal-cluster/abcd1234-2a4b-4b2a-8c9c-c1234defg567/wal/14/" diff --git a/pkg/apis/acid.zalan.do/v1/operator_configuration_type.go b/pkg/apis/acid.zalan.do/v1/operator_configuration_type.go index 29cddffa5..d21cbe48b 100644 --- a/pkg/apis/acid.zalan.do/v1/operator_configuration_type.go +++ b/pkg/apis/acid.zalan.do/v1/operator_configuration_type.go @@ -50,7 +50,7 @@ type MajorVersionUpgradeConfiguration struct { MajorVersionUpgradeMode string `json:"major_version_upgrade_mode" default:"off"` // off - no actions, manual - manifest triggers action, full - manifest and minimal version violation trigger upgrade MajorVersionUpgradeTeamAllowList []string `json:"major_version_upgrade_team_allow_list,omitempty"` MinimalMajorVersion string `json:"minimal_major_version" default:"11"` - TargetMajorVersion string `json:"target_major_version" default:"14"` + TargetMajorVersion string `json:"target_major_version" default:"15"` } // KubernetesMetaConfiguration defines k8s conf required for all Postgres clusters and the operator itself diff --git a/pkg/cluster/majorversionupgrade.go b/pkg/cluster/majorversionupgrade.go index 7a63da32f..f635dc604 100644 --- a/pkg/cluster/majorversionupgrade.go +++ b/pkg/cluster/majorversionupgrade.go @@ -17,6 +17,7 @@ var VersionMap = map[string]int{ "13": 130000, "14": 140000, "15": 150000, + } // IsBiggerPostgresVersion Compare two Postgres version numbers @@ -35,7 +36,7 @@ func (c *Cluster) GetDesiredMajorVersionAsInt() int { func (c *Cluster) GetDesiredMajorVersion() string { if c.Config.OpConfig.MajorVersionUpgradeMode == "full" { - // e.g. current is 10, minimal is 11 allowing 11 to 14 clusters, everything below is upgraded + // e.g. current is 10, minimal is 11 allowing 11 to 15 clusters, everything below is upgraded if IsBiggerPostgresVersion(c.Spec.PgVersion, c.Config.OpConfig.MinimalMajorVersion) { c.logger.Infof("overwriting configured major version %s to %s", c.Spec.PgVersion, c.Config.OpConfig.TargetMajorVersion) return c.Config.OpConfig.TargetMajorVersion diff --git a/pkg/controller/operator_config.go b/pkg/controller/operator_config.go index b1e46b6ae..40d639b20 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, "registry.opensource.zalan.do/acid/spilo-14:2.1-p7") + result.DockerImage = util.Coalesce(fromCRD.DockerImage, "ghcr.io/zalando/spilo-15:2.1-p9") result.Workers = util.CoalesceUInt32(fromCRD.Workers, 8) result.MinInstances = fromCRD.MinInstances result.MaxInstances = fromCRD.MaxInstances @@ -63,7 +63,7 @@ func (c *Controller) importConfigurationFromCRD(fromCRD *acidv1.OperatorConfigur result.MajorVersionUpgradeMode = util.Coalesce(fromCRD.MajorVersionUpgrade.MajorVersionUpgradeMode, "off") result.MajorVersionUpgradeTeamAllowList = fromCRD.MajorVersionUpgrade.MajorVersionUpgradeTeamAllowList result.MinimalMajorVersion = util.Coalesce(fromCRD.MajorVersionUpgrade.MinimalMajorVersion, "11") - result.TargetMajorVersion = util.Coalesce(fromCRD.MajorVersionUpgrade.TargetMajorVersion, "14") + result.TargetMajorVersion = util.Coalesce(fromCRD.MajorVersionUpgrade.TargetMajorVersion, "15") // kubernetes config result.CustomPodAnnotations = fromCRD.Kubernetes.CustomPodAnnotations diff --git a/pkg/util/config/config.go b/pkg/util/config/config.go index 80aa509e3..4afc30e1a 100644 --- a/pkg/util/config/config.go +++ b/pkg/util/config/config.go @@ -165,7 +165,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:"registry.opensource.zalan.do/acid/spilo-14:2.1-p7"` + DockerImage string `name:"docker_image" default:"ghcr.io/zalando/spilo-15:2.1-p9"` 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"` @@ -233,7 +233,7 @@ type Config struct { MajorVersionUpgradeMode string `name:"major_version_upgrade_mode" default:"off"` MajorVersionUpgradeTeamAllowList []string `name:"major_version_upgrade_team_allow_list" default:""` MinimalMajorVersion string `name:"minimal_major_version" default:"11"` - TargetMajorVersion string `name:"target_major_version" default:"14"` + TargetMajorVersion string `name:"target_major_version" default:"15"` PatroniAPICheckInterval time.Duration `name:"patroni_api_check_interval" default:"1s"` PatroniAPICheckTimeout time.Duration `name:"patroni_api_check_timeout" default:"5s"` EnablePatroniFailsafeMode *bool `name:"enable_patroni_failsafe_mode" default:"false"` diff --git a/ui/operator_ui/main.py b/ui/operator_ui/main.py index fdb61cd39..49920c8e0 100644 --- a/ui/operator_ui/main.py +++ b/ui/operator_ui/main.py @@ -321,7 +321,7 @@ def index(): 'users_visible': True, 'databases_visible': True, 'resources_visible': RESOURCES_VISIBLE, - 'postgresql_versions': ['11', '12', '13', '14'], + 'postgresql_versions': ['11', '12', '13', '14', '15'], 'dns_format_string': '{0}.{1}', 'pgui_link': '', 'static_network_whitelist': {},