Integrate k0smotron with CI/CD

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:

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

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. With ClusterClass you can also “template”, not in the same way as with Helm, and use variables for various needs.