diff --git a/Chart.yaml b/Chart.yaml index 4875139..213c319 100644 --- a/Chart.yaml +++ b/Chart.yaml @@ -14,4 +14,4 @@ name: openspeedtest sources: - https://github.com/openspeedtest/Helm-chart type: application -version: 0.1.2 +version: 0.2.0 diff --git a/templates/httproute.yaml b/templates/httproute.yaml new file mode 100644 index 0000000..c8bb037 --- /dev/null +++ b/templates/httproute.yaml @@ -0,0 +1,29 @@ +{{- if .Values.gateway.enabled -}} +{{- $fullName := include "openspeedtest.fullname" . -}} +{{- $svcPort := .Values.service.port -}} +apiVersion: gateway.networking.k8s.io/v1 +kind: HTTPRoute +metadata: + name: {{ $fullName }} + labels: + {{- include "openspeedtest.labels" . | nindent 4 }} + {{- with .Values.gateway.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +spec: + parentRefs: + {{- toYaml .Values.gateway.parentRefs | nindent 4 }} + {{- with .Values.gateway.hostnames }} + hostnames: + {{- toYaml . | nindent 4 }} + {{- end }} + rules: + - backendRefs: + - name: {{ $fullName }} + port: {{ $svcPort }} + {{- with .Values.gateway.matches }} + matches: + {{- toYaml . | nindent 8 }} + {{- end }} +{{- end }} diff --git a/values.yaml b/values.yaml index b0c8379..4d171b2 100644 --- a/values.yaml +++ b/values.yaml @@ -58,6 +58,27 @@ ingress: # hosts: # - chart-example.local +gateway: + # Render a gateway.networking.k8s.io/v1 HTTPRoute that attaches to an + # existing Gateway and points at this chart's Service. Disabled by default. + enabled: false + annotations: {} + # parentRefs binds the HTTPRoute to an existing Gateway. At least one is + # required when enabled. `namespace` and `sectionName` are optional. + parentRefs: [] + # - name: my-gateway + # namespace: gateway + # sectionName: https + # hostnames restricts the route to specific hosts. When empty, the route + # matches every hostname the parent Gateway accepts. + hostnames: [] + # - chart-example.local + # matches is optional; when empty the rule applies to all paths. + matches: + - path: + type: PathPrefix + value: / + resources: {} # We usually recommend not to specify default resources and to leave this as a conscious # choice for the user. This also increases chances charts run on environments with little