Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ability to provide extra Ingress backends (refs #361). #413

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v2
name: vault
version: 0.8.0
version: 0.8.1
rossigee marked this conversation as resolved.
Show resolved Hide resolved
appVersion: 1.5.4
description: Official HashiCorp Vault Chart
home: https://www.vaultproject.io
Expand Down
6 changes: 6 additions & 0 deletions templates/server-ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,12 @@ spec:
- host: {{ .host | quote }}
http:
paths:
{{- range .extraBackends }}
rossigee marked this conversation as resolved.
Show resolved Hide resolved
- path: {{ .path }}
backend:
serviceName: {{ .serviceName }}
servicePort: {{ .servicePort }}
{{- end }}
{{- range (.paths | default (list "/")) }}
- path: {{ . }}
backend:
Expand Down
19 changes: 18 additions & 1 deletion test/unit/server-ingress.bats
Original file line number Diff line number Diff line change
Expand Up @@ -120,4 +120,21 @@ load _helpers
. | tee /dev/stderr |
yq -r '.spec.rules[0].http.paths[0].backend.serviceName' | tee /dev/stderr)
[ "${actual}" = "RELEASE-NAME-vault" ]
}
}

@test "server/ingress: adds extra backend workaround for ALB https redirection - yaml" {
cd `chart_dir`

local actual=$(helm template \
--show-only templates/server-ingress.yaml \
--set 'server.ingress.enabled=true' \
--set 'server.ingress.hosts[0].host=test.com' \
--set 'server.ingress.hosts[0].paths[0]=/' \
--set 'server.ingress.hosts[0].extraBackends[0].path=/' \
--set 'server.ingress.hosts[0].extraBackends[0].serviceName=ssl-redirect' \
--set 'server.ingress.hosts[0].extraBackends[0].servicePort=use-annotation' \
--set 'server.service.enabled=true' \
. | tee /dev/stderr |
yq -r '.spec.rules[0].http.paths[0].backend.serviceName' | tee /dev/stderr)
[ "${actual}" = "ssl-redirect" ]
}
8 changes: 8 additions & 0 deletions values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,14 @@ server:
hosts:
- host: chart-example.local
paths: []
# Allow adding extra backend sections. This allows us to make use of
# the annotations required to do https redirection using AWS
# Application Load Balancers.
# See <https://github.com/hashicorp/vault-helm/issues/361>.
# extraBackends:
# - path: /*
# serviceName: ssl-redirect
# servicePort: use-annotation

tls: []
# - secretName: chart-example-tls
Expand Down