pkgs.k8s.io Has One Repository per Minor Version, So the Repository URL Is the Version Pin

In progress Kubernetes Linux

The Kubernetes apt packages come from pkgs.k8s.io, which publishes a separate repository for each minor release: https://pkgs.k8s.io/core:/stable:/v1.36/deb/. A node with that repository can only ever install 1.36 patch releases. Moving to 1.37 is never an accidental apt upgrade: it starts by changing the repository line, then follows the kubeadm upgrade procedure.

So the version a node runs is decided in two places:

Control Stops
Repository URL (v1.36) A jump to another minor version.
apt-mark hold kubelet kubeadm kubectl A patch upgrade on one node only, out of step with the others.

Keep the minor version in one variable (k8s_minor_version in an Ansible play), so every node and the control plane get the same one.

Picking the Minor Version

Upstream supports the three most recent minor releases, each with about a year of patches. A minor version that has fallen out of that window gets no security fixes, so a rebuild is the cheapest moment to leave it.

Mind the version skew rules: the kubelet may be older than the API server, never newer. Upgrade the control plane first.

References