Skip to content

Commit

Permalink
Support for multi-ingress environments (#278)
Browse files Browse the repository at this point in the history
  • Loading branch information
sivanov-nuodb authored May 3, 2022
1 parent 37dd9c3 commit 46a3c85
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 8 deletions.
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ require (
github.com/otiai10/copy v1.2.0
github.com/stretchr/testify v1.7.0
golang.org/x/crypto v0.0.0-20200709230013-948cd5f35899 // indirect
golang.org/x/sys v0.0.0-20220422013727-9388b58f7150 // indirect
golang.org/x/time v0.0.0-20200630173020-3af7569d3a1e // indirect
gopkg.in/yaml.v2 v2.4.0
k8s.io/api v0.19.0
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -566,6 +566,8 @@ golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20200622214017-ed371f2e16b4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f h1:+Nyd8tzPX9R7BWHguqsrbFdRx3WQ/1ib8I44HXV5yTA=
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20220422013727-9388b58f7150 h1:xHms4gcpe1YE7A3yIllJXP16CMAGuqwO2lX1mTyyRRc=
golang.org/x/sys v0.0.0-20220422013727-9388b58f7150/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/text v0.0.0-20160726164857-2910a502d2bf/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
Expand Down
10 changes: 6 additions & 4 deletions test/minikube/minikube_external_access_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -293,23 +293,25 @@ func TestKubernetesIngress(t *testing.T) {
defer testlib.Teardown(testlib.TEARDOWN_DATABASE)

// install HAProxy Ingress controller
haProxyReleaseName := testlib.StartHAProxyIngress(t, &helm.Options{}, namespaceName)
haProxyOptions := helm.Options{}
haProxyReleaseName := testlib.StartHAProxyIngress(t, &haProxyOptions, namespaceName)
ingressClassName := haProxyReleaseName
_, ingressPort := findDomainExternalInfo(t, namespaceName, fmt.Sprintf("%s-kubernetes-ingress", haProxyReleaseName), "https")

options := helm.Options{
SetValues: map[string]string{
"admin.ingress.enabled": "true",
"admin.ingress.api.hostname": testlib.ADMIN_API_INGRESS_HOSTNAME,
"admin.ingress.api.className": "haproxy",
"admin.ingress.api.className": ingressClassName,
"admin.ingress.sql.hostname": testlib.ADMIN_SQL_INGRESS_HOSTNAME,
"admin.ingress.sql.className": "haproxy",
"admin.ingress.sql.className": ingressClassName,
"database.sm.resources.requests.cpu": testlib.MINIMAL_VIABLE_ENGINE_CPU,
"database.sm.resources.requests.memory": testlib.MINIMAL_VIABLE_ENGINE_MEMORY,
"database.te.resources.requests.cpu": testlib.MINIMAL_VIABLE_ENGINE_CPU,
"database.te.resources.requests.memory": testlib.MINIMAL_VIABLE_ENGINE_MEMORY,
"database.te.ingress.enabled": "true",
"database.te.ingress.hostname": testlib.DATABASE_TE_INGRESS_HOSTNAME,
"database.te.ingress.className": "haproxy",
"database.te.ingress.className": ingressClassName,
// The product doesn't support Ingress resource lookup, so define
// the port manually; most of the time in production a service of
// type=LoadBalancer will be provisioned for the Ingress Controller
Expand Down
10 changes: 6 additions & 4 deletions test/testlib/haproxy_utilities.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,12 @@ func StartHAProxyIngress(t *testing.T, options *helm.Options, namespaceName stri

defaultOptions := helm.Options{
SetValues: map[string]string{
"controller.replicaCount": "1",
"controller.service.type": "NodePort",
"defaultBackend.enabled": "true",
"defaultBackend.replicaCount": "1",
"controller.replicaCount": "1",
"controller.service.type": "NodePort",
"controller.ingressClass": helmChartReleaseName,
"controller.ingressClassResource.name": helmChartReleaseName,
"defaultBackend.enabled": "true",
"defaultBackend.replicaCount": "1",
},
}

Expand Down

0 comments on commit 46a3c85

Please sign in to comment.