# Can I tear down and build Jenkins Cluster as Infrastructure as Code?

I would like to have a Jenkins cluster configuration (with all plugin details &amp; more) checked into git as code and a click of button should bring up the cluster. What are the options?

##### Post Metadata
- Posted at: almost 7 years ago
- Author title: Staff DevOps, Site Reliability Engineer at 247.ai
- Net upvotes: 1


## Comments
### Comment 1

Yes it is completely possible. There are several ways to do it.  My recommended way is to install CloudBees Jenkins core in a kubernetes cluster. The alternatives are to use a combination of terraform and packer to configure the infrastructure and build a VM image for deployment.  Once an image is created with packer and configured the way you like using the jenkins cli (https://medium.com/@shahmaulikn/install-jenkins-plugins-using-command-line-interface-8df0d0eed349)  you can deploy and further configure the cluster with terraform and chef.

##### Comment Metadata
- Posted at: over 6 years ago
- Author title: DevOps/SRE at Loanpal



### Comment 2

I think you can do it via tools like Chef / puppet,  but building full cluster from the scratch may take significant time. Another option can be to dockerize the full solution.    Option 3 can be keeping the Jenkins Server up all the time and load Slaves on demand (provide by clouds like Docker / Kubernetes / AWS etc. )

##### Comment Metadata
- Posted at: almost 7 years ago
- Author title: Lead Consultant (DevOps) at Infosys




## Related Product
[CloudBees](https://www.g2.com/products/cloudbees/reviews)

## Related Category
[Continuous Integration](https://www.g2.com/categories/continuous-integration)

## Related discussions
- [How well does Trello scale into a larger team?](https://www.g2.com/discussions/1-how-well-does-trello-scale-into-a-larger-team)
  - Posted at: about 13 years ago
  - Comments: 6
- [Can we please add a new section](https://www.g2.com/discussions/2-can-we-please-add-a-new-section)
  - Posted at: about 13 years ago
  - Comments: 0
- [Quantifiable benefits from implementing your CRM](https://www.g2.com/discussions/quantifiable-benefits-from-implementing-your-crm)
  - Posted at: about 13 years ago
  - Comments: 4


