yandex_kubernetes_node_group (Resource)
- Example usage
- Schema
- Required
- Optional
- Read-Only
- Nested Schema for instance_template
- Nested Schema for instance_template.boot_disk
- Nested Schema for instance_template.container_network
- Nested Schema for instance_template.container_runtime
- Nested Schema for instance_template.gpu_settings
- Nested Schema for instance_template.network_interface
- Nested Schema for instance_template.network_interface.ipv4_dns_records
- Nested Schema for instance_template.network_interface.ipv6_dns_records
- Nested Schema for instance_template.placement_policy
- Nested Schema for instance_template.resources
- Nested Schema for instance_template.scheduling_policy
- Nested Schema for scale_policy
- Nested Schema for scale_policy.auto_scale
- Nested Schema for scale_policy.fixed_scale
- Nested Schema for allocation_policy
- Nested Schema for allocation_policy.location
- Nested Schema for deploy_policy
- Nested Schema for maintenance_policy
- Nested Schema for maintenance_policy.maintenance_window
- Nested Schema for timeouts
- Nested Schema for version_info
- Import
Creates a Yandex Managed Kubernetes Cluster Node Group. For more information, see the official documentation.
Example usage
//
// Create a new Managed Kubernetes Node Group.
//
resource "yandex_kubernetes_node_group" "my_node_group" {
cluster_id = yandex_kubernetes_cluster.my_cluster.id
name = "name"
description = "description"
version = "1.30"
labels = {
"key" = "value"
}
instance_template {
platform_id = "standard-v2"
network_interface {
nat = true
subnet_ids = ["${yandex_vpc_subnet.my_subnet.id}"]
}
resources {
memory = 2
cores = 2
}
boot_disk {
type = "network-hdd"
size = 64
}
scheduling_policy {
preemptible = false
}
container_runtime {
type = "containerd"
}
}
scale_policy {
fixed_scale {
size = 1
}
}
allocation_policy {
location {
zone = "ru-central1-a"
}
}
maintenance_policy {
auto_upgrade = true
auto_repair = true
maintenance_window {
day = "monday"
start_time = "15:00"
duration = "3h"
}
maintenance_window {
day = "friday"
start_time = "10:00"
duration = "4h30m"
}
}
}
Schema
Required
cluster_id(String) The ID of the Kubernetes cluster that this node group belongs to.instance_template(Block List, Min: 1, Max: 1) Template used to create compute instances in this Kubernetes node group. (see below for nested schema)scale_policy(Block List, Min: 1, Max: 1) Scale policy of the node group. (see below for nested schema)
Optional
allocation_policy(Block List, Max: 1) This argument specify subnets (zones), that will be used by node group compute instances. (see below for nested schema)allowed_unsafe_sysctls(List of String) A list of allowed unsafesysctlparameters for this node group. For more details see documentation .deploy_policy(Block List, Max: 1) Deploy policy of the node group. (see below for nested schema)description(String) The resource description.labels(Map of String) A set of key/value label pairs which assigned to resource.maintenance_policy(Block List, Max: 1) Maintenance policy for this Kubernetes node group. If policy is omitted, automatic revision upgrades are enabled and could happen at any time. Revision upgrades are performed only within the same minor version, e.g.1.29. Minor version upgrades (e.g.1.29->1.30) should be performed manually. (see below for nested schema)name(String) The resource name.node_labels(Map of String) A set of key/value label pairs, that are assigned to all the nodes of this Kubernetes node group.node_taints(List of String) A list of Kubernetes taints, that are applied to all the nodes of this Kubernetes node group.timeouts(Block, Optional) (see below for nested schema)version(String) Version of Kubernetes that will be used for Kubernetes node group.
Read-Only
created_at(String) The creation timestamp of the resource.id(String) The ID of this resource.instance_group_id(String) ID of instance group that is used to manage this Kubernetes node group.status(String) Status of the Kubernetes node group.version_info(List of Object) Information about Kubernetes node group version. (see below for nested schema)
Nested Schema for instance_template
Optional:
boot_disk(Block List, Max: 1) The specifications for boot disks that will be attached to the instance. (see below for nested schema)container_network(Block List, Max: 1) Container network configuration. (see below for nested schema)container_runtime(Block List, Max: 1) Container runtime configuration. (see below for nested schema)gpu_settings(Block List, Max: 1) GPU settings. (see below for nested schema)labels(Map of String) Labels that will be assigned to compute nodes (instances), created by the Node Group.metadata(Map of String) The set of metadatakey:valuepairs assigned to this instance template. This includes custom metadata and predefined keys. Note: keyuser-datawon't be provided into instances. It reserved for internal activity inkubernetes_node_groupresource.name(String) Name template of the instance. In order to be unique it must contain at least one of instance unique placeholders:
- `
{instance.index}- combination of
{instance.zone_id}and{instance.index_in_zone}
Example: my-instance-{instance.index}.
If not set, default is used: {instance_group.id}-{instance.short_id}. It may also contain another placeholders, see Compute Instance group metadata doc for full list.
nat(Boolean, Deprecated) Enables NAT for node group compute instances.network_acceleration_type(String) Type of network acceleration. Values:standard,software_accelerated.network_interface(Block List) An array with the network interfaces that will be attached to the instance. (see below for nested schema)placement_policy(Block List, Max: 1) The placement policy configuration. (see below for nested schema)platform_id(String) The ID of the hardware platform configuration for the node group compute instances.resources(Block List, Max: 1) (see below for nested schema)scheduling_policy(Block List, Max: 1) The scheduling policy for the instances in node group. (see below for nested schema)
Nested Schema for instance_template.boot_disk
Optional:
size(Number) The size of the disk in GB. Allowed minimal size: 64 GB.type(String) The disk type.
Nested Schema for instance_template.container_network
Optional:
pod_mtu(Number) MTU for pods.
Nested Schema for instance_template.container_runtime
Required:
type(String) Type of container runtime. Values:docker,containerd.
Nested Schema for instance_template.gpu_settings
Optional:
gpu_cluster_id(String) GPU cluster id.gpu_environment(String) GPU environment. Values:runc,runc_drivers_cuda.
Nested Schema for instance_template.network_interface
Required:
subnet_ids(Set of String) The IDs of the subnets.
Optional:
ipv4(Boolean) Allocate an IPv4 address for the interface. The default value istrue.ipv4_dns_records(Block List) List of configurations for creating ipv4 DNS records. (see below for nested schema)ipv6(Boolean) If true, allocate an IPv6 address for the interface. The address will be automatically assigned from the specified subnet.ipv6_dns_records(Block List) List of configurations for creating ipv6 DNS records. (see below for nested schema)nat(Boolean) A public address that can be used to access the internet over NAT.security_group_ids(Set of String) Security group IDs for network interface.
Nested Schema for instance_template.network_interface.ipv4_dns_records
Required:
fqdn(String) DNS record FQDN.
Optional:
dns_zone_id(String) DNS zone ID (if not set, private zone is used).ptr(Boolean) When set totrue, also create a PTR DNS record.ttl(Number) DNS record TTL (in seconds).
Nested Schema for instance_template.network_interface.ipv6_dns_records
Required:
fqdn(String) DNS record FQDN.
Optional:
dns_zone_id(String) DNS zone ID (if not set, private zone is used).ptr(Boolean) When set totrue, also create a PTR DNS record.ttl(Number) DNS record TTL (in seconds).
Nested Schema for instance_template.placement_policy
Required:
placement_group_id(String) Specifies the id of the Placement Group to assign to the instances.
Nested Schema for instance_template.resources
Optional:
core_fraction(Number) Baseline core performance as a percent.cores(Number) Number of CPU cores allocated to the instance.gpus(Number) Number of GPU cores allocated to the instance.memory(Number) The memory size allocated to the instance.
Nested Schema for instance_template.scheduling_policy
Optional:
preemptible(Boolean) Specifies if the instance is preemptible. Defaults tofalse.
Nested Schema for scale_policy
Optional:
auto_scale(Block List, Max: 1) Scale policy for an autoscaled node group. (see below for nested schema)fixed_scale(Block List, Max: 1) Scale policy for a fixed scale node group. (see below for nested schema)
Nested Schema for scale_policy.auto_scale
Required:
initial(Number) Initial number of instances in the node group.max(Number) Maximum number of instances in the node group.min(Number) Minimum number of instances in the node group.
Nested Schema for scale_policy.fixed_scale
Optional:
size(Number) The number of instances in the node group.
Nested Schema for allocation_policy
Optional:
location(Block List) Repeated field, that specify subnets (zones), that will be used by node group compute instances. Subnet specified bysubnet_idshould be allocated in zone specified by 'zone' argument. (see below for nested schema)
Nested Schema for allocation_policy.location
Optional:
subnet_id(String, Deprecated) ID of the subnet, that will be used by one compute instance in node group.zone(String) ID of the availability zone where for one compute instance in node group.
Nested Schema for deploy_policy
Required:
max_expansion(Number) The maximum number of instances that can be temporarily allocated above the group's target size during the update.max_unavailable(Number) The maximum number of running instances that can be taken offline during update.
Nested Schema for maintenance_policy
Required:
auto_repair(Boolean) Flag that specifies if node group can be repaired automatically. When omitted, default value istrue.auto_upgrade(Boolean) Flag specifies if node group can be upgraded automatically. When omitted, default value istrue.
Optional:
maintenance_window(Block Set) Set of day intervals, when maintenance is allowed for this node group. When omitted, it defaults to any time.
To specify time of day interval, for all days, one element should be provided, with two fields set, start_time and duration.
To allow maintenance only on specific days of week, please provide list of elements, with all fields set. Only one time interval is allowed for each day of week. Please see my_node_group config example. (see below for nested schema)
Nested Schema for maintenance_policy.maintenance_window
Required:
duration(String)start_time(String)
Optional:
day(String)
Nested Schema for timeouts
Optional:
create(String) A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).delete(String) A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Setting a timeout for a Delete operation is only applicable if changes are saved into state before the destroy operation occurs.read(String) A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Read operations occur during any refresh or planning operation when refresh is enabled.update(String) A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).
Nested Schema for version_info
Read-Only:
current_version(String)new_revision_available(Boolean)new_revision_summary(String)version_deprecated(Boolean)
Import
The resource can be imported by using their resource ID. For getting the resource ID you can use Yandex Cloud Web Console
# terraform import yandex_kubernetes_node_group.<resource Name> <resource Id>
terraform import yandex_kubernetes_node_group.my_node_group ...