From be5fb00fa78a9f4870a1872e58b3aba1573bfd9c Mon Sep 17 00:00:00 2001 From: Petr Drastil Date: Mon, 13 May 2024 01:16:06 +0200 Subject: [PATCH] feat(argo-cd): Add Gateway API support Signed-off-by: Petr Drastil --- .../argocd-server/gateway-httproute.yaml | 42 +++++++++++++++++++ charts/argo-cd/values.yaml | 39 +++++++++++++++++ 2 files changed, 81 insertions(+) create mode 100644 charts/argo-cd/templates/argocd-server/gateway-httproute.yaml diff --git a/charts/argo-cd/templates/argocd-server/gateway-httproute.yaml b/charts/argo-cd/templates/argocd-server/gateway-httproute.yaml new file mode 100644 index 000000000..f2deb3215 --- /dev/null +++ b/charts/argo-cd/templates/argocd-server/gateway-httproute.yaml @@ -0,0 +1,42 @@ +{{- .Values.server.gatewayAPI.enabled }} +apiVersion: {{ .Values.server.gatewayAPI.apiVersion }} +kind: HTTPRoute +metadata: + name: {{ include "argo-cd.server.fullname" . }} + namespace: {{ .Release.Namespace | quote }} + labels: + {{- include "argo-cd.labels" (dict "context" . "component" .Values.server.name "name" .Values.server.name) | nindent 4 }} + {{- with .Values.server.gatewayAPI.labels }} + {{- toYaml . | nindent 4 }} + {{- end }} + {{- with .Values.server.gatewayAPI.annotations }} + annotations: + {{- range $key, $value := . }} + {{ $key }}: {{ $value | quote }} + {{- end }} + {{- end }} +spec: + parentRefs: + - group: gateway.networking.k8s.io + kind: Gateway + name: {{ .Values.server.gatewayAPI.gateway }} + hostnames: + - {{ .Values.server.gatewayAPI.hostname | default .Values.global.domain }} + rules: + - matches: + - path: + type: {{ .Values.server.gatewayAPI.pathType }} + value: {{ .Values.server.gatewayAPI.path }} + {{- with .Values.server.gatewayAPI.extraPaths }} + - path: + type: {{ .type | default $.Values.gatewayAPI.pathType }} + value: {{ .value }} + {{- end }} + backendRefs: + - name: {{ include "argo-cd.server.fullname" . }} + port: {{ .Values.server.service.servicePortHttp }} + {{- with .Values.server.ingress.extraRules }} + - matches: + {{- tpl (toYaml .) $ | nindent 4 }} + {{- end }} +{{- end }} diff --git a/charts/argo-cd/values.yaml b/charts/argo-cd/values.yaml index 4ab533d01..2f15a9307 100644 --- a/charts/argo-cd/values.yaml +++ b/charts/argo-cd/values.yaml @@ -2043,6 +2043,45 @@ server: # -- Automount API credentials for the Service Account automountServiceAccountToken: true + # Argo CD server Gateway API HTTPRoute configuration + # NOTE: Alpha feature, gRPC & TLS pass-through will not work + gatewayAPI: + # -- Enable a Gateway API resources for the Argo CD server + enabled: true + # -- Additional route labels + labels: {} + # -- Additional route annotations + annotations: {} + + # -- Defines which Gateway will implement the resource + gateway: "" + + # -- Argo CD server hostname + # @default -- `""` (defaults to global.domain) + hostname: "" + + # -- The path to Argo CD server + path: / + + # -- HTTP reoute path type. Either 'Exact' or `PathPrefix` + pathType: PathPrefix + + extraPaths: [] + # - type: PathPrefix + # value: /* + + # -- Additional routing rules + # @default -- `[]` (See [values.yaml]) + ## Note: Supports use of custom Helm templates + extraRules: [] + # - path: + # type: PathPrefix + # value: / + # backendRefs: + # - name: '{{ include "argo-cd.server.fullname" . }}' + # port: '{{ .Values.server.service.servicePortHttpName }}' + + # Argo CD server ingress configuration ingress: # -- Enable an ingress resource for the Argo CD server