From 2b9855ffa9031844a7b66c7c8e74f26392e40eef Mon Sep 17 00:00:00 2001 From: Nic de Sousa <15162654+nicdesousa@users.noreply.github.com> Date: Wed, 12 Feb 2020 19:51:39 +0200 Subject: [PATCH 1/2] Dashboard version Introduce environment variables to control the Dashboard version. Defaults to the latest release. --- .../en/installation/kube-dashboard/_index.md | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/content/k3s/latest/en/installation/kube-dashboard/_index.md b/content/k3s/latest/en/installation/kube-dashboard/_index.md index ace9931b2e9..9852520a6ff 100644 --- a/content/k3s/latest/en/installation/kube-dashboard/_index.md +++ b/content/k3s/latest/en/installation/kube-dashboard/_index.md @@ -8,7 +8,9 @@ This installation guide will help you to deploy and configure the [Kubernetes Da ### Deploying the Kubernetes Dashboard ```bash -sudo k3s kubectl create -f https://raw.githubusercontent.com/kubernetes/dashboard/v2.0.0-rc5/aio/deploy/recommended.yaml +GITHUB_URL=https://github.com/kubernetes/dashboard/releases +VERSION_KUBE_DASHBOARD=$(curl -w '%{url_effective}' -I -L -s -S ${GITHUB_URL}/latest -o /dev/null | sed -e 's|.*/||') +sudo k3s kubectl create -f https://raw.githubusercontent.com/kubernetes/dashboard/${VERSION_KUBE_DASHBOARD}/aio/deploy/recommended.yaml ``` ### Dashboard RBAC Configuration @@ -69,20 +71,19 @@ The Dashboard is now accessible at: #### Advanced: Remote Access to the Dashboard -Please see: Using [Port Forwarding](https://kubernetes.io/docs/tasks/access-application-cluster/port-forward-access-application-cluster/) to Access Applications in a Cluster. +Please see the Dashboard documentation: 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 -The latest Dashboard releases are available from: https://github.com/kubernetes/dashboard/releases/latest - ```bash sudo k3s kubectl delete ns kubernetes-dashboard -sudo k3s kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/[...] +GITHUB_URL=https://github.com/kubernetes/dashboard/releases +VERSION_KUBE_DASHBOARD=$(curl -w '%{url_effective}' -I -L -s -S ${GITHUB_URL}/latest -o /dev/null | sed -e 's|.*/||') +sudo k3s kubectl create -f https://raw.githubusercontent.com/kubernetes/dashboard/${VERSION_KUBE_DASHBOARD}/aio/deploy/recommended.yaml -f dashboard.admin-user.yml -f dashboard.admin-user-role.yml ``` ### Deleting the Dashboard and admin-user configuration ```bash -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 +sudo k3s kubectl delete ns kubernetes-dashboard ``` From 6f259e72798c3d9d9838e95b84279c2ce72d895c Mon Sep 17 00:00:00 2001 From: Nic de Sousa <15162654+nicdesousa@users.noreply.github.com> Date: Thu, 13 Feb 2020 07:21:58 +0200 Subject: [PATCH 2/2] Kubectl apply Co-Authored-By: Erik Wilson --- 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 9852520a6ff..127770e858c 100644 --- a/content/k3s/latest/en/installation/kube-dashboard/_index.md +++ b/content/k3s/latest/en/installation/kube-dashboard/_index.md @@ -79,7 +79,7 @@ Please see the Dashboard documentation: Using [Port Forwarding](https://kubernet sudo k3s kubectl delete ns kubernetes-dashboard GITHUB_URL=https://github.com/kubernetes/dashboard/releases VERSION_KUBE_DASHBOARD=$(curl -w '%{url_effective}' -I -L -s -S ${GITHUB_URL}/latest -o /dev/null | sed -e 's|.*/||') -sudo k3s kubectl create -f https://raw.githubusercontent.com/kubernetes/dashboard/${VERSION_KUBE_DASHBOARD}/aio/deploy/recommended.yaml -f dashboard.admin-user.yml -f dashboard.admin-user-role.yml +sudo k3s kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/${VERSION_KUBE_DASHBOARD}/aio/deploy/recommended.yaml -f dashboard.admin-user.yml -f dashboard.admin-user-role.yml ``` ### Deleting the Dashboard and admin-user configuration