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
+
# Separately Managed Node Pool
resource "[[google_container_node_pool]]" "primary_nodes" {
+
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]] {
+
   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]]"
+
     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:
 
     }
 
     }
 
   }
 
   }
}
+
}
 +
 
  
<pre>
 
 
# # 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>: <code>[[n1-standard-1]], [[g1-small]]</code>
+
* <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 your-cluster-name --region us-central1-a]]</code>
+
* <code>[[gcloud container clusters describe]]</code>
  
 
== See also ==
 
== See also ==
* {{gke.tf}}
 
 
* {{tf GKE}}
 
* {{tf GKE}}
  
 
[[Category:GKE]]
 
[[Category:GKE]]

Please note that all contributions to wikieduonline may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see Wikieduonline:Copyrights for details). Do not submit copyrighted work without permission!

Cancel Editing help (opens in new window)

Advertising: