diff --git a/helm/frontend.yaml b/helm/frontend.yaml new file mode 100644 index 0000000..df0a147 --- /dev/null +++ b/helm/frontend.yaml @@ -0,0 +1,24 @@ +httpRoute: + enabled: true + parentRefs: + - name: default-gw + namespace: kube-system + sectionName: https-0 + hostnames: + - monitoring.moreiradj.net + rules: + - matches: + - path: + type: PathPrefix + value: / + filters: + - type: ResponseHeaderModifier + responseHeaderModifier: + add: + - name: PROTOCOL + value: HTTPS-Secure + - type: RequestHeaderModifier + requestHeaderModifier: + add: + - name: PROTOCOL + value: HTTPS-Secure diff --git a/helm/frontend/templates/httproute.yaml b/helm/frontend/templates/httproute.yaml new file mode 100644 index 0000000..ef05cbd --- /dev/null +++ b/helm/frontend/templates/httproute.yaml @@ -0,0 +1,38 @@ +{{- if .Values.httpRoute.enabled -}} +{{- $fullName := include "frontend.fullname" . -}} +{{- $svcPort := .Values.service.port -}} +apiVersion: gateway.networking.k8s.io/v1 +kind: HTTPRoute +metadata: + name: {{ $fullName }} + labels: + {{- include "frontend.labels" . | nindent 4 }} + {{- with .Values.httpRoute.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +spec: + parentRefs: + {{- with .Values.httpRoute.parentRefs }} + {{- toYaml . | nindent 4 }} + {{- end }} + {{- with .Values.httpRoute.hostnames }} + hostnames: + {{- toYaml . | nindent 4 }} + {{- end }} + rules: + {{- range .Values.httpRoute.rules }} + {{- with .matches }} + - matches: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .filters }} + filters: + {{- toYaml . | nindent 8 }} + {{- end }} + backendRefs: + - name: {{ $fullName }} + port: {{ $svcPort }} + weight: 1 + {{- end }} +{{- end }} diff --git a/helm/frontend/values.yaml b/helm/frontend/values.yaml index 76ea28c..38d4d9d 100644 --- a/helm/frontend/values.yaml +++ b/helm/frontend/values.yaml @@ -61,6 +61,42 @@ ingress: # hosts: # - chart-example.local +# -- How the service is exposed via gateway-apis HTTPRoute. +httpRoute: + # -- HTTPRoute enabled. + enabled: false + # -- HTTPRoute annotations. + annotations: {} + # -- Which Gateways this Route is attached to + parentRefs: + - name: gateway + sectionName: http + # namespace: default + # -- Hostnames matching HTTP header. + hostnames: + - chart-example.local + # -- List of rules and filters applied. + rules: + - matches: + - path: + type: PathPrefix + value: / + # filters: + # - type: RequestHeaderModifier + # requestHeaderModifier: + # set: + # - name: My-Overwrite-Header + # value: this-is-the-only-value + # remove: + # - User-Agent + # - matches: + # - path: + # type: PathPrefix + # value: /echo + # headers: + # - name: version + # value: v2 + 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 diff --git a/helmfile.yaml b/helm/helmfile.yaml similarity index 82% rename from helmfile.yaml rename to helm/helmfile.yaml index af252be..5d73ec9 100644 --- a/helmfile.yaml +++ b/helm/helmfile.yaml @@ -20,14 +20,15 @@ releases: value: local-path - name: person - chart: ./helm/person + chart: ./person version: 0.1.0 namespace: observability - set: - - name: postgres.host - value: postgres-postgresql + values: + - ./person.yaml - name: frontend - chart: ./helm/frontend + chart: ./frontend version: 0.1.0 namespace: observability + values: + - ./frontend.yaml diff --git a/helm/person.yaml b/helm/person.yaml new file mode 100644 index 0000000..718c007 --- /dev/null +++ b/helm/person.yaml @@ -0,0 +1,2 @@ +postgres: + host: postgres-postgresql