Skip to content

Commit 80e7dc2

Browse files
Add files via upload
1 parent ab3704f commit 80e7dc2

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

Kubernetes/KubernetesDashBoard.txt

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/v2.0.1/aio/deploy/recommended.yaml
2+
kubectl get svc kubernetes-dashboard -n kubernetes-dashboard
3+
kubectl edit svc kubernetes-dashboard -n kubernetes-dashboard
4+
kubectl get pods -n kubernetes-dashboard -o wide
5+
6+
--
7+
# Create service account
8+
kubectl create serviceaccount cluster-admin-dashboard-sa
9+
# Bind ClusterAdmin role to the service account
10+
kubectl create clusterrolebinding cluster-admin-dashboard-sa \
11+
--clusterrole=cluster-admin \
12+
--serviceaccount=default:cluster-admin-dashboard-sa
13+
# Parse the token
14+
TOKEN=$(kubectl describe secret $(kubectl -n kube-system get secret | awk '/^cluster-admin-dashboardsa-
15+
token-/{print $1}') | awk '$1=="token:"{print $2}')
16+
17+
echo $TOKEN
18+

0 commit comments

Comments
 (0)