Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix how-to-retrieve-kubeconfig-from-custom-cluster #279

Open
flrichar opened this issue Jul 26, 2024 · 0 comments
Open

Fix how-to-retrieve-kubeconfig-from-custom-cluster #279

flrichar opened this issue Jul 26, 2024 · 0 comments
Assignees

Comments

@flrichar
Copy link
Contributor

Ian worked out a way to just run the entire thing inside the kubelet container for RKE1, if the customer doesn't have kubelet or jq installed and cannot for some reason, install it.

Also updates it as a secret instead of configmap, adding proper base64 -d as well.

docker exec kubelet bash -c 'kubectl --kubeconfig /etc/kubernetes/ssl/kubecfg-kube-node.yaml get secret -n kube-system full-cluster-state -ojson  | jq -r .data.\"full-cluster-state\" | base64 -d | jq -r .currentState.certificatesBundle.\"kube-admin\".config | sed -e "/^[[:space:]]*server:/ s_:.*_: \"https://127.0.0.1:6443\"_" > kubeconfig.yaml'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants