diff --git a/tests/framework/installer/ceph_helm_installer.go b/tests/framework/installer/ceph_helm_installer.go index 6e9c753793af8..b9e4f249d90ee 100644 --- a/tests/framework/installer/ceph_helm_installer.go +++ b/tests/framework/installer/ceph_helm_installer.go @@ -69,6 +69,7 @@ func (h *CephInstaller) CreateRookCephClusterViaHelm(values map[string]interface if err := yaml.Unmarshal([]byte(h.Manifests.GetCephCluster()), &clusterCRD); err != nil { return err } + values["cephClusterSpec"] = clusterCRD["spec"] values["operatorNamespace"] = h.settings.OperatorNamespace values["configOverride"] = clusterCustomSettings @@ -76,7 +77,18 @@ func (h *CephInstaller) CreateRookCephClusterViaHelm(values map[string]interface "enabled": true, "image": "rook/ceph:" + LocalBuildTag, } - values["cephClusterSpec"] = clusterCRD["spec"] + values["ingress"] = map[string]interface{}{ + "dashboard": map[string]interface{}{ + "annotations": map[string]interface{}{ + "kubernetes.io/ingress-class": "nginx", + "nginx.ingress.kubernetes.io/rewrite-target": "/ceph-dashboard/$2", + }, + "host": map[string]interface{}{ + "name": "localhost", + "path": "/ceph-dashboard(/|$)(.*)", + }, + }, + } if err := h.CreateBlockPoolConfiguration(values, blockPoolName, blockPoolSCName); err != nil { return err diff --git a/tests/integration/ceph_base_deploy_test.go b/tests/integration/ceph_base_deploy_test.go index 204de0e86124f..f52e792134760 100644 --- a/tests/integration/ceph_base_deploy_test.go +++ b/tests/integration/ceph_base_deploy_test.go @@ -86,6 +86,12 @@ func checkIfRookClusterIsHealthy(s suite.Suite, testClient *clients.TestClient, require.Nil(s.T(), err) } +func checkIfRookClusterHasHealthyIngress(s suite.Suite, k8sh *utils.K8sHelper, clusterNamespace string) { + logger.Infof("Testing ingress %s health", clusterNamespace) + _, err := k8sh.GetResourceStatus("Ingress", clusterNamespace + "-dashboard", clusterNamespace) + assert.NoError(s.T(), err) +} + func HandlePanics(r interface{}, uninstaller func(), t func() *testing.T) { if r != nil { logger.Infof("unexpected panic occurred during test %s, --> %v", t().Name(), r) diff --git a/tests/integration/ceph_helm_test.go b/tests/integration/ceph_helm_test.go index b0a1f5d741e9c..40abd7a719211 100644 --- a/tests/integration/ceph_helm_test.go +++ b/tests/integration/ceph_helm_test.go @@ -92,6 +92,7 @@ func (h *HelmSuite) AfterTest(suiteName, testName string) { // Test to make sure all rook components are installed and Running func (h *HelmSuite) TestARookInstallViaHelm() { checkIfRookClusterIsInstalled(h.Suite, h.k8shelper, h.settings.Namespace, h.settings.Namespace, 1) + checkIfRookClusterHasHealthyIngress(h.Suite, h.k8shelper, h.settings.Namespace) } // Test BlockCreation on Rook that was installed via Helm