Best way to use Gitlab, Terraform, Flux and GKE in gitops principle

357 Views Asked by At

I am new to devops and I am wondering, what's the best way to use GKE, Terraform and Gitlab repository for CI/CD. Right now, there are sets of commands used with flux, cert manager, but it's not automated. What are the best practice, tools and whole scheme be used like? Thanks for the answers.

1

There are 1 best solutions below

0
On

In my previous project we've tried quite a few approaches and in the end realised that deployment with Octopus Deploy was the best fit, though partly cause it was used wider across the company, but for deployment with terraform it was also quite good. The main benefit was having the concept of tenants which correspond to each client (in particular Google Cloud project) and for a tenant you can set plenty of variables which mostly going to be used by terraform. Depending on the list of variables having configured each tenant can be a quite tedious task but I guess it's only at the first setup. Then it's much quicker to update it and run actual deployment.

We've also tried GitOps as in having repo per client (GCP project) with those variables and in our deployment scripts just pulling those repos and it's good as well cause it brings all benefits of having specification in source code as in logging and being single source of truth. The main disadvantage though was on any change there merge request should have been opened and it could take quite a while. If in your case it's not neccessary and the pipeline running on the changes to such specs repos is not so long then you can try it, why not.

Another thing you can try is to put variables into Gitlab variables, but it also depends on number of environments you've got, if it's going to keep growing (assuming it is) it probably not a good idea as there's no much visibility over changes and it can be hard to keep track of all those variables.