Run Two Kubernetes Dashboards Simultaneously

5/15/2019

Is it possible to run two Kubernetes dashboard's locally within two different shells? I want to view two different cluster's at the same time, however, I run into an issue with the dashboard's port.

  1. Open Dashboard on 1st cluster
  2. Open new shell and switch context to 2nd cluster
  3. Open Dashboard on 2nd cluster

I created the first dashboard like so:

$ kubectl -n kube-system describe secret $(kubectl -n kube-system get secret | grep admin-user | awk '{print $1}')
$ kubectl proxy
Starting to serve on 127.0.0.1:8001

I opened a new shell and changed context to the new cluster receiving the error:

$ listen tcp 127.0.0.1:8001: bind: address already in use

I understand why this is happening, however I'm not sure how to mitigate this problem.

Furthermore, when I change the port to 8002 for the second cluster's dashboard I'm unable to view both pages live without one rendering an Internal Server Error (500): square/go-jose: error in cryptographic primitive

I have switched to incognito, adding a Chrome configuration to erase/ignore browser cookies from localhost:8001 and localhost:8002, however when I go to login I receive the following error in the Chrome console:

Possibly unhandled rejection: {  
"data":"MSG_LOGIN_UNAUTHORIZED_ERROR\n",
"status":401,
"config":{  
  "method":"GET",
  "transformRequest":[  
     null
  ],
  "transformResponse":[  
     null
  ],
  "jsonpCallbackParam":"callback",
  "url":"api/v1/rbac/status",
  "headers":{  
     "Accept":"application/json, text/plain, */*"
  }
},
  "statusText":"Unauthorized",
  "xhrStatus":"complete",
  "resource":{  

  }
}
-- Baily
google-kubernetes-engine
kubernetes
kubernetes-pod

1 Answer

5/15/2019

The problem originates from the kubectl-proxy. The first one is using port 8001 and a port can be used only once. You can start your second kubectl on a different port

kubectl proxy --port=8002

You need to point your browser to the different port to access the other dashboard, of course.

-- Thomas
Source: StackOverflow