Skip to content

vismayIO/gke-gcp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GCP GKE Terraform Infrastructure

This repository contains Terraform code to provision a Google Kubernetes Engine (GKE) cluster and supporting infrastructure on Google Cloud Platform (GCP).

Features

  • Custom VPC and subnets (public/private)
  • GKE cluster with node pools
  • NAT gateway for private subnet egress
  • IAM service accounts and roles for GKE nodes
  • Firewall rules for secure access
  • Google Cloud APIs enablement

Repository Structure

.
├── apis.tf              # Enable required GCP APIs
├── firewalls.tf         # Firewall rules
├── gke.tf               # GKE cluster definition
├── gke-nodes.tf         # Node pool and IAM for GKE nodes
├── local.tf             # Locals and variables
├── nat.tf               # NAT gateway configuration
├── provider.tf          # Provider and backend config
├── subnets.tf           # Subnet definitions
├── vpc.tf               # VPC network definition

Prerequisites

Usage

  1. Clone the repository:

    git clone <repo-url>
    cd <repo-directory>
  2. Initialize Terraform:

    terraform init
  3. Review and apply the plan:

    terraform plan
    terraform apply
  4. Destroy resources (when finished):

    terraform destroy

Customization

  • Edit local.tf to set your project ID, region, and other variables.
  • Modify gke.tf and gke-nodes.tf to adjust cluster/node pool settings.
  • Update firewalls.tf to change network access rules.

Notes

  • State files (terraform.tfstate*) should not be committed to version control.
  • The GKE cluster is created without deletion protection. Use the lifecycle block if you want to prevent accidental deletion.
  • Make sure to clean up resources to avoid unnecessary charges.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages