From ced3d154a29341af5cdfb1924c04b78818be352c Mon Sep 17 00:00:00 2001 From: Edward Viaene Date: Sat, 2 Jun 2018 13:56:24 +0000 Subject: [PATCH] dashboard updates --- dashboard/README.md | 30 ++++++++++++++++++++++++++++++ dashboard/sample-user.yaml | 18 ++++++++++++++++++ 2 files changed, 48 insertions(+) create mode 100644 dashboard/README.md create mode 100644 dashboard/sample-user.yaml diff --git a/dashboard/README.md b/dashboard/README.md new file mode 100644 index 0000000..938b128 --- /dev/null +++ b/dashboard/README.md @@ -0,0 +1,30 @@ +# Setting up the dashboard + +## Start dashboard + +Create dashboard: +``` +kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/master/src/deploy/recommended/kubernetes-dashboard.yaml +``` + +## Create user + +Create sample user (if using RBAC - on by default on new installs with kops / kubeadm): +``` +kubectl create -f sample-user.yaml + +``` + +## Get login token: +``` +kubectl -n kube-system get secret | grep admin-user +kubectl -n kube-system describe secret admin-user-token- +``` + +## Login to dashboard +Go to http://api.yourdomain.com:8001/api/v1/namespaces/kube-system/services/https:kubernetes-dashboard:/proxy/#!/login + +Login: admin +Password: the password that is listed in ~/.kube/config (open file in editor and look for "password: ..." + +Choose for login token and enter the login token from the previous step diff --git a/dashboard/sample-user.yaml b/dashboard/sample-user.yaml new file mode 100644 index 0000000..f286676 --- /dev/null +++ b/dashboard/sample-user.yaml @@ -0,0 +1,18 @@ +apiVersion: v1 +kind: ServiceAccount +metadata: + name: admin-user + namespace: kube-system +--- +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