Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions module-workers.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
22 changes: 22 additions & 0 deletions modules/workers/cloudinit.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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] : []
Expand Down
8 changes: 7 additions & 1 deletion modules/workers/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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 <a href=https://github.com/cri-o/cri-o/pull/9401>CRI-O pull request</a> 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 <a href=https://docs.oracle.com/en-us/iaas/api/#/en/iaas/20160918/datatypes/PlatformConfig>PlatformConfig</a> for more information."
Expand All @@ -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 <a href=https://docs.oracle.com/en-us/iaas/api/#/en/iaas/20160918/datatypes/InstanceAgentConfig for more information."
description = "Default agent_config for self-managed worker pools created with mode: 'instance', 'instance-pool', or 'cluster-network'. See <a href=https://docs.oracle.com/en-us/iaas/api/#/en/iaas/20160918/datatypes/InstanceAgentConfig>InstanceConfig</a> for more information."
type = object({
are_all_plugins_disabled = bool,
is_management_disabled = bool,
Expand Down
6 changes: 6 additions & 0 deletions variables-workers.tf
Original file line number Diff line number Diff line change
Expand Up @@ -251,3 +251,9 @@ variable "agent_config" {
plugins_config = map(string),
})
}

variable "allow_short_container_image_names" {
default = false
description = "Whether to allow short container image names for K8s version >= 1.34.0. See <a href=https://github.com/cri-o/cri-o/pull/9401>CRI-O pull request</a> for more information."
type = bool
}