https://rancher.com/ logo
Title
p

polite-piano-74233

03/21/2023, 2:04 PM
if i have a cluster.yaml (add cluster custom yaml file) how can i apply it via cli in/to rancher?
b

big-hydrogen-97240

03/21/2023, 2:05 PM
kubectl apply -f cluster.yaml
p

polite-piano-74233

03/21/2023, 2:07 PM
the file has no api or kind etc associated with it, would it still kubectl apply?
at least not the way its built with the gui
b

big-hydrogen-97240

03/21/2023, 2:08 PM
From the Rancher GUI?
p

polite-piano-74233

03/21/2023, 2:09 PM
b

big-hydrogen-97240

03/21/2023, 2:09 PM
Oh, that is an RKE cluster. That you cannot apply. I thought you were talking about a cluster.yaml like the ones that do get applied by Rancher.
p

polite-piano-74233

03/21/2023, 2:09 PM
i wish 😞
h

hundreds-evening-84071

03/21/2023, 2:12 PM
Isn't this how we can do for RKE? (maybe I am misunderstanding your question):
rke up --config <path to your cluster.yaml>
b

big-hydrogen-97240

03/21/2023, 2:12 PM
Yes, but that creates a new cluster and doesn't put it in Rancher.
p

polite-piano-74233

03/21/2023, 2:13 PM
^ its the 'put it in rancher' part that i want lol
aka rancher managed not just imported
b

big-hydrogen-97240

03/21/2023, 2:13 PM
I will say that what you are trying to accomplish is possible, but you need the cluster.yaml that Rancher uses. There is also a Rancher terraform provider that can help you accomplish this.
p

polite-piano-74233

03/21/2023, 2:14 PM
ya i might end up just rewriting in terraform
just dont like the idea of maintaining two states (terraform + rancher)
b

big-hydrogen-97240

03/21/2023, 2:16 PM
What I would do: create the cluster that you want to create in Rancher, but before creating it, look at the YAML. There is a button for this in the UI. That is essentially the YAML that you would need to apply. It would take some experimenting to get right, but that is how I would go about it.