Home > Software engineering >  How to get the current context name using Kubernetes client
How to get the current context name using Kubernetes client

Time:05-27

I'm trying to access the current cluster name by getting the current context name. So I wanted to know how to get the current context name using client provided by: "sigs.k8s.io/controller-runtime/pkg/client"

CodePudding user response:

The cluster name output by the kubectl cluster-info command is only stored in the local kubeconfig file, it is not part of an API. So, you can not get the cluster name by using the client.

  • Related