Clarify behavior of parallel pod management policy of stateful sets #47085
Labels
kind/bug
Categorizes issue or PR as related to a bug.
needs-triage
Indicates an issue or PR lacks a `triage/foo` label and requires one.
sig/apps
Categorizes an issue or PR as relevant to SIG Apps.
sig/architecture
Categorizes an issue or PR as relevant to SIG Architecture.
sig/scheduling
Categorizes an issue or PR as relevant to SIG Scheduling.
Problem:
I was facing the issue described in kubernetes/kubernetes#67250
The way around discussed by community users to avoid this is to set the
podManagementPolicy
toParallel
. As suggested hereI have tried this and it works as expected, when I update the pod template to a good configuration it terminates all pods and does not wait for pods to be Running and Ready or completely terminated before launching or terminating another Pod.
All was good until I read the documentation for
podManagementPolicy
further, I saw one more line stated hereSetting it to Parallel worked for me and when I update the configuration, it works, contradicting what the above line in the docs says.
I went through the code for it and saw
https://github.com/kubernetes/kubernetes/blob/88313a445174e21ed326f40802429b854e5be9ba/pkg/controller/statefulset/stateful_set_control.go#L436-L440
when we set
podManagementPolicy
to parallel,monotonic
is set tofalse
and we never enter this if block. this in turn at the end leads to updating the pods.https://github.com/kubernetes/kubernetes/blob/88313a445174e21ed326f40802429b854e5be9ba/pkg/controller/statefulset/stateful_set_control.go#L459
Proposed Solution:
This doc change was added for the Kubernetes 1.11 version and I suppose the code has changed for it since then. I have verified that updates are indeed affected by the parallel pod management policy. We should update the docs to remove the line stating
updates are not affected
.Page to Update:
https://kubernetes.io/docs/concepts/workloads/controllers/statefulset
Kubernetes Version: v1.30.0
The text was updated successfully, but these errors were encountered: