https://rancher.com/ logo
Title
h

hundreds-evening-84071

03/20/2023, 2:34 PM
hello all, I have a kubectl question - not necessarily rancher question... but more a reference with rancher. In Rancher UI Cluster Management we can click on the 3 vertical dots and there is an option to download yaml. Is there a way to do this (get cluster yaml) from command line via kubectl or another way?
2nd last option of Download YAML - is what I am looking for but from command line:
b

bulky-sunset-52084

03/20/2023, 4:58 PM
kubectl get <resource> -n <namespace> <resource name> -o yaml > my_manifest.yaml
is that what you were looking for?
h

hundreds-evening-84071

03/20/2023, 5:02 PM
I am looking for whole cluster... For example, in Rancher UI, we can edit cluster via YAML, is there a way to do that from kubectl ?
b

bulky-sunset-52084

03/20/2023, 5:03 PM
ooh the cluster manifest yea there should be a CRD in the local cluster that contains the manifests for all the downstream clusters
on sec let me find the CRD
kubectl get <http://clusters.provisioning.cattle.io|clusters.provisioning.cattle.io> -A
will get you the list
kubectl get <http://clusters.provisioning.cattle.io|clusters.provisioning.cattle.io> -n <namespace> <cluster name> -o yaml
will get you the yaml
👍 1
h

hundreds-evening-84071

03/20/2023, 5:11 PM
Thank you!!!
p

polite-piano-74233

03/20/2023, 5:26 PM
+1 thanks been looking forever for this!