diff --git a/ocs_ci/deployment/hosted_cluster.py b/ocs_ci/deployment/hosted_cluster.py index 5606d783aa8..578f87aa7cd 100644 --- a/ocs_ci/deployment/hosted_cluster.py +++ b/ocs_ci/deployment/hosted_cluster.py @@ -38,6 +38,7 @@ get_latest_release_version, ) from ocs_ci.utility.version import get_semantic_version +from ocs_ci.ocs.resources.storage_client import StorageClient logger = logging.getLogger(__name__) @@ -103,6 +104,16 @@ def do_deploy(self, cluster_names=None): logger.info("Download kubeconfig for all clusters") kubeconfig_paths = self.download_hosted_clusters_kubeconfig_files() + # Need to create networkpolicy as mentioned in bug 2281536, + # https://bugzilla.redhat.com/show_bug.cgi?id=2281536#c21 + + # Create Network Policy + storage_client = StorageClient() + for cluster_name in cluster_names: + storage_client.create_network_policy( + namespace_to_create_storage_client=f"clusters-{cluster_name}" + ) + # stage 4 deploy ODF on all hosted clusters if not already deployed for cluster_name in cluster_names: