This sections contains multiple OpenTofu modules used to provision a Google Cloud Platform Project.
- OpenTofu (>= 1.6)
- GCloud CLI (>= 464.0.0)
- A GCP Project
This project contains multiples modules that can be applied indenpendely to provision a GKE cluster.
In a new account, the modules can be deployed in the following order:
- User Access (requires update after the Remote State deployment)
- Remote State
- Network
- GKE
Once a cluster has been provisioned, Argo CD is used to deploy applications into it.
The user access module manages users permissions to the GCP project. To allow a user to execute the GKE terraform, add it to the user-access module.
WARNING: This gives a lot of permission in the account that are not only restricted to the GKE cluster.
The remote state module creates a remote state storage that can be used as a state backend.
The network module create the necessary VPC and DNS Zones that will be used by the GKE clusters.
The GKE module provision one or more GKE clusters.
After the GKE cluster is deployed, you can deploy Argo CD on it and use Applications resources to provision other components. Some componenets that are dependencies for Argo CD to work properly, such as Certificate Manager, will need to be deployed manually first.
kubectl apply -k cluster-config -n kube-system
kubectl apply -k cert-manager -n cert-manager
kubectl apply -k argocd -n argocd
// If the apply for argocd fails, run it again. It might fail the first time due to missing CRDs
// Before applying the Applications, you might need to update the repoURL and targetRevision
// if you are working on custom branch
kubectl apply -k argoproj -n argocd