From 97f8ea2506953e8ceeb2f58bf8bb112d7d8f5985 Mon Sep 17 00:00:00 2001 From: Saikrishna Edupuganti Date: Tue, 29 Jan 2019 01:22:06 +0000 Subject: [PATCH] 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 --- clr-k8s-examples/create_stack.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/clr-k8s-examples/create_stack.sh b/clr-k8s-examples/create_stack.sh index da0d27a..86887ef 100755 --- a/clr-k8s-examples/create_stack.sh +++ b/clr-k8s-examples/create_stack.sh @@ -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-