Minishift Kubernetes Dashboard throw error: services "kubernetes-dashboard" not found

Viewed 483

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 Answers

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

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:

Related