Skip to content

Commit

Permalink
feat(argo-cd): add support for dual stack clusters (#2649)
Browse files Browse the repository at this point in the history
* feat(argo-cd): add support for dual stack clusters

Signed-off-by: Ludovic Ortega <ludovic.ortega@adminafk.fr>

* fix: add suggested change

Signed-off-by: Ludovic Ortega <ludovic.ortega@adminafk.fr>

* fix: metric template & add suggested change

Signed-off-by: Ludovic Ortega <ludovic.ortega@adminafk.fr>

* fix: remove changelog in README.md.gotmpl

Signed-off-by: Ludovic Ortega <ludovic.ortega@adminafk.fr>

* fix: applicationset metric template

Signed-off-by: Ludovic Ortega <ludovic.ortega@adminafk.fr>

* fix: add changelog as annotation

Signed-off-by: Ludovic Ortega <ludovic.ortega@adminafk.fr>

* feat: use a global setting to enable dual stack

Signed-off-by: Ludovic Ortega <ludovic.ortega@adminafk.fr>

---------

Signed-off-by: Ludovic Ortega <ludovic.ortega@adminafk.fr>
Signed-off-by: Marco Maurer (-Kilchhofer) <mkilchhofer@users.noreply.github.com>
Co-authored-by: Aikawa <yu.croco@gmail.com>
Co-authored-by: Marco Maurer (-Kilchhofer) <mkilchhofer@users.noreply.github.com>
  • Loading branch information
3 people authored May 31, 2024
1 parent 0a97419 commit 45ff566
Show file tree
Hide file tree
Showing 15 changed files with 35 additions and 3 deletions.
6 changes: 3 additions & 3 deletions charts/argo-cd/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ appVersion: v2.11.2
kubeVersion: ">=1.23.0-0"
description: A Helm chart for Argo CD, a declarative, GitOps continuous delivery tool for Kubernetes.
name: argo-cd
version: 7.0.0
version: 7.1.0
home: https://github.com/argoproj/argo-helm
icon: https://argo-cd.readthedocs.io/en/stable/assets/logo.png
sources:
Expand All @@ -26,5 +26,5 @@ annotations:
fingerprint: 2B8F22F57260EFA67BE1C5824B11F800CD9D2252
url: https://argoproj.github.io/argo-helm/pgp_keys.asc
artifacthub.io/changes: |
- kind: changed
description: Represent cluster credentials as a map
- kind: added
description: Add support for IPv4/IPv6 dual-stack networking.
2 changes: 2 additions & 0 deletions charts/argo-cd/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -671,6 +671,8 @@ NAME: my-release
| global.deploymentAnnotations | object | `{}` | Annotations for the all deployed Deployments |
| global.deploymentStrategy | object | `{}` | Deployment strategy for the all deployed Deployments |
| global.domain | string | `"argocd.example.com"` | Default domain used by all components |
| global.dualStack.ipFamilies | list | `[]` | IP families that should be supported and the order in which they should be applied to ClusterIP as well. Can be IPv4 and/or IPv6. |
| global.dualStack.ipFamilyPolicy | string | `""` | IP family policy to configure dual-stack see [Configure dual-stack](https://kubernetes.io/docs/concepts/services-networking/dual-stack/#services) |
| global.env | list | `[]` | Environment variables to pass to all deployed Deployments |
| global.hostAliases | list | `[]` | Mapping between IP and hostnames that will be injected as entries in the pod's hosts files |
| global.image.imagePullPolicy | string | `"IfNotPresent"` | If defined, a imagePullPolicy applied to all Argo CD deployments |
Expand Down
12 changes: 12 additions & 0 deletions charts/argo-cd/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -245,3 +245,15 @@ Allows overriding it for multi-namespace deployments in combined charts.
{{- define "argo-cd.namespace" -}}
{{- default .Release.Namespace .Values.namespaceOverride | trunc 63 | trimSuffix "-" -}}
{{- end }}

{{/*
Dual stack definition
*/}}
{{- define "argo-cd.dualStack" -}}
{{- with .Values.global.dualStack.ipFamilyPolicy }}
ipFamilyPolicy: {{ . }}
{{- end }}
{{- with .Values.global.dualStack.ipFamilies }}
ipFamilies: {{ toYaml . | nindent 4 }}
{{- end }}
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ spec:
{{- if and .Values.controller.metrics.service.clusterIP (eq .Values.controller.metrics.service.type "ClusterIP") }}
clusterIP: {{ .Values.controller.metrics.service.clusterIP }}
{{- end }}
{{- include "argo-cd.dualStack" . | indent 2 }}
ports:
- name: {{ .Values.controller.metrics.service.portName }}
protocol: TCP
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ spec:
{{- if and .Values.applicationSet.metrics.service.clusterIP (eq .Values.applicationSet.metrics.service.type "ClusterIP") }}
clusterIP: {{ .Values.applicationSet.metrics.service.clusterIP }}
{{- end }}
{{- include "argo-cd.dualStack" . | indent 2 }}
ports:
- name: {{ .Values.applicationSet.metrics.service.portName }}
protocol: TCP
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ metadata:
{{- end }}
spec:
type: {{ .Values.applicationSet.service.type }}
{{- include "argo-cd.dualStack" . | indent 2 }}
ports:
- name: {{ .Values.applicationSet.service.portName }}
port: {{ .Values.applicationSet.service.port }}
Expand Down
1 change: 1 addition & 0 deletions charts/argo-cd/templates/argocd-notifications/metrics.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ spec:
{{- if and .Values.notifications.metrics.service.clusterIP (eq .Values.notifications.metrics.service.type "ClusterIP") }}
clusterIP: {{ .Values.notifications.metrics.service.clusterIP }}
{{- end }}
{{- include "argo-cd.dualStack" . | indent 2 }}
selector:
{{- include "argo-cd.selectorLabels" (dict "context" . "name" .Values.notifications.name) | nindent 6 }}
ports:
Expand Down
1 change: 1 addition & 0 deletions charts/argo-cd/templates/argocd-repo-server/metrics.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ spec:
{{- if and .Values.repoServer.metrics.service.clusterIP (eq .Values.repoServer.metrics.service.type "ClusterIP") }}
clusterIP: {{ .Values.repoServer.metrics.service.clusterIP }}
{{- end }}
{{- include "argo-cd.dualStack" . | indent 2 }}
ports:
- name: {{ .Values.repoServer.metrics.service.portName }}
protocol: TCP
Expand Down
1 change: 1 addition & 0 deletions charts/argo-cd/templates/argocd-repo-server/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ metadata:
name: {{ template "argo-cd.repoServer.fullname" . }}
namespace: {{ include "argo-cd.namespace" . }}
spec:
{{- include "argo-cd.dualStack" . | indent 2 }}
ports:
- name: {{ .Values.repoServer.service.portName }}
protocol: TCP
Expand Down
1 change: 1 addition & 0 deletions charts/argo-cd/templates/argocd-server/aws/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ metadata:
name: {{ template "argo-cd.server.fullname" . }}-grpc
namespace: {{ include "argo-cd.namespace" . }}
spec:
{{- include "argo-cd.dualStack" . | indent 2 }}
ports:
- name: {{ .Values.server.service.servicePortHttpName }}
protocol: TCP
Expand Down
1 change: 1 addition & 0 deletions charts/argo-cd/templates/argocd-server/metrics.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ spec:
{{- if and .Values.server.metrics.service.clusterIP (eq .Values.server.metrics.service.type "ClusterIP") }}
clusterIP: {{ .Values.server.metrics.service.clusterIP }}
{{- end }}
{{- include "argo-cd.dualStack" . | indent 2 }}
ports:
- name: {{ .Values.server.metrics.service.portName }}
protocol: TCP
Expand Down
1 change: 1 addition & 0 deletions charts/argo-cd/templates/argocd-server/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ metadata:
{{- end }}
spec:
type: {{ .Values.server.service.type }}
{{- include "argo-cd.dualStack" . | indent 2 }}
{{- with .Values.server.service.externalIPs }}
externalIPs: {{ . }}
{{- end }}
Expand Down
1 change: 1 addition & 0 deletions charts/argo-cd/templates/dex/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ metadata:
{{- toYaml .Values.dex.metrics.service.labels | nindent 4 }}
{{- end }}
spec:
{{- include "argo-cd.dualStack" . | indent 2 }}
ports:
- name: {{ .Values.dex.servicePortHttpName }}
protocol: TCP
Expand Down
1 change: 1 addition & 0 deletions charts/argo-cd/templates/redis/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ metadata:
{{- end }}
{{- end }}
spec:
{{- include "argo-cd.dualStack" . | indent 2 }}
ports:
- name: redis
port: {{ .Values.redis.servicePort }}
Expand Down
7 changes: 7 additions & 0 deletions charts/argo-cd/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,13 @@ global:
# hostnames:
# - git.myhostname

# Configure dual-stack used by all component services
dualStack:
# -- IP family policy to configure dual-stack see [Configure dual-stack](https://kubernetes.io/docs/concepts/services-networking/dual-stack/#services)
ipFamilyPolicy: ""
# -- IP families that should be supported and the order in which they should be applied to ClusterIP as well. Can be IPv4 and/or IPv6.
ipFamilies: []

# Default network policy rules used by all components
networkPolicy:
# -- Create NetworkPolicy objects for all components
Expand Down

0 comments on commit 45ff566

Please sign in to comment.