Skip to content

Commit

Permalink
helm: allow further configurability of ingress version
Browse files Browse the repository at this point in the history
The ingress api version changed when it went to v1, and this has caused some upheaval
throughout the kubernetes ecosystem. This commit uses a common method of deciding which
ingress api to use, and allows the optional override of the kubernetes version
presented to helm using the helm build-in capabilities.
also add an ingress into the helm integration tests so any regressions to how ingresses
are handled in the future are caught easier.

Closes #9174

Signed-off-by: Tom Hellier <me@tomhellier.com>
(cherry picked from commit ba44602)
  • Loading branch information
TomHellier committed Nov 29, 2021
1 parent 90394c6 commit 88a46e5
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 1 deletion.
14 changes: 13 additions & 1 deletion tests/framework/installer/ceph_helm_installer.go
Expand Up @@ -69,14 +69,26 @@ 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
values["toolbox"] = 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
Expand Down
6 changes: 6 additions & 0 deletions tests/integration/ceph_base_deploy_test.go
Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions tests/integration/ceph_helm_test.go
Expand Up @@ -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
Expand Down

0 comments on commit 88a46e5

Please sign in to comment.