Skip to content

Instantly share code, notes, and snippets.

@shemul
Created August 8, 2020 08:35
Show Gist options
  • Save shemul/e984d3e8ff19faa75a358aa7cf9ed574 to your computer and use it in GitHub Desktop.
Save shemul/e984d3e8ff19faa75a358aa7cf9ed574 to your computer and use it in GitHub Desktop.
Google Cloud Platform - kubernetes engine using terraform
module "gke" {
source = "terraform-google-modules/kubernetes-engine/google"
project_id = "<PROJECT ID>"
name = "gke-test-1"
region = "us-central1"
zones = ["us-central1-a", "us-central1-b", "us-central1-f"]
network = "vpc-01"
subnetwork = "us-central1-01"
ip_range_pods = "us-central1-01-gke-01-pods"
ip_range_services = "us-central1-01-gke-01-services"
http_load_balancing = false
horizontal_pod_autoscaling = true
network_policy = true
node_pools = [
{
name = "default-node-pool"
machine_type = "e2-medium"
min_count = 1
max_count = 100
local_ssd_count = 0
disk_size_gb = 100
disk_type = "pd-standard"
image_type = "COS"
auto_repair = true
auto_upgrade = true
service_account = "project-service-account@<PROJECT ID>.iam.gserviceaccount.com"
preemptible = false
initial_node_count = 80
},
]
node_pools_oauth_scopes = {
all = []
default-node-pool = [
"https://www.googleapis.com/auth/cloud-platform",
]
}
node_pools_labels = {
all = {}
default-node-pool = {
default-node-pool = true
}
}
node_pools_metadata = {
all = {}
default-node-pool = {
node-pool-metadata-custom-value = "my-node-pool"
}
}
node_pools_tags = {
all = []
default-node-pool = [
"default-node-pool",
]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment