From 9bda0261e622b5203b1b6cae239f22117e70cb8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20=C5=BBu=C5=82nowski?= Date: Tue, 8 Dec 2020 20:49:15 +0100 Subject: [PATCH] Add possibility to change NodePort if this is type of Service. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Łukasz Żułnowski --- charts/argo-cd/README.md | 2 ++ charts/argo-cd/templates/argocd-server/service.yaml | 6 ++++++ charts/argo-cd/values.yaml | 3 +++ 3 files changed, 11 insertions(+) diff --git a/charts/argo-cd/README.md b/charts/argo-cd/README.md index 07b72e20..35792cc8 100644 --- a/charts/argo-cd/README.md +++ b/charts/argo-cd/README.md @@ -251,6 +251,8 @@ Helm v3 has removed the `install-crds` hook so CRDs are now populated by files i | server.service.servicePortHttps | Server service https port | `443` | | server.service.servicePortHttpName | Server service http port name, can be used to route traffic via istio | `http` | | server.service.servicePortHttpsName | Server service https port name, can be used to route traffic via istio | `https` | +| server.service.nodePortHttp | Server service http port for NodePort service type| `30080` | +| server.service.servicePortHttps | Server service http port for NodePort service type | `30443` | | server.service.loadBalancerSourceRanges | Source IP ranges to allow access to service from. | `[]` | | server.service.type | Server service type | `"ClusterIP"` | | server.serviceAccount.annotations | Server service account annotations | `{}` | diff --git a/charts/argo-cd/templates/argocd-server/service.yaml b/charts/argo-cd/templates/argocd-server/service.yaml index 46bb264f..4772a686 100644 --- a/charts/argo-cd/templates/argocd-server/service.yaml +++ b/charts/argo-cd/templates/argocd-server/service.yaml @@ -25,10 +25,16 @@ spec: protocol: TCP port: {{ .Values.server.service.servicePortHttp }} targetPort: {{- if .Values.server.service.namedTargetPort }} {{ .Values.server.name }} {{- else }} {{ .Values.server.containerPort }} {{- end }} + {{- if eq .Values.server.service.type "NodePort" }} + nodePort: {{ .Values.server.service.nodePortHttp }} + {{- end }} - name: {{ .Values.server.service.servicePortHttpsName }} protocol: TCP port: {{ .Values.server.service.servicePortHttps }} targetPort: {{- if .Values.server.service.namedTargetPort }} {{ .Values.server.name }} {{- else }} {{ .Values.server.containerPort }} {{- end }} + {{- if eq .Values.server.service.type "NodePort" }} + nodePort: {{ .Values.server.service.nodePortHttps }} + {{- end }} selector: app.kubernetes.io/instance: {{ .Release.Name }} app.kubernetes.io/name: {{ include "argo-cd.name" . }}-{{ .Values.server.name }} diff --git a/charts/argo-cd/values.yaml b/charts/argo-cd/values.yaml index 745b270b..7acbda40 100755 --- a/charts/argo-cd/values.yaml +++ b/charts/argo-cd/values.yaml @@ -434,6 +434,9 @@ server: annotations: {} labels: {} type: ClusterIP + ## For node port default ports + nodePortHttp: 30080 + nodePortHttps: 30443 servicePortHttp: 80 servicePortHttps: 443 servicePortHttpName: http