Fixing kubectl conflict on KUD addons 16/89016/4
authorSamuli Silvius <s.silvius@partner.samsung.com>
Fri, 31 May 2019 11:19:07 +0000 (14:19 +0300)
committerSamuli Silvius <s.silvius@partner.samsung.com>
Wed, 5 Jun 2019 10:32:24 +0000 (13:32 +0300)
Removing kubectl (andrewrothstein.kubectl) dependency
that conflicts with kubectl installed by Kupespray.

Copy kubectl installed by Kubespray also to host
running Ansible.
That needs kubectl_localhost: true in Kubespray configuration
to make it copy binary to localhost.

Issue-ID: MULTICLOUD-667

Change-Id: I8c5f56488a9f559c4358cea5ad56fa23b26ec6aa
Signed-off-by: Samuli Silvius <s.silvius@partner.samsung.com>
kud/hosting_providers/vagrant/installer.sh
kud/hosting_providers/vagrant/inventory/group_vars/k8s-cluster.yml

index c37d274..1d84646 100755 (executable)
@@ -131,6 +131,8 @@ function install_k8s {
     # Configure environment
     mkdir -p $HOME/.kube
     cp $kud_inventory_folder/artifacts/admin.conf $HOME/.kube/config
+    # Copy Kubespray kubectl to be usable in host running Ansible. Requires kubectl_localhost: true in inventory/group_vars/k8s-cluster.yml
+    sudo cp $kud_inventory_folder/artifacts/kubectl /usr/local/bin/
 }
 
 # install_addons() - Install Kubenertes AddOns
index 8f719a4..9966ba8 100644 (file)
@@ -38,8 +38,10 @@ kube_token_auth: true
 # Can also be set to 'cloud', which lets the cloud provider setup appropriate routing
 kube_network_plugin: flannel
 
-# Make a copy of kubeconfig on the host that runs Ansible in GITDIR/artifacts
+# Make a copy of kubeconfig (admin.conf) on the host that runs Ansible to inventory/artifacts
 kubeconfig_localhost: true
+# Copy kubectl binary on the host that runs Ansible to inventory/artifacts
+kubectl_localhost: true
 
 # Enable MountPropagation gate feature
 local_volumes_enabled: true