From b43314dade3e11a72f532fe9881bf189c6ecd547 Mon Sep 17 00:00:00 2001 From: Jari Kolehmainen Date: Thu, 30 Aug 2018 16:30:30 +0300 Subject: [PATCH] Add missing kubeadm-flags.env on upgrade (#578) --- lib/pharos/phases/migrate_worker.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/pharos/phases/migrate_worker.rb b/lib/pharos/phases/migrate_worker.rb index fba4b2270..b77558649 100644 --- a/lib/pharos/phases/migrate_worker.rb +++ b/lib/pharos/phases/migrate_worker.rb @@ -32,13 +32,18 @@ def migrate_1_3? end def migrate_1_3 - logger.info { 'Upgrade kubelet config for 1.10' } + logger.info { 'Upgrade kubelet config' } # use the new version of kubeadm to write out /var/lib/kubelet/config.yaml for new kubelet version to be installed # the kube master must be running, which is the case for upgrades host_configurer.upgrade_kubeadm(Pharos::KUBEADM_VERSION) @ssh.exec!("sudo /usr/local/bin/pharos-kubeadm-#{Pharos::KUBEADM_VERSION} upgrade node config --kubelet-version=v#{Pharos::KUBE_VERSION}") + + kubeadm_flags = @ssh.file("/var/lib/kubelet/kubeadm-flags.env") + return if kubeadm_flags.exist? + + kubeadm_flags.write('KUBELET_KUBEADM_ARGS=--cni-bin-dir=/opt/cni/bin --cni-conf-dir=/etc/cni/net.d --network-plugin=cni') end end end