kube-skew-check
v0.1.1
Published
Find the Kubernetes component versions your repository pins — kind, k3s, minikube, Terraform, setup-kubectl, .tool-versions — and say which pairs fall outside the Kubernetes project's own version skew policy, with the project's own sentence quoted under e
Maintainers
Readme
kube-skew-check
Read the Kubernetes component versions your repository pins, and say which pairs fall outside the Kubernetes project's own version skew policy — with the project's own sentence quoted under every answer.
npx kube-skew-check1 pair outside the Kubernetes version skew policy:
UNSUPPORTED kube-apiserver 1.29 and kubectl 1.33
kubectl is 4 minor versions newer than kube-apiserver; the policy allows at most 1.
kube-apiserver 1.29.2 at .github/workflows/e2e.yml:10
kubectl 1.33.0 at .github/workflows/e2e.yml:13
the rule: "kubectl is supported within one minor version (older or newer) of kube-apiserver."
https://kubernetes.io/releases/version-skew-policy/Exit 1 when a pairing your repository states is outside the policy, so a CI job stops. Exit 0 otherwise, including when there was nothing to check.
Why
A repository names a cluster version in one place and a kubectl version in
another: a kindest/node image in a CI job, azure/setup-kubectl three lines
above it, an EKS cluster_version in Terraform, kubectl 1.30.1 in
.tool-versions. Those numbers are governed by a published rule. When they
drift apart nothing warns you — kubectl talks to an API it does not know, or a
node never registers, and you find out mid-rollout.
What it reads
| Where | Read as |
| --- | --- |
| kindest/node:v1.29.2 | the cluster version (a kind node runs the control plane) |
| rancher/k3s:v1.29.6-k3s1, k3d --image | the cluster version |
| --kubernetes-version=v1.28.3 (minikube, kind) | the cluster version |
| Terraform cluster_version, kubernetes_version, min_master_version, master_version, orchestrator_version | the cluster version |
| azure/setup-kubectl with version: | kubectl |
| dl.k8s.io/release/v1.30.1, bitnami/kubectl:… | kubectl |
| kubectl 1.30.1 in .tool-versions, mise.toml, .k8s-version | kubectl |
${{ env.FOO }} and ${{ matrix.k8s }} are resolved when the same file defines
them, and the output names the key it read. A matrix with several entries is
reported at every entry, because the job runs at every entry.
What it will not say
This is the half that took the care.
- A Helm chart's
kubeVersionis not a pin. It is the range the chart declares it supports. It is shown for context and never compared, because reading "I work on >=1.27" as "I run 1.27" invents a cluster. - An unpinned kubectl is reported as unpinned.
azure/setup-kubectlwith noversion:installs whatever is newest when the job runs. We do not claim what that resolves to — that needs the network. We say it is not a pin, and print the rule it will have to satisfy. - A digest-only image, a floating tag and an unresolvable
${{ }}are each reported NOT CHECKED with the reason. None of them reaches a comparison. - A gap between two files is not a failure. Two versions in the same file are in the same job: your repository has stated that pairing, and a gap there stops the build. A kubectl in a workflow and an EKS version in Terraform are two places, and nothing in your repository says the first talks to the second. Those are reported as WORTH CHECKING and do not set the exit code.
- Nothing inside
node_modules,vendor,.terraformor any other cache is yours. A line naming a file you cannot edit is worse than silence. - No end-of-support date is claimed anywhere. This tool does skew arithmetic on minor versions and quotes a rule. It publishes no retirement date and no "current release" of its own, because the only release number it can quote was read on a named day and that is printed as such.
Options
kube-skew-check [path]
--json the whole reading as JSON
--quiet only the pairs outside the policy
--no-fail report and always exit 0In CI
- run: npx kube-skew-checkWhere the rules come from
One page: the Kubernetes project's own version skew policy, harvested into six records — one per governed component pair — each carrying the sentence that states the rule, verbatim, with the link. Browse them at referencesource.org/kubernetes-version-skew-policy/. The page was read on the date the tool prints in its last line.
Source documentation CC BY 4.0 (Kubernetes / CNCF). This compilation CC0-1.0. Built and maintained automatically.
