Create GKE clusters for GitOps Manager with Terraform: the Google Cloud
counterpart of eksmanager-bootstrap
and aksmanager-bootstrap.
Then install the core stack on the cluster with
core-stack's install-core-stack.yml.
Open source under the Apache License 2.0. Copyright GitOps Manager, S.L.
Beta: not tested. Written 1 Nov 2026 and never run. The stages were validated and the create script tested locally, before the move to Terraform 1.17.1; nothing has run with Terraform, in GitHub Actions or against Google Cloud. Expect changes, and don't use it for clusters you depend on yet.
Actions -> bootstrap-create-cluster -> Run workflow, with the cluster's
name (clusters/<name>.json). A dry run validates the file and plans stage 1
only.
| Stage | Creates |
|---|---|
1-cluster |
The cluster in your VPC and subnet (VPC-native), private nodes, the control plane's DNS-based endpoint, Workload Identity, no release channel (GitOps Manager upgrades it), and a node service account with only logging, monitoring and image-pull roles |
identity-cnrm |
Config Connector's own identity (terraform/cluster-identities/cnrm): the service account cnrm-<cluster>, its Workload Identity binding for cnrm-system/cnrm-controller-manager-nodepools, node pool calls through a custom role and actAs on the node service account only, gom-* service accounts through a conditioned custom role, and project IAM changes limited to a fixed list of roles. Never deleted or replaced by a run |
2-nodepools |
The bootstrap pool only: one node per zone, the size of the file's general pool, labelled sku=general (Traefik runs on sku=general), Workload Identity metadata, auto-repair on and auto-upgrade off |
3-platform |
StorageClasses default-retain and default (as on EKS and AKS); the cluster file's namespaces; the Argo CD admin password in Secret Manager (<cluster>-argocd-admin-secret); Workload Identity grants (External Secrets may read the shared services project's secrets, external-dns may manage the Cloud DNS zone); Argo CD from core-stack, and its infra project |
Then it records the cluster in clusters/<name>.outputs.json (project,
location, network, DNS endpoint), which core-stack's install reads.
The file's own node_pools are not made by the create. Install the core stack
with install_node_pool_operator on: Config Connector then makes them from the
CD repo, and the bootstrap pool goes
(4-handover, not built yet).
Config Connector's identity changes only through
bootstrap-cluster-identities.yml
(mode create, or update for new grants); a run that would delete or replace
anything is refused.
Each stage is its own state (gs://<bucket>/projects/<project>/clusters/<name>/<stage>/),
so re-running is safe. A cancelled run stops Terraform gracefully instead of
killing it mid-write (scripts/run_terraform_stage.sh).
setup.sh does the first part (the APIs, the state bucket, an Artifact
Registry repository with the runner image copied in) and prints the rest:
the repository variables, and the roles for core-stack's terraform/runners-gcp.
- A VPC and subnet with two secondary ranges, for pods and for services,
and a
/28free for the control plane (network.master_cidr). Today the network is an input, not created here. - A GCS bucket for the state.
- The shared services project's Secret Manager holding
global-cd-repo-secret: the CD repo's GitHub App, as GitOps Manager writes it (a Kubernetes Secret manifest as JSON). - A runner: GitOps Manager's long-job runner on Google Cloud (label
gom-gcp-long, core-stack'sterraform/runners-gcp) by default, acting as its service account. Elsewhere (CREATE_CLUSTER_RUNNER, e.g. GitHub's runners), Workload Identity Federation from this repo to a service account. Either service account needs:- in the cluster's project: Kubernetes Engine Admin, Service Account Admin and Service Account User (the node service account), Project IAM Admin (the node service account's roles, Config Connector's), and Role Administrator (Config Connector's two custom roles per cluster);
- in the shared services project: Secret Manager Admin and Project IAM Admin (External Secrets' grant);
- in the Cloud DNS zone's project: Project IAM Admin (external-dns's grant);
- on the state bucket: Storage Object Admin;
- on a Shared VPC subnet, if the subnet is shared: Compute Network User.
- Repository variables: listed at the top of
.github/workflows/bootstrap-create-cluster.yml. - A GitHub App: the create records
clusters/<cluster>.outputs.jsonthrough a pull request squash-merged at once (gitopsmanager/Auto-Commit-Squash-Merge), as the App. Install one on this repository with Contents and Pull requests read and write, then set the repository variableGOM_APP_CLIENT_IDand the secretGOM_APP_PRIVATE_KEY. With a required review onmain, let the App bypass it.
clusters/example-gce-dev-gke1.json:
name (2-40 characters), project, location (a region for a regional
cluster, or a zone), zone_prefix, dns_zone, kubernetes_version
(major.minor; the newest patch in that location is used), network,
node_pools (one named general is required; count is per zone) and
global_namespaces.
- Writing the secrets (
global-cd-repo-secret, the GitHub App's) into the shared services project: the GUI does it on the SaaS; by hand otherwise. - Creating the VPC, NAT and Cloud DNS zones; Let's Encrypt certificates for the zones.
- The cluster monitor on Google Cloud is core-stack's (
terraform/cluster-monitor-gcp).