Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Multi-cluster] Some pages are broken when meshID is not set #6249

Closed
nrfox opened this issue Jun 8, 2023 · 6 comments · Fixed by #6279
Closed

[Multi-cluster] Some pages are broken when meshID is not set #6249

nrfox opened this issue Jun 8, 2023 · 6 comments · Fixed by #6279
Assignees
Labels
backlog Triaged Issue added to backlog bug Something isn't working

Comments

@nrfox
Copy link
Contributor

nrfox commented Jun 8, 2023

When the meshID is not set, the istio api does not populate the clusters field on the /config response. The frontend looks for this clusters field to determine whether or not Kiali is in "multi-cluster mode".

@nrfox nrfox added bug Something isn't working backlog Triaged Issue added to backlog labels Jun 8, 2023
@jshaughn
Copy link
Collaborator

jshaughn commented Jun 8, 2023

if meshID is not set does it have some default value or is it simply unset? IIrc it's just unset and so clusters would not be returned and I think Istio is assuming a single cluster, and I guess we should as well?

@nrfox
Copy link
Contributor Author

nrfox commented Jun 8, 2023

if meshID is not set does it have some default value or is it simply unset?

At least in the env I tested in and where Kiali is reading this in the default config, it is unset.

kiali/business/mesh.go

Lines 173 to 181 in ecd24d3

meshConfig := meshIdConfig{}
err = yaml.Unmarshal([]byte(meshConfigYaml), &meshConfig)
if err != nil {
return false, err
}
if len(meshConfig.DefaultConfig.MeshId) > 0 {
isMeshConfigured = true
}

Yeah I think the clusters field was populated based on "best effort" but for better or worse some parts of Kiali use that field like if clusters > 1: do MC things else do single cluster things. This is used on the frontend to hide the cluster column for example and I think it's used on the backend too. When the clusters field is empty or == 1 then kiali assumes singlecluster. The cache, on the other hand, does not look at this clusters field and correctly starts talking to the remote clusters when there's a remote secret added.

@jmazzitelli
Copy link
Collaborator

Right - that MeshID istio config is the key to turning on the Mesh page/left-hand-menu item.

@jshaughn
Copy link
Collaborator

jshaughn commented Jun 8, 2023

This is a little confusing, is meshID required for Istio itself to be MC? If so then it seems that we should honor what it tells us in /config. It would be a little strange that Kiali would assume MC, based on secrets, when Istio itself doesn't think it's MC.

@nrfox
Copy link
Contributor Author

nrfox commented Jun 9, 2023

This is a little confusing, is meshID required for Istio itself to be MC? If so then it seems that we should honor what it tells us in /config. It would be a little strange that Kiali would assume MC, based on secrets, when Istio itself doesn't think it's MC.

I think it's only required if you have multiple meshes and want to distinguish between them. It also may be emitted by telemetry for these purposes. In other words, I don't think setting the meshID enables MC in istio.

@jshaughn
Copy link
Collaborator

jshaughn commented Jun 9, 2023

I think meshID may actually be injected into the telemetry for cross-mesh traffic (I think there is a default value related to the trust domain), although Kiali does not handle cross-mesh at this time.

Anyway, it sounds like we need to trust our secrets and report the clusters that way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backlog Triaged Issue added to backlog bug Something isn't working
Projects
Development

Successfully merging a pull request may close this issue.

3 participants