Editing Gke.tf
Jump to navigation
Jump to search
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 24: | Line 24: | ||
# GKE cluster | # GKE cluster | ||
resource "[[google_container_cluster]]" "primary" { | resource "[[google_container_cluster]]" "primary" { | ||
+ | <pre> | ||
name = "${var.project_id}-gke" | name = "${var.project_id}-gke" | ||
location = var.region | location = var.region | ||
Line 32: | Line 33: | ||
remove_default_node_pool = true | remove_default_node_pool = true | ||
initial_node_count = 1 | initial_node_count = 1 | ||
− | + | ||
network = google_compute_network.vpc.name | network = google_compute_network.vpc.name | ||
subnetwork = google_compute_subnetwork.subnet.name | subnetwork = google_compute_subnetwork.subnet.name | ||
− | + | } | |
− | + | ||
− | + | # Separately Managed Node Pool | |
− | + | resource "google_container_node_pool" "primary_nodes" { | |
name = "${google_container_cluster.primary.name}" | name = "${google_container_cluster.primary.name}" | ||
location = var.region | location = var.region | ||
cluster = google_container_cluster.primary.name | cluster = google_container_cluster.primary.name | ||
node_count = var.gke_num_nodes | node_count = var.gke_num_nodes | ||
− | + | ||
− | + | node_config { | |
oauth_scopes = [ | oauth_scopes = [ | ||
"https://www.googleapis.com/auth/logging.write", | "https://www.googleapis.com/auth/logging.write", | ||
Line 55: | Line 56: | ||
# preemptible = true | # preemptible = true | ||
− | + | machine_type = "n1-standard-1" | |
tags = ["gke-node", "${var.project_id}-gke"] | tags = ["gke-node", "${var.project_id}-gke"] | ||
metadata = { | metadata = { | ||
Line 61: | Line 62: | ||
} | } | ||
} | } | ||
− | + | } | |
+ | |||
− | |||
# # Kubernetes provider | # # Kubernetes provider | ||
# # The Terraform Kubernetes Provider configuration below is used as a learning reference only. | # # The Terraform Kubernetes Provider configuration below is used as a learning reference only. | ||
Line 85: | Line 86: | ||
== Related == | == Related == | ||
− | * <code>[[machine_type | + | * <code>[[machine_type]]</code> |
* <code>[[google_compute_instance]]</code> | * <code>[[google_compute_instance]]</code> | ||
* <code>[[eks-cluster.tf]]</code> | * <code>[[eks-cluster.tf]]</code> | ||
− | * <code>[[gcloud container clusters describe | + | * <code>[[gcloud container clusters describe]]</code> |
== See also == | == See also == | ||
− | |||
* {{tf GKE}} | * {{tf GKE}} | ||
[[Category:GKE]] | [[Category:GKE]] |
Advertising: