-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathconfigure-kubectl.sh
More file actions
executable file
·34 lines (26 loc) · 863 Bytes
/
configure-kubectl.sh
File metadata and controls
executable file
·34 lines (26 loc) · 863 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
28
29
30
31
32
33
34
#!/bin/bash
if [ $# -eq 0 ]
then
echo "You must specify URL of load balancer for Kubernetes cluster"
exit 1
fi
kubectl config set-cluster 'kubernetes-the-hard-way' \
--certificate-authority=terraform/certs/generated/ca.pem \
--embed-certs=true \
--server=$1:6443
kubectl config set-credentials admin --token chAng3m3
kubectl config set-context kthw --cluster='kubernetes-the-hard-way' --user=admin
kubectl config use-context kthw --cluster='kubernetes-the-hard-way' --user=admin
kubectl config set-context kthw
printf '\n\n'
printf '**************************\n'
printf '*** Component statuses ***\n'
printf '**************************\n'
printf '\n'
kubectl get componentstatuses
printf '\n\n'
printf '**************************\n'
printf '********* Nodes **********\n'
printf '**************************\n'
printf '\n'
kubectl get nodes