Last active
November 3, 2023 23:46
-
-
Save bikram20/4f4dbbaf5fcc874d5daee2e3b780d919 to your computer and use it in GitHub Desktop.
Self-install kubernetes dashboard on DOKS using helm3
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Requires that you have helm3 installed on your local machine and cluster is accessible (kubeconfig). | |
# You do NOT need the following instructions, if you are comfortable using helm!! | |
# Reference: https://github.com/kubernetes/dashboard/releases/tag/v3.0.0-alpha0 | |
# Helm Instructions: https://artifacthub.io/packages/helm/k8s-dashboard/kubernetes-dashboard | |
# Dashboard 3.0 alpha version is supported on k8s 1.27 only. However we will go ahead and install on 1.28. | |
# Verify your DOKS k8s version | |
(bash) ~ kubectl version --short | |
Flag --short has been deprecated, and will be removed in the future. The --short output will become the default. | |
Client Version: v1.27.2 | |
Kustomize Version: v5.0.1 | |
Server Version: v1.28.2 | |
(bash) ~ | |
(bash) ~ helm repo add kubernetes-dashboard https://kubernetes.github.io/dashboard/ | |
(bash) ~ helm upgrade --install kubernetes-dashboard kubernetes-dashboard/kubernetes-dashboard --create-namespace --namespace kubernetes-dashboard --set app.ingress.enabled=false --set metrics-server.enabled=false --set cert-manager.enabled=false --set nginx.enabled=false | |
# Now do the port-forwarding to your local machine, so you can access the dashboard from your local browser | |
(bash) ~ export POD_NAME=$(kubectl get pods -n kubernetes-dashboard -l "app.kubernetes.io/name=kubernetes-dashboard,app.kubernetes.io/instance=kubernetes-dashboard" -o jsonpath="{.items[0].metadata.name}") | |
(bash) ~ echo $POD_NAME | |
kubernetes-dashboard-65f476df89-886k8 | |
(bash) ~ kubectl -n kubernetes-dashboard port-forward $POD_NAME 8443:8443 | |
# Kubernetes Dashboard URL on your local machine: https://127.0.0.1:8443/ | |
# At this point, we can connect to dashboard from our local browser. There will be a certificate warning, so make sure to override that. | |
# When connecting to dashboard, it will require the kubernetes auth credentials for your cluster. Make sure to download the kubernetes configuration file for your cluster from DOKS cloud console. | |
# The dashboard installed does not have a public endpoint. If you need one, then you will need to install nginx, cert-manager and configure the values.yaml file as part of installation | |
############################ | |
# If you want to reinstall the dashboard with updated configuration of your choice, do the following. | |
# Download the package details | |
(bash) ~ helm repo update | |
(bash) ~ helm search repo kubernetes-dashboard | |
(bash) ~ helm pull kubernetes-dashboard/kubernetes-dashboard --untar | |
# The above command should download the package and keep in kubernetes-dashboard folder in the current directory. Update the values.yaml to your choice. Then do a helm upgrade. | |
# Note that the values.yaml file retrieved here does not seem to have cert-manager configuration! You may like to retrieve the latest values.yaml from https://artifacthub.io/packages/helm/k8s-dashboard/kubernetes-dashboard (look for default values in the right menu). | |
(bash) ~ helm ls | |
(bash) ~ helm upgrade --install kubernetes-dashboard kubernetes-dashboard/kubernetes-dashboard --create-namespace --namespace kubernetes-dashboard | |
# The above should have your dashboard upgraded with new configurations from values.yaml | |
# If you want to remove the helm chart, use helm uninstall | |
(bash) ~ helm uninstall kubernetes-dashboard -n kubernetes-dashboard | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment