diff --git a/charts/fider/templates/httproute.yaml b/charts/fider/templates/httproute.yaml new file mode 100644 index 0000000..7c71fdd --- /dev/null +++ b/charts/fider/templates/httproute.yaml @@ -0,0 +1,60 @@ +{{- if .Values.httpRoute.enabled -}} +{{- $fullName := include "fider.fullname" . -}} +{{- $svcPort := .Values.service.port -}} +apiVersion: gateway.networking.k8s.io/v1 +kind: HTTPRoute +metadata: + name: {{ $fullName }} + labels: + {{- include "fider.labels" . | nindent 4 }} + {{- with .Values.httpRoute.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +spec: + parentRefs: + {{- toYaml .Values.httpRoute.parentRefs | nindent 4 }} + {{- with .Values.httpRoute.hostnames }} + hostnames: + {{- range . }} + - {{ . | quote }} + {{- end }} + {{- end }} + rules: + {{- if .Values.httpRoute.rules }} + {{- range .Values.httpRoute.rules }} + - {{- if .matches }} + matches: + {{- toYaml .matches | nindent 8 }} + {{- end }} + {{- if .filters }} + filters: + {{- toYaml .filters | nindent 8 }} + {{- end }} + {{- $timeouts := .timeouts | default $.Values.httpRoute.timeouts }} + {{- with $timeouts }} + timeouts: + {{- toYaml . | nindent 8 }} + {{- end }} + backendRefs: + {{- if .backendRefs }} + {{- toYaml .backendRefs | nindent 8 }} + {{- else }} + - name: {{ $fullName }} + port: {{ $svcPort }} + {{- end }} + {{- end }} + {{- else }} + - matches: + - path: + type: PathPrefix + value: / + {{- with .Values.httpRoute.timeouts }} + timeouts: + {{- toYaml . | nindent 8 }} + {{- end }} + backendRefs: + - name: {{ $fullName }} + port: {{ $svcPort }} + {{- end }} +{{- end }} diff --git a/charts/fider/values.yaml b/charts/fider/values.yaml index 58a3e1e..bf0eae9 100644 --- a/charts/fider/values.yaml +++ b/charts/fider/values.yaml @@ -133,6 +133,38 @@ ingress: # hosts: # - fider.local +# -- Gateway API HTTPRoute configuration. Use this as an alternative to `ingress` when running a Gateway API implementation (e.g. Envoy Gateway, Istio, Cilium, Contour). +httpRoute: + # -- If `true`, an HTTPRoute (gateway.networking.k8s.io/v1) is created + enabled: false + # -- Annotations for the HTTPRoute + annotations: {} + # -- Parent Gateways the HTTPRoute attaches to. At least one entry is required when `enabled` is true. + parentRefs: [] + # - name: my-gateway + # namespace: gateway-system + # sectionName: https + # -- Hostnames the HTTPRoute matches against. Leave empty to inherit hostnames from the parent Gateway listener. + hostnames: [] + # - fider.local + # -- Default timeouts applied to each generated rule. Individual entries in `rules` can override this by setting their own `timeouts` block. See https://gateway-api.sigs.k8s.io/api-types/httproute/#timeouts + timeouts: {} + # request: 30s + # backendRequest: 10s + # -- HTTPRoute rules. When empty, a single rule is generated that forwards all traffic ("/") to the Fider service. + rules: [] + # - matches: + # - path: + # type: PathPrefix + # value: / + # filters: [] + # timeouts: + # request: 30s + # backendRequest: 10s + # backendRefs: + # - name: my-custom-backend + # port: 3000 + # -- Kubernetes resources resources: {} # limits: