Kubernetes : Access dashboard from remote browser

4/9/2019

I have a small Kubernetes cluster that I have built following (mostly) this tuto.

So I have a master and some slaves on Virtual Box CentOS VMs, and I want to access the Kubernetes dashboard from a browser on my host machine.

So I used this file to create my dashboard service, deployment, role binding, ... . And started a proxy as follow :

 kubectl proxy --port=9999 --address=[MASTER_IP_ADDRESS] --accept-hosts="^*
quot;

I then tried to access the dashboard from my browser using the URL : http://[MASTER_IP_ADDRESS]:9999/api/v1/namespaces/kube-system/services/kubernetes-dashboard, but I get the following json displayed :

{
"kind": "Service",
  "apiVersion": "v1",
  "metadata": {
    "name": "kubernetes-dashboard",
    "namespace": "kube-system",
    "selfLink": "/api/v1/namespaces/kube-system/services/kubernetes-dashboard",
    "uid": "a0b1d1bc-5adf-11e9-a89e-080027cef83a",
    "resourceVersion": "569",
    "creationTimestamp": "2019-04-09T15:53:33Z",
    "labels": {
      "k8s-app": "kubernetes-dashboard"
    },
    "annotations": {
      "kubectl.kubernetes.io/last-applied-configuration": "{\"apiVersion\":\"v1\",\"kind\":\"Service\",\"metadata\":{\"annotations\":{},\"labels\":{\"k8s-app\":\"kubernetes-dashboard\"},\"name\":\"kubernetes-dashboard\",\"namespace\":\"kube-system\"},\"spec\":{\"ports\":[{\"port\":443,\"targetPort\":8443}],\"selector\":{\"k8s-app\":\"kubernetes-dashboard\"}}}\n"
    }
  },
  "spec": {
    "ports": [
      {
        "protocol": "TCP",
        "port": 443,
        "targetPort": 8443
      }
    ],
    "selector": {
      "k8s-app": "kubernetes-dashboard"
    },
    "clusterIP": "10.102.168.28",
    "type": "ClusterIP",
    "sessionAffinity": "None"
  },
  "status": {
    "loadBalancer": {

    }
  }
}

How can I access my dashboard ?

Note :

  • When I browse the URL http://192.168.99.20:9999/api/v1/namespaces/kube-system/services/kubernetes-dashboard:/proxy, I get a 503 no endpoints available for service \"kubernetes-dashboard\" error.

EDIT :

After some digging up, I think that the problem is deeper thant just 'I can't access the dashboard'. I created another question with all the informations that you can find here.

-- Nakeuh
kubernetes

0 Answers