2

While trying to connect to kubernetes cluster using kubeconfig file I am getting below mentioned error

Response: {"error":"invalid_request","error_description":"Refresh token is invalid or has already been claimed by another client."}

Following is the sequence of instruction executed

  1. create a clientset using the kubeconfig file
    config, err := clientcmd.BuildConfigFromFlags("", kubeconfig)
    if err != nil {
        return nil, err
    }
    clientset:= kubernetes.NewForConfig(config)
  1. Connect to the namespace
    ns, err := clientset.CoreV1().Namespaces().Get(namespace, metav1.GetOptions{})
    if err != nil {
        log.Println(err)   ///Getting the error at this place
    }
  1. if error, get the latest kubeconfig file

  2. execute from step1

If I restart the server and try running this code, it works. But I need a way to make it work without restarting the servers.

0 Answers0