kubeswitch icon indicating copy to clipboard operation
kubeswitch copied to clipboard

Rancher store

Open BeryJu opened this issue 2 years ago • 2 comments

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)

BeryJu avatar Sep 23 '21 11:09 BeryJu

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"}

BeryJu avatar Sep 23 '21 11:09 BeryJu

That would be dope!

danielfoehrKn avatar Sep 24 '21 09:09 danielfoehrKn