Created
June 14, 2019 19:24
-
-
Save mlabouardy/90a1febe5d54d37c451e8f80bd1bccfe to your computer and use it in GitHub Desktop.
Create Google Kubernetes Engine with Terraform
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
resource "google_container_cluster" "cluster" { | |
name = "${var.environment}" | |
location = "${var.zone}" | |
remove_default_node_pool = true | |
initial_node_count = "${var.k8s_nodes}" | |
master_auth { | |
username = "" | |
password = "" | |
client_certificate_config { | |
issue_client_certificate = false | |
} | |
} | |
} | |
resource "google_container_node_pool" "pool" { | |
name = "k8s-node-pool-${var.environment}" | |
location = "${var.zone}" | |
cluster = "${google_container_cluster.cluster.name}" | |
node_count = "${var.k8s_nodes}" | |
node_config { | |
preemptible = true | |
machine_type = "${var.instance_type}" | |
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