From 567e7ce91fb23faf1e61710c4a5df1806d6e8afb Mon Sep 17 00:00:00 2001
From: AkiraFukushima
Date: Fri, 10 Apr 2020 01:02:23 +0900
Subject: [PATCH] Add loadBalancerSourceRanges parameter for ArgoCD service
resource (#290)
---
charts/argo-cd/Chart.yaml | 2 +-
charts/argo-cd/README.md | 5 +++--
charts/argo-cd/templates/argocd-server/service.yaml | 6 +++++-
charts/argo-cd/values.yaml | 1 +
4 files changed, 10 insertions(+), 4 deletions(-)
diff --git a/charts/argo-cd/Chart.yaml b/charts/argo-cd/Chart.yaml
index 3163b4db..a07fef62 100644
--- a/charts/argo-cd/Chart.yaml
+++ b/charts/argo-cd/Chart.yaml
@@ -2,7 +2,7 @@ apiVersion: v1
appVersion: "1.5.1"
description: A Helm chart for ArgoCD, a declarative, GitOps continuous delivery tool for Kubernetes.
name: argo-cd
-version: 2.1.1
+version: 2.1.2
home: https://github.com/argoproj/argo-helm
icon: https://raw.githubusercontent.com/argoproj/argo/master/docs/assets/argo.png
keywords:
diff --git a/charts/argo-cd/README.md b/charts/argo-cd/README.md
index 591d9314..e419f734 100644
--- a/charts/argo-cd/README.md
+++ b/charts/argo-cd/README.md
@@ -58,8 +58,8 @@ Helm v3 has removed the `install-crds` hook so CRDs are now populated by files i
| global.image.imagePullPolicy | If defined, a imagePullPolicy applied to all ArgoCD deployments. | `"IfNotPresent"` |
| global.image.repository | If defined, a repository applied to all ArgoCD deployments. | `"argoproj/argocd"` |
| global.image.tag | If defined, a tag applied to all ArgoCD deployments. | `"v1.5.1"` |
-| global.securityContext | Toggle and define securityContext | See [values.yaml](values.yaml) |
-| global.imagePullSecrets | If defined, uses a Secret to pull an image from a private Docker registry or repository. | `[]` |
+| global.securityContext | Toggle and define securityContext | See [values.yaml](values.yaml) |
+| global.imagePullSecrets | If defined, uses a Secret to pull an image from a private Docker registry or repository. | `[]` |
| global.hostAliases | Mapping between IP and hostnames that will be injected as entries in the pod's hosts files | `[]` |
| nameOverride | Provide a name in place of `argocd` | `"argocd"` |
| installCRDs | bool | `true` | Install CRDs if you are using Helm2. |
@@ -224,6 +224,7 @@ Helm v3 has removed the `install-crds` hook so CRDs are now populated by files i
| server.service.labels | Server service labels | `{}` |
| server.service.servicePortHttp | Server service http port | `80` |
| server.service.servicePortHttps | Server service https port | `443` |
+| server.service.loadBalancerSourceRanges | Source IP ranges to allow access to service from. | `[]` |
| server.service.type | Server service type | `"ClusterIP"` |
| server.serviceAccount.create | Create server service account | `true` |
| server.serviceAccount.name | Server service account name | `"argocd-server"` |
diff --git a/charts/argo-cd/templates/argocd-server/service.yaml b/charts/argo-cd/templates/argocd-server/service.yaml
index 031d0b62..673461b2 100644
--- a/charts/argo-cd/templates/argocd-server/service.yaml
+++ b/charts/argo-cd/templates/argocd-server/service.yaml
@@ -28,4 +28,8 @@ spec:
targetPort: {{ .Values.server.name }}
selector:
app.kubernetes.io/instance: {{ .Release.Name }}
- app.kubernetes.io/name: {{ include "argo-cd.name" . }}-{{ .Values.server.name }}
\ No newline at end of file
+ app.kubernetes.io/name: {{ include "argo-cd.name" . }}-{{ .Values.server.name }}
+{{- if and (eq .Values.server.service.type "LoadBalancer") .Values.server.service.loadBalancerSourceRanges }}
+ loadBalancerSourceranges:
+{{ toYaml .Values.server.service.loadBalancerSourceRanges | indent 4 }}
+{{- end -}}
diff --git a/charts/argo-cd/values.yaml b/charts/argo-cd/values.yaml
index 07bbfb7e..d79e5536 100755
--- a/charts/argo-cd/values.yaml
+++ b/charts/argo-cd/values.yaml
@@ -386,6 +386,7 @@ server:
type: ClusterIP
servicePortHttp: 80
servicePortHttps: 443
+ loadBalancerSourceRanges: []
## Server metrics service configuration
metrics: