-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Description
Kubeadm version skew policies defines following rules
- kubeadm can be used with Kubernetes components (aka control plane) that are the same version as kubeadm or one version older.
- kubeadm can be used with a kubelet version that is the same version as kubeadm or three versions older
- If new nodes are joined to the cluster, the kubeadm binary used for kubeadm join must match the last version of kubeadm used to either create the cluster with kubeadm init or to upgrade the same node with kubeadm upgrade
In Cluster API, assuming that kubeadm binary is backed into images and it is always of the same version of the Kubernetes version existing in the image, 1 and 3 might become an issue when you try to join machines with an older Kubernetes versions than the control plane, because we are going to use a kubeadm version older than the control plane version e.g.:
- During an upgrade to 1.35, if you scale up a MD still at 1.34, you are going to use kubeadm 1.34 -> control plane 1.35 (violates skew)
- During an upgrade to 1.35,, if a remediation happen on MD still at 1.34, you are going to use kubeadm 1.34 -> control plane 1.35 (violates skew)
Those issue were mitigate by several factors.
- In most of the cases, violating this policy does not lead to issue, because kubeadm is pretty stable nowdays.
- In managed topology, cluster upgrade is a single operation, and thus you might assume that version skew between CP and workers only exists for a short period of time
- In managed topology, during upgrade the system is designed to minimize rollouts, so it is expected and acceptable to defer changes.
- Over time we introduced MachineSet preflight checks preventing scale up or machine remediation to start when this can potentially lead to issue
Those mitigation worked well in the past, but while they started to become not ideal with chained upgrades, now that we are starting looking into #12466, those mitigations are becoming an issue, because we are going to support having workers in older versions for a longer period, and we do expect that MD/MP with pinned K8s versions will be fully operational.
This issue is about investigating how to overcome current system constraints. A few initial points to think about:
-
How can we make kubeadm join possible on machines with older k8s versions
- Is upgrading kubeadm in flight a viable option?
- How do we upgrade kubeadm in flight?
- How do we prevent upgrading kubeadm in flight violating other kubeadm skew rules (e.g. 2 from the initial list)?
- Do we need more than upgrade kubeadm in flight (e.g. provide a different version of the kubeadm join configuration)?
- Are there alternatives to upgrading kubeadm in flight a viable option?
- How are we introducing this feature in CAPI?
- Will this be implemented in core CAPI or deferred to users like ~everything we do on machine initialisation?
- How we make this extensible / configurable by providers (if required)
- Will this work on all the existing old images or only on new images
- Is upgrading kubeadm in flight a viable option?
-
Assuming we have a solution for kubeadm join on machines with older k8s versions
- How do we make it possible to disable existing preflight checks preventing this operation
-
How do we balance the fact that we are enabling operations on workers with older K8s versions, with the fact that we still want to minimize the number rollouts during upgrades?
Note: there might also more subtle issue when version skew exists in the cluster, might be worth to take a look at kubernetes/enhancements#4020 and related work