diff --git a/README.md b/README.md index a9d8bc709..9a040cdbd 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,7 @@ pipelines with no access to Kubernetes API directly, promoting infrastructure as [pg_basebackup](https://www.postgresql.org/docs/11/app-pgbasebackup.html) / [WAL-E](https://github.com/wal-e/wal-e) via [Spilo](https://github.com/zalando/spilo) * Preload libraries: [bg_mon](https://github.com/CyberDem0n/bg_mon), -[pg_stat_statements](https://www.postgresql.org/docs/9.4/pgstatstatements.html), +[pg_stat_statements](https://www.postgresql.org/docs/14/pgstatstatements.html), [pgextwlist](https://github.com/dimitri/pgextwlist), [pg_auth_mon](https://github.com/RafiaSabih/pg_auth_mon) * Incl. popular Postgres extensions such as @@ -53,15 +53,10 @@ pipelines with no access to Kubernetes API directly, promoting infrastructure as The Postgres Operator has been developed at Zalando and is being used in production for over three years. -## Notes on Postgres 13 support - -If you are new to the operator, you can skip this and just start using the Postgres operator as is, Postgres 13 is ready to go. - -The Postgres operator supports Postgres 13 with the new Spilo Image that includes also the recent Patroni version to support PG13 settings. -More work on optimizing restarts and rolling upgrades is pending. +## Using Spilo 12 images or lower If you are already using the Postgres operator in older version with a Spilo 12 Docker image you need to be aware of the changes for the backup path. -We introduce the major version into the backup path to smoothen the [major version upgrade](docs/administrator.md#minor-and-major-version-upgrade) that is now supported manually. +We introduce the major version into the backup path to smoothen the [major version upgrade](docs/administrator.md#minor-and-major-version-upgrade) that is now supported. 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. diff --git a/charts/postgres-operator-ui/templates/deployment.yaml b/charts/postgres-operator-ui/templates/deployment.yaml index 8a5036fa9..8942539d6 100644 --- a/charts/postgres-operator-ui/templates/deployment.yaml +++ b/charts/postgres-operator-ui/templates/deployment.yaml @@ -71,6 +71,7 @@ spec: "resources_visible": true, "users_visible": true, "postgresql_versions": [ + "14", "13", "12", "11" diff --git a/charts/postgres-operator/crds/operatorconfigurations.yaml b/charts/postgres-operator/crds/operatorconfigurations.yaml index c29ab3099..5c35b42e1 100644 --- a/charts/postgres-operator/crds/operatorconfigurations.yaml +++ b/charts/postgres-operator/crds/operatorconfigurations.yaml @@ -135,10 +135,10 @@ spec: default: "off" minimal_major_version: type: string - default: "9.5" + default: "9.6" target_major_version: type: string - default: "13" + default: "14" kubernetes: type: object properties: diff --git a/charts/postgres-operator/crds/postgresqls.yaml b/charts/postgres-operator/crds/postgresqls.yaml index 4f97a29ad..b5da81103 100644 --- a/charts/postgres-operator/crds/postgresqls.yaml +++ b/charts/postgres-operator/crds/postgresqls.yaml @@ -362,14 +362,12 @@ spec: version: type: string enum: - - "9.3" - - "9.4" - - "9.5" - "9.6" - "10" - "11" - "12" - "13" + - "14" parameters: type: object additionalProperties: diff --git a/charts/postgres-operator/values.yaml b/charts/postgres-operator/values.yaml index 24aaa8144..cee05202c 100644 --- a/charts/postgres-operator/values.yaml +++ b/charts/postgres-operator/values.yaml @@ -65,9 +65,9 @@ configMajorVersionUpgrade: # "off": no upgrade, "manual": manifest triggers action, "full": minimal version violation triggers too major_version_upgrade_mode: "off" # minimal Postgres major version that will not automatically be upgraded - minimal_major_version: "9.5" + minimal_major_version: "9.6" # target Postgres major version when upgrading clusters automatically - target_major_version: "13" + target_major_version: "14" configKubernetes: # list of additional capabilities for postgres container diff --git a/docs/reference/operator_parameters.md b/docs/reference/operator_parameters.md index 5ccb85cda..ee8c3fae1 100644 --- a/docs/reference/operator_parameters.md +++ b/docs/reference/operator_parameters.md @@ -186,12 +186,12 @@ CRD-configuration, they are grouped under the `major_version_upgrade` key. * **minimal_major_version** The minimal Postgres major version that will not automatically be upgraded - when `major_version_upgrade_mode` is set to `"full"`. The default is `"9.5"`. + when `major_version_upgrade_mode` is set to `"full"`. The default is `"9.6"`. * **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 `"13"`. + `major_version_upgrade_mode` is set to `"full"`. The default is `"14"`. ## Kubernetes resources diff --git a/docs/user.md b/docs/user.md index ef3277436..9cc376443 100644 --- a/docs/user.md +++ b/docs/user.md @@ -30,7 +30,7 @@ spec: databases: foo: zalando postgresql: - version: "13" + version: "14" ``` Once you cloned the Postgres Operator [repository](https://github.com/zalando/postgres-operator) diff --git a/e2e/tests/test_e2e.py b/e2e/tests/test_e2e.py index 6a4bf78ca..29316cdf0 100644 --- a/e2e/tests/test_e2e.py +++ b/e2e/tests/test_e2e.py @@ -766,7 +766,7 @@ class EndToEndTestCase(unittest.TestCase): pg_patch_version = { "spec": { "postgres": { - "version": "13" + "version": "14" } } } diff --git a/manifests/complete-postgres-manifest.yaml b/manifests/complete-postgres-manifest.yaml index 1d938ca63..177b05223 100644 --- a/manifests/complete-postgres-manifest.yaml +++ b/manifests/complete-postgres-manifest.yaml @@ -36,7 +36,7 @@ spec: defaultRoles: true defaultUsers: false postgresql: - version: "13" + version: "14" parameters: # Expert section shared_buffers: "32MB" max_connections: "10" diff --git a/manifests/configmap.yaml b/manifests/configmap.yaml index 70719524b..6dee7adcd 100644 --- a/manifests/configmap.yaml +++ b/manifests/configmap.yaml @@ -83,7 +83,7 @@ data: # min_instances: "-1" # min_cpu_limit: 250m # min_memory_limit: 250Mi - # minimal_major_version: "9.5" + # minimal_major_version: "9.6" # node_readiness_label: "" # oauth_token_secret_name: postgresql-operator # pam_configuration: | @@ -124,7 +124,7 @@ data: spilo_privileged: "false" storage_resize_mode: "pvc" super_username: postgres - # target_major_version: "13" + # target_major_version: "14" # 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 ff96e392b..f0c5ff4b5 100644 --- a/manifests/minimal-postgres-manifest.yaml +++ b/manifests/minimal-postgres-manifest.yaml @@ -18,4 +18,4 @@ spec: preparedDatabases: bar: {} postgresql: - version: "13" + version: "14" diff --git a/manifests/operatorconfiguration.crd.yaml b/manifests/operatorconfiguration.crd.yaml index 55ec6d011..d7ca7862c 100644 --- a/manifests/operatorconfiguration.crd.yaml +++ b/manifests/operatorconfiguration.crd.yaml @@ -131,10 +131,10 @@ spec: default: "off" minimal_major_version: type: string - default: "9.5" + default: "9.6" target_major_version: type: string - default: "13" + default: "14" kubernetes: type: object properties: diff --git a/manifests/postgresql-operator-default-configuration.yaml b/manifests/postgresql-operator-default-configuration.yaml index 333e54b6b..ca760a21a 100644 --- a/manifests/postgresql-operator-default-configuration.yaml +++ b/manifests/postgresql-operator-default-configuration.yaml @@ -28,8 +28,8 @@ configuration: super_username: postgres major_version_upgrade: major_version_upgrade_mode: "off" - minimal_major_version: "9.5" - target_major_version: "13" + minimal_major_version: "9.6" + target_major_version: "14" kubernetes: # additional_pod_capabilities: # - "SYS_NICE" diff --git a/manifests/postgresql.crd.yaml b/manifests/postgresql.crd.yaml index 1f883f451..7465a23be 100644 --- a/manifests/postgresql.crd.yaml +++ b/manifests/postgresql.crd.yaml @@ -358,14 +358,12 @@ spec: version: type: string enum: - - "9.3" - - "9.4" - - "9.5" - "9.6" - "10" - "11" - "12" - "13" + - "14" parameters: type: object additionalProperties: diff --git a/manifests/standby-manifest.yaml b/manifests/standby-manifest.yaml index 593f409ec..3ba8d6b9d 100644 --- a/manifests/standby-manifest.yaml +++ b/manifests/standby-manifest.yaml @@ -9,7 +9,7 @@ spec: size: 1Gi numberOfInstances: 1 postgresql: - version: "13" + version: "14" # Make this a standby cluster and provide the s3 bucket path of source cluster for continuous streaming. standby: s3_wal_path: "s3://path/to/bucket/containing/wal/of/source/cluster/" diff --git a/pkg/apis/acid.zalan.do/v1/crds.go b/pkg/apis/acid.zalan.do/v1/crds.go index a8fc490ac..886387fb0 100644 --- a/pkg/apis/acid.zalan.do/v1/crds.go +++ b/pkg/apis/acid.zalan.do/v1/crds.go @@ -504,15 +504,6 @@ var PostgresCRDResourceValidation = apiextv1.CustomResourceValidation{ "version": { Type: "string", Enum: []apiextv1.JSON{ - { - Raw: []byte(`"9.3"`), - }, - { - Raw: []byte(`"9.4"`), - }, - { - Raw: []byte(`"9.5"`), - }, { Raw: []byte(`"9.6"`), }, @@ -528,6 +519,9 @@ var PostgresCRDResourceValidation = apiextv1.CustomResourceValidation{ { Raw: []byte(`"13"`), }, + { + Raw: []byte(`"14"`), + }, }, }, "parameters": { 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 5bd999444..6d0dd136a 100644 --- a/pkg/apis/acid.zalan.do/v1/operator_configuration_type.go +++ b/pkg/apis/acid.zalan.do/v1/operator_configuration_type.go @@ -44,8 +44,8 @@ type PostgresUsersConfiguration struct { // MajorVersionUpgradeConfiguration defines how to execute major version upgrades of Postgres. 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 - MinimalMajorVersion string `json:"minimal_major_version" default:"9.5"` - TargetMajorVersion string `json:"target_major_version" default:"13"` + MinimalMajorVersion string `json:"minimal_major_version" default:"9.6"` + TargetMajorVersion string `json:"target_major_version" default:"14"` } // 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 c997a675a..c0f868820 100644 --- a/pkg/cluster/majorversionupgrade.go +++ b/pkg/cluster/majorversionupgrade.go @@ -9,12 +9,12 @@ import ( // VersionMap Map of version numbers var VersionMap = map[string]int{ - "9.5": 90500, "9.6": 90600, "10": 100000, "11": 110000, "12": 120000, "13": 130000, + "14": 140000, } // IsBiggerPostgresVersion Compare two Postgres version numbers @@ -33,7 +33,7 @@ func (c *Cluster) GetDesiredMajorVersionAsInt() int { func (c *Cluster) GetDesiredMajorVersion() string { if c.Config.OpConfig.MajorVersionUpgradeMode == "full" { - // current is 9.5, minimal is 11 allowing 11 to 13 clusters, everything below is upgraded + // current is 9.6, minimal is 11 allowing 11 to 14 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 88ebd197f..65a99bdc4 100644 --- a/pkg/controller/operator_config.go +++ b/pkg/controller/operator_config.go @@ -56,8 +56,8 @@ func (c *Controller) importConfigurationFromCRD(fromCRD *acidv1.OperatorConfigur // major version upgrade config result.MajorVersionUpgradeMode = util.Coalesce(fromCRD.MajorVersionUpgrade.MajorVersionUpgradeMode, "off") - result.MinimalMajorVersion = util.Coalesce(fromCRD.MajorVersionUpgrade.MinimalMajorVersion, "9.5") - result.TargetMajorVersion = util.Coalesce(fromCRD.MajorVersionUpgrade.TargetMajorVersion, "13") + result.MinimalMajorVersion = util.Coalesce(fromCRD.MajorVersionUpgrade.MinimalMajorVersion, "9.6") + result.TargetMajorVersion = util.Coalesce(fromCRD.MajorVersionUpgrade.TargetMajorVersion, "14") // kubernetes config result.CustomPodAnnotations = fromCRD.Kubernetes.CustomPodAnnotations diff --git a/pkg/util/config/config.go b/pkg/util/config/config.go index 228342e66..4219f82fb 100644 --- a/pkg/util/config/config.go +++ b/pkg/util/config/config.go @@ -212,8 +212,8 @@ type Config struct { EnablePgVersionEnvVar bool `name:"enable_pgversion_env_var" default:"true"` EnableSpiloWalPathCompat bool `name:"enable_spilo_wal_path_compat" default:"false"` MajorVersionUpgradeMode string `name:"major_version_upgrade_mode" default:"off"` - MinimalMajorVersion string `name:"minimal_major_version" default:"9.5"` - TargetMajorVersion string `name:"target_major_version" default:"13"` + MinimalMajorVersion string `name:"minimal_major_version" default:"9.6"` + TargetMajorVersion string `name:"target_major_version" default:"14"` } // MustMarshal marshals the config or panics diff --git a/ui/manifests/deployment.yaml b/ui/manifests/deployment.yaml index 21a87a31f..d70885d32 100644 --- a/ui/manifests/deployment.yaml +++ b/ui/manifests/deployment.yaml @@ -66,6 +66,7 @@ spec: "cost_core": 0.0575, "cost_memory": 0.014375, "postgresql_versions": [ + "14", "13", "12", "11" diff --git a/ui/operator_ui/spiloutils.py b/ui/operator_ui/spiloutils.py index 26113bd54..1fc7a1b8e 100644 --- a/ui/operator_ui/spiloutils.py +++ b/ui/operator_ui/spiloutils.py @@ -308,7 +308,7 @@ def read_versions( if uid == 'wal' or defaulting(lambda: UUID(uid)) ] -BACKUP_VERSION_PREFIXES = ['','9.5/', '9.6/', '10/','11/', '12/', '13/'] +BACKUP_VERSION_PREFIXES = ['', '9.6/', '10/', '11/', '12/', '13/', '14/'] def read_basebackups( pg_cluster, diff --git a/ui/run_local.sh b/ui/run_local.sh index 79723680a..33c0abf27 100755 --- a/ui/run_local.sh +++ b/ui/run_local.sh @@ -23,6 +23,7 @@ default_operator_ui_config='{ "cost_core": 0.0575, "cost_memory": 0.014375, "postgresql_versions": [ + "14", "13", "12", "11"