Skip to content

Commit

Permalink
feat(argo-cd): Add Gateway API support
Browse files Browse the repository at this point in the history
Signed-off-by: Petr Drastil <[email protected]>
  • Loading branch information
pdrastil committed Jul 9, 2024
1 parent 6dab549 commit 0117c1c
Show file tree
Hide file tree
Showing 2 changed files with 97 additions and 0 deletions.
48 changes: 48 additions & 0 deletions charts/argo-cd/templates/argocd-server/gateway-httproute.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{{- if .Values.server.gatewayAPI.enabled }}
apiVersion: gateway.networking.k8s.io/v1
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 }}
{{- with .Values.server.gatewayAPI.gatewaySection }}
sectionName: {{ . }}
{{- end }}
hostnames:
- {{ .Values.server.gatewayAPI.hostname | default .Values.global.domain }}
{{- with .Values.server.gatewayAPI.extraHosts }}
{{- toYaml . | nindent 4 }}
{{- end }}
rules:
{{- with .Values.server.ingress.extraRules }}
{{- tpl (toYaml .) $ | nindent 4 }}
{{- end }}
- matches:
- path:
type: {{ .Values.server.gatewayAPI.pathType }}
value: {{ .Values.server.gatewayAPI.path }}
{{- range .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 }}
weight: 100
{{- end }}
49 changes: 49 additions & 0 deletions charts/argo-cd/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2151,6 +2151,55 @@ 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: ""

# -- Defines which Gateway section will implement the resource
gatewaySection: ""

# -- 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

# -- The list of additional hostnames to be covered by API Gateway record
extraHosts: []

# -- Additional API Gateway paths
# @default -- `[]` (See [values.yaml])
## Note: Supports use of custom Helm templates
extraPaths: []
# - type: PathPrefix
# value: /*

# -- Additional routing rules
# @default -- `[]` (See [values.yaml])
## Note: Supports use of custom Helm templates
extraRules: []
# - matches:
# - 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
Expand Down

0 comments on commit 0117c1c

Please sign in to comment.