Skip to content

Commit 5a776ab

Browse files
committed
Add supprt for HTTPRoute
1 parent 46d7ab2 commit 5a776ab

3 files changed

Lines changed: 39 additions & 1 deletion

File tree

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.3.0
5+
version: 0.4.0
66
appVersion: "latest"
77
maintainers:
88
- name: pmint93
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{{- if .Values.httproute.enabled -}}
2+
apiVersion: gateway.networking.k8s.io/v1
3+
kind: HTTPRoute
4+
metadata:
5+
name: {{ template "single-deployment.fullname" . }}
6+
labels:
7+
{{- include "single-deployment.labels" . | nindent 4 }}
8+
{{- with .Values.httproute.labels }}
9+
{{- toYaml . | nindent 4 }}
10+
{{- end }}
11+
spec:
12+
parentRefs:
13+
- group: gateway.networking.k8s.io
14+
kind: Gateway
15+
name: {{ .Values.httproute.gatewayName }}
16+
namespace: {{ .Values.httproute.gatewayNamespace }}
17+
hostnames: {{ .Values.httproute.hosts }}
18+
rules:
19+
- matches:
20+
- path:
21+
type: {{ .Values.httproute.pathType }}
22+
value: {{ .Values.httproute.path }}
23+
backendRefs:
24+
- kind: Service
25+
name: {{ template "single-deployment.fullname" $ }}
26+
port: http
27+
28+
{{- end -}}

charts/single-deployment/values.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,16 @@ ingress:
166166
# hosts:
167167
# - chart-example.local
168168

169+
httproute:
170+
enabled: false
171+
# gatewayName: ""
172+
# gatewayNamespace: ""
173+
labels: {}
174+
path: /
175+
pathType: PathPrefix
176+
hosts:
177+
- default-backend.example.io
178+
169179
## Additional environment variables to set
170180
extraEnvs: {}
171181
# LOG_LEVEL: info

0 commit comments

Comments
 (0)