Skip to content

Commit

Permalink
feat: The operating_system input is now a required variable for OCP…
Browse files Browse the repository at this point in the history
… related DAs. Valid values are `REDHAT_8_64` or `RHCOS`. Anyone who is using the override json will now also need to explicitly set this value. (#905)
  • Loading branch information
Aashiq-J authored Oct 23, 2024
1 parent d8ddba1 commit e2390eb
Show file tree
Hide file tree
Showing 14 changed files with 18 additions and 11 deletions.
4 changes: 2 additions & 2 deletions README.md

Large diffs are not rendered by default.

3 changes: 1 addition & 2 deletions cluster.tf
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ module "cluster" {
if cluster.kube_type == "openshift"
}
source = "terraform-ibm-modules/base-ocp-vpc/ibm"
version = "3.32.1"
version = "3.34.0"
resource_group_id = local.resource_groups[each.value.resource_group]
region = var.region
cluster_name = each.value.cluster_name
Expand Down Expand Up @@ -289,7 +289,6 @@ module "cluster" {
] : []
)
force_delete_storage = each.value.cluster_force_delete_storage
operating_system = each.value.operating_system
ocp_version = each.value.kube_version == null || each.value.kube_version == "default" ? each.value.kube_version : replace(each.value.kube_version, "_openshift", "")
import_default_worker_pool_on_create = each.value.import_default_worker_pool_on_create
allow_default_worker_pool_replacement = each.value.allow_default_worker_pool_replacement
Expand Down
1 change: 1 addition & 0 deletions dynamic_values/cluster.tf
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ module "ut_cluster_map" {
workers_per_subnet = 2
flavor = "spicy"
secondary_storage = "300gb.5iops-tier"
operating_system = "REDHAT_8_64"
}
]
}
Expand Down
1 change: 1 addition & 0 deletions dynamic_values/cluster_worker_pools.tf
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ module "ut_worker_pools" {
workers_per_subnet = 2
flavor = "spicy"
secondary_storage = "300gb.5iops-tier"
operating_system = "REDHAT_8_64"
}
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ locals {
vpc_id = var.vpc_modules[pool.vpc_name].vpc_id # add vpc_id
subnets = module.worker_pool_subnets["${var.prefix}-${cluster.name}-${pool.name}"].subnets
kube_type = cluster.kube_type
operating_system = lookup(pool, "operating_system", null)
operating_system = lookup(pool, "operating_system", "REDHAT_8_64")
}) if pool != null
] if cluster.worker_pools != null
]
Expand Down
1 change: 1 addition & 0 deletions examples/override-example/override.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
"flavor": "bx2.16x64",
"name": "logging-worker-pool",
"secondary_storage": "300gb.5iops-tier",
"operating_system" : "REDHAT_8_64",
"subnet_names": [
"vsi-zone-1",
"vsi-zone-2",
Expand Down
1 change: 1 addition & 0 deletions patterns/mixed/config.tf
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ locals {
"vsi-zone-${zone}"
]
entitlement = var.entitlement
operating_system = "REDHAT_8_64"
workers_per_subnet = var.workers_per_zone
flavor = var.flavor
secondary_storage = var.secondary_storage
Expand Down
1 change: 1 addition & 0 deletions patterns/mixed/override.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
"entitlement": "cloud_pak",
"flavor": "bx2.16x64",
"name": "logging-worker-pool",
"operating_system": "REDHAT_8_64",
"subnet_names": [
"vsi-zone-1",
"vsi-zone-2",
Expand Down
2 changes: 1 addition & 1 deletion patterns/roks-quickstart/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ locals {
"resource_group": "workload-rg",
"disable_outbound_traffic_protection": true,
"cluster_force_delete_storage": true,
"operating_system": null,
"operating_system": "REDHAT_8_64",
"kms_wait_for_apply": true,
"kms_config": {
"crk_name": "roks-key",
Expand Down
1 change: 1 addition & 0 deletions patterns/roks/module/config.tf
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ locals {
# workers_per_subnet = var.workers_per_zone
# flavor = var.flavor
# boot_volume_crk_name = "${var.prefix}-roks-key"
# operating_system = "REDHAT_8_64"
# }
]
}
Expand Down
4 changes: 2 additions & 2 deletions patterns/roks/module/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -272,10 +272,10 @@ variable "cluster_force_delete_storage" {
variable "operating_system" {
type = string
description = "The operating system of the workers in the default worker pool. If no value is specified, the current default version OS will be used. See https://cloud.ibm.com/docs/openshift?topic=openshift-openshift_versions#openshift_versions_available ."
default = null
default = "REDHAT_8_64"
validation {
error_message = "RHEL 8 (REDHAT_8_64) or Red Hat Enterprise Linux CoreOS (RHCOS) are the allowed OS values. RHCOS requires VPC clusters created from 4.15 onwards. Upgraded clusters from 4.14 cannot use RHCOS."
condition = var.operating_system == null || var.operating_system == "REDHAT_8_64" || var.operating_system == "RHCOS"
condition = var.operating_system == "REDHAT_8_64" || var.operating_system == "RHCOS"
}
}

Expand Down
2 changes: 2 additions & 0 deletions patterns/roks/override.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
"vsi-zone-3"
],
"vpc_name": "management",
"operating_system": "REDHAT_8_64",
"workers_per_subnet": 2
}
],
Expand Down Expand Up @@ -76,6 +77,7 @@
"vsi-zone-3"
],
"vpc_name": "workload",
"operating_system": "REDHAT_8_64",
"workers_per_subnet": 2
}
],
Expand Down
4 changes: 2 additions & 2 deletions patterns/roks/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -290,10 +290,10 @@ variable "cluster_force_delete_storage" {
variable "operating_system" {
type = string
description = "The operating system of the workers in the default worker pool. If no value is specified, the current default version OS will be used. See https://cloud.ibm.com/docs/openshift?topic=openshift-openshift_versions#openshift_versions_available ."
default = null
default = "REDHAT_8_64"
validation {
error_message = "RHEL 8 (REDHAT_8_64) or Red Hat Enterprise Linux CoreOS (RHCOS) are the allowed OS values. RHCOS requires VPC clusters created from 4.15 onwards. Upgraded clusters from 4.14 cannot use RHCOS."
condition = var.operating_system == null || var.operating_system == "REDHAT_8_64" || var.operating_system == "RHCOS"
condition = var.operating_system == "REDHAT_8_64" || var.operating_system == "RHCOS"
}
}

Expand Down
2 changes: 1 addition & 1 deletion variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -889,7 +889,7 @@ variable "clusters" {
entitlement = optional(string) # entitlement option for openshift
secondary_storage = optional(string) # Secondary storage type
boot_volume_crk_name = optional(string) # Boot volume encryption key name
operating_system = optional(string) # The operating system of the workers in the default worker pool. If no value is specified, the current default version OS will be used. See https://cloud.ibm.com/docs/openshift?topic=openshift-openshift_versions#openshift_versions_available .
operating_system = string # The operating system of the workers in the default worker pool. See https://cloud.ibm.com/docs/openshift?topic=openshift-openshift_versions#openshift_versions_available .
labels = optional(map(string)) # A list of labels that you want to add to all the worker nodes in the worker pool.
})
)
Expand Down

0 comments on commit e2390eb

Please sign in to comment.