This repository builds and manages OpenShift Dedicated clusters on Google Cloud. Inputs live in Git, Terraform owns the GCP prerequisites and cluster bootstrap lifecycle, and OpenShift GitOps manages normal in-cluster changes.
catalog/: shared defaults and cluster classesclusters/: one folder per cluster underclusters/<group-path>/<cluster-name>/modules/: factory-facing Terraform modulesgitops/: OpenShift GitOps bootstrap and reusable day-2 applicationsplaybooks/: Ansible Automation Platform examplesscripts/: render, validate, backend, and workflow helper scriptsdocs/: architecture notes and execution guidance
- Write or update
cluster.yaml,gitops.yaml, and any values files underclusters/<group-path>/<cluster-name>/. - Render and validate the effective stack with
scripts/render_effective_config.pyandscripts/validate_stack_inputs.py. - Run Terraform through the workflow helpers rather than writing generated files back into the cluster folder.
- Terraform composes the GCP infrastructure, cluster creation, kubeconfig setup, optional ACM registration, and optional GitOps bootstrap through the new factory path.
- GitOps manages the platform and workload applications after the cluster is ready.
- Optional GCP infrastructure creation through
modules/osd-gcp-infra/ - OpenShift Dedicated cluster creation on GCP through
modules/osd-gcp-core/ - Kubeconfig setup through
modules/osd-gcp-kubeconfig/ - Optional ACM registration and OpenShift GitOps bootstrap through the factory path
modules/osd-gcp-infra/ is optional. If networking is provisioned outside this repo, set infrastructure.create_gcp_resources: false and provide the existing VPC and subnet names in the cluster config.
For the current recommended private OSD on GCP model, also set cluster.private_service_connect_enabled: true and provide network.psc_subnet_name.
The modules/ and clusters/ layout is the operator-facing factory interface.
terraformpython3gcloudocmochelmjq- network access to Red Hat OCM and the target GCP environment
- a GCP project with permission to create or reuse network, IAM, DNS, secret, and cluster resources
- Red Hat pull secret and OCM token stored in Google Secret Manager
- Bastion or admin workstation:
scripts/run_cluster_stack_bastion.sh clusters/dev/gcp-classic-101 plan - Manual bastion apply:
OCP_GCP_FACTORY_ALLOW_APPLY=true scripts/run_cluster_stack_bastion.sh clusters/dev/gcp-classic-101 apply - GitHub Actions:
.github/workflows/factory.yml - Azure Pipelines:
azure-pipelines.yml - AAP:
playbooks/aap/run_cluster_stack.yml
Rendered files, plans, backend config files, and workflow outputs should go under .artifacts/ instead of mixing generated files into source directories.
For remote state, cluster roots declare a gcs backend and the workflow helpers expect backend settings through environment variables such as TF_BACKEND_BUCKET and optional TF_BACKEND_PREFIX.
The tracked files under catalog/ and clusters/ are starter configurations, not production values. Validation now rejects placeholder or empty values for required production inputs such as:
gcp_project_idnetwork.base_dns_domainsecrets.pull_secret_secret_projectsecrets.git_token_secret_projectgitops.repository_url
- Keep GCP-specific networking aligned with OpenShift Dedicated on GCP guidance. Red Hat’s installation docs for GCP networking call out matching
machineNetworkto the preferred subnet CIDR and avoiding overlapping reserved ranges such as172.17.0.0/16. - Treat Workload Identity Federation, project IAM, and GCP network CIDRs as provider-specific inputs layered under the ROSA-style factory structure rather than inventing a separate repo shape.
- For GitOps-managed workloads, this repo now defaults to Kubernetes-to-Google
workload_identity_federationand keeps the static service-account-key path available only throughgitops.gcp_auth.mode: service_account_key. - Use
openshift_versioninx.yform, for example4.18, rather than full patch strings in the Terraform-facing config.