Skip to content

Commit

Permalink
Upgrade cluster scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
sumitmaji committed Sep 21, 2022
1 parent 14c5792 commit 48b525c
Showing 1 changed file with 29 additions and 1 deletion.
30 changes: 29 additions & 1 deletion install_k8s/gok
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,24 @@ helmInst() {

}

startKubelet() {
systemctl stop kubelet
systemctl start kubelet
}

startHa() {
docker stop master-proxy
docker rm master-proxy
docker run -d --name master-proxy \
-v /opt/haproxy.cfg:/usr/local/etc/haproxy/haproxy.cfg:ro \
--net=host haproxy
}

disableSwap(){
sudo sed -i '/ swap / s/^\(.*\)$/#\1/g' /etc/fstab
sudo swapoff -a
}

if [ "$CMD" == "bash" ]; then
pod=$(getpod)
echo "Opening terminal on $pod"
Expand Down Expand Up @@ -215,6 +233,16 @@ elif [ "$CMD" == "install" ]; then
|____| |____/\___ (____ /____ >\___ > \/\_/ (____ |__||__| |__| \____/|__| |___| |__|_| |__|___| / /\
\/ \/ \/ \/ \/ \/ \/ \/
EOF

fi
elif [ "$CMD" == "start" ]; then
COMPONENT=$2
if [ "$COMPONENT" == "cluster" ]; then
disableSwap
startHa
startKubelet
elif [ "$COMPONENT" == "proxy" ]; then
startHa
elif [ "$COMPONNT" == "kubelet" ]; then
startKubelet
fi
fi

0 comments on commit 48b525c

Please sign in to comment.