Skip to content

document changed configmap default#3116

Open
FxKu wants to merge 8 commits into
masterfrom
use-configmaps-by-default
Open

document changed configmap default#3116
FxKu wants to merge 8 commits into
masterfrom
use-configmaps-by-default

Conversation

@FxKu

@FxKu FxKu commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

the default of kubernetes_use_configmaps options was silently set to true in #3102 but as a direct change of this config can have severe consequences we need to provide a guide how to migrate to the new setup - from deprecated endpoints to config maps

closes #2946, #3056

@FxKu FxKu added this to the 2.0.0 milestone Jun 25, 2026
@FxKu FxKu moved this to WIP / currently reviewed in Postgres Operator Jun 25, 2026
@FxKu FxKu moved this from WIP / currently reviewed to Good state for merge in Postgres Operator Jun 29, 2026
@FxKu

FxKu commented Jun 29, 2026

Copy link
Copy Markdown
Contributor Author

👍

Comment thread pkg/cluster/util.go
}
if c.OpConfig.KubernetesUseConfigMaps == nil {
return true
}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since it's now a *bool type, the option can be nil and should then default to true

Comment thread pkg/cluster/sync.go
}
}()

if !c.patroniKubernetesUseConfigMaps() {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so we work everywhere with the operator config c.OpConfig.KubernetesUseConfigMaps but here refer to the Patroni one ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it includes an extra check patroniUsesKubernetes

expectedValuesS3Bucket := []ExpectedValue{
{
envIndex: 15,
envIndex: 16,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

which change triggered the renumbering of the env vars ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

KUBERNETES_USE_CONFIGMAPS env var is now present in unit tests

Comment thread docs/migrate.md
@@ -0,0 +1,17 @@
<h1>Migrate from v1 to v2</h1>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that needs a bigger announcement than just a doc.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

my plan is to fill this document with more sections and then link it from the README

Comment thread docs/migrate.md

If your current operator deployment is relying on K8s endpoints (the default setup) for Patroni to manage the HA state you have to start planning to switch to configmaps, because endpoints are deprecated from K8s 1.33 onwards. The default of the corresponding parameter `kubernetes_use_configmaps` is changing to `true` with v2.0 of the operator. This means you have to explicity set it to `false` in your configuration if you haven't done it yet before you start the upgrade.

We explicitly warn you to go straight to configmap-based HA management with database clusters that use replicas, because there's is a danger to run into split-brain scenarios during the rolling update of pods. To play it safe, here is what you should do - before or after the Postgres Operator upgrade:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why and under which conditions ?

Comment thread docs/migrate.md Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Good state for merge

Development

Successfully merging this pull request may close these issues.

Operator deprecation warning: "v1 Endpoints is deprecated in v1.33+; use discovery.k8s.io/v1 EndpointSlice

2 participants