Skip to content

Commit

Permalink
upgrade kubectl client version with the control plane
Browse files Browse the repository at this point in the history
  • Loading branch information
marwanad committed Dec 5, 2018
1 parent 9b3a268 commit e11fd4d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pkg/cloud/azure/actuators/machine/machineactuator.go
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,10 @@ func (azure *AzureClient) updateMaster(cluster *clusterv1.Cluster, currentMachin
"sudo chmod a+rx /usr/bin/kubeadm;", goalMachine.Spec.Versions.ControlPlane)
cmd += fmt.Sprintf("sudo kubeadm upgrade apply v%s -y;", goalMachine.Spec.Versions.ControlPlane)

// update kubectl client version
cmd += fmt.Sprintf("curl -sSL https://dl.k8s.io/release/v%s/bin/linux/amd64/kubectl | "+
"sudo tee /usr/bin/kubectl > /dev/null;"+
"sudo chmod a+rx /usr/bin/kubectl;", goalMachine.Spec.Versions.Kubelet)
commandRunFuture, err := azure.compute().RunCommand(clusterConfig.ResourceGroup, resourcemanagement.GetVMName(goalMachine), cmd)
if err != nil {
return fmt.Errorf("error running command on vm: %v", err)
Expand All @@ -202,10 +206,6 @@ func (azure *AzureClient) updateMaster(cluster *clusterv1.Cluster, currentMachin
"sudo apt-get install kubelet=%s;", nodeName, goalMachine.Spec.Versions.Kubelet+"-00")
// mark the node as schedulable
cmd += fmt.Sprintf("sudo kubectl uncordon %s --kubeconfig /etc/kubernetes/admin.conf;", nodeName)
// update kubectl client version
cmd += fmt.Sprintf("curl -sSL https://dl.k8s.io/release/v%s/bin/linux/amd64/kubectl | "+
"sudo tee /usr/bin/kubectl > /dev/null;"+
"sudo chmod a+rx /usr/bin/kubectl;", goalMachine.Spec.Versions.Kubelet)

commandRunFuture, err := azure.compute().RunCommand(clusterConfig.ResourceGroup, resourcemanagement.GetVMName(goalMachine), cmd)
if err != nil {
Expand Down

0 comments on commit e11fd4d

Please sign in to comment.