fix(gatewayAPI): add httpRoute

This commit is contained in:
2026-05-29 22:08:35 +02:00
parent 20f522e437
commit f5de20f34a
4 changed files with 324 additions and 0 deletions
+32
View File
@@ -0,0 +1,32 @@
{{/* vim: set filetype=mustache: */}}
{{/* annotations */}}
{{- define "reposilite.httpRoute.annotations" -}}
{{ include "reposilite.annotations" . }}
{{- if .Values.gatewayAPI.core.httpRoute.annotations }}
{{ toYaml .Values.gatewayAPI.core.httpRoute.annotations }}
{{- end }}
{{- end }}
{{/* enabled */}}
{{- define "reposilite.httpRoute.enabled" -}}
{{- if and .Values.gatewayAPI.enabled
.Values.gatewayAPI.core.httpRoute.enabled
.Values.service.enabled
-}}
true
{{- else -}}
false
{{- end -}}
{{- end }}
{{/* labels */}}
{{- define "reposilite.httpRoute.labels" -}}
{{ include "reposilite.labels" . }}
{{- if .Values.gatewayAPI.core.httpRoute.labels }}
{{ toYaml .Values.gatewayAPI.core.httpRoute.labels }}
{{- end }}
{{- end }}
+36
View File
@@ -0,0 +1,36 @@
{{- if eq (include "reposilite.httpRoute.enabled" $) "true" }}
---
apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
{{- with (include "reposilite.httpRoute.annotations" . | fromYaml) }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with (include "reposilite.httpRoute.labels" . | fromYaml) }}
labels:
{{- toYaml . | nindent 4 }}
{{- end }}
name: {{ include "reposilite.fullname" . }}
namespace: {{ .Release.Namespace }}
spec:
{{- with .Values.gatewayAPI.core.httpRoute.hostnames }}
hostnames:
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with .Values.gatewayAPI.core.httpRoute.parentRefs }}
parentRefs:
{{- toYaml . | nindent 4 }}
{{- end }}
rules:
- backendRefs:
- kind: Service
name: {{ include "reposilite.service.name" . }}
namespace: {{ .Release.Namespace }}
port: {{ .Values.service.port }}
weight: 1
{{- with .Values.gatewayAPI.core.httpRoute.matches }}
matches:
{{- toYaml . | nindent 6 }}
{{- end }}
{{- end }}