Repolode
terraform-google-modules

terraform-google-modules/terraform-google-kubernetes-engine

Terraform module that provisions opinionated Google Kubernetes Engine (GKE) clusters with node pools, network policy and IP masquerade configuration.

Stars
1,287
Forks
1,293
Open issues
73
Last commit
yesterday

What is it?

This Terraform module creates and configures Google Kubernetes Engine clusters on Google Cloud Platform with a set of opinionated defaults. It provisions the cluster with the requested addons, creates one or more node pools and attaches them to the cluster, and can enable network policy, replace the default kube-dns configmap for stub domains, and install an ip-masq-agent configmap for non-masquerade CIDRs.

The module exposes a large input surface covering node pool sizing, machine types, spot and preemptible instances, GPUs, OAuth scopes, labels, taints, network tags, autoscaling, maintenance windows, Workload Identity, logging and monitoring, and shared VPC settings. Sub modules are included for private clusters and for clusters that use GKE beta features. Terraform 1.3 or later is required.

Key features

  • 01Creates GKE clusters with selectable addons such as HTTP load balancing, HPA and the Persistent Disk CSI driver
  • 02Creates node pools from a list of configurations and attaches them to the cluster
  • 03Enables network policy and configures ip-masq-agent non-masquerade CIDRs
  • 04Supports stub domains by replacing the default kube-dns configmap
  • 05Provides private cluster and beta feature sub modules

Use cases

  • Standing up a production GKE cluster in Terraform with consistent defaults across environments
  • Adding GPU or spot node pools to an existing GKE cluster managed as code
  • Building a private GKE cluster on a shared VPC network

Quick start

  1. 1

    Copy the usage example into a root Terraform folder and set your project ID

  2. 2

    Initialize Terraform to download plugins

    terraform init
  3. 3

    Preview the infrastructure plan

    terraform plan
  4. 4

    Apply the infrastructure build

    terraform apply

Things to know

  • Requires Terraform 1.3 or later, and older Terraform versions need older releases of the module.
  • Enabling configure_ip_masq on a private cluster requires access to the API server.
  • Deletion protection is on by default, so the cluster cannot be destroyed until it is turned off.

Topics

FAQ

What is terraform-google-kubernetes-engine?
Terraform module that provisions opinionated Google Kubernetes Engine (GKE) clusters with node pools, network policy and IP masquerade configuration. This Terraform module creates and configures Google Kubernetes Engine clusters on Google Cloud Platform with a set of opinionated defaults. It provisions the cluster with the requested addons, creates one or more node pools and attaches them to the cluster, and can enable network policy, replace the default kube-dns configmap for stub domains, and install an ip-masq-agent configmap for non-masquerade CIDRs.
Is terraform-google-kubernetes-engine free to use? What license does it have?
terraform-google-kubernetes-engine is open source under the Apache-2.0 license. Check the license terms before using it in commercial products.
Is terraform-google-kubernetes-engine still maintained?
Actively maintained. The last commit to terraform-google-kubernetes-engine was on Nov 6, 2026.
What can I use terraform-google-kubernetes-engine for?
Standing up a production GKE cluster in Terraform with consistent defaults across environments Adding GPU or spot node pools to an existing GKE cluster managed as code Building a private GKE cluster on a shared VPC network
How do I install terraform-google-kubernetes-engine?
Copy the usage example into a root Terraform folder and set your project ID Initialize Terraform to download plugins: terraform init Preview the infrastructure plan: terraform plan Apply the infrastructure build: terraform apply
Where can I get terraform-google-kubernetes-engine?
The source code and installation instructions are on GitHub: https://github.com/terraform-google-modules/terraform-google-kubernetes-engine

Summary generated by AI from the project's README. GitHub stats refresh daily.

Related projects