From 4e2e6a61183529c1b8eed84daf1dc1d494813698 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Evrard Date: Mon, 6 Jul 2020 11:19:42 +0200 Subject: [PATCH 1/3] Allow any version of k8s-client With the change of the virtual provides from kubernetes- to k8s- and the version appended packages, we can now to decide whether this package need _any_ version of a kubernetes, or a specific one. skuba-update can rely on any version of kubectl, so we could be changing the `Requires:` line for supporting k8s-client or kubernetes-client. However, to not have an impact on upgrades, we should instead remove the requires. This is a combined patch of: (cherry picked from commit 6808a1b4e9032e65f67a34a3ed37e682df89c51f) (cherry picked from commit 74366c38ab96e957d2a85b6024a4a296399916df) --- ci/packaging/suse/skuba_spec_template | 1 - 1 file changed, 1 deletion(-) diff --git a/ci/packaging/suse/skuba_spec_template b/ci/packaging/suse/skuba_spec_template index d18d4a233f..0cd7773cb8 100644 --- a/ci/packaging/suse/skuba_spec_template +++ b/ci/packaging/suse/skuba_spec_template @@ -60,7 +60,6 @@ Summary: Utility to automatically refresh and update a skuba cluster Group: System/Management Requires: python3-setuptools Requires: zypper >= 1.14.15 -Requires: kubernetes-client Requires: lsof BuildArch: noarch %{?systemd_requires} From 22143af94a3851f3bab196d91dff622bcbbf2e90 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Evrard Date: Mon, 6 Jul 2020 16:59:13 +0200 Subject: [PATCH 2/3] Remove cri-o-kubeadm-criconfig in stage1 Without this patch, the removal of kubernetes-kubeadm will be problematic, as no packages will provide it and it is still required by cri-o-kubeadm-criconfig. If we remove this package, and upgrade cri-o to 1.18 during the same transaction, we'll keep the kubelet to the current version, and kubeadm can be upgraded to 1.18. (cherry picked from commit 0e0c8e494cda5f328a9dedf67e991ec6033d5e5d) --- internal/pkg/skuba/deployments/ssh/kubernetes.go | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/internal/pkg/skuba/deployments/ssh/kubernetes.go b/internal/pkg/skuba/deployments/ssh/kubernetes.go index 7ef7d9d403..839a256f46 100644 --- a/internal/pkg/skuba/deployments/ssh/kubernetes.go +++ b/internal/pkg/skuba/deployments/ssh/kubernetes.go @@ -113,9 +113,16 @@ func kubernetesUpgradeStageOne(t *Target, data interface{}) error { // 1.17 is the last version included in CaaSP4. It's the tipping // point where we changed our packaging. // On 1.17 we can't remove kubernetes-1.17-kubeadm, because it doesn't exist. - // Removing kubeadm keeps kubelet alive. - // The rest needs to be removed on the next stage. - pkgs = append(pkgs, "-patterns-caasp-Node-1.17", "-\"kubernetes-kubeadm<1.18\"", "-caasp-config") + // We are removing kubeadm while keeping kubelet alive to its version 1.17. + // For the initial migration we need to update crio kubeadm + // to 1.18 in stage1, due to conflict resolution: the caasp4 + // cri-o-kubeadm-criconfig requires kubernetes-kubeadm which is + // not provided anymore (when we remove kubernetes-kubeadm, and + // because we don't want to have the same provides: on the new + // package to avoid upgrade during zypper migration). + // we need to remove cri-o in stage2 else 1.17 kubelet could + // complain about cri-runtime being absent. + pkgs = append(pkgs, "-patterns-caasp-Node-1.17", "-\"kubernetes-kubeadm<1.18\"", "-caasp-config", "-cri-o-kubeadm-criconfig") } else { pkgs = append(pkgs, fmt.Sprintf("-kubernetes-%s-kubeadm", currentV)) } @@ -144,7 +151,7 @@ func kubernetesUpgradeStageTwo(t *Target, data interface{}) error { pkgs = append(pkgs, "-\"kubernetes-kubelet<1.18\"") pkgs = append(pkgs, "-kubernetes-common") pkgs = append(pkgs, "-\"kubernetes-client<1.18\"") - pkgs = append(pkgs, "-cri-o*") + pkgs = append(pkgs, "-\"cri-o<1.18\"") } else { pkgs = append(pkgs, fmt.Sprintf("-kubernetes-%s-*", currentV)) pkgs = append(pkgs, fmt.Sprintf("-cri-o-%s*", currentV)) From 90c555633efc6ffcd1478dbdbeb81ce324af91b5 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Evrard Date: Tue, 14 Jul 2020 09:08:08 +0200 Subject: [PATCH 3/3] Install cri-tools- On our processes, we used to install cri-tools. However, because of incorrect CaaSP4 packaging of kubernetes, installing new versions of cri-tools is a problem during the SP1->2 migration. This forces us to have a different package. cri-tools- is the new package name. (cherry picked from commit 15bcc0348dbfcbd07eef51c135a9b4493c58aa22) --- internal/pkg/skuba/deployments/ssh/kubernetes.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/internal/pkg/skuba/deployments/ssh/kubernetes.go b/internal/pkg/skuba/deployments/ssh/kubernetes.go index 839a256f46..94d7dae1a3 100644 --- a/internal/pkg/skuba/deployments/ssh/kubernetes.go +++ b/internal/pkg/skuba/deployments/ssh/kubernetes.go @@ -91,6 +91,7 @@ func kubernetesFreshInstallAllPkgs(t *Target, data interface{}) error { pkgs = append(pkgs, fmt.Sprintf("+kubernetes-%s-kubelet", current)) pkgs = append(pkgs, fmt.Sprintf("+kubernetes-%s-client", current)) pkgs = append(pkgs, fmt.Sprintf("+cri-o-%s*", current)) + pkgs = append(pkgs, fmt.Sprintf("+cri-tools-%s*", current)) _, _, err = t.zypperInstall(pkgs...) return err @@ -155,11 +156,13 @@ func kubernetesUpgradeStageTwo(t *Target, data interface{}) error { } else { pkgs = append(pkgs, fmt.Sprintf("-kubernetes-%s-*", currentV)) pkgs = append(pkgs, fmt.Sprintf("-cri-o-%s*", currentV)) + pkgs = append(pkgs, fmt.Sprintf("-cri-tools-%s*", currentV)) } pkgs = append(pkgs, fmt.Sprintf("+kubernetes-%s-client", nextV)) pkgs = append(pkgs, fmt.Sprintf("+kubernetes-%s-kubelet", nextV)) pkgs = append(pkgs, fmt.Sprintf("+cri-o-%s*", nextV)) + pkgs = append(pkgs, fmt.Sprintf("+cri-tools-%s*", nextV)) _, _, err = t.zypperInstall(pkgs...) return err }