# Integrate k0smotron with CI/CD

**URL:** https://forums.k8slens.dev/t/integrate-k0smotron-with-ci-cd/3515
**Category:** k0smotron
**Created:** [August 15, 2024, 12:13pm UTC](https://forums.k8slens.dev/t/integrate-k0smotron-with-ci-cd/3515 "2024-08-15T12:13:34Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![yurkanice2134](https://forums.k8slens.dev/letter_avatar_proxy/v4/letter/y/a183cd/32.png) [@yurkanice2134](https://forums.k8slens.dev/u/yurkanice2134)
#### Post date: [August 15, 2024, 12:13pm UTC](https://forums.k8slens.dev/t/integrate-k0smotron-with-ci-cd/3515/1 "2024-08-15T12:13:34Z")

</div>

Hello, dear visitors of my topic. I am junior devops with different task for my level of qualification.

I need help with the concept of how to integrate k0smotron with ci/cd.

Idea: automate creation, management, deletion of clusters with k0smotron CRDs and ci/cd.

I created cluster for ci/cd:

- apiVersion: [k0smotron.io/v1beta1](http://k0smotron.io/v1beta1)  
kind: Cluster  
metadata:  
name: ci-cd-cluster  
spec:  
ci-cd settings

And added job ci/cd for specific cluster:  
jobs:

- name: Deploy-to-Kubernetes  
uses: my-repo/kube-deploy-action@v1  
with:  
cluster: ci-cd-cluster  
namespace: production  
manifests: ./k8s

But, I need to build complex system which will take variables as name of cluster, specs and so on. Of course, we can specify all specs in one ci/cd variable of gitlab ci/cd, but is there better solution?  
How to do it? I don’t ask for full solution, just a direction, hints where to go and what to consider about

---

<div class="post-metadata">

### Author: ![jnummelin](https://forums.k8slens.dev/letter_avatar_proxy/v4/letter/j/c5a1d2/32.png) [@jnummelin](https://forums.k8slens.dev/u/jnummelin)
#### Post date: [August 21, 2024, 10:33am UTC](https://forums.k8slens.dev/t/integrate-k0smotron-with-ci-cd/3515/2 "2024-08-21T10:33:09Z")

</div>

Ok, so you have few options.

The first one that comes to my mind is to template all the needed things as a Helm chart. This way you can use variables for different clusters to get the job done.

One other option, depending if you use ClusterAPI or not, is to utilize ClusterAPI [ClusterClass](https://cluster-api.sigs.k8s.io/tasks/experimental-features/cluster-class/). With ClusterClass you can also “template”, not in the same way as with Helm, and use variables for various needs.
