fbpx

This page demonstrates how to create an Ocean GKE Custom Launch Specification resource using the Spotinst Terraform plugin.

This post assumes that you already have a Spotinst account and went through Spotinst Terraform Installation & Configuration

Example Usage – Ocean GKE Launch Specification
resource "spotinst_ocean_gke_launch_spec" "example" {
  ocean_id     = "o-123456"
  source_image = "image"
  
  metadata {
    key   = "gci-update-strategy"
    value = "update_disabled"
  }
  
  labels {
    key   = "labelKey"
    value = "labelVal"
  }
  
  taints {
    key    = "taintKey"
    value  = "taintVal"
    effect = "taintEffect"
  }
  
  autoscale_headrooms {
    num_of_units = 5
    cpu_per_unit = 1000
    gpu_per_unit = 0
    memory_per_unit = 2048
  }
}

 

Argument Reference

ParameterTypeDescription
ocean_id * String

The Ocean cluster ID.

Example: o-123456
source_image String

Image URL.

Example: ami-123456
metadata String

Cluster's metadata.

Example: echo hello world
labels Object

Optionally adds labels to instances launched in an Ocean cluster.

labels.key * String

The label key.

Example: fakeKey
labels.value * String

The label value.

Example: fakeValue
taints Object

Optionally adds taints to instances launched in an Ocean cluster.

taints.key * String

The tag key.

taints.value * String

The tag value.

taints.effect * String

The effect of the taint. Valid values: "NoSchedule", "PreferNoSchedule", "NoExecute".

autoscale_headrooms Object

Set custom headroom per launch spec. Provide list of headrooms object.

autoscale_headrooms.num_of_units * Integer

The number of units to retain as headroom, where each unit has the defined headroom CPU, memory and GPU.

autoscale_headrooms.cpu_per_unit Integer

Optionally configure the number of CPUs to allocate for each headroom unit. CPUs are denoted in CPU units, where 1024 units = 1 vCPU.

autoscale_headrooms.gpu_per_unit Integer

Optionally configure the number of GPUS to allocate for each headroom unit.

autoscale_headrooms.memory_per_unit Integer

Optionally configure the amount of memory (MiB) to allocate for each headroom unit.