Add containerd support for Calico upgrade
Whole "kubernetes.pool" state run is required during Calico upgrade
when containerd is in use. Otherwise, the following requirement
"require: service: containerd" is not satisfied on "calico-node"
service update.
Related-Prod: PROD-24746 (PROD:24746)
Change-Id: Ic5bee1bcaf62a76ff894bb00246dc130561ca879
diff --git a/k8s-upgrade-pipeline.groovy b/k8s-upgrade-pipeline.groovy
index a09ae85..ef1c145 100644
--- a/k8s-upgrade-pipeline.groovy
+++ b/k8s-upgrade-pipeline.groovy
@@ -139,11 +139,15 @@
}
}
-def performCalicoConfigurationUpdateAndServicesRestart(pepperEnv, target) {
+def performCalicoConfigurationUpdateAndServicesRestart(pepperEnv, target, ctl_node) {
def salt = new com.mirantis.mk.Salt()
stage("Performing Calico configuration update and services restart") {
- salt.enforceState(pepperEnv, target, "kubernetes.pool.calico")
+ if (containerDenabled(pepperEnv, ctl_node)) {
+ salt.enforceState(pepperEnv, target, "kubernetes.pool")
+ } else {
+ salt.enforceState(pepperEnv, target, "kubernetes.pool.calico")
+ }
salt.runSaltProcessStep(pepperEnv, target, 'service.restart', ['kubelet'])
}
}
@@ -494,7 +498,7 @@
// this sequence implies workloads operations downtime
startCalicoUpgrade(pepperEnv, ctl_node)
- performCalicoConfigurationUpdateAndServicesRestart(pepperEnv, POOL)
+ performCalicoConfigurationUpdateAndServicesRestart(pepperEnv, POOL, ctl_node)
completeCalicoUpgrade(pepperEnv, ctl_node)
// after that no downtime is expected