google_gkeonprem_bare_metal_node_pool

A Google Bare Metal Node Pool.

Example Usage - Gkeonprem Bare Metal Node Pool Basic

resource "google_gkeonprem_bare_metal_cluster" "default-basic" {
  name = "my-cluster"
  location = "us-west1"
  admin_cluster_membership = "projects/870316890899/locations/global/memberships/gkeonprem-terraform-test"
  bare_metal_version = "1.12.3"
  network_config {
    island_mode_cidr {
      service_address_cidr_blocks = ["172.26.0.0/16"]
      pod_address_cidr_blocks = ["10.240.0.0/13"]
    }
  }
  control_plane {
    control_plane_node_pool_config {
      node_pool_config {
        labels = {}
        operating_system = "LINUX"
        node_configs {
          labels = {}
          node_ip = "10.200.0.9"
        }
      }
    }
  }
  load_balancer {
    port_config {
      control_plane_load_balancer_port = 443
    }
    vip_config {
      control_plane_vip = "10.200.0.13"
      ingress_vip = "10.200.0.14"
    }
    metal_lb_config {
      address_pools {
        pool = "pool1"
        addresses = [
          "10.200.0.14/32",
          "10.200.0.15/32",
          "10.200.0.16/32",
          "10.200.0.17/32",
          "10.200.0.18/32",
          "fd00:1::f/128",
          "fd00:1::10/128",
          "fd00:1::11/128",
          "fd00:1::12/128"
        ]
      }
    }
  }
  storage {
    lvp_share_config {
      lvp_config {
        path = "/mnt/localpv-share"
        storage_class = "local-shared"
      }
      shared_path_pv_count = 5
    }
    lvp_node_mounts_config {
      path = "/mnt/localpv-disk"
      storage_class = "local-disks"
    }
  }
  security_config {
    authorization {
      admin_users {
        username = "admin@hashicorptest.com"
      }
    }
  }
}

resource "google_gkeonprem_bare_metal_node_pool" "nodepool-basic" {
  name =  "my-nodepool"
  bare_metal_cluster =  google_gkeonprem_bare_metal_cluster.default-basic.name
  location = "us-west1"
  node_pool_config {
    operating_system = "LINUX"
    node_configs {
      node_ip = "10.200.0.11"
    }
  }
}

Example Usage - Gkeonprem Bare Metal Node Pool Full

resource "google_gkeonprem_bare_metal_cluster" "default-full" {
  name = "my-cluster"
  location = "us-west1"
  admin_cluster_membership = "projects/870316890899/locations/global/memberships/gkeonprem-terraform-test"
  bare_metal_version = "1.12.3"
  network_config {
    island_mode_cidr {
      service_address_cidr_blocks = ["172.26.0.0/16"]
      pod_address_cidr_blocks = ["10.240.0.0/13"]
    }
  }
  control_plane {
    control_plane_node_pool_config {
      node_pool_config {
        labels = {}
        operating_system = "LINUX"
        node_configs {
          labels = {}
          node_ip = "10.200.0.9"
        }
      }
    }
  }
  load_balancer {
    port_config {
      control_plane_load_balancer_port = 443
    }
    vip_config {
      control_plane_vip = "10.200.0.13"
      ingress_vip = "10.200.0.14"
    }
    metal_lb_config {
      address_pools {
        pool = "pool1"
        addresses = [
          "10.200.0.14/32",
          "10.200.0.15/32",
          "10.200.0.16/32",
          "10.200.0.17/32",
          "10.200.0.18/32",
          "fd00:1::f/128",
          "fd00:1::10/128",
          "fd00:1::11/128",
          "fd00:1::12/128"
        ]
      }
    }
  }
  storage {
    lvp_share_config {
      lvp_config {
        path = "/mnt/localpv-share"
        storage_class = "local-shared"
      }
      shared_path_pv_count = 5
    }
    lvp_node_mounts_config {
      path = "/mnt/localpv-disk"
      storage_class = "local-disks"
    }
  }
  security_config {
    authorization {
      admin_users {
        username = "admin@hashicorptest.com"
      }
    }
  }
}

resource "google_gkeonprem_bare_metal_node_pool" "nodepool-full" {
  name =  "my-nodepool"
  display_name = "test-name"
  bare_metal_cluster =  google_gkeonprem_bare_metal_cluster.default-full.name
  location = "us-west1"
  annotations = {}
  node_pool_config {
    operating_system = "LINUX"
    labels = {}
    node_configs {
      node_ip = "10.200.0.11"
      labels = {}
    }
    taints {
      key = "test-key"
      value = "test-value"
      effect = "NO_EXECUTE"
    }
  }
}

Argument Reference

The following arguments are supported:

The node_pool_config block supports:

The node_configs block supports:

The taints block supports:


Attributes Reference

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

The status block contains:

The conditions block contains:

Timeouts

This resource provides the following Timeouts configuration options:

Import

BareMetalNodePool can be imported using any of these accepted formats:

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

import {
  id = "projects/{{project}}/locations/{{location}}/bareMetalClusters/{{bare_metal_cluster}}/bareMetalNodePools/{{name}}"
  to = google_gkeonprem_bare_metal_node_pool.default
}

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

$ terraform import google_gkeonprem_bare_metal_node_pool.default projects/{{project}}/locations/{{location}}/bareMetalClusters/{{bare_metal_cluster}}/bareMetalNodePools/{{name}}
$ terraform import google_gkeonprem_bare_metal_node_pool.default {{project}}/{{location}}/{{bare_metal_cluster}}/{{name}}
$ terraform import google_gkeonprem_bare_metal_node_pool.default {{location}}/{{bare_metal_cluster}}/{{name}}

User Project Overrides

This resource supports User Project Overrides.