Skip to content

Commit 5d9d80b

Browse files
authored
feat: add the ability to disable / enable the OCP console using new parameter in clusters input enable_ocp_console (#960)
1 parent 898a009 commit 5d9d80b

File tree

8 files changed

+53
-45
lines changed

8 files changed

+53
-45
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Large diffs are not rendered by default.

cluster.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ module "cluster" {
244244
if cluster.kube_type == "openshift"
245245
}
246246
source = "terraform-ibm-modules/base-ocp-vpc/ibm"
247-
version = "3.37.3"
247+
version = "3.41.7"
248248
resource_group_id = local.resource_groups[each.value.resource_group]
249249
region = var.region
250250
cluster_name = each.value.cluster_name
@@ -290,7 +290,6 @@ module "cluster" {
290290
)
291291
force_delete_storage = each.value.cluster_force_delete_storage
292292
ocp_version = each.value.kube_version == null || each.value.kube_version == "default" ? each.value.kube_version : replace(each.value.kube_version, "_openshift", "")
293-
import_default_worker_pool_on_create = each.value.import_default_worker_pool_on_create
294293
allow_default_worker_pool_replacement = each.value.allow_default_worker_pool_replacement
295294
tags = var.tags
296295
use_existing_cos = true
@@ -299,6 +298,7 @@ module "cluster" {
299298
verify_worker_network_readiness = each.value.verify_cluster_network_readiness
300299
use_private_endpoint = each.value.use_ibm_cloud_private_api_endpoints
301300
addons = each.value.addons
301+
enable_ocp_console = each.value.enable_ocp_console
302302
manage_all_addons = each.value.manage_all_addons
303303
disable_outbound_traffic_protection = each.value.disable_outbound_traffic_protection
304304
kms_config = each.value.kms_config == null ? {} : {

patterns/mixed/config.tf

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -111,19 +111,18 @@ locals {
111111
crk_name = "${var.prefix}-roks-key"
112112
private_endpoint = true
113113
}
114-
workers_per_subnet = var.workers_per_zone
115-
machine_type = var.flavor
116-
kube_type = "openshift"
117-
kube_version = var.kube_version
118-
resource_group = "${var.prefix}-${var.vpcs[1]}-rg"
119-
cos_name = "cos"
120-
entitlement = var.entitlement
121-
secondary_storage = var.secondary_storage
122-
use_private_endpoint = var.use_private_endpoint
123-
operating_system = "REDHAT_8_64"
124-
verify_worker_network_readiness = var.verify_worker_network_readiness
125-
boot_volume_crk_name = "${var.prefix}-roks-key"
126-
import_default_worker_pool_on_create = false
114+
workers_per_subnet = var.workers_per_zone
115+
machine_type = var.flavor
116+
kube_type = "openshift"
117+
kube_version = var.kube_version
118+
resource_group = "${var.prefix}-${var.vpcs[1]}-rg"
119+
cos_name = "cos"
120+
entitlement = var.entitlement
121+
secondary_storage = var.secondary_storage
122+
use_private_endpoint = var.use_private_endpoint
123+
operating_system = "REDHAT_8_64"
124+
verify_worker_network_readiness = var.verify_worker_network_readiness
125+
boot_volume_crk_name = "${var.prefix}-roks-key"
127126
# By default, create dedicated pool for logging
128127
worker_pools = [
129128
{

patterns/roks-quickstart/main.tf

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ locals {
4949
"workers_per_subnet": 1,
5050
"entitlement": ${local.entitlement_val},
5151
"disable_public_endpoint": false,
52-
"import_default_worker_pool_on_create" : false,
5352
"use_ibm_cloud_private_api_endpoints": false
5453
}
5554
],

patterns/roks/module/config.tf

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -91,24 +91,23 @@ locals {
9191
crk_name = "${var.prefix}-roks-key"
9292
private_endpoint = true
9393
}
94-
workers_per_subnet = var.workers_per_zone
95-
machine_type = var.flavor
96-
kube_type = "openshift"
97-
kube_version = var.kube_version
98-
resource_group = "${var.prefix}-${network}-rg"
99-
cos_name = "cos"
100-
entitlement = var.entitlement
101-
secondary_storage = var.secondary_storage
102-
addons = var.cluster_addons
103-
manage_all_addons = var.manage_all_cluster_addons
104-
boot_volume_crk_name = "${var.prefix}-roks-key"
105-
disable_outbound_traffic_protection = var.disable_outbound_traffic_protection
106-
cluster_force_delete_storage = var.cluster_force_delete_storage
107-
operating_system = var.operating_system
108-
kms_wait_for_apply = var.kms_wait_for_apply
109-
use_ibm_cloud_private_api_endpoints = var.use_ibm_cloud_private_api_endpoints
110-
verify_cluster_network_readiness = var.verify_cluster_network_readiness
111-
import_default_worker_pool_on_create = false
94+
workers_per_subnet = var.workers_per_zone
95+
machine_type = var.flavor
96+
kube_type = "openshift"
97+
kube_version = var.kube_version
98+
resource_group = "${var.prefix}-${network}-rg"
99+
cos_name = "cos"
100+
entitlement = var.entitlement
101+
secondary_storage = var.secondary_storage
102+
addons = var.cluster_addons
103+
manage_all_addons = var.manage_all_cluster_addons
104+
boot_volume_crk_name = "${var.prefix}-roks-key"
105+
disable_outbound_traffic_protection = var.disable_outbound_traffic_protection
106+
cluster_force_delete_storage = var.cluster_force_delete_storage
107+
operating_system = var.operating_system
108+
kms_wait_for_apply = var.kms_wait_for_apply
109+
use_ibm_cloud_private_api_endpoints = var.use_ibm_cloud_private_api_endpoints
110+
verify_cluster_network_readiness = var.verify_cluster_network_readiness
112111
# By default, create dedicated pool for logging
113112
worker_pools = [
114113
# {

tests/resources/override-example.json

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
"operating_system": "REDHAT_8_64",
2222
"use_ibm_cloud_private_api_endpoints": false,
2323
"verify_cluster_network_readiness": false,
24-
"import_default_worker_pool_on_create": false,
2524
"kms_config": {
2625
"crk_name": "slz-key",
2726
"private_endpoint": true
@@ -110,7 +109,19 @@
110109
"force_delete": true,
111110
"kms_key": "slz-atracker-key",
112111
"name": "atracker-bucket",
113-
"storage_class": "standard"
112+
"storage_class": "standard",
113+
"expire_rule": {
114+
"rule_id": "a-bucket-expire-rule",
115+
"enable": true,
116+
"days": 30,
117+
"prefix": "logs/"
118+
},
119+
"archive_rule": {
120+
"rule_id": "a-bucket-arch-rule",
121+
"enable": true,
122+
"days": 0,
123+
"type": "Glacier"
124+
}
114125
}
115126
],
116127
"keys": [
@@ -393,7 +404,7 @@
393404
{
394405
"access_tags": [],
395406
"boot_volume_encryption_key_name": "slz-vsi-volume-key",
396-
"image_name": "ibm-ubuntu-24-04-6-minimal-amd64-1",
407+
"image_name": "ibm-ubuntu-24-04-6-minimal-amd64-2",
397408
"machine_type": "cx2-2x4",
398409
"name": "jump-box",
399410
"resource_group": "slz-management-rg",
@@ -427,7 +438,7 @@
427438
{
428439
"access_tags": [],
429440
"boot_volume_encryption_key_name": "slz-vsi-volume-key",
430-
"image_name": "ibm-ubuntu-24-04-6-minimal-amd64-1",
441+
"image_name": "ibm-ubuntu-24-04-6-minimal-amd64-2",
431442
"machine_type": "cx2-2x4",
432443
"name": "private-svs",
433444
"resource_group": "slz-work-rg",
@@ -461,7 +472,7 @@
461472
{
462473
"access_tags": [],
463474
"boot_volume_encryption_key_name": "slz-vsi-volume-key",
464-
"image_name": "ibm-ubuntu-24-04-6-minimal-amd64-1",
475+
"image_name": "ibm-ubuntu-24-04-6-minimal-amd64-2",
465476
"machine_type": "cx2-2x4",
466477
"name": "inet-svs",
467478
"resource_group": "slz-edge-rg",

variables.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -887,9 +887,9 @@ variable "clusters" {
887887
kms_wait_for_apply = optional(bool, true) # make terraform wait until KMS is applied to master and it is ready and deployed
888888
verify_cluster_network_readiness = optional(bool, true) # Flag to run a script will run kubectl commands to verify that all worker nodes can communicate successfully with the master. If the runtime does not have access to the kube cluster to run kubectl commands, this should be set to false.
889889
use_ibm_cloud_private_api_endpoints = optional(bool, true) # Flag to force all cluster related api calls to use the IBM Cloud private endpoints.
890-
import_default_worker_pool_on_create = optional(bool) # (Advanced users) Whether to handle the default worker pool as a stand-alone ibm_container_vpc_worker_pool resource on cluster creation. Only set to false if you understand the implications of managing the default worker pool as part of the cluster resource. Set to true to import the default worker pool as a separate resource. Set to false to manage the default worker pool as part of the cluster resource.
891-
allow_default_worker_pool_replacement = optional(bool) # (Advanced users) Set to true to allow the module to recreate a default worker pool. Only use in the case where you are getting an error indicating that the default worker pool cannot be replaced on apply. Once the default worker pool is handled as a stand-alone ibm_container_vpc_worker_pool, if you wish to make any change to the default worker pool which requires the re-creation of the default pool set this variable to true
890+
allow_default_worker_pool_replacement = optional(bool) # (Advanced users) Set to true to allow the module to recreate a default worker pool. If you wish to make any change to the default worker pool which requires the re-creation of the default pool follow these [steps](https://github.com/terraform-ibm-modules/terraform-ibm-base-ocp-vpc?tab=readme-ov-file#important-considerations-for-terraform-and-default-worker-pool).
892891
labels = optional(map(string)) # A list of labels that you want to add to the default worker pool.
892+
enable_ocp_console = optional(bool) # Flag to specify whether to enable or disable the OpenShift console. If set to `null` the module will not modify the setting currently set on the cluster. Bare in mind when setting this to `true` or `false` on a cluster with private only endpoint enabled, the runtime must be able to access the private endpoint.
893893
addons = optional(object({ # Map of OCP cluster add-on versions to install
894894
debug-tool = optional(string)
895895
image-key-synchronizer = optional(string)

version.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ terraform {
88
required_providers {
99
ibm = {
1010
source = "IBM-Cloud/ibm"
11-
version = ">= 1.68.1, < 2.0.0"
11+
version = ">= 1.71.0, < 2.0.0"
1212
}
1313
random = {
1414
source = "hashicorp/random"

0 commit comments

Comments
 (0)