Sorting of clusters?
hjacobs opened this issue · 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.
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.
I would really like if clusters would not be strict up to down . Widescreen displays