Accept int for StatefulSet maxUnavailable #884
+1
−1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
General information
The maxUnavailable field is available for StatefulSets by default as of Kubernetes v1.35, and defaults to an integer value of 1. https://kubernetes.io/blog/2025/12/17/kubernetes-v1-35-release/#maxunavailable-for-statefulsets
The StatefulSetRollingUpdate class only accepted a string value, resulting in a validation error after updating to Kubernetes v1.35.
Bug reports
After updating to Kubernetes 1.35, monitoring failed for clusters containing StatefulSets. This was running on Talos Linux 1.12, which uses standard/upstream Kubernetes.
Runing
cmk --debug -vvn myclustershowed the following problem:Inspecting StatefulSets with
kubectl get statefulset mystatefulset -o yamlshowed the following configuration, with maxUnavailable set to an integer value of 1. This is a default value set by Kubernetes. It was not part of the manifest file.Proposed changes
Allow max_unavailable StatefulSetRollingUpdate to accept integer values,
The PR allows both
strandint, matching the RollingUpdate class in the same file.strmay not be necessary, but I can't be confident that removing it wouldn't cause problems for someone else, hence matching RollingUpdate.