Moving around to allow early exit

In case we need to exit early this would have copied the credentials
into the home dir

Signed-off-by: Saikrishna Edupuganti <saikrishna.edupuganti@intel.com>
This commit is contained in:
Saikrishna Edupuganti
2019-01-29 01:22:06 +00:00
committed by Saikrishna Edupuganti
parent c8006ca944
commit 97f8ea2506
+5 -5
View File
@@ -22,16 +22,16 @@ function cluster_init() {
#to enable the RuntimeClass featuregate
sudo -E kubeadm init --config=./kubeadm.yaml
# If this an interactive terminal then wait for user to join workers
if [ -t 0 ]; then
read -p "Join other nodes. Press enter to continue"
fi
rm -rf $HOME/.kube
mkdir -p $HOME/.kube
sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
sudo chown $(id -u):$(id -g) $HOME/.kube/config
# If this an interactive terminal then wait for user to join workers
if [ -t 0 ]; then
read -p "Join other nodes. Press enter to continue"
fi
#Ensure single node k8s works
if [ $(kubectl get nodes | wc -l) -eq 2 ]; then
kubectl taint nodes --all node-role.kubernetes.io/master-