Skip to content

Latest commit

 

History

History
78 lines (61 loc) · 2.35 KB

File metadata and controls

78 lines (61 loc) · 2.35 KB
page_title stackit_ske_machine_image_versions Data Source - stackit
subcategory
description Returns a list of supported Kubernetes machine image versions for the cluster nodes.

stackit_ske_machine_image_versions (Data Source)

Returns a list of supported Kubernetes machine image versions for the cluster nodes.

Example Usage

data "stackit_ske_machine_image_versions" "example" {
  version_state = "SUPPORTED"
}

locals {
  flatcar_supported_version = one(flatten([
    for mi in data.stackit_ske_machine_image_versions.example.machine_images : [
      for v in mi.versions :
      v.version
      if mi.name == "flatcar" # or ubuntu
    ]
  ]))
}

resource "stackit_ske_cluster" "example" {
  project_id         = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
  name               = "example"
  kubernetes_version = "x.x"
  node_pools = [
    {
      name               = "np-example"
      machine_type       = "x.x"
      os_version         = local.flatcar_supported_version
      os_name            = "flatcar"
      minimum            = "2"
      maximum            = "3"
      availability_zones = ["eu01-1"]
      volume_type        = "storage_premium_perf6"
      volume_size        = "48"
    }
  ]
}

Schema

Optional

  • region (String) Region override. If omitted, the provider’s region will be used.
  • version_state (String) Filter returned machine image versions by their state. Possible values are: SUPPORTED.

Read-Only

Nested Schema for machine_images

Read-Only:

  • name (String) Name of the OS image (e.g., ubuntu or flatcar).
  • versions (Attributes List) Supported versions of the image. (see below for nested schema)

Nested Schema for machine_images.versions

Read-Only:

  • cri (List of String) Container runtimes supported (e.g., containerd).
  • expiration_date (String) Expiration date of the version in RFC3339 format.
  • state (String) State of the image version.
  • version (String) Machine image version string.