38 lines
1.1 KiB
YAML
38 lines
1.1 KiB
YAML
{{- if .Values.httpRoute.enabled -}}
|
|
{{- $fullName := include "headlamp.fullname" . -}}
|
|
{{- $svcPort := .Values.service.port -}}
|
|
apiVersion: gateway.networking.k8s.io/v1
|
|
kind: HTTPRoute
|
|
metadata:
|
|
name: {{ $fullName }}
|
|
namespace: {{ include "headlamp.namespace" . }}
|
|
labels:
|
|
{{- include "headlamp.labels" . | nindent 4 }}
|
|
{{- with .Values.httpRoute.labels }}
|
|
{{- toYaml . | nindent 4 }}
|
|
{{- end }}
|
|
{{- with .Values.httpRoute.annotations }}
|
|
annotations:
|
|
{{- toYaml . | nindent 4 }}
|
|
{{- end }}
|
|
spec:
|
|
parentRefs:
|
|
{{- required "A valid .Values.httpRoute.parentRefs entry is required when httpRoute.enabled is true" .Values.httpRoute.parentRefs | toYaml | nindent 4 }}
|
|
{{- with .Values.httpRoute.hostnames }}
|
|
hostnames:
|
|
{{- toYaml . | nindent 4 }}
|
|
{{- end }}
|
|
rules:
|
|
{{- if .Values.httpRoute.rules }}
|
|
{{- toYaml .Values.httpRoute.rules | nindent 4 }}
|
|
{{- else }}
|
|
- matches:
|
|
- path:
|
|
type: PathPrefix
|
|
value: /
|
|
backendRefs:
|
|
- name: {{ $fullName }}
|
|
port: {{ $svcPort }}
|
|
{{- end }}
|
|
{{- end }}
|