Skip to content
Open
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
98 changes: 98 additions & 0 deletions chart/templates/httproute.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
{{- if .Values.httpRoute.enabled -}}
{{- $fullName := include "fusionauth.fullname" . -}}
apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
name: {{ $fullName }}
labels:
app.kubernetes.io/name: {{ include "fusionauth.name" . }}
helm.sh/chart: {{ include "fusionauth.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- with .Values.httpRoute.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
parentRefs:
{{- range .Values.httpRoute.parentRefs }}
- name: {{ .name }}
{{- with .namespace }}
namespace: {{ . }}
{{- end }}
sectionName: https
{{- end }}
{{- with .Values.httpRoute.hostnames }}
hostnames:
{{- toYaml . | nindent 4 }}
{{- end }}
rules:
- matches:
{{- range .Values.httpRoute.matches }}
- path:
type: {{ .path.type | default "PathPrefix" }}
value: {{ .path.value | default "/" }}
{{- with .method }}
method: {{ . }}
{{- end }}
{{- with .headers }}
headers:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with .queryParams }}
queryParams:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- end }}
{{- with .Values.httpRoute.filters }}
filters:
{{- toYaml . | nindent 8 }}
{{- end }}
backendRefs:
- name: {{ $fullName }}
port: {{ .Values.service.port }}
{{- with .Values.httpRoute.backendRefs.weight }}
weight: {{ . }}
{{- end }}
{{- if .Values.httpRoute.redirect }}
---
apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
name: {{ $fullName }}-redirect
labels:
app.kubernetes.io/name: {{ include "fusionauth.name" . }}
helm.sh/chart: {{ include "fusionauth.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- with .Values.httpRoute.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
parentRefs:
{{- range .Values.httpRoute.parentRefs }}
- name: {{ .name }}
{{- with .namespace }}
namespace: {{ . }}
{{- end }}
sectionName: http
{{- end }}
{{- with .Values.httpRoute.hostnames }}
hostnames:
{{- toYaml . | nindent 4 }}
{{- end }}
rules:
- matches:
{{- range .Values.httpRoute.matches }}
- path:
type: {{ .path.type | default "PathPrefix" }}
value: {{ .path.value | default "/" }}
{{- end }}
filters:
- type: RequestRedirect
requestRedirect:
scheme: https
statusCode: 301
{{- end }}
{{- end }}
29 changes: 29 additions & 0 deletions chart/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,35 @@
}
}
},
"httpRoute": {
"type": "object",
"properties": {
"enabled": {
"type": "boolean"
},
"annotations": {
"type": "object"
},
"parentRefs": {
"type": "array"
},
"hostnames": {
"type": "array"
},
"matches": {
"type": "array"
},
"filters": {
"type": "array"
},
"backendRefs": {
"type": "object"
},
"redirect": {
"type": "boolean"
}
}
},
"initContainers": {
"type": "object",
"properties": {
Expand Down
32 changes: 32 additions & 0 deletions chart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,38 @@ ingress:
# hosts:
# - chart-example.local

httpRoute:
# httpRoute.enabled -- Enables HTTPRoute creation for fusionauth (requires Gateway API)
enabled: false
# httpRoute.annotations -- Configure annotations to add to the HTTPRoute object
annotations: {}
# httpRoute.parentRefs -- List of parent Gateway references
parentRefs:
- name: gateway
namespace: default
# Optional: specify a specific listener section
# sectionName: https
# httpRoute.hostnames -- List of hostnames for the route
hostnames:
- fusionauth.example.com
# httpRoute.matches -- Path matching rules for the route
matches:
- path:
type: PathPrefix
value: /
# httpRoute.filters -- Optional filters to apply to requests
filters: []
# - type: RequestHeaderModifier
# requestHeaderModifier:
# set:
# - name: X-Custom-Header
# value: custom-value
# httpRoute.backendRefs -- Backend configuration
backendRefs:
weight: 1
# httpRoute.redirect -- Enable HTTP to HTTPS redirect HTTPRoute (creates a separate HTTPRoute for redirection)
redirect: false

# resources -- Define resource requests and limits for fusionauth-app.
resources: {}
# We usually recommend not to specify default resources and to leave this as a conscious
Expand Down