google_edgecontainer_node_pool

"A set of Kubernetes nodes in a cluster with common configuration and specification."

To get more information about NodePool, see:

Example Usage - Edgecontainer Node Pool

resource "google_edgecontainer_cluster" "cluster" {
  name = "default"
  location = "us-central1"

  authorization {
    admin_users {
      username = "admin@hashicorptest.com"
    }
  }

  networking {
    cluster_ipv4_cidr_blocks = ["10.0.0.0/16"]
    services_ipv4_cidr_blocks = ["10.1.0.0/16"]
  }

  fleet {
    project = "projects/${data.google_project.project.number}"
  }
}

resource "google_edgecontainer_node_pool" "default" {
  name = "nodepool-1"
  cluster = google_edgecontainer_cluster.cluster.name
  location = "us-central1"
  node_location = "us-central1-edge-example-edgesite"
  node_count = 3

  labels = {
    my_key    = "my_val"
    other_key = "other_val"
  }
}

data "google_project" "project" {}

Example Usage - Edgecontainer Node Pool With Cmek

resource "google_edgecontainer_cluster" "cluster" {
  name = "default"
  location = "us-central1"

  authorization {
    admin_users {
      username = "admin@hashicorptest.com"
    }
  }

  networking {
    cluster_ipv4_cidr_blocks = ["10.0.0.0/16"]
    services_ipv4_cidr_blocks = ["10.1.0.0/16"]
  }

  fleet {
    project = "projects/${data.google_project.project.number}"
  }
}

resource "google_kms_crypto_key_iam_member" "crypto_key" {
  crypto_key_id = google_kms_crypto_key.crypto_key.id
  role          = "roles/cloudkms.cryptoKeyEncrypterDecrypter"
  member        = "serviceAccount:service-${data.google_project.project.number}@gcp-sa-edgecontainer.iam.gserviceaccount.com"
}

resource "google_kms_crypto_key" "crypto_key" {
  name     = "key"
  key_ring = google_kms_key_ring.key_ring.id
}

resource "google_kms_key_ring" "key_ring" {
  name     = "keyring"
  location = "us-central1"
}

resource "google_edgecontainer_node_pool" "default" {
  depends_on = [google_kms_crypto_key_iam_member.crypto_key]

  name = "nodepool-1"
  cluster = google_edgecontainer_cluster.cluster.name
  location = "us-central1"
  node_location = "us-central1-edge-example-edgesite"
  node_count = 3

  local_disk_encryption {
    kms_key = google_kms_crypto_key.crypto_key.id
  }
}

data "google_project" "project" {}

Example Usage - Edgecontainer Local Control Plane Node Pool

resource "google_edgecontainer_cluster" "default" {
  name = ""
  location = "us-central1"

  authorization {
    admin_users {
      username = "admin@hashicorptest.com"
    }
  }

  networking {
    cluster_ipv4_cidr_blocks = ["10.0.0.0/16"]
    services_ipv4_cidr_blocks = ["10.1.0.0/16"]
  }

  fleet {
    project = "projects/${data.google_project.project.number}"
  }

  external_load_balancer_ipv4_address_pools = ["10.100.0.0-10.100.0.10"]

  control_plane {
    local {
      node_location = "us-central1-edge-example-edgesite"
      node_count = 1
      machine_filter = "machine-name"
      shared_deployment_policy = "ALLOWED"
    }
  }
}

resource "google_edgecontainer_node_pool" "default" {
  name = "nodepool-1"
  cluster = google_edgecontainer_cluster.cluster.name
  location = "us-central1"
  node_location = "us-central1-edge-example-edgesite"
  node_count = 3
}

data "google_project" "project" {}

Argument Reference

The following arguments are supported:


The local_disk_encryption block supports:

The node_config block supports:

Attributes Reference

In addition to the arguments listed above, the following computed attributes are exported:

Timeouts

This resource provides the following Timeouts configuration options:

Import

NodePool can be imported using any of these accepted formats:

In Terraform v1.5.0 and later, use an import block to import NodePool using one of the formats above. For example:

import {
  id = "projects/{{project}}/locations/{{location}}/clusters/{{cluster}}/nodePools/{{name}}"
  to = google_edgecontainer_node_pool.default
}

When using the terraform import command, NodePool can be imported using one of the formats above. For example:

$ terraform import google_edgecontainer_node_pool.default projects/{{project}}/locations/{{location}}/clusters/{{cluster}}/nodePools/{{name}}
$ terraform import google_edgecontainer_node_pool.default {{project}}/{{location}}/{{cluster}}/{{name}}
$ terraform import google_edgecontainer_node_pool.default {{location}}/{{cluster}}/{{name}}

User Project Overrides

This resource supports User Project Overrides.