Skip to content

Commit f1d9289

Browse files
authored
Merge pull request #158 from pmint93/single-deployment-httproute
Add rewrite support for HTTPRoute
2 parents 6905d37 + 20ef124 commit f1d9289

File tree

3 files changed

+14
-1
lines changed

3 files changed

+14
-1
lines changed

charts/single-deployment/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ apiVersion: v2
22
name: single-deployment
33
description: A Helm chart for single deployment application
44
type: application
5-
version: 0.4.1
5+
version: 0.4.2
66
appVersion: "latest"
77
maintainers:
88
- name: pmint93

charts/single-deployment/templates/httproute.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,18 @@ spec:
2020
- path:
2121
type: {{ .Values.httproute.pathType }}
2222
value: {{ .Values.httproute.path }}
23+
{{- if .Values.httproute.rewriteTo }}
24+
filters:
25+
- type: URLRewrite
26+
urlRewrite:
27+
path:
28+
type: {{- if eq .Values.httproute.pathType "Exact" }} ReplaceFullPath {{ else }} ReplacePrefixMatch {{ end }}
29+
{{- if eq .Values.httproute.pathType "Exact" }}
30+
replaceFullPath: {{ .Values.httproute.rewriteTo }}
31+
{{- else }}
32+
replacePrefixMatch: {{ .Values.httproute.rewriteTo }}
33+
{{- end }}
34+
{{- end }}
2335
backendRefs:
2436
- kind: Service
2537
name: {{ template "single-deployment.fullname" $ }}

charts/single-deployment/values.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,7 @@ httproute:
173173
labels: {}
174174
path: /
175175
pathType: PathPrefix
176+
# rewriteTo: /
176177
hosts:
177178
- default-backend.example.io
178179

0 commit comments

Comments
 (0)