This message was deleted.
# fleet
a
This message was deleted.
s
I personally haven't. If you are though it will be against the fleet local and you will be in some form creating a provisioning/io cluster kind object. Rancher is creating a cluster object as yaml. I have been meaning to explore this but it's not formally documented how to do this
m
Yeah. Automation around provisioning seems poorly documented in general. I think I can't go this route because it's the chances of the cluster YAML changing is too high. Investing into getting it all working with Fleet and then have some change to the YAML definition would make me lose my remaining hair.
s
I have however gone round the terraform route and expected although not yaml it works really well. I have that going off to a pipeline and deploying my cluster
m
There is was a rancher master class that would be applicable. You could use helm cluster templates with fleet together and I think they talked about that in this video

https://www.youtube.com/watch?v=xXtOP7CHbSA

s
This is slightly different. Cluster templates is defining a Web page that you can use to deploy. What we are discussing is deploying a cluster through yaml through fleet
m
Well, actually you can extend the rancher ui with a questions.yaml inside the helm chart to deploy the cluster templates from inside rancher dashboard, but you don't have to. they are just helm charts you can also deploy them through fleet. I have already done this as a PoC and it is definitly possible.
s
Acknowledged through creating cluster templates through fleet. I would like to create a cluster as definition as yaml and send that to rancher to deploy the full cluster, I believe that the op is talking about the same thing . I am currently doing this through terraform. I use the rancher terraform providers and that creates for me a cluster kicked off from the pipeline. My question and what I was answering is can I create a rancher cluster definition in yaml in a repo and send that to perhaps fleet-local which in turn will create the downstream cluster in rancher through fleet? This is different to creating a ui definition of a template through code which I then click my way through. Last time I heard this is not possible l for rke2. It is possible with rke 1
m
So, for the UI method you can also just do it manually with a Helm chart and values file. I do that in an automation pipeline. But the values in the Helm chart are really lacking.... I can't modify the CNI at all for example.
m
The cluster-templates helm charts are unfortunately not complete and you have to/can extend them urself quite a bit, that's what I am doing and afterwards you CAN just put those helmcharts in a repo and add that repo to fleet and deploy to to fleet-default namespace to create new downstream cluster complete with the underlying vms provided you use one of the supported cloud-providers. Than there is no need for terraform. That was exactly what I was trying to say but maybe I wasn't clear enough
for example the cni IS actually changeable but I think in the example cluster-template it was hardcoded in the cluster.yaml and the value was being ignored
and the designing of the UI-Integration is solely base if you have a question.yaml inside your helm chart and if you add the cluster-template to the gitrepos under apps
s
What is involved in extending them? Would be interested to see how you do it. Yours looks like a two step process. Do I need to create a cluster template first then repurpose the resulting template?
My goal is just to define my cluster as yaml with out having to go through a ui. Terraform allows me to do this
🙌 1
m
Yeah I know but I wanted to try it without TF and i works for me. You might look at the repos from @handsome-byte-4849 like here is the question.yaml to extend the ui for the equnix-cluster-template https://github.com/bashofmann/rancher-cluster-templates/blob/main/charts/rancher-equinix-cluster-template/questions.yaml
and here is the real values.yaml which you could also just use with the chart to deploy the whole downstream cluster with helm install -f values.yaml ./. from inside the rancher-equinix-cluster-template folder https://github.com/bashofmann/rancher-cluster-templates/blob/main/charts/rancher-equinix-cluster-template/values.yaml
you dont have to have the template added to the repositories under apps, but IF you do that then the questions.yaml will extend the UI under create cluster but that is just a frontend for modfying the override-values for the underlying helm install operation, which you can just do manually or let fleet handle for you... you just have to deploy the chart into the fleet-default namespace of your rancher cluster
it was a little buggy though and I had to almost rewrite the whole helm charts myself because of hardcoded values and some other problems, but that was also good because that way i could preset some of my cluster settings inside the default values and just use a small set of overrides to actually control my new clusters like node count of CPU/RAM sizing etc
s
That looks interesting. I only use terraform because it didn't seem that there was a way to do it. Would like to explore this route and explore it further. Is there any documentation as to how to create these
I was told by someone who works at rancher that it was no official way to do it. Even through cluster templates.
m
Unfortunatly not really, the best think was I think in the QA Section of the Video I posted and a little inspiration from the repos and a little in the official docs... to be honest the lack of documentation almost killed this approach for us but I just dug in and found out how it worked the hard way
s
Hence I went with terraform. But now that you have done it I would like to try it
Do you have any public repos that you can share?
m
That sounds about right... I would not say it was supported, and some hacking was involved to get the first clusters up and running but since then it is working like a charm
not yet and I am not sure if I can make our work-product public, I will ask my teamlead though
I wouldn't mind helping you directly though if you had some public repo and wanted to get it working, I could chip in
which Cloudprovider you want to go with?
s
At the moment we are using vsphere and azure
I will reach out to you if it is ok . Thank you for the help
m
Sure no problem. I was already thinking about how to spread the knowledge a bit and maybe even get rancherlabs to support/document it a little more. Especially considering that the perferred terraform way of doing this stuff might not be so future proof after the recent license changes
s
I think terraform will be ok. But I would rather follow The way you describe as that is all based in kubernetes