diff --git a/module-workers.tf b/module-workers.tf index 9fb663c5..48821788 100644 --- a/module-workers.tf +++ b/module-workers.tf @@ -31,12 +31,13 @@ module "workers" { ad_numbers_to_names = local.ad_numbers_to_names # Cluster - apiserver_private_host = local.apiserver_private_host - cluster_ca_cert = local.cluster_ca_cert - cluster_dns = var.cluster_dns - cluster_id = coalesce(var.cluster_id, one(module.cluster[*].cluster_id)) - cluster_type = var.cluster_type - kubernetes_version = var.kubernetes_version + apiserver_private_host = local.apiserver_private_host + cluster_ca_cert = local.cluster_ca_cert + cluster_dns = var.cluster_dns + cluster_id = coalesce(var.cluster_id, one(module.cluster[*].cluster_id)) + cluster_type = var.cluster_type + kubernetes_version = var.kubernetes_version + allow_short_container_image_names = var.allow_short_container_image_names # Compute clusters compute_clusters = var.worker_compute_clusters diff --git a/modules/workers/cloudinit.tf b/modules/workers/cloudinit.tf index bb17b440..196f1d8b 100644 --- a/modules/workers/cloudinit.tf +++ b/modules/workers/cloudinit.tf @@ -96,6 +96,28 @@ data "cloudinit_config" "workers" { } } + # Disable CRI-O enforce shortnames mode (for versions greater than 1.34) + dynamic "part" { + for_each = tonumber(split(".", each.value.kubernetes_version)[1]) >= 34 && var.allow_short_container_image_names ? [1] : [] + content { + content_type = "text/cloud-config" + content = jsonencode({ + write_files = [ + { + content = <<-EOT + [crio.image] + short_name_mode = "disabled" + EOT + path = "/etc/crio/crio.conf.d/11-default.conf" + } + ] + }) + filename = "50-crio-config.yml" + merge_type = local.default_cloud_init_merge_type + } + } + + # OKE setup and initialization for Ubuntu images dynamic "part" { for_each = !each.value.disable_default_cloud_init && lookup(local.ubuntu_worker_pools, each.key, null) != null ? [1] : [] diff --git a/modules/workers/variables.tf b/modules/workers/variables.tf index 50b57462..ab2c18fd 100644 --- a/modules/workers/variables.tf +++ b/modules/workers/variables.tf @@ -297,6 +297,12 @@ variable "legacy_imds_endpoints_disabled" { type = bool } +variable "allow_short_container_image_names" { + default = false + description = "Whether to allow short container image names for K8s version >= 1.34.0. See CRI-O pull request for more information." + type = bool +} + variable "platform_config" { default = null description = "Default platform_config for self-managed worker pools created with mode: 'instance', 'instance-pool', or 'cluster-network'. See PlatformConfig for more information." @@ -316,7 +322,7 @@ variable "platform_config" { } variable "agent_config" { - description = "Default agent_config for self-managed worker pools created with mode: 'instance', 'instance-pool', or 'cluster-network'. See