# Configuration as Code

**URL:** <https://forums.suse.com/t/configuration-as-code/13530>\
**Category:** SUSE Rancher Prime\
**Created:** [March 4, 2019, 2:54pm UTC](https://forums.suse.com/t/configuration-as-code/13530 "2019-03-04T14:54:01Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![ekirmayer](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/ekirmayer/32/4780_2.png) [@ekirmayer](https://forums.suse.com/u/ekirmayer)\
**Post date:** [March 4, 2019, 2:54pm UTC](https://forums.suse.com/t/configuration-as-code/13530/1 "2019-03-04T14:54:01Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Fraser\_Goffin](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/fraser_goffin/32/6608_2.png) [@Fraser\_Goffin](https://forums.suse.com/u/Fraser_Goffin)\
**Post date:** [March 8, 2019, 10:36pm UTC](https://forums.suse.com/t/configuration-as-code/13530/2 "2019-03-08T22:36:49Z")

</div>

How about using the Rancher Terraform provider.

---

<div class="post-metadata">

**Author:** ![ekirmayer](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/ekirmayer/32/4780_2.png) [@ekirmayer](https://forums.suse.com/u/ekirmayer)\
**Post date:** [March 9, 2019, 7:23am UTC](https://forums.suse.com/t/configuration-as-code/13530/3 "2019-03-09T07:23:50Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![wt.schreiter](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/wt.schreiter/32/4907_2.png) [@wt.schreiter](https://forums.suse.com/u/wt.schreiter)\
**Post date:** [March 16, 2019, 6:46am UTC](https://forums.suse.com/t/configuration-as-code/13530/4 "2019-03-16T06:46:27Z")

</div>

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](https://github.com/bitgrip/cattlectl)

Kind regards  
Wulf

---

<div class="post-metadata">

**Author:** ![bkalai](https://avatars.discourse-cdn.com/v4/letter/b/76d3ee/32.png) [@bkalai](https://forums.suse.com/u/bkalai)\
**Post date:** [October 31, 2019, 10:47pm UTC](https://forums.suse.com/t/configuration-as-code/13530/5 "2019-10-31T22:47:40Z")

</div>

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.)

---

<div class="post-metadata">

**Author:** ![Fraser\_Goffin](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/fraser_goffin/32/6608_2.png) [@Fraser\_Goffin](https://forums.suse.com/u/Fraser_Goffin)\
**Post date:** [November 5, 2019, 9:23pm UTC](https://forums.suse.com/t/configuration-as-code/13530/6 "2019-11-05T21:23:22Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![bkalai](https://avatars.discourse-cdn.com/v4/letter/b/76d3ee/32.png) [@bkalai](https://forums.suse.com/u/bkalai)\
**Post date:** [November 12, 2019, 8:55pm UTC](https://forums.suse.com/t/configuration-as-code/13530/7 "2019-11-12T20:55:40Z")

</div>

you can add all of these in the RKE config section

---

<div class="post-metadata">

**Author:** ![pramodsetlur](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/pramodsetlur/32/9595_2.png) [@pramodsetlur](https://forums.suse.com/u/pramodsetlur)\
**Post date:** [March 16, 2023, 5:22pm UTC](https://forums.suse.com/t/configuration-as-code/13530/8 "2023-03-16T17:22:53Z")

</div>

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.
