Add spot vm support to gke-nodepool

This commit is contained in:
Julio Castillo
2022-05-04 10:04:39 +02:00
parent 882c07cc19
commit aee089dcd3
3 changed files with 13 additions and 5 deletions

View File

@@ -41,7 +41,7 @@ module "cluster-1-nodepool-1" {
|---|---|:---:|:---:|:---:| |---|---|:---:|:---:|:---:|
| [cluster_name](variables.tf#L26) | Cluster name. | <code>string</code> | ✓ | | | [cluster_name](variables.tf#L26) | Cluster name. | <code>string</code> | ✓ | |
| [location](variables.tf#L59) | Cluster location. | <code>string</code> | ✓ | | | [location](variables.tf#L59) | Cluster location. | <code>string</code> | ✓ | |
| [project_id](variables.tf#L210) | Cluster project id. | <code>string</code> | ✓ | | | [project_id](variables.tf#L216) | Cluster project id. | <code>string</code> | ✓ | |
| [autoscaling_config](variables.tf#L17) | Optional autoscaling configuration. | <code title="object&#40;&#123;&#10; min_node_count &#61; number&#10; max_node_count &#61; number&#10;&#125;&#41;">object&#40;&#123;&#8230;&#125;&#41;</code> | | <code>null</code> | | [autoscaling_config](variables.tf#L17) | Optional autoscaling configuration. | <code title="object&#40;&#123;&#10; min_node_count &#61; number&#10; max_node_count &#61; number&#10;&#125;&#41;">object&#40;&#123;&#8230;&#125;&#41;</code> | | <code>null</code> |
| [gke_version](variables.tf#L31) | Kubernetes nodes version. Ignored if auto_upgrade is set in management_config. | <code>string</code> | | <code>null</code> | | [gke_version](variables.tf#L31) | Kubernetes nodes version. Ignored if auto_upgrade is set in management_config. | <code>string</code> | | <code>null</code> |
| [initial_node_count](variables.tf#L37) | Initial number of nodes for the pool. | <code>number</code> | | <code>1</code> | | [initial_node_count](variables.tf#L37) | Initial number of nodes for the pool. | <code>number</code> | | <code>1</code> |
@@ -68,10 +68,11 @@ module "cluster-1-nodepool-1" {
| [node_service_account_create](variables.tf#L174) | Auto-create service account. | <code>bool</code> | | <code>false</code> | | [node_service_account_create](variables.tf#L174) | Auto-create service account. | <code>bool</code> | | <code>false</code> |
| [node_service_account_scopes](variables.tf#L182) | Scopes applied to service account. Default to: 'cloud-platform' when creating a service account; 'devstorage.read_only', 'logging.write', 'monitoring.write' otherwise. | <code>list&#40;string&#41;</code> | | <code>&#91;&#93;</code> | | [node_service_account_scopes](variables.tf#L182) | Scopes applied to service account. Default to: 'cloud-platform' when creating a service account; 'devstorage.read_only', 'logging.write', 'monitoring.write' otherwise. | <code>list&#40;string&#41;</code> | | <code>&#91;&#93;</code> |
| [node_shielded_instance_config](variables.tf#L188) | Shielded instance options. | <code title="object&#40;&#123;&#10; enable_secure_boot &#61; bool&#10; enable_integrity_monitoring &#61; bool&#10;&#125;&#41;">object&#40;&#123;&#8230;&#125;&#41;</code> | | <code>null</code> | | [node_shielded_instance_config](variables.tf#L188) | Shielded instance options. | <code title="object&#40;&#123;&#10; enable_secure_boot &#61; bool&#10; enable_integrity_monitoring &#61; bool&#10;&#125;&#41;">object&#40;&#123;&#8230;&#125;&#41;</code> | | <code>null</code> |
| [node_tags](variables.tf#L197) | Network tags applied to nodes. | <code>list&#40;string&#41;</code> | | <code>null</code> | | [node_spot](variables.tf#L197) | Use Spot VMs for nodes. | <code>bool</code> | | <code>null</code> |
| [node_taints](variables.tf#L203) | Kubernetes taints applied to nodes. E.g. type=blue:NoSchedule. | <code>list&#40;string&#41;</code> | | <code>&#91;&#93;</code> | | [node_tags](variables.tf#L203) | Network tags applied to nodes. | <code>list&#40;string&#41;</code> | | <code>null</code> |
| [upgrade_config](variables.tf#L215) | Optional node upgrade configuration. | <code title="object&#40;&#123;&#10; max_surge &#61; number&#10; max_unavailable &#61; number&#10;&#125;&#41;">object&#40;&#123;&#8230;&#125;&#41;</code> | | <code>null</code> | | [node_taints](variables.tf#L209) | Kubernetes taints applied to nodes. E.g. type=blue:NoSchedule. | <code>list&#40;string&#41;</code> | | <code>&#91;&#93;</code> |
| [workload_metadata_config](variables.tf#L224) | Metadata configuration to expose to workloads on the node pool. | <code>string</code> | | <code>&#34;GKE_METADATA&#34;</code> | | [upgrade_config](variables.tf#L221) | Optional node upgrade configuration. | <code title="object&#40;&#123;&#10; max_surge &#61; number&#10; max_unavailable &#61; number&#10;&#125;&#41;">object&#40;&#123;&#8230;&#125;&#41;</code> | | <code>null</code> |
| [workload_metadata_config](variables.tf#L230) | Metadata configuration to expose to workloads on the node pool. | <code>string</code> | | <code>&#34;GKE_METADATA&#34;</code> |
## Outputs ## Outputs

View File

@@ -105,6 +105,7 @@ resource "google_container_node_pool" "nodepool" {
service_account = local.service_account_email service_account = local.service_account_email
tags = var.node_tags tags = var.node_tags
boot_disk_kms_key = var.node_boot_disk_kms_key boot_disk_kms_key = var.node_boot_disk_kms_key
spot = var.node_spot
dynamic "guest_accelerator" { dynamic "guest_accelerator" {
for_each = var.node_guest_accelerator for_each = var.node_guest_accelerator

View File

@@ -194,6 +194,12 @@ variable "node_shielded_instance_config" {
default = null default = null
} }
variable "node_spot" {
description = "Use Spot VMs for nodes."
type = bool
default = null
}
variable "node_tags" { variable "node_tags" {
description = "Network tags applied to nodes." description = "Network tags applied to nodes."
type = list(string) type = list(string)