Skip to content

Accept int for StatefulSet maxUnavailable#884

Closed
AndrewMRQuinn wants to merge 1 commit intoCheckmk:masterfrom
AndrewMRQuinn:StatefulSet-maxUnavailable
Closed

Accept int for StatefulSet maxUnavailable#884
AndrewMRQuinn wants to merge 1 commit intoCheckmk:masterfrom
AndrewMRQuinn:StatefulSet-maxUnavailable

Conversation

@AndrewMRQuinn
Copy link
Copy Markdown

@AndrewMRQuinn AndrewMRQuinn commented Dec 23, 2025

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 mycluster showed the following problem:

Agent exited with code 1: 1 validation error for StatefulSetRollingUpdate
max_unavailable
  Input should be a valid string [type=string_type, input_value=1, input_type=int]
    For further information visit https://errors.pydantic.dev/2.10/v/string_type(!!)

Inspecting StatefulSets with kubectl get statefulset mystatefulset -o yaml showed 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.

    updateStrategy:
      rollingUpdate:
        maxSurge: 0
        maxUnavailable: 1
      type: RollingUpdate

Proposed changes

Allow max_unavailable StatefulSetRollingUpdate to accept integer values,
The PR allows both str and int, matching the RollingUpdate class in the same file. str may not be necessary, but I can't be confident that removing it wouldn't cause problems for someone else, hence matching RollingUpdate.

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.

The change allows an integer or a string, matching the RollingUpdate class.
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Dec 23, 2025

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@AndrewMRQuinn
Copy link
Copy Markdown
Author

I have read the CLA Document and I hereby sign the CLA or my organization already has a signed CLA.

@relrod
Copy link
Copy Markdown
Member

relrod commented Feb 24, 2026

Hello, thank you for your PR. We have recently fixed this crash in Werk 19306 (https://checkmk.com/werk/19306) as part of separate work, so I will close this. Thanks again.

@relrod relrod closed this Feb 24, 2026
@github-actions github-actions Bot locked and limited conversation to collaborators Feb 24, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants