https://rancher.com/ logo
b

broad-king-3332

09/30/2022, 7:30 PM
Hi, is it possible to regenerate a lost Ranger kubeonfig?
b

bulky-sunset-52084

10/01/2022, 2:27 AM
Are you talking about the kubeconfig for the rancher cluster? This was made by one of the devs for RKE1 https://gist.github.com/superseb/b14ed3b5535f621ad3d2aa6a4cd6443b Rke2 and k3s put the kubeconfig in
/etc/rancher/<k8s distro>/config.yaml
on the control plane nodes
b

broad-king-3332

03/26/2023, 10:14 PM
Sorry for being that late with my answer. So it seems that the kubeconfig ranger-desktop has added to the existing .kubeconfig file is still valid, but it works just some seconds after reboot of ranger
Copy code
kubectl get ns                                                                                                                                        
NAME              STATUS   AGE
default           Active   335d
kube-system       Active   335d
kube-public       Active   335d
kube-node-lease   Active   335d
After some seconds later it will end up in errors:
Copy code
kubectl get ns                                                                                                                                      
Unable to connect to the server: net/http: TLS handshake timeout

kubectl get nodes                                                                                                                                     
Unable to connect to the server: net/http: TLS handshake timeout
Then the second question is still, if I would loose my kubeconfig, how can I get the config related parameter afterwards without doing a
Factory Reset
on Ranger Desktop at last resort. Because this also will break my existing services an installation, right?
8 Views