Skip to content

Commit

Permalink
Bump spilo and target version for PostgreSQL 15 (zalando#2139)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>
Co-authored-by: Felix Kunde <[email protected]>
  • Loading branch information
3 people authored Jan 4, 2023
1 parent 9c88fb9 commit becf8a4
Show file tree
Hide file tree
Showing 19 changed files with 31 additions and 29 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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) /
Expand Down Expand Up @@ -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`

Expand Down
1 change: 1 addition & 0 deletions charts/postgres-operator-ui/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ spec:
"cost_core": 0.0575,
"cost_memory": 0.014375,
"postgresql_versions": [
"15",
"14",
"13",
"12",
Expand Down
4 changes: 2 additions & 2 deletions charts/postgres-operator/crds/operatorconfigurations.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -170,7 +170,7 @@ spec:
default: "11"
target_major_version:
type: string
default: "14"
default: "15"
kubernetes:
type: object
properties:
Expand Down
4 changes: 2 additions & 2 deletions charts/postgres-operator/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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: ""
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion docs/reference/operator_parameters.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions docs/user.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -109,7 +109,7 @@ metadata:
spec:
[...]
postgresql:
version: "14"
version: "15"
parameters:
password_encryption: scram-sha-256
```
Expand Down
2 changes: 1 addition & 1 deletion e2e/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
4 changes: 2 additions & 2 deletions e2e/tests/test_e2e.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
4 changes: 2 additions & 2 deletions manifests/complete-postgres-manifest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -44,7 +44,7 @@ spec:
defaultRoles: true
defaultUsers: false
postgresql:
version: "14"
version: "15"
parameters: # Expert section
shared_buffers: "32MB"
max_connections: "10"
Expand Down
4 changes: 2 additions & 2 deletions manifests/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion manifests/minimal-postgres-manifest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ spec:
preparedDatabases:
bar: {}
postgresql:
version: "14"
version: "15"
4 changes: 2 additions & 2 deletions manifests/operatorconfiguration.crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -168,7 +168,7 @@ spec:
default: "11"
target_major_version:
type: string
default: "14"
default: "15"
kubernetes:
type: object
properties:
Expand Down
4 changes: 2 additions & 2 deletions manifests/postgresql-operator-default-configuration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion manifests/standby-manifest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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/"
Expand Down
2 changes: 1 addition & 1 deletion pkg/apis/acid.zalan.do/v1/operator_configuration_type.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion pkg/cluster/majorversionupgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ var VersionMap = map[string]int{
"13": 130000,
"14": 140000,
"15": 150000,

}

// IsBiggerPostgresVersion Compare two Postgres version numbers
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions pkg/controller/operator_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions pkg/util/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
Expand Down Expand Up @@ -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"`
Expand Down
2 changes: 1 addition & 1 deletion ui/operator_ui/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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': {},
Expand Down

0 comments on commit becf8a4

Please sign in to comment.