<p>I've created a cluster using terraform with:</p>

<pre><code>provider "google" {
  credentials = "${file("gcp.json")}"
  project = "${var.gcp_project}"
  region  = "us-central1"
  zone    = "us-central1-c"
}

resource "google_container_cluster" "primary" {
  name     = "${var.k8s_cluster_name}"
  location   = "us-central1-a"
  project      = "${var.gcp_project}"

  # We can't create a cluster with no node pool defined, but we want to only use
  # separately managed node pools. So we create the smallest possible default
  # node pool and immediately delete it.
  remove_default_node_pool = true
  initial_node_count = 1

  master_auth {
    username = ""
    password = ""

    client_certificate_config {
      issue_client_certificate = false
    }
  }
}

resource "google_container_node_pool" "primary_preemptible_nodes" {
  project      = "${var.gcp_project}"
  name       = "my-node-pool"
  location   = "us-central1-a"
  cluster    = "${google_container_cluster.primary.name}"
  # node_count = 3

  autoscaling {
    min_node_count = 3
    max_node_count = 5
  }

  node_config {
    # preemptible  = true
    machine_type = "g1-small"

    metadata = {
      disable-legacy-endpoints = "true"
    }

    oauth_scopes = [
      "https://www.googleapis.com/auth/logging.write",
      "https://www.googleapis.com/auth/monitoring",
      "https://www.googleapis.com/auth/devstorage.read_only"
    ]
  }
}
</code></pre>

<p>Surprisingly this node pool seems to be 'stuck' at 0 instances? Why? How can I diagnose this?</p>

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

Chris Stryczynski
<p>you should add &quot;initial_node_count&quot; (like <code>initial_node_count = 3</code>) to &quot;google_container_node_pool&quot; resourse.
<a href="https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/container_node_pool#node_count" rel="nofollow noreferrer">Official documentation</a> says you should not to use &quot;node_count&quot; with &quot;autoscaling&quot;.</p>
