Configuration as Code

Hello,

Is there a way to manage rancher as code? (Such as YAML or JSON)
Although we have a small number of clusters so far (Only 6), we would like to manage it in Git to control the definitions of each cluster so we can set automatically all the Alarms and define cluster using templates.

Thanks,
Elad

How about using the Rancher Terraform provider.

Iwas looking into this, but it only serve very little options and all the clusters configurations dont exist.

Hallo Elad,

Actually I don’t have a ready to use solution to your question.

But I’m working on a little tool providing infrastructure as code for Rancher 2.X
This tool was started to solve our need to automate deployments in projects and that is the current state of it.
We are planning to enhance it to automate cluster creation and management too, which sound as what you are looking for.

Would you mind to drop us a feature request with your requirements?
You’ll find the tool here: https://github.com/bitgrip/cattlectl

Kind regards
Wulf

use rancher2 provider to standup you cluster. one you get the cluster up you can use kubernetes provider to deploy your assets (pods, services, deployments etc.)

If you use rke then there is a whole yaml syntax for declaring your configuration, so also config as code.

you can add all of these in the RKE config section

We have Rancher running in GKE. I was hoping to maintain Rancher’s resources - Projects, Namespaces within the projects possibly using a helm chart / yaml. Looks like we might have to go towards terraform.