headlamp-k8s / headlamp

A Kubernetes web UI that is fully-featured, user-friendly and extensible
https://headlamp.dev
Apache License 2.0
2.22k stars 156 forks source link

Incorrectly detected clusters #2454

Open kiemlicz opened 3 days ago

kiemlicz commented 3 days ago

Describe the bug

Contexts are displayed as clusters instead of clusters.

To Reproduce

Steps to reproduce the bug:

  1. Load cluster
  2. Choose file
  3. load file with these contents
    apiVersion: v1
    clusters:
    - cluster:
    certificate-authority-data: blabla
    server: https://address:6443
    name: k3s
    contexts:
    - context:
    cluster: k3s
    namespace: infra-flux
    user: default
    name: flux
    - context:
    cluster: k3s
    namespace: home
    user: default
    name: home
    - context:
    cluster: k3s
    namespace: infra-ingress
    user: default
    name: ingress
    - context:
    cluster: k3s
    namespace: infra-kubevirt
    user: default
    name: kubevirt
    - context:
    cluster: k3s
    namespace: infra-logging
    user: default
    name: logging
    - context:
    cluster: k3s
    namespace: media
    user: default
    name: media
    - context:
    cluster: k3s
    namespace: infra-metallb
    user: default
    name: metallb
    - context:
    cluster: k3s
    namespace: infra-monitoring
    user: default
    name: monitoring
    - context:
    cluster: k3s
    namespace: mosquitto
    user: default
    name: mosquitto
    - context:
    cluster: k3s
    namespace: infra-openebs
    user: default
    name: openebs
    current-context: home
    kind: Config
    preferences: {}
    users:
    - name: default
    user:
    client-certificate-data: blabla=
    client-key-data: blabla=
  4. Each context is displayed as separate cluster whereas there is just a single cluster k3s

Environment (please provide info about your environment):

knrt10 commented 1 day ago

Hi @kiemlicz, thank you for your feedback! In Headlamp, each context is indeed treated as a separate cluster because each one has its own unique identity. While we understand the naming conventions can sometimes be confusing, this is intended behaviour rather than a bug. If you have any further questions or need clarification, feel free to reach out. Thanks

illume commented 1 day ago

Thanks for the feedback @kiemlicz. There is indeed a difference with clusters and contexts in Headlamp, which does lead to confusion IMHO.

I think probably a clear&precise terminology that would work for both people new to k8s and users who know what a context is would be "Cluster Contexts". Although maybe a bit long.

kiemlicz commented 22 hours ago

Thank you for response

I'm not gonna lie: I don't understand your point

I think probably a clear&precise terminology that would work for both people new to k8s and users who know what a context is would be "Cluster Contexts".

If you want to go via UX path - yes, it would be much better but still super confusing.
Basically I need to load single blessed context out of many to load the namespaces either way because you still need to somehow "discover" the cluster

each context is indeed treated as a separate cluster because each one has its own unique identity.

clusters also contain clusters[].name field that must be unique and is precisely what you want to load

clusters:
- cluster:
    certificate-authority-data: blabla
    server: https://address:6443
  name: k3s