diff --git a/install/k8s/install.sh b/install/k8s/install.sh index 96f2d7e..5fc9f46 100755 --- a/install/k8s/install.sh +++ b/install/k8s/install.sh @@ -77,7 +77,7 @@ Additional Options for ACI: Examples: -1. Install Contiv on Kubeadm master host using the specified DNS/IP for netmaster. +1. Install Contiv on Kubeadm master host using the specified DNS/IP for netmaster. ./install/k8s/install.sh -n 2. Install Contiv on Kubeadm master host using the specified DNS/IP for netmaster and specified ACI configuration. @@ -101,7 +101,7 @@ error_ret() { exit 1 } -while getopts ":s:n:v:w:c:t:k:a:u:p:l:d:e:m:y:z:" opt; do +while getopts ":s:n:v:w:c:t:k:a:u:p:l:d:e:m:y:z:g:i:" opt; do case $opt in s) cluster_store=$OPTARG @@ -151,6 +151,12 @@ while getopts ":s:n:v:w:c:t:k:a:u:p:l:d:e:m:y:z:" opt; do z) apic_cert_dn=$OPTARG ;; + g) + infra_gateway=$OPTARG + ;; + i) + infra_subnet=$OPTARG + ;; :) echo "An argument required for $OPTARG was not passed" usage @@ -251,13 +257,18 @@ rm -f /usr/bin/netctl cp ./netctl /usr/bin/ # Install Contiv $kubectl apply -f $contiv_yaml -if [ "$fwd_mode" = "routing" ]; then - sleep 60 - netctl --netmaster http://$netmaster:9999 global set --fwd-mode routing -fi -$kubectl get deployment/kube-dns -n kube-system -o json >kube-dns.yaml -$kubectl delete deployment/kube-dns -n kube-system +sleep 10 +for i in {0..30}; do + netctl tenant ls >/dev/null 2>&1 + if [ "$?" -eq "0" ]; then + break + fi + sleep 10 +done + +netctl net create -n infra -s $infra_subnet -g $infra_gateway contivh1 +netctl --netmaster http://$netmaster:9999 global set --fwd-mode routing echo "Installation is complete" echo "=========================================================" diff --git a/install/k8s/uninstall.sh b/install/k8s/uninstall.sh index 97f887e..b5c5a35 100755 --- a/install/k8s/uninstall.sh +++ b/install/k8s/uninstall.sh @@ -31,6 +31,3 @@ fi kubectl create -f install/k8s/$k8sfolder/cleanup.yaml sleep 60 kubectl delete -f install/k8s/$k8sfolder/cleanup.yaml - -# Re-creating the kube-dns deployment -kubectl create -f kube-dns.yaml