-
Notifications
You must be signed in to change notification settings - Fork 28
Expand file tree
/
Copy pathadd_node.sh
More file actions
27 lines (22 loc) · 855 Bytes
/
Copy pathadd_node.sh
File metadata and controls
27 lines (22 loc) · 855 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/bin/bash
# PARAMETER1: name of the host to add
if [ $# -eq 0 ]
then
echo "No arguments supplied"
echo "Please add the following parameters to the shell script:"
echo " - Parameter1: Host to add to the cluster"
exit 0
fi
KUBEADMJOIN=$(kubeadm token create --print-join-command)
ssh -o "StrictHostKeyChecking no" root@$1 $KUBEADMJOIN
frames="/ | \\ -"
while [ $(kubectl get nodes | grep NotReady | wc -l) -eq 1 ]
do
for frame in $frames; do
echo "sleeping a bit - waiting for all nodes to be ready ..."
sleep 0.5; printf "\rsleeping a bit - waiting for all nodes to be ready ... $frame"
done
done
kubectl label node rhel4 "topology.kubernetes.io/region=dc"
kubectl label node rhel4 "topology.kubernetes.io/zone=east"
kubectl delete -n trident po -l app=node.csi.trident.netapp.io --field-selector spec.nodeName=rhel4