Skip to content

Instantly share code, notes, and snippets.

@limed
Created July 20, 2020 18:09
Show Gist options
  • Save limed/7b643a388b21aae2cc02faa7f6770a90 to your computer and use it in GitHub Desktop.
Save limed/7b643a388b21aae2cc02faa7f6770a90 to your computer and use it in GitHub Desktop.
terraform {
backend "gcs" {
bucket = "terraform-state-limed"
prefix = "terraform/gke"
}
}
locals {
project_id = "mozilla-it-service-engineering"
node_pools = [
{
name = "default-node-pool-1"
machine_type = "e2-small"
min_count = "2"
max_count = "50"
auto_repair = true
auto_upgrade = true
preemptible = true
initial_node_count = 2
}
]
}
provider "google-beta" {
version = "~> 3"
region = var.region
project = local.project_id
}
data "google_compute_zones" "available" {
region = var.region
project = local.project_id
}
resource "random_shuffle" "zones" {
input = data.google_compute_zones.available.names
result_count = 3
}
module "gke" {
source = "terraform-google-modules/kubernetes-engine/google"
version = "~> 10"
project_id = local.project_id
name = "limed-dev"
region = var.region
zones = random_shuffle.zones.result
network = "default"
node_pools = local.node_pools
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment