1
votes

I am attempting to monitor the performance of my pods within MiniShift and tried to implement the Kubernetes Dashboard (https://github.com/kubernetes/dashboard) following all instructions.

It creates the Kubernetes-Dashboard project (separate from the NodeJs project I am attempting to monitor) and when I run kubectl proxy and access the URL (http://localhost:8001/api/v1/namespaces/kubernetes-dashboard/services/https:kubernetes-dashboard:/proxy/) it gives the following error.

{
  "kind": "Status",
  "apiVersion": "v1",
  "metadata": {

  },
  "status": "Failure",
  "message": "services \"kubernetes-dashboard\" not found",
  "reason": "NotFound",
  "details": {
    "name": "kubernetes-dashboard",
    "kind": "services"
  },
  "code": 404
}
2
You don't have to implement and deploy the dashboard like that. Did you try to use minishift console command? - acid_fuji
I agree with @acid_fuji above, the OpenShift Web Console should contain all the information you need. Do you have a specific issue preventing you from using using the included Console? - Simon
The Minishift dashboard/console doesn't provide monitoring metrics (CPU, Memory usage etc..). I have now attempted to deploy the same application on MiniKube rather than MiniShift so that I can use the Kubernetes Dashboard tool. Currently facing an issue deploying & accessing the service URL - SherazS
@SherazS I`m little bit confused now, are we talking about minishift or minikube here? With minikube you are not deploying the dashboard but running it in bit similar way to minishift, using 'minikube dashboard'. - acid_fuji

2 Answers

0
votes

As described by acid_fuji, you can enable kubernetes dashboard via minikube addons:

minikube addons list
minikube addons enable dashboard

# in addition to get information about CPU/memory/usage please enable metrics-server

minikube addons enable metrics-server 

  • If you are trying to install manually dashboard please refer to the docs

1. Apply manifest by running:

kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/v2.0.0/aio/deploy/recommended.yaml

2. Make sure that your deployment, service and corresponding endpoints were deployed by running:

kubectl get all -n kubernetes-dashboard

3. create Service Account/ClusterRoleBinding and obtain Bearer Token to access kubernetes dashboard:

Note:

IMPORTANT: Make sure that you know what you are doing before proceeding. Granting admin privileges to Dashboard's Service Account might be a security risk

apiVersion: v1
kind: ServiceAccount
metadata:
  name: admin-user
  namespace: kubernetes-dashboard

---
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: kubernetes-dashboard

Getting a Bearer Token:

kubectl -n kubernetes-dashboard describe secret $(kubectl -n kubernetes-dashboard get secret | grep admin-user | awk '{print $1}')

4. Addditional resources:

1
votes

If you attempt to use dashboard in minikube the situation is similar to the minishift. You don't deploy the dashboard since minikube has integrated support for the dashboard.

To access the dashboard you use this command:

minikube dashboard

This will enable the dashboard add-on, and open the proxy in the default web browser. If you want just the simple url here is the dashboard command can also simply emit a URL:

minikube dashboard --url

Coming back to minishift you might want to check out the minishift add-ons and it's kubernetes dashboard add-on