forked from masezou/k8s-study-vanilla
-
Notifications
You must be signed in to change notification settings - Fork 1
/
result.sh
62 lines (59 loc) · 2.19 KB
/
result.sh
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#!/usr/bin/env bash
DNSDOMAINNAME="k8slab.internal"
#### LOCALIP #########
ip address show ens160 >/dev/null
retval=$?
if [ ${retval} -eq 0 ]; then
LOCALIPADDR=`ip -f inet -o addr show ens160 |cut -d\ -f 7 | cut -d/ -f 1`
else
ip address show ens192 >/dev/null
retval2=$?
if [ ${retval2} -eq 0 ]; then
LOCALIPADDR=`ip -f inet -o addr show ens192 |cut -d\ -f 7 | cut -d/ -f 1`
else
LOCALIPADDR=`ip -f inet -o addr show eth0 |cut -d\ -f 7 | cut -d/ -f 1`
fi
fi
DNSHOSTIP=${LOCALIPADDR}
DNSHOSTNAME=`hostname`
DASHBOARD_EXTERNALIP=`kubectl -n kubernetes-dashboard get service dashboard-service-lb| awk '{print $4}' | tail -n 1`
REGISTRY_EXTERNALIP=`kubectl -n registry get service pregistry-frontend-clusterip | awk '{print $4}' | tail -n 1`
echo "*************************************************************************************"
echo "Here is cluster context."
echo -e "\e[1mkubectl config get-contexts \e[m"
kubectl config get-contexts
echo ""
echo -e "\e[1mDNS Server \e[m"
echo -n "DNS Domain Name is "
echo -e "\e[32m${DNSDOMAINNAME} \e[m"
echo -n "DNS DNS IP address is "
echo -e "\e[32m${DNSHOSTIP} \e[m"
echo " If you change dns server setting in client pc, you can access this server with this FQDN."
echo ""
echo -e "\e[1mKubernetes dashboard \e[m"
echo -e "\e[32m https://${DASHBOARD_EXTERNALIP}/#/login \e[m"
echo "or"
echo -e "\e[32m https://dashboard.${DNSDOMAINNAME}/#/login \e[m"
echo ""
echo -e "\e[32m login token is cat ./dashboard.token \e[m"
cat ./dashboard.token
echo ""
echo -e "\e[1mMinio dashboard \e[m"
echo -e "\e[32m https://${LOCALIPADDR}:9001 \e[m"
echo "or"
echo -e "\e[32m https://minio.${DNSDOMAINNAME}:9001 \e[m"
echo ""
echo -n " login credential is "
echo -e "\e[32mminioadminuser/minioadminuser \e[m"
echo ""
echo -e "\e[1mRegistry \e[m"
echo -e "\e[32m http://${LOCALIPADDR}:5000 \e[m"
echo "You need to set insecure-registry in your client side docker setting."
echo -e "\e[1mRegistry frontend UI \e[m"
echo -e "\e[32m https://${REGISTRY_EXTERNALIP} \e[m"
echo "or"
echo -e "\e[32m http://registryfe.${DNSDOMAINNAME} \e[m"
echo ""
echo -e "\e[1mKubeconfig \e[m"
echo -e "\e[32m ~/.kube/config \e[m"
echo " You can access Kubernetes from your desktop!"