kube-ops-view icon indicating copy to clipboard operation
kube-ops-view copied to clipboard

Sorting of clusters?

Open hjacobs opened this issue 5 years ago • 2 comments

From private mail to me:

Hi,

I have just started to use kube-ops-view to monitor Kubernetes clusters and I really like the dashboard and how you can get a single pane of glass of multiple Kubernetes clusters. Great job!

I can't figure out how the clusters are ordered in the dashboard, or what's determining where each cluster are drawn.

I'm not a very experienced developer so I was hoping you could point me in the right direction where I can find out what's determining which order of the clusters are drawn in the dashboard.

Thanks.

hjacobs avatar Mar 30 '19 10:03 hjacobs

When using a kubeconfig file with multiple clusters/contexts defined, it seems like it uses the context name to determine the ordering of the clusters.

I prefixed the context name with numbers to get wanted ordering of how multiple clusters are drawn.

apiVersion: v1
kind: Config
clusters:
  - cluster: 
      server: 'https://dev.example.com'
    name: dev-cluster
  - cluster: 
      server: 'https://qa.example.com'
    name: qa-cluster
  - cluster:
      server: 'https://prod.example.com'
    name: prod-cluster
contexts:
  - context:
      cluster: prod-cluster
      user: ops-view-prod
    name: 1-prod-cluster-context
  - context:
      cluster: qa-cluster
      user: ops-view-qa
    name: 2-qa-cluster-context
  - context: 
      cluster: dev-cluster
      user: ops-view-dev
    name: 3-dev-cluster-context
users:
  - name: ops-view-dev
    user: 
      token: <dev-token>
  - name: ops-view-qa
    user: 
      token: <qa-token>
  - name: ops-view-prod
    user: 
      token: <prod-token>

With this kubeconfig file the prod-cluster is drawn at the top, with qa and dev-cluster underneath.

bendikp avatar Apr 01 '19 06:04 bendikp

I would really like if clusters would not be strict up to down . Widescreen displays

Flowkap avatar Oct 14 '19 08:10 Flowkap