kubeswitch
kubeswitch copied to clipboard
Rancher store
Rancher's CLI tool allows you to run rancher cluster kubeconfig <name>
and returns a kubeconfig YAML.
CLI entrypoint is here https://github.com/rancher/cli/blob/7c7f747d32b2fe848d09dd90f95ef82bc9be25db/cmd/cluster.go#L474
That seems to call https://github.com/rancher/rancher/blob/ba4347297ef8984f629650979a1b3a470592f4da/pkg/client/generated/management/v3/zz_generated_cluster.go#L184
Not quite sure which actual URL is called behind that, but I'll look into it (and plan to PR a rancher store provider)
API seems to be POST https://<rancher server>/v3/clusters/<cluster-id>?action=generateKubeconfig
, which returns this json:
{"baseType":"generateKubeConfigOutput","config":"apiVersion: v1\nkind:....\n","type":"generateKubeConfigOutput"}
That would be dope!