Skip to content

Commit f363c99

Browse files
authored
feat(argo-cd): adding httproute support to applicationset webhook (#3859)
* feat(argo-cd): adding httproute support to applicationset webhook Signed-off-by: Yahia <yahia.berchi@tiime.fr> * feat(argo-cd): Code review Signed-off-by: Yahia <yahia.berchi@tiime.fr> * feat(argo-cd): Code review Signed-off-by: Yahia <yahia.berchi@tiime.fr> * feat(argo-cd): Code review Signed-off-by: Yahia <yahia.berchi@tiime.fr> * feat(argo-cd): Code review Signed-off-by: Yahia <yahia.berchi@tiime.fr> --------- Signed-off-by: Yahia <yahia.berchi@tiime.fr> Signed-off-by: Yahia Berchi <yahia.berchi@laposte.net>
1 parent e21e577 commit f363c99

4 files changed

Lines changed: 92 additions & 3 deletions

File tree

charts/argo-cd/Chart.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ appVersion: v3.3.8
33
kubeVersion: ">=1.25.0-0"
44
description: A Helm chart for Argo CD, a declarative, GitOps continuous delivery tool for Kubernetes.
55
name: argo-cd
6-
version: 9.5.5
6+
version: 9.5.6
77
home: https://github.com/argoproj/argo-helm
88
icon: https://argo-cd.readthedocs.io/en/stable/assets/logo.png
99
sources:
@@ -26,5 +26,5 @@ annotations:
2626
fingerprint: 2B8F22F57260EFA67BE1C5824B11F800CD9D2252
2727
url: https://argoproj.github.io/argo-helm/pgp_keys.asc
2828
artifacthub.io/changes: |
29-
- kind: fixed
30-
description: Fix ArgoAppNotSynced PrometheusRule example annotations to use plain Prometheus template syntax instead of Helm raw-string escaping, which caused alertmanager to receive unrendered template expressions.
29+
- kind: added
30+
description: Added httproute support to ApplicationSet controller webhook

charts/argo-cd/README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1701,6 +1701,12 @@ If you use an External Redis (See Option 3 above), this Job is not deployed.
17011701
| applicationSet.extraEnvFrom | list | `[]` (See [values.yaml]) | envFrom to pass to the ApplicationSet controller |
17021702
| applicationSet.extraVolumeMounts | list | `[]` | List of extra mounts to add (normally used with extraVolumes) |
17031703
| applicationSet.extraVolumes | list | `[]` | List of extra volumes to add |
1704+
| applicationSet.httproute.annotations | object | `{}` | Additional HTTPRoute annotations |
1705+
| applicationSet.httproute.enabled | bool | `false` | Enable HTTPRoute resource for Argo CD Applicationset Webhook (Gateway API) |
1706+
| applicationSet.httproute.hostnames | list | `[]` (See [values.yaml]) | List of hostnames for the HTTPRoute |
1707+
| applicationSet.httproute.labels | object | `{}` | Additional HTTPRoute labels |
1708+
| applicationSet.httproute.parentRefs | list | `[]` (See [values.yaml]) | Gateway API parentRefs for the HTTPRoute |
1709+
| applicationSet.httproute.rules | list | `[]` (See [values.yaml]) | HTTPRoute rules configuration |
17041710
| applicationSet.image.imagePullPolicy | string | `""` (defaults to global.image.imagePullPolicy) | Image pull policy for the ApplicationSet controller |
17051711
| applicationSet.image.repository | string | `""` (defaults to global.image.repository) | Repository to use for the ApplicationSet controller |
17061712
| applicationSet.image.tag | string | `""` (defaults to global.image.tag) | Tag to use for the ApplicationSet controller |
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
{{- if .Values.applicationSet.httproute.enabled -}}
2+
{{- $fullName := include "argo-cd.applicationSet.fullname" . -}}
3+
apiVersion: gateway.networking.k8s.io/v1
4+
kind: HTTPRoute
5+
metadata:
6+
name: {{ $fullName }}
7+
namespace: {{ include "argo-cd.namespace" . }}
8+
labels:
9+
{{- include "argo-cd.labels" (dict "context" . "component" .Values.applicationSet.name "name" .Values.applicationSet.name) | nindent 4 }}
10+
{{- with .Values.applicationSet.httproute.labels }}
11+
{{- toYaml . | nindent 4 }}
12+
{{- end }}
13+
{{- with .Values.applicationSet.httproute.annotations }}
14+
annotations:
15+
{{- toYaml . | nindent 4 }}
16+
{{- end }}
17+
spec:
18+
parentRefs:
19+
{{- with .Values.applicationSet.httproute.parentRefs }}
20+
{{- toYaml . | nindent 4 }}
21+
{{- end }}
22+
{{- with .Values.applicationSet.httproute.hostnames }}
23+
hostnames:
24+
{{- toYaml . | nindent 4 }}
25+
{{- end }}
26+
rules:
27+
{{- range .Values.applicationSet.httproute.rules }}
28+
{{- with .matches }}
29+
- matches:
30+
{{- toYaml . | nindent 8 }}
31+
{{- end }}
32+
{{- with .filters }}
33+
filters:
34+
{{- toYaml . | nindent 8 }}
35+
{{- end }}
36+
backendRefs:
37+
- group: ''
38+
kind: Service
39+
name: {{ $fullName }}
40+
port: {{ .Values.applicationSet.service.port }}
41+
weight: 1
42+
{{- end }}
43+
{{- end }}

charts/argo-cd/values.yaml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3647,6 +3647,46 @@ applicationSet:
36473647
# - secretName: argocd-applicationset-tls
36483648
# hosts:
36493649
# - argocd-applicationset.example.com
3650+
3651+
## Gateway API HTTPRoute for the Git Generator webhook
3652+
## Ref: https://argocd-applicationset.readthedocs.io/en/master/Generators-Git/#webhook-configuration)
3653+
# NOTE: Gateway API support is in EXPERIMENTAL status
3654+
# Support depends on your Gateway controller implementation
3655+
# Some controllers may require additional configuration (e.g., BackendTLSPolicy for HTTPS backends)
3656+
# Refer to https://gateway-api.sigs.k8s.io/implementations/ for controller-specific details
3657+
httproute:
3658+
# -- Enable HTTPRoute resource for Argo CD Applicationset Webhook (Gateway API)
3659+
enabled: false
3660+
# -- Additional HTTPRoute labels
3661+
labels: {}
3662+
# -- Additional HTTPRoute annotations
3663+
annotations: {}
3664+
# -- Gateway API parentRefs for the HTTPRoute
3665+
## Must reference an existing Gateway
3666+
# @default -- `[]` (See [values.yaml])
3667+
parentRefs: []
3668+
# - name: example-gateway
3669+
# namespace: example-gateway-namespace
3670+
# sectionName: https
3671+
# -- List of hostnames for the HTTPRoute
3672+
# @default -- `[]` (See [values.yaml])
3673+
hostnames: []
3674+
# - argocd.example.com
3675+
# -- HTTPRoute rules configuration
3676+
# @default -- `[]` (See [values.yaml])
3677+
rules:
3678+
- matches:
3679+
- path:
3680+
type: PathPrefix
3681+
value: /api/webhook
3682+
# filters: []
3683+
# - type: RequestHeaderModifier
3684+
# requestHeaderModifier:
3685+
# add:
3686+
# - name: X-Custom-Header
3687+
# value: custom-value
3688+
3689+
36503690
# -- Enable ApplicationSet in any namespace feature
36513691
allowAnyNamespace: false
36523692

0 commit comments

Comments
 (0)