
This repository contains Terraform configurations to deploy a Google Kubernetes Engine (GKE) cluster with custom networking settings.
The cluster is configured with the following IP ranges:
- Nodes: 10.0.0.0/16
- Pods: 10.1.0.0/16
- Services: 10.2.0.0/16
Example output:

- Clone the repository:
git clone https://github.com/cvitaa11/gke-demo.git
cd gke-demo/infra/example
- Create a
terraform.tfvars file with your project settings:
project_id = "your-project-id"
region = "your-desired-region"
node_locations = ["your-desired-AZs"]
- Initialize Terraform
- Review the plan:
- Apply the configuration:
- After deployment, configure kubectl:
gcloud container clusters get-credentials $(terraform output -raw kubernetes_cluster_name) --region $(terraform output -raw region)
| Name |
Description |
Type |
Default |
Required |
| node_ip_range |
IP address range of GKE nodes |
string |
"10.0.0.0/16" |
no |
| node_locations |
Availability zone of the GKE nodes |
any |
n/a |
yes |
| pod_ip_range |
IP address range of k8s pods |
string |
"10.1.0.0/16" |
no |
| project_id |
GCP project id |
any |
n/a |
yes |
| region |
region |
string |
"us-east1" |
no |
| service_ip_range |
IP address range of k8s services |
string |
"10.2.0.0/16" |
no |
To destroy the created resources run the following command:
- The configuration uses minimal resources to stay within GCP's free tier
- The cluster is deployed in a single zone for cost optimization
- Remember to monitor your GCP usage and costs