Skip to content

fix(k8s): devops k8s doctor and deploy-stack report a kubectl or kubelet outside the supported version skew, and the readme names the homelab's #1640

Description

@dan-petty

Friction

devops-cli installs kubectl 1.37.1, and the homelab cluster runs Kubernetes 1.31 (k3s v1.31.4+k3s1). kubectl is supported only within one minor of the API server, so every kubectl call devops-cli makes against the homelab is six minors outside the skew policy, and nothing says so. Kubernetes 1.31 is also past upstream end of life. The k3s upgrade itself belongs to the homelab repository (dan-petty/homelab#3, which pins k3s_version and owns make upgrade); devops-cli's part is to detect and document the skew, not to pin an end-of-life kubectl.

Evidence

Live, read-only, 2026-10-17:

  • All three nodes (, , ) report kubeletVersion v1.31.4+k3s1 and containerd 1.7.23-k3s2.

Repo:

  • src/devops_cli/tools_lock/tools.lock:28 pins [binary.kubectl] version = "1.37.1"; helm is 4.3.0 and the Python client is kubernetes==36.0.3 (pyproject.toml:25).
  • src/devops_cli/k8s/service.py:156,190-191 already calls VersionApi.get_code for reachability, but discards the version. K8sClusterStatusResult.server_version exists (src/devops_cli/models/k8s.py:438).
  • devops k8s doctor (src/devops_cli/k8s/doctor.py:490, diagnose) has node, volume, pod and event rules and no version rule; its Snapshot already holds the nodes, whose status.nodeInfo.kubeletVersion gives each kubelet's version.
  • No README section names a supported Kubernetes range or the skew policy. No devops-cli issue covers it (searched: kubectl skew, kubectl version, tools.lock kubectl).
  • The homelab repository pins k3s_version: "v1.31.4+k3s1" (ansible/inventory/group_vars/k3s_cluster.yaml:3), and its docs: document branch protection and branch management standards #3 plans the minor-by-minor upgrade.

Remedy

  1. Tests first (tests/k8s/test_doctor*.py or beside the existing doctor tests, on the shared fake cluster): a snapshot whose server minor is more than one away from the locked kubectl minor yields one warning finding naming both versions and the supported range; a snapshot within one minor yields none; kubelets older than the API server by more than the Kubernetes skew policy allows yield a finding per node.
  2. In doctor.py, add the server version to Snapshot (from the VersionApi.get_code call the service already makes, added to plan_doctor_requests so --dry-run lists it) and a version-skew rule. Parse versions with packaging.version.Version (already a dependency), read the kubectl version from devops_cli.tools_lock.load_tools_lock(), and keep the rule a pure function. No hand-kept table of Kubernetes releases.
  3. deploy-stack prints the same warning once before it applies anything, without failing (the skew is real but rarely breaks apply).
  4. k8s/README.md Prerequisites: state the kubectl skew policy, that tools.lock tracks a current kubectl, and that the homelab stays outside it until dan-petty/homelab#3 lands. Do not pin kubectl to 1.31 or 1.32; both are end of life and the devcontainer's minikube runs a current release.

Priority: P3. The runtime risk (runc and containerd CVEs, end-of-life minor) is tracked in dan-petty/homelab#3; this item only makes the skew visible.

Activity

  1. added
    source/agent
    type/bug
    on Oct 18, 2026
  2. dan-petty commented on Oct 18, 2026

    @dan-petty
    OwnerAuthor

    Intake placed this item to the backlog: at intake only a critical fix goes into a release; a release start pulls Ready items in, P0 features first.

    • Type: type/bug. The candidate addresses a version skew issue that causes kubectl to be outside the supported Kubernetes version policy.
    • Priority: P3-Low. The issue is about visibility of version skew and does not introduce immediate runtime risk or security concerns.
    • Value: Medium. Fixing the version skew improves operational safety and clarity for users working with the cluster.
    • Effort: High. The fix involves adding tests, modifying doctor logic, updating deploy-stack behavior, and updating documentation across multiple files.
  3. added a commit that references this issue on Oct 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    source/agenttype/bug

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions