Registering remote cluster secrets

A remote cluster secret holds the kubeconfig that the Kiali server uses to read a remote cluster. The Kiali Operator can learn about such secrets in three ways. Choose one of them.

Installing Kiali in a multi-cluster mesh relies on the default, label based auto-detection.

Label based auto-detection

The Operator mounts every secret in the Kiali deployment namespace that carries the kiali.io/multiCluster=true label. The relevant defaults are the following:

spec:
  clustering:
    autodetect_secrets:
      enabled: true
      label: kiali.io/multiCluster=true

Explicit declaration

Set autodetect_secrets.enabled to false and name each secret in the Kiali resource:

spec:
  clustering:
    autodetect_secrets:
      enabled: false
    clusters:
    - name: cluster2
      secret_name: kiali-remote-cluster-secret-cluster2

One combined secret

Place a kubeconfig for every remote cluster in a single secret named kiali-multi-cluster-secret, each under its own key in stringData where the key is the cluster name. Add the kiali.io/kiali-multi-cluster-secret: "true" label so that the Operator restarts the Kiali server automatically whenever the secret changes:

apiVersion: v1
kind: Secret
metadata:
  name: kiali-multi-cluster-secret
  namespace: istio-system
  labels:
    kiali.io/kiali-multi-cluster-secret: "true"
stringData:
  cluster2: |
    # kubeconfig for cluster2
  cluster3: |
    # kubeconfig for cluster3
WARNING

Never apply the kiali.io/kiali-multi-cluster-secret: "true" label to a secret with a different name. The Operator has no permission to read such a secret and errors occur.

If several Kiali servers share a namespace, they all have to use the combined secret. To let each server reach a different set of clusters, do not use the combined secret.