blob: 3cac56abd3b50f39804a1f1e8aa07f2e2475add2 [file] [log] [blame]
---
# ----------------------------------------------------------------------------
#
# *** AUTO GENERATED CODE *** Type: MMv1 ***
#
# ----------------------------------------------------------------------------
#
# This file is automatically generated by Magic Modules and manual
# changes will be clobbered when the file is regenerated.
#
# Please read more about how to change this file in
# .github/CONTRIBUTING.md.
#
# ----------------------------------------------------------------------------
subcategory: "Anthos On-Prem"
description: |-
A Google Bare Metal Node Pool.
---
# google\_gkeonprem\_bare\_metal\_node\_pool
A Google Bare Metal Node Pool.
## Example Usage - Gkeonprem Bare Metal Node Pool Basic
```hcl
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
```hcl
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:
* `node_pool_config` -
(Required)
Node pool configuration.
Structure is [documented below](#nested_node_pool_config).
* `name` -
(Required)
The bare metal node pool name.
* `bare_metal_cluster` -
(Required)
The cluster this node pool belongs to.
* `location` -
(Required)
The location of the resource.
<a name="nested_node_pool_config"></a>The `node_pool_config` block supports:
* `node_configs` -
(Required)
The list of machine addresses in the Bare Metal Node Pool.
Structure is [documented below](#nested_node_configs).
* `operating_system` -
(Optional)
Specifies the nodes operating system (default: LINUX).
* `taints` -
(Optional)
The initial taints assigned to nodes of this node pool.
Structure is [documented below](#nested_taints).
* `labels` -
(Optional)
The map of Kubernetes labels (key/value pairs) to be applied to
each node. These will added in addition to any default label(s)
that Kubernetes may apply to the node. In case of conflict in
label keys, the applied set may differ depending on the Kubernetes
version -- it's best to assume the behavior is undefined and
conflicts should be avoided. For more information, including usage
and the valid values, see:
http://kubernetes.io/v1.1/docs/user-guide/labels.html
An object containing a list of "key": value pairs.
Example: { "name": "wrench", "mass": "1.3kg", "count": "3" }.
<a name="nested_node_configs"></a>The `node_configs` block supports:
* `node_ip` -
(Optional)
The default IPv4 address for SSH access and Kubernetes node.
Example: 192.168.0.1
* `labels` -
(Optional)
The map of Kubernetes labels (key/value pairs) to be applied to
each node. These will added in addition to any default label(s)
that Kubernetes may apply to the node. In case of conflict in
label keys, the applied set may differ depending on the Kubernetes
version -- it's best to assume the behavior is undefined and
conflicts should be avoided. For more information, including usage
and the valid values, see:
http://kubernetes.io/v1.1/docs/user-guide/labels.html
An object containing a list of "key": value pairs.
Example: { "name": "wrench", "mass": "1.3kg", "count": "3" }.
<a name="nested_taints"></a>The `taints` block supports:
* `key` -
(Optional)
Key associated with the effect.
* `value` -
(Optional)
Value associated with the effect.
* `effect` -
(Optional)
Specifies the nodes operating system (default: LINUX).
Possible values are: `EFFECT_UNSPECIFIED`, `PREFER_NO_SCHEDULE`, `NO_EXECUTE`.
- - -
* `display_name` -
(Optional)
The display name for the Bare Metal Node Pool.
* `annotations` -
(Optional)
Annotations on the Bare Metal Node Pool.
This field has the same restrictions as Kubernetes annotations.
The total size of all keys and values combined is limited to 256k.
Key can have 2 segments: prefix (optional) and name (required),
separated by a slash (/).
Prefix must be a DNS subdomain.
Name must be 63 characters or less, begin and end with alphanumerics,
with dashes (-), underscores (_), dots (.), and alphanumerics between.
**Note**: This field is non-authoritative, and will only manage the annotations present in your configuration.
Please refer to the field `effective_annotations` for all of the annotations present on the resource.
* `project` - (Optional) The ID of the project in which the resource belongs.
If it is not provided, the provider project is used.
## Attributes Reference
In addition to the arguments listed above, the following computed attributes are exported:
* `id` - an identifier for the resource with format `projects/{{project}}/locations/{{location}}/bareMetalClusters/{{bare_metal_cluster}}/bareMetalNodePools/{{name}}`
* `status` -
Specifies detailed node pool status.
Structure is [documented below](#nested_status).
* `uid` -
The unique identifier of the Bare Metal Node Pool.
* `state` -
The current state of this cluster.
* `reconciling` -
If set, there are currently changes in flight to the Bare Metal User Cluster.
* `create_time` -
The time the cluster was created, in RFC3339 text format.
* `update_time` -
The time the cluster was last updated, in RFC3339 text format.
* `delete_time` -
The time the cluster was deleted, in RFC3339 text format.
* `etag` -
This checksum is computed by the server based on the value of other
fields, and may be sent on update and delete requests to ensure the
client has an up-to-date value before proceeding.
Allows clients to perform consistent read-modify-writes
through optimistic concurrency control.
* `effective_annotations` -
All of annotations (key/value pairs) present on the resource in GCP, including the annotations configured through Terraform, other clients and services.
<a name="nested_status"></a>The `status` block contains:
* `error_message` -
(Output)
Human-friendly representation of the error message from the user cluster
controller. The error message can be temporary as the user cluster
controller creates a cluster or node pool. If the error message persists
for a longer period of time, it can be used to surface error message to
indicate real problems requiring user intervention.
* `conditions` -
(Output)
ResourceConditions provide a standard mechanism for higher-level status reporting from user cluster controller.
Structure is [documented below](#nested_conditions).
<a name="nested_conditions"></a>The `conditions` block contains:
* `type` -
(Optional)
Type of the condition.
(e.g., ClusterRunning, NodePoolRunning or ServerSidePreflightReady)
* `reason` -
(Optional)
Machine-readable message indicating details about last transition.
* `message` -
(Optional)
Human-readable message indicating details about last transition.
* `last_transition_time` -
(Output)
Last time the condition transit from one status to another.
* `state` -
(Output)
The lifecycle state of the condition.
## Timeouts
This resource provides the following
[Timeouts](https://developer.hashicorp.com/terraform/plugin/sdkv2/resources/retries-and-customizable-timeouts) configuration options:
- `create` - Default is 20 minutes.
- `update` - Default is 20 minutes.
- `delete` - Default is 20 minutes.
## Import
BareMetalNodePool can be imported using any of these accepted formats:
* `projects/{{project}}/locations/{{location}}/bareMetalClusters/{{bare_metal_cluster}}/bareMetalNodePools/{{name}}`
* `{{project}}/{{location}}/{{bare_metal_cluster}}/{{name}}`
* `{{location}}/{{bare_metal_cluster}}/{{name}}`
In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import BareMetalNodePool using one of the formats above. For example:
```tf
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](https://developer.hashicorp.com/terraform/cli/commands/import), 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](https://registry.terraform.io/providers/hashicorp/google/latest/docs/guides/provider_reference#user_project_override).