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

Description of kiali_urls. Kiali URL to cluster name mapping. #672

Merged
merged 6 commits into from
Aug 23, 2023

Conversation

hhovsepy
Copy link
Contributor

@hhovsepy hhovsepy commented Aug 7, 2023

@hhovsepy hhovsepy added the requires server PR A PR requires additional changes in the backend code. label Aug 7, 2023
@hhovsepy
Copy link
Contributor Author

hhovsepy commented Aug 7, 2023

Server PR kiali/kiali#6452

crd-docs/crd/kiali.io_kialis.yaml Outdated Show resolved Hide resolved
crd-docs/crd/kiali.io_kialis.yaml Show resolved Hide resolved
jmazzitelli
jmazzitelli previously approved these changes Aug 7, 2023
Copy link
Contributor

@jmazzitelli jmazzitelli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@nrfox
Copy link
Contributor

nrfox commented Aug 10, 2023

Never mind these settings are used by the operator/helm-chart but are not part of the kiali config @hhovsepy can you also remove these settings as they are no longer present in the kiali server config and no longer valid:

                      autodetect_secrets:
                        description: "Settings to allow cluster secrets to be auto-detected. Secrets must exist in the Kiali deployment namespace."
                        type: object
                        properties:
                          enabled:
                            description: "If true then remote cluster secrets will be autodetected during the installation of the Kiali Server Deployment. Any remote cluster secrets found in the Kiali deployment namespace will be mounted to the Kiali Server's file system. If false, you can still manually specify the remote cluster secret information in the 'clusters' setting if you wish to utilize multicluster features."
                            type: boolean
                          label:
                            description: "The name and value of a label that exists on all remote cluster secrets. Default is 'kiali.io/multiCluster=true'."
                            type: string
                      clusters:
                        description: "A list of clusters that the Kiali Server can access. You need to specify the remote clusters here if 'autodetect_secrets.enabled' is false."
                        type: array
                        items:
                          type: object
                          properties:
                            name:
                              description: "The name of the cluster."
                              type: string
                            secret_name:
                              description: "The name of the secret that contains the credentials necessary to connect to the remote cluster. This secret must exist in the Kiali deployment namespace."
                              type: string

@nrfox
Copy link
Contributor

nrfox commented Aug 10, 2023

It looks like they're present in the helm chart as well: https://github.com/kiali/helm-charts/blob/master/kiali-server/values.yaml#L96-L100

@jmazzitelli
Copy link
Contributor

jmazzitelli commented Aug 10, 2023

can you also remove these settings as they are no longer present in the kiali server config and no longer valid

no, these are very important. This is how the operator (and helm charts) sets up the kiali remote cluster secrets. don't remove these :)

- name: Autodetect remote cluster secrets within the Kiali deployment namespace
vars:
all_remote_cluster_secrets: "{{ query(k8s_plugin, namespace=kiali_vars.deployment.namespace, api_version='v1', kind='Secret', label_selector=kiali_vars.kiali_feature_flags.clustering.autodetect_secrets.label) }}"
loop: "{{ all_remote_cluster_secrets }}"
set_fact:
kiali_deployment_remote_cluster_secret_volumes: "{{ kiali_deployment_remote_cluster_secret_volumes | combine({ item.metadata.annotations['kiali.io/cluster']|default(item.metadata.name): {'secret_name': item.metadata.name }}) }}"
when:
- kiali_vars.kiali_feature_flags.clustering.autodetect_secrets.enabled
- name: Prepare the manually declared remote clusters
loop: "{{ kiali_vars.kiali_feature_flags.clustering.clusters }}"
set_fact:
kiali_deployment_remote_cluster_secret_volumes: "{{ kiali_deployment_remote_cluster_secret_volumes | combine({ item.name: {'secret_name': item.secret_name }}) }}"
when:
- kiali_vars.kiali_feature_flags.clustering.clusters | length > 0

{% for sec in kiali_deployment_remote_cluster_secret_volumes %}
- name: {{ sec }}
mountPath: "/kiali-remote-cluster-secrets/{{ kiali_deployment_remote_cluster_secret_volumes[sec].secret_name }}"
readOnly: true
{% endfor %}

@jmazzitelli
Copy link
Contributor

they are no longer present in the kiali server config

We actually don't put them in the Kiali Config object because they aren't used by the server at all - these are one of the few settings that are for the operator (and helm charts) only - i.e. used only for installation. The Server never uses these settings so that is why they aren't in the Config object.

@nrfox
Copy link
Contributor

nrfox commented Aug 10, 2023

We actually don't put them in the Kiali Config object because they aren't used by the server at all - these are one of the few settings that are for the operator (and helm charts) only - i.e. used only for installation. The Server never uses these settings so that is why they aren't in the Config object.

Ah alright that makes sense. I'm always unsure of which configuration on the CR is just for the operator and which is for the kiali config.

@jmazzitelli
Copy link
Contributor

jmazzitelli commented Aug 10, 2023

I'm always unsure of which configuration on the CR is just for the operator and which is for the kiali config.

This is why I try to always make the Config object match the CR - only because its confusing if they don't match ("why is this in the CR but not in the Config object?").

I actually went against my instincts when I did not include these secret/cluster settings in the Config object. I convinced myself it was the right thing to do because these settings are essentially useless to the server - the server should never have a reason to look up their values.

@nrfox
Copy link
Contributor

nrfox commented Aug 10, 2023

This is why I try to always make the Config object match the CR - only because its confusing if they don't match ("why is this in the CR but not in the Config object?").

Well if there's ever a Kiali v2 with some breaking changes, perhaps we can separate the two on the CR. Something like

  spec:
    kialiConfig: ...
    deployment: ...
    otherCRFieldNotRelatedToConfig: ...

@hhovsepy hhovsepy merged commit aaf6af6 into kiali:master Aug 23, 2023
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
requires server PR A PR requires additional changes in the backend code.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants