Created
May 7, 2020 13:09
-
-
Save tsuyo/7356dcab52646688d98cb00fd8e327e6 to your computer and use it in GitHub Desktop.
Quick installation & configuration for k8s dashboard on Mac
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
cat > /tmp/dashboard-adminuser-1.yaml << EOF | |
apiVersion: v1 | |
kind: ServiceAccount | |
metadata: | |
name: admin-user | |
namespace: kubernetes-dashboard | |
EOF | |
cat > /tmp/dashboard-adminuser-2.yaml << EOF | |
apiVersion: rbac.authorization.k8s.io/v1 | |
kind: ClusterRoleBinding | |
metadata: | |
name: admin-user | |
roleRef: | |
apiGroup: rbac.authorization.k8s.io | |
kind: ClusterRole | |
name: cluster-admin | |
subjects: | |
- kind: ServiceAccount | |
name: admin-user | |
namespace: kubernetes-dashboard | |
EOF | |
kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/v2.0.0/aio/deploy/recommended.yaml | |
kubectl apply -f /tmp/dashboard-adminuser-1.yaml | |
kubectl apply -f /tmp/dashboard-adminuser-2.yaml | |
kubectl -n kubernetes-dashboard describe secret $(kubectl -n kubernetes-dashboard get secret | grep admin-user | awk '{print $1}') | |
kubectl proxy & |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment