It is not possible to set antiAffinityTopologyKey

Description

It is not possible to set antiAffinityTopologyKey: "topology.kubernetes.io/zone" directly without “advanced“ configuration block
https://docs.percona.com/percona-operator-for-mongodb/operator.html?h=afinity#replsets-affinity-antiaffinitytopologykey

As a result on pods I see a default value topologyKey: kubernetes.io/hostname

spec: affinity: podAntiAffinity: requiredDuringSchedulingIgnoredDuringExecution: - labelSelector: matchLabels: app.kubernetes.io/component: mongod app.kubernetes.io/instance: test app.kubernetes.io/managed-by: percona-server-mongodb-operator app.kubernetes.io/name: percona-server-mongodb app.kubernetes.io/part-of: percona-server-mongodb app.kubernetes.io/replset: rs1 topologyKey: kubernetes.io/hostname



In the code are used deprecated labels as valid labels:
failure-domain.beta.kubernetes.io/region
failure-domain.beta.kubernetes.io/zone
https://github.com/percona/percona-server-mongodb-operator/blob/d938d4bc38bcc40a7cefc6627945550893fd17d8/pkg/apis/psmdb/v1/psmdb_defaults.go#L784-L785

topology.kubernetes.io/region
topology.kubernetes.io/zone
Should be used as valid as well:
https://kubernetes.io/docs/reference/labels-annotations-taints/#failure-domainbetakubernetesioregion


Environment

None

Activity

Slava Sarzhan March 21, 2024 at 7:05 PM

hi The issue was fixed and will be available in the next psmdb operator release.

natalia.marukovich March 19, 2024 at 2:30 PM

In the task we need to check:
- starting from version 1.16.0 we can use correct antiAffinityTopologyKey
- check that if we use antiAffinityTopologyKey: failure-domain.beta.kubernetes.io/zone in version 1.15.0 and update operator to version 1.16.0, psmdb cluster continues works correctly

Done

Details

Assignee

Reporter

Needs QA

Yes

Fix versions

Affects versions

Priority

Smart Checklist

Created March 15, 2024 at 3:28 PM
Updated June 18, 2024 at 1:52 PM
Resolved June 18, 2024 at 1:52 PM

Flag notifications