Skip to content

Instantly share code, notes, and snippets.

@arsham
Last active February 18, 2019 17:11
Show Gist options
  • Save arsham/8a63b634083234613110796f345aedfd to your computer and use it in GitHub Desktop.
Save arsham/8a63b634083234613110796f345aedfd to your computer and use it in GitHub Desktop.
Install and access #kubernetes #dashboard

Install

kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/v1.10.1/src/deploy/recommended/kubernetes-dashboard.yaml

Access

kubectl proxy

Then browse to:

http://localhost:8001/api/v1/namespaces/kube-system/services/https:kubernetes-dashboard:/proxy/

Token

cat <<EOF | kubectl create -f -
    apiVersion: v1
    kind: ServiceAccount
    metadata:
      name: admin-user
      namespace: kube-system
EOF

cat <<EOF | kubectl create -f -
    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: kube-system
EOF

kubectl -n kube-system describe secret $(kubectl -n kube-system get secret | grep admin-user | awk '{print $1}')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment