Home > Back-end >  Can I access multiple clusters from single k8s dashbaord?
Can I access multiple clusters from single k8s dashbaord?

Time:08-20

I have two servers with k3s setup. I have install k8s-dashboard on server1.

I have setup clustering in server1 i.e. I can access k8s resources of server2 from server1.

kubectl config set-cluster server2 --server=https://{IP_OF_SERVER2}:6443
kubectl config set-context server2 --cluster=server2
kubectl config use-context server2

But I want to access all resources of server2 from k8s dashboard of server1.

Is this possible to do?

CodePudding user response:

First, The Kubernetes dashboard needs to query dashboard-metrics-scraper, so you will need to install that before linking the dashboard UI with scraper.

Second from the code, it does not look like it accept array, but accept string.

# Metrics Scraper sidecar host for dashboard
K8S_DASHBOARD_SIDECAR_HOST=${K8S_DASHBOARD_SIDECAR_HOST:-"http://localhost:8000"}

Scraper sidecar

docker-env

So you will need deploy Metrics Scraper sidecar on the cluster 2 and then you will need to expose the service and might need two instance of the dashboard.

so better to create dashboards on its own cluster.

CodePudding user response:

If you need a single dashboard for all clusters, try Lens IDE

  • Related