<p>I am trying to create a GKE cluster of node size 1. However, it always create a cluster of 3 nodes. Why is that? </p>

<pre><code>resource "google_container_cluster" "gke-cluster" {
  name = "sonarqube"
  location = "asia-southeast1"
  remove_default_node_pool = true
  initial_node_count = 1
}

resource "google_container_node_pool" "gke-node-pool" {
  name = "sonarqube"
  location = "asia-southeast1"
  cluster = google_container_cluster.gke-cluster.name
  node_count = 1

  node_config {
    machine_type = "n1-standard-1"
    metadata = {
      disable-legacy-endpoints = "true"
    }

    labels = {
      app = "sonarqube"
    }
  }
}
</code></pre>

<p><a href="https://i.stack.imgur.com/6bwMX.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/6bwMX.png" alt="enter image description here"></a></p>

Jiew Meng
<p>Ok, found I can do so using <code>node_locations</code>: </p>

<pre><code>resource "google_container_cluster" "gke-cluster" {
  name = "sonarqube"
  location = "asia-southeast1"
  node_locations = [
    "asia-southeast1-a"
  ]
  remove_default_node_pool = true
  initial_node_count = 1
}
</code></pre>

<p>Without that, it seems GKE will create 1 node per zone. </p>
