Skip to content

Commit

Permalink
Merge pull request #105 from unclejack/liveness_checks
Browse files Browse the repository at this point in the history
k8s: add liveness checks
  • Loading branch information
unclejack authored Apr 14, 2017
2 parents 2169a39 + a90aea0 commit fa52081
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 11 deletions.
27 changes: 19 additions & 8 deletions install/k8s/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 <netmaster DNS/IP>
2. Install Contiv on Kubeadm master host using the specified DNS/IP for netmaster and specified ACI configuration.
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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 "========================================================="
Expand Down
3 changes: 0 additions & 3 deletions install/k8s/uninstall.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit fa52081

Please sign in to comment.