Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
4 changes: 4 additions & 0 deletions charts/simple-app/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# 1.8.0

* Add `ingress.paths` support to allow restricting exposed URL paths

# 1.7.0

* Add `extraManifests` support to inject arbitrary Kubernetes manifests into the release
Expand Down
2 changes: 1 addition & 1 deletion charts/simple-app/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: "1.7.0"
version: "1.8.0"

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
Expand Down
12 changes: 12 additions & 0 deletions charts/simple-app/templates/ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,23 @@ spec:
- host: {{ .Values.domain }}
http:
paths:
{{- if $ingress.paths }}
{{- range $ingress.paths }}
- path: {{ . }}
pathType: Prefix
backend:
service:
name: {{ $fullName }}
port:
number: {{ $svcPort }}
{{- end }}
{{- else }}
- path: {{ if $ingress.nginx }}/{{ else }}/*{{ end }}
pathType: ImplementationSpecific
backend:
service:
name: {{ $fullName }}
port:
number: {{ $svcPort }}
{{- end }}
{{- end }}
39 changes: 39 additions & 0 deletions charts/simple-app/tests/simple_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,45 @@ tests:
path: spec.rules[0].http.paths[0].backend.service.port.number
value: 7000

- it: Ingress should use custom paths when ingress.paths is set
template: ingress.yaml
set:
domain: example.com
ingress.enabled: true
ingress.paths:
- /api/v1/predict
- /api/v1/health
asserts:
- isKind:
of: Ingress
- equal:
path: spec.rules[0].http.paths[0].path
value: /api/v1/predict
- equal:
path: spec.rules[0].http.paths[0].pathType
value: Prefix
- equal:
path: spec.rules[0].http.paths[1].path
value: /api/v1/health
- equal:
path: spec.rules[0].http.paths[1].pathType
value: Prefix

- it: Ingress should use default catch-all path when ingress.paths is not set
template: ingress.yaml
set:
domain: example.com
ingress.enabled: true
asserts:
- isKind:
of: Ingress
- equal:
path: spec.rules[0].http.paths[0].path
value: "/*"
- equal:
path: spec.rules[0].http.paths[0].pathType
value: ImplementationSpecific

- it: Deployment should have correctly mounted volumes with pvc
template: deployment.yaml
asserts:
Expand Down
4 changes: 4 additions & 0 deletions charts/simple-app/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,10 @@ ingress: {}
# # - secretName: chart-example-tls
# # hosts:
# # - chart-example.local
# paths: [] # Optional list of path prefixes to expose (pathType: Prefix)
# # - /api/v1/predict
# # - /api/v1/health
# # If not set, defaults to a single catch-all path (/ for nginx, /* otherwise)

gateway:
# If enabled, creates HTTPRoute which uses given gateway
Expand Down
Loading