diff --git a/contrib/firstboot.sh b/contrib/firstboot.sh index 2b165a4..613cc5a 100755 --- a/contrib/firstboot.sh +++ b/contrib/firstboot.sh @@ -13,13 +13,29 @@ k8sDeploy () { cd ${groot}/contrib/ansible && \ ansible-playbook bootstrap-node.yml && \ ansible-playbook init-cluster.yml + while true ; do + echo "Waiting for CNI..." + result=$(kubectl get nodes|awk '{print $2}'| tail -1| grep -nE '^Ready') + if [ -z "$result" ] ; then + break + fi + sleep 1 + done +} +InstallIngress () { + # Allow scheduling on our master node + kubectl taint nodes k8s-demo node-role.kubernetes.io/master- + # Installing Ingress + helm repo add nginx-stable https://helm.nginx.com/stable && \ + helm repo update && \ + helm install nginx-stable/nginx-ingress --namespace kube-system --generate-name --set rbac.create=true } -#InstallIngress () { -# -#} if [ ! -f ${bootflag} ]; then touch ${bootflag} k8sDemoWA; k8sDeploy; + echo "Sleeping for 120s..." + sleep 120; + InstallIngress; fi