https://rancher.com/ logo
Title
i

incalculable-painting-771

06/25/2022, 2:16 PM
how can I restore the kube_config_cluster.yml if it gets deleted locally? I mean I still have ssh access to the cluster machine ( it is a one node cluster )
b

bulky-sunset-52084

06/26/2022, 6:19 PM
Run this on the node:
kubectl --kubeconfig $(docker inspect kubelet --format '{{ range .Mounts }}{{ if eq .Destination "/etc/kubernetes" }}{{ .Source }}{{ end }}{{ end }}')/ssl/kubecfg-kube-node.yaml get secret -n kube-system kube-admin -o jsonpath={.data.Config} | base64 -d | sed -e "/^[[:space:]]*server:/ s_:.*_: \"<https://127.0.0.1:6443\|https://127.0.0.1:6443\>"_" > kubeconfig_admin.yaml
You'll need jq installed on the node. Hopefully this helps