From e865625e020f1401aae05b0bfe2a750d80f2f452 Mon Sep 17 00:00:00 2001 From: Nic de Sousa <15162654+nicdesousa@users.noreply.github.com> Date: Mon, 10 Feb 2020 23:03:25 +0200 Subject: [PATCH 1/5] Dashboard Quick-Start --- .../latest/en/quick-start/dashboard/_index.md | 88 +++++++++++++++++++ 1 file changed, 88 insertions(+) create mode 100644 content/k3s/latest/en/quick-start/dashboard/_index.md diff --git a/content/k3s/latest/en/quick-start/dashboard/_index.md b/content/k3s/latest/en/quick-start/dashboard/_index.md new file mode 100644 index 00000000000..32f26d312f9 --- /dev/null +++ b/content/k3s/latest/en/quick-start/dashboard/_index.md @@ -0,0 +1,88 @@ +--- +title: "Kubernetes Dashboard" +weight: 10 +--- + +This quick-start guide will help you to deploy and configure the [Kubernetes Dashboard](https://kubernetes.io/docs/tasks/access-application-cluster/web-ui-dashboard/) on K3s. + +### Deploying the Kubernetes Dashboard + +```bash +kubectl create -f https://raw.githubusercontent.com/kubernetes/dashboard/v2.0.0-rc5/aio/deploy/recommended.yaml +``` + +### Dashboard admin-user RBAC Configuration + +> **Important:** Granting admin privileges to the Dashboard's Service Account might be a security risk! The admin-user created in this guide will have administrative privileges and is for educational purposes only. + +Create the following resource manifest files: + +`dashboard.admin-user.yml` +```yaml +apiVersion: v1 +kind: ServiceAccount +metadata: + name: admin-user + namespace: kube-system +``` + +`dashboard.admin-user-role.yml` +```yaml +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 +``` + +Deploy the `admin-user` configuration: + +```bash +kubectl create -f dashboard.admin-user.yml -f dashboard.admin-user-role.yml +``` + +### Obtain the Bearer Token + +```bash +kubectl -n kube-system describe secret admin-user-token | grep ^token +``` + +### Local Access to the Dashboard + +Local proxy configuration: + +```bash +kubectl proxy +``` + +The Dashboard is now accessible at: + +* http://localhost:8001/api/v1/namespaces/kubernetes-dashboard/services/https:kubernetes-dashboard:/proxy/ +* `Sign In` with the `admin-user` Bearer Token + +#### Advanced: Remote Access to the Dashboard + +[Port Forwarding](https://kubernetes.io/docs/tasks/access-application-cluster/port-forward-access-application-cluster/) can be used to Access Applications in a Cluster. + +### Upgrading the Dashboard + +The latest Dashboard releases are available from: https://github.com/kubernetes/dashboard/releases/latest + +```bash +kubectl delete ns kubernetes-dashboard +kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/[...] +``` + +### Deleting the Dashboard and admin-user configuration + +```bash +kubectl delete -f https://raw.githubusercontent.com/kubernetes/dashboard/v2.0.0-rc5/aio/deploy/recommended.yaml +kubectl delete -f dashboard.admin-user.yml -f dashboard.admin-user-role.yml +``` From 9910a170c7ad84a756d4baab8ce17301710ec2fa Mon Sep 17 00:00:00 2001 From: Nic de Sousa <15162654+nicdesousa@users.noreply.github.com> Date: Tue, 11 Feb 2020 06:43:33 +0200 Subject: [PATCH 2/5] Update _index.md Cleanup --- content/k3s/latest/en/quick-start/dashboard/_index.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/content/k3s/latest/en/quick-start/dashboard/_index.md b/content/k3s/latest/en/quick-start/dashboard/_index.md index 32f26d312f9..457f55f625f 100644 --- a/content/k3s/latest/en/quick-start/dashboard/_index.md +++ b/content/k3s/latest/en/quick-start/dashboard/_index.md @@ -11,7 +11,7 @@ This quick-start guide will help you to deploy and configure the [Kubernetes Das kubectl create -f https://raw.githubusercontent.com/kubernetes/dashboard/v2.0.0-rc5/aio/deploy/recommended.yaml ``` -### Dashboard admin-user RBAC Configuration +### Dashboard RBAC Configuration > **Important:** Granting admin privileges to the Dashboard's Service Account might be a security risk! The admin-user created in this guide will have administrative privileges and is for educational purposes only. @@ -56,7 +56,7 @@ kubectl -n kube-system describe secret admin-user-token | grep ^token ### Local Access to the Dashboard -Local proxy configuration: +To access the Dashboard you must create a secure channel to your K3s cluster: ```bash kubectl proxy @@ -69,7 +69,7 @@ The Dashboard is now accessible at: #### Advanced: Remote Access to the Dashboard -[Port Forwarding](https://kubernetes.io/docs/tasks/access-application-cluster/port-forward-access-application-cluster/) can be used to Access Applications in a Cluster. +Please see: Using [Port Forwarding](https://kubernetes.io/docs/tasks/access-application-cluster/port-forward-access-application-cluster/) to Access Applications in a Cluster. ### Upgrading the Dashboard From c2e2347bd59893e8ed0067568fdcf72626a24fb3 Mon Sep 17 00:00:00 2001 From: Nic de Sousa <15162654+nicdesousa@users.noreply.github.com> Date: Tue, 11 Feb 2020 22:19:37 +0200 Subject: [PATCH 3/5] kube-dashboard --- .../dashboard => installation/kube-dashboard}/_index.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename content/k3s/latest/en/{quick-start/dashboard => installation/kube-dashboard}/_index.md (92%) diff --git a/content/k3s/latest/en/quick-start/dashboard/_index.md b/content/k3s/latest/en/installation/kube-dashboard/_index.md similarity index 92% rename from content/k3s/latest/en/quick-start/dashboard/_index.md rename to content/k3s/latest/en/installation/kube-dashboard/_index.md index 457f55f625f..5947fc227d8 100644 --- a/content/k3s/latest/en/quick-start/dashboard/_index.md +++ b/content/k3s/latest/en/installation/kube-dashboard/_index.md @@ -1,9 +1,9 @@ --- title: "Kubernetes Dashboard" -weight: 10 +weight: 60 --- -This quick-start guide will help you to deploy and configure the [Kubernetes Dashboard](https://kubernetes.io/docs/tasks/access-application-cluster/web-ui-dashboard/) on K3s. +This installation guide will help you to deploy and configure the [Kubernetes Dashboard](https://kubernetes.io/docs/tasks/access-application-cluster/web-ui-dashboard/) on K3s. ### Deploying the Kubernetes Dashboard From 7a351421f1cb477497bfba7a12a96beb370bf4a3 Mon Sep 17 00:00:00 2001 From: Nic de Sousa <15162654+nicdesousa@users.noreply.github.com> Date: Tue, 11 Feb 2020 23:41:50 +0200 Subject: [PATCH 4/5] kube-dashboard --- .../en/installation/kube-dashboard/_index.md | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/content/k3s/latest/en/installation/kube-dashboard/_index.md b/content/k3s/latest/en/installation/kube-dashboard/_index.md index 5947fc227d8..939e03ad055 100644 --- a/content/k3s/latest/en/installation/kube-dashboard/_index.md +++ b/content/k3s/latest/en/installation/kube-dashboard/_index.md @@ -13,7 +13,7 @@ kubectl create -f https://raw.githubusercontent.com/kubernetes/dashboard/v2.0.0- ### Dashboard RBAC Configuration -> **Important:** Granting admin privileges to the Dashboard's Service Account might be a security risk! The admin-user created in this guide will have administrative privileges and is for educational purposes only. +> **Important:** The `admin-user` created in this guide will have administrative privileges in the Dashboard. Create the following resource manifest files: @@ -23,7 +23,7 @@ apiVersion: v1 kind: ServiceAccount metadata: name: admin-user - namespace: kube-system + namespace: kubernetes-dashboard ``` `dashboard.admin-user-role.yml` @@ -39,19 +39,19 @@ roleRef: subjects: - kind: ServiceAccount name: admin-user - namespace: kube-system + namespace: kubernetes-dashboard ``` Deploy the `admin-user` configuration: ```bash -kubectl create -f dashboard.admin-user.yml -f dashboard.admin-user-role.yml +sudo k3s kubectl create -f dashboard.admin-user.yml -f dashboard.admin-user-role.yml ``` ### Obtain the Bearer Token ```bash -kubectl -n kube-system describe secret admin-user-token | grep ^token +sudo k3s kubectl -n kubernetes-dashboard describe secret admin-user-token | grep ^token ``` ### Local Access to the Dashboard @@ -59,7 +59,7 @@ kubectl -n kube-system describe secret admin-user-token | grep ^token To access the Dashboard you must create a secure channel to your K3s cluster: ```bash -kubectl proxy +sudo k3s kubectl proxy ``` The Dashboard is now accessible at: @@ -76,13 +76,13 @@ Please see: Using [Port Forwarding](https://kubernetes.io/docs/tasks/access-appl The latest Dashboard releases are available from: https://github.com/kubernetes/dashboard/releases/latest ```bash -kubectl delete ns kubernetes-dashboard -kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/[...] +sudo k3s kubectl delete ns kubernetes-dashboard +sudo k3s kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/[...] ``` ### Deleting the Dashboard and admin-user configuration ```bash -kubectl delete -f https://raw.githubusercontent.com/kubernetes/dashboard/v2.0.0-rc5/aio/deploy/recommended.yaml -kubectl delete -f dashboard.admin-user.yml -f dashboard.admin-user-role.yml +sudo k3s kubectl delete -f https://raw.githubusercontent.com/kubernetes/dashboard/v2.0.0-rc5/aio/deploy/recommended.yaml +sudo k3s kubectl delete -f dashboard.admin-user.yml -f dashboard.admin-user-role.yml ``` From 543add46c53983bbdf079c932c1d4fe01120ce1d Mon Sep 17 00:00:00 2001 From: Nic de Sousa <15162654+nicdesousa@users.noreply.github.com> Date: Tue, 11 Feb 2020 23:46:52 +0200 Subject: [PATCH 5/5] kube-dashboard --- content/k3s/latest/en/installation/kube-dashboard/_index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/k3s/latest/en/installation/kube-dashboard/_index.md b/content/k3s/latest/en/installation/kube-dashboard/_index.md index 939e03ad055..ace9931b2e9 100644 --- a/content/k3s/latest/en/installation/kube-dashboard/_index.md +++ b/content/k3s/latest/en/installation/kube-dashboard/_index.md @@ -8,7 +8,7 @@ This installation guide will help you to deploy and configure the [Kubernetes Da ### Deploying the Kubernetes Dashboard ```bash -kubectl create -f https://raw.githubusercontent.com/kubernetes/dashboard/v2.0.0-rc5/aio/deploy/recommended.yaml +sudo k3s kubectl create -f https://raw.githubusercontent.com/kubernetes/dashboard/v2.0.0-rc5/aio/deploy/recommended.yaml ``` ### Dashboard RBAC Configuration