Kubernetes Dashboard on Nutanix Karbon

  • 11 November 2018
  • 8 replies
  • 4981 views

Userlevel 3
Badge +1
With the release of Nutanix Karbon TP, PC 5.9, you may want to deploy some of the traditional addons like Kubernetes Dashboard with Heapster.

This post walks you through the process to successfully deploy the Kubernetes Dashboard addon.

Before you can start with the deployment of the addon you need a working Kubernetes cluster and the kubectl CLI-tool.

The steps to follow are:
  1. Deploy Heapster
  2. Deploy Kubernetes Dashboard
  3. Connect to Kubernetes Dashboard

Deploying Heapster

From Heapster website:

Heapster enables Container Cluster Monitoring and Performance Analysis for Kubernetes (versions v1.0.6 and higher), and platforms which include it.

Heapster is deprecated. Consider using metrics-server and a third party metrics pipeline to gather Prometheus-format metrics instead. See the deprecation timeline for more information on support.

The reason of using Heapster is because:

Currently only Heapster integration is supported with Kubernetes Dashboard, however there are plans to introduce integration framework to Dashboard. It will allow to support and integrate more metric providers as well as additional applications such as Weave Scope or Grafana.

To deploy Heapster, execute following commands:
  • Clone the Heapster GitHub repo
code:
          git clone https://github.com/kubernetes/heapster.git
  • Move to the InfluxDB directory
code:
          cd heapster/deploy/kube-config/influxdb
  • Deploy InfluxDB
code:
          kubectl create -f influxdb.yaml
  • Replace the source value for the heapster.yaml manifest file from --source=kubernetes:https://kubernetes.default with --source=kubernetes.summary_api:''
code:
          command:
- /heapster
- --source=kubernetes.summary_api:''
- --sink=influxdb:http://monitoring-influxdb.kube-system.svc:8086
  • Deploy Heapster
code:
          kubectl create -f heapster.yaml
  • Check Heapster is running
code:
          kubectl get -f heapster.yaml
NAME SECRETS AGE
serviceaccount/heapster 1 50m

NAME DESIRED CURRENT UP-TO-DATE AVAILABLE AGE
deployment.extensions/heapster 1 1 1 1 50m

NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
service/heapster ClusterIP 172.19.173.162 80/TCP 50m




Deploying Kubernetes Dashboard

From Kubernetes Dashboard website:

Kubernetes Dashboard is a general purpose, web-based UI for Kubernetes clusters. It allows users to manage applications running in the cluster and troubleshoot them, as well as manage the cluster itself.

To deploy Dashboard, execute following command:
code:
kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/master/src/deploy/recommended/kubernetes-dashboard.yaml




Connecting to Kubernetes Dashboard

To access Dashboard from your local workstation you must create a secure channel to your Kubernetes cluster. Run the following command:
code:
kubectl proxy




Now access Dashboard at:
code:
http://localhost:8001/api/v1/namespaces/kube-system/services/https:kubernetes-dashboard:/proxy/




If you would like to access the Dashboard without use the proxy, you can use the following URL. Make sure you don't use Chrome because you will get a certificate warning and the Dashboard won't work. I recommend for the Dashboard you use Firefox. Make sure you replace localhost with your Kubernetes Master address.

Now access Dashboard at (credentials: admin / nutanix/4u ):
code:
https:// < master_address > /api/v1/namespaces/kube-system/services/https:kubernetes-dashboard:/proxy/



Congratulations! now you have a Kubernetes Dashboard with Heapster up and running.


8 replies

Userlevel 4
Badge +20
Great work, if your trying to figure out your master ip you can use prism to grab the IP or use kubectl cluster-info
Badge +1
Hi,

How did you enable a username/password for credentials to hit the secure URL for the dashboard. From my testing with the dashboard, it always prompts for a kubeconfig file or token given it only has the concepts of service accounts - I am not able to get it to work to prompt me for a user/password. I didn't deploy Heapster, just the dashboard for the moment. Jut curious if there is something I might be missing. thanks!

-Keith
Userlevel 3
Badge +1
Hi,

How did you enable a username/password for credentials to hit the secure URL for the dashboard. From my testing with the dashboard, it always prompts for a kubeconfig file or token given it only has the concepts of service accounts - I am not able to get it to work to prompt me for a user/password. I didn't deploy Heapster, just the dashboard for the moment. Jut curious if there is something I might be missing. thanks!

-Keith


This is due to changes on the latest version of Kubernetes Dashboard. On this latest version you will need to get the token running the following commands:
  1. kubectl -n kube-system get secret
  2. Look for the kubernetes-dashboard-token
  3. kubectl -n kube-system describe secret kubernetes-dashboard-token-
  4. Copy the token and paste it in the K8s Dashboard website.
Let me know if this works for you.

-Jose Gomez
Badge +1
Thanks Jose,

That did work when I was testing. I thought maybe I was missing something on the user/passwd and I wanted to validate since getting into the dashboard has become locked down with the later versions and RBAC.....was hoping I was missing something to make life easier. Thanks for the quick response and update to the post! I'll continue on with my testing.

Regards,

-Keith
echolaughmk: if you want to use the usename and password provided in your kubeconfig file you need to enable basic auth on the dashboard deployment. use `kubectl edit deployment kubernetes-dashboard -n kube-system` and add `--authentication-mode=basic` to the args for the dashboard container.
Badge +1
Thanks. That had worked previously when I tried it. I initially thought there was a trick I was missing with RBAC since that is preferred in the later versions of K8S, but you are correct if you change the authentication method and remove RBAC from the equation.
Badge +2
code:
url didnot found in chapter 'Deploying Kubernetes Dashboard'

this could work:

kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/v1.10.1/src/deploy/recommended/kubernetes-dashboard.yaml
Badge +1
You can also use latest (beta) version:
https://kubernetes.io/docs/tasks/access-application-cluster/web-ui-dashboard/
create a service account and a cluster role binding
https://github.com/kubernetes/dashboard/wiki/Creating-sample-user
then access the dashboard via:

kubectl proxy

and open
http://localhost:8001/api/v1/namespaces/kubernetes-dashboard/services/https:kubernetes-dashboard:/proxy/

using the token for the dashboard-admin-sa that you get via:

kubectl describe secrets

Regards
Roberto

Reply