Skip to content

Instantly share code, notes, and snippets.

@fcrespo82
Created November 6, 2020 14:29
Show Gist options
  • Save fcrespo82/03ee36f9c5dccc806fdb6230474936ef to your computer and use it in GitHub Desktop.
Save fcrespo82/03ee36f9c5dccc806fdb6230474936ef to your computer and use it in GitHub Desktop.
Kubernetes - Deploy dashboard, create user and expose it on ingress
kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/v2.0.0/aio/deploy/recommended.yaml
cat <<EOF | kubectl apply -f -
apiVersion: v1
kind: ServiceAccount
metadata:
name: admin-user
namespace: kubernetes-dashboard
EOF
cat <<EOF | kubectl apply -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: kubernetes-dashboard
EOF
kubectl -n kubernetes-dashboard describe secret $(kubectl -n kubernetes-dashboard 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