How to set context when inCluster case ?
TimeXZone-ccp opened this issue · 3 comments
#2407
I found the issue, but it seems there is no further solution provided.
Can you share more details about your scenario?
I'm fairly positive that there is only one context in the default in cluster configuration.
If you are loading your own kubeconfig file into your Pod in the cluster, you should use one of the other helper methods to create the client.
At the end of the day ClientBuilder.cluster()
is just a helper method, so you can always look at the implementation and build a new method that meets your use case.
Thanks for replying.The problem I am currently facing is that I have two Kubernetes clusters located in different regions. My microservices are deployed in one of the clusters, and I need to run the kubectl describe
command to retrieve information about the other cluster. Does this mean I have to create my own kubeconfig to manage the connection between the two clusters?