<p>I’m trying to run the following example: <a href="https://kubernetes.io/docs/tutorials/stateful-application/cassandra/" rel="nofollow noreferrer">https://kubernetes.io/docs/tutorials/stateful-application/cassandra/</a>
When I run on minikube, it runs well. But when I run on GKE, I see an error, <code>0/3 nodes are available: 3 Insufficient cpu.</code></p>

<p>Anyone can help me please?</p>

<p>Where I can increase CPU? On stateful_set or on kluster config?</p>

<p>I created my cluster with terraform, with the following configurations:</p>

<pre><code>resource "google_container_cluster" "gcloud_cluster" {
  name               = "gcloud-cluster-${var.workspace}"
  zone               = "us-east1-b"
  initial_node_count = 3
  project            = "${var.project}"

  addons_config {
    network_policy_config {
      disabled = true
    }
  }

  master_auth {
    username = "${var.username}"
    password = "${var.password}"
  }

  node_config {
    oauth_scopes = [
      "https://www.googleapis.com/auth/devstorage.read_only",
      "https://www.googleapis.com/auth/logging.write",
      "https://www.googleapis.com/auth/monitoring",
      "https://www.googleapis.com/auth/service.management.readonly",
      "https://www.googleapis.com/auth/servicecontrol",
      "https://www.googleapis.com/auth/trace.append",
      "https://www.googleapis.com/auth/compute",
    ]
  }
}
</code></pre>

<p>Thanks</p>

<p><a href="https://i.stack.imgur.com/pTgRi.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/pTgRi.png" alt="0/3 nodes are available: 3 Insufficient cpu."></a></p>

<p>What is happening here is that by default your cluster is being created using n1-standard-1 machines which have only 1vCPU. </p>

<p>You should add to your config information about machine type you want to use i.e:</p>

<pre><code>resource "google_container_cluster" "gcloud_cluster" {
  name               = "gcloud-cluster-${var.workspace}"
  zone               = "us-east1-b"
  initial_node_count = 3
  project            = "${var.project}"

  addons_config {
    network_policy_config {
      disabled = true
    }
  }

  master_auth {
    username = "${var.username}"
    password = "${var.password}"
  }

  node_config {
    machine_type = "${var.machine_type}"
    oauth_scopes = [
      "https://www.googleapis.com/auth/devstorage.read_only",
      "https://www.googleapis.com/auth/logging.write",
      "https://www.googleapis.com/auth/monitoring",
      "https://www.googleapis.com/auth/service.management.readonly",
      "https://www.googleapis.com/auth/servicecontrol",
      "https://www.googleapis.com/auth/trace.append",
      "https://www.googleapis.com/auth/compute",
    ]
  }
}
</code></pre>

<p>and declare it in variable.tf file using either n1-standard-2 or n1-standard-4 i.e:</p>

<pre><code>variable "machine_type" {
    type = "string"
    default = "n1-standard-4"
}
</code></pre>
