From a7090c53a7cd51b52d7bad9d915077a0c85e9838 Mon Sep 17 00:00:00 2001 From: Coady LaCroix Date: Fri, 5 Jan 2024 04:04:38 -0800 Subject: [PATCH 1/2] Use COS as noobaa backing store for IBM Cloud IPI (#9072) * Use COS as noobaa backing store for IBM Cloud IPI Signed-off-by: Coady LaCroix --- ocs_ci/deployment/deployment.py | 7 +++++++ ocs_ci/utility/ibmcloud.py | 15 +++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/ocs_ci/deployment/deployment.py b/ocs_ci/deployment/deployment.py index b1914145aec..cbb81e7865d 100644 --- a/ocs_ci/deployment/deployment.py +++ b/ocs_ci/deployment/deployment.py @@ -374,6 +374,12 @@ def post_ocp_deploy(self): enable_huge_pages() if config.DEPLOYMENT.get("dummy_zone_node_labels"): create_dummy_zone_labels() + ibmcloud_ipi = ( + config.ENV_DATA["platform"] == constants.IBMCLOUD_PLATFORM + and config.ENV_DATA["deployment_type"] == "ipi" + ) + if ibmcloud_ipi: + ibmcloud.label_nodes_region() def label_and_taint_nodes(self): """ @@ -692,6 +698,7 @@ def deploy_ocs_via_operator(self, image=None): ibmcloud.add_deployment_dependencies() if not live_deployment: create_ocs_secret(self.namespace) + if config.ENV_DATA["platform"] == constants.IBMCLOUD_PLATFORM: if config.DEPLOYMENT.get("create_ibm_cos_secret", True): logger.info("Creating secret for IBM Cloud Object Storage") with open(constants.IBM_COS_SECRET_YAML, "r") as cos_secret_fd: diff --git a/ocs_ci/utility/ibmcloud.py b/ocs_ci/utility/ibmcloud.py index 3bf12d11d85..82bc1b54ec8 100644 --- a/ocs_ci/utility/ibmcloud.py +++ b/ocs_ci/utility/ibmcloud.py @@ -518,3 +518,18 @@ def delete_volume_id(self, volume): logger.info(f"volume is deleted successfully: {volume}") else: logger.info("volume is not deleted") + + +def label_nodes_region(): + """ + Apply the region label to the worker and master nodes. + Necessary for IBM COS-backed backingstore support. + + """ + logger.info("Applying region label to worker and master nodes") + region = config.ENV_DATA.get("region") + worker_nodes = get_nodes(node_type=constants.WORKER_MACHINE) + master_nodes = get_nodes(node_type=constants.MASTER_MACHINE) + all_nodes = worker_nodes + master_nodes + for node in all_nodes: + node.add_label(rf"ibm-cloud\.kubernetes\.io/region={region}") From 1388330774a1870b66d1cee5606a22001fe113a3 Mon Sep 17 00:00:00 2001 From: Coady LaCroix Date: Fri, 12 Jan 2024 12:55:55 -0800 Subject: [PATCH 2/2] Only apply region node to worker nodes for noobaa IBM Cloud COS backingstore (#9147) Signed-off-by: Coady LaCroix --- ocs_ci/utility/ibmcloud.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/ocs_ci/utility/ibmcloud.py b/ocs_ci/utility/ibmcloud.py index 82bc1b54ec8..62a2e5f7685 100644 --- a/ocs_ci/utility/ibmcloud.py +++ b/ocs_ci/utility/ibmcloud.py @@ -522,14 +522,12 @@ def delete_volume_id(self, volume): def label_nodes_region(): """ - Apply the region label to the worker and master nodes. + Apply the region label to the worker nodes. Necessary for IBM COS-backed backingstore support. """ - logger.info("Applying region label to worker and master nodes") + logger.info("Applying region label to worker nodes") region = config.ENV_DATA.get("region") worker_nodes = get_nodes(node_type=constants.WORKER_MACHINE) - master_nodes = get_nodes(node_type=constants.MASTER_MACHINE) - all_nodes = worker_nodes + master_nodes - for node in all_nodes: + for node in worker_nodes: node.add_label(rf"ibm-cloud\.kubernetes\.io/region={region}")