Skip to content

Instantly share code, notes, and snippets.

@oboukili
Last active May 17, 2019 13:24
Show Gist options
  • Select an option

  • Save oboukili/3b23ea31f020f716d79055021fde0fa1 to your computer and use it in GitHub Desktop.

Select an option

Save oboukili/3b23ea31f020f716d79055021fde0fa1 to your computer and use it in GitHub Desktop.
resource "google_container_cluster" "primary" {
name = "primary"
region = "europe-west1"
remove_default_node_pool = true
initial_node_count = 1
ip_allocation_policy {
cluster_secondary_range_name = "10.0.0.0/16"
services_secondary_range_name = "10.1.0.0/16"
}
maintenance_policy {
daily_maintenance_window {
start_time = "02:00"
}
}
}
resource "google_container_node_pool" "autoscale1" {
name = "autoscale1"
region = "europe-west1"
cluster = "${google_container_cluster.primary.name}"
initial_node_count = 1
autoscaling {
min_node_count = 1
max_node_count = 3
}
management {
auto_repair = true
auto_upgrade = true
}
node_config {
min_cpu_platform = "Intel Skylake"
preemptible = true
machine_type = "n1-standard-4"
metadata {
disable-legacy-endpoints = "true"
}
oauth_scopes = [
"https://www.googleapis.com/auth/logging.write",
"https://www.googleapis.com/auth/monitoring",
]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment