How can we use inclusterconfig for multiple clusters?
I tried below code for one cluster
rest.InclusterConfig
Can someone help me with this?
It's not possible to use in cluster config to connect to a cluster which is not the current cluster where the pod is deployed because client-go uses the service account token (valid for the current cluster) mounted inside the pod at the /var/run/secrets/kubernetes.io/serviceaccount
path when the rest.InClusterConfig()
is used.