kube-dashboard

This commit is contained in:
Nic de Sousa
2020-02-11 23:41:50 +02:00
parent c2e2347bd5
commit 7a351421f1
@@ -13,7 +13,7 @@ kubectl create -f https://raw.githubusercontent.com/kubernetes/dashboard/v2.0.0-
### Dashboard 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. > **Important:** The `admin-user` created in this guide will have administrative privileges in the Dashboard.
Create the following resource manifest files: Create the following resource manifest files:
@@ -23,7 +23,7 @@ apiVersion: v1
kind: ServiceAccount kind: ServiceAccount
metadata: metadata:
name: admin-user name: admin-user
namespace: kube-system namespace: kubernetes-dashboard
``` ```
`dashboard.admin-user-role.yml` `dashboard.admin-user-role.yml`
@@ -39,19 +39,19 @@ roleRef:
subjects: subjects:
- kind: ServiceAccount - kind: ServiceAccount
name: admin-user name: admin-user
namespace: kube-system namespace: kubernetes-dashboard
``` ```
Deploy the `admin-user` configuration: Deploy the `admin-user` configuration:
```bash ```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 ### Obtain the Bearer Token
```bash ```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 ### 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: To access the Dashboard you must create a secure channel to your K3s cluster:
```bash ```bash
kubectl proxy sudo k3s kubectl proxy
``` ```
The Dashboard is now accessible at: 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 The latest Dashboard releases are available from: https://github.com/kubernetes/dashboard/releases/latest
```bash ```bash
kubectl delete ns kubernetes-dashboard sudo k3s kubectl delete ns kubernetes-dashboard
kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/[...] sudo k3s kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/[...]
``` ```
### Deleting the Dashboard and admin-user configuration ### Deleting the Dashboard and admin-user configuration
```bash ```bash
kubectl delete -f https://raw.githubusercontent.com/kubernetes/dashboard/v2.0.0-rc5/aio/deploy/recommended.yaml sudo k3s 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 dashboard.admin-user.yml -f dashboard.admin-user-role.yml
``` ```