From 8ef092f2d30476e3dbcd10f7b2a4c427fc95dcc9 Mon Sep 17 00:00:00 2001 From: Bhavin Gandhi Date: Tue, 14 May 2019 11:26:33 +0530 Subject: [PATCH] [stable/nginx-ingress] consider values in nodePorts for LoadBalancer - Makes it possible to specify nodePort values when the controller service type is LoadBalancer - Update README.md - Bump the version Signed-off-by: Bhavin Gandhi --- stable/nginx-ingress/Chart.yaml | 2 +- stable/nginx-ingress/README.md | 4 ++-- stable/nginx-ingress/templates/controller-service.yaml | 5 +++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/stable/nginx-ingress/Chart.yaml b/stable/nginx-ingress/Chart.yaml index 8a725a5ab3c2..0baa31096536 100644 --- a/stable/nginx-ingress/Chart.yaml +++ b/stable/nginx-ingress/Chart.yaml @@ -1,5 +1,5 @@ name: nginx-ingress -version: 1.6.0 +version: 1.6.1 appVersion: 0.24.1 home: https://github.com/kubernetes/ingress-nginx description: An nginx Ingress controller that uses ConfigMap to store the nginx configuration. diff --git a/stable/nginx-ingress/README.md b/stable/nginx-ingress/README.md index 491b80356f49..c4de3292c0f3 100644 --- a/stable/nginx-ingress/README.md +++ b/stable/nginx-ingress/README.md @@ -95,8 +95,8 @@ Parameter | Description | Default `controller.service.targetPorts.http` | Sets the targetPort that maps to the Ingress' port 80 | `80` `controller.service.targetPorts.https` | Sets the targetPort that maps to the Ingress' port 443 | `443` `controller.service.type` | type of controller service to create | `LoadBalancer` -`controller.service.nodePorts.http` | If `controller.service.type` is `NodePort` and this is non-empty, it sets the nodePort that maps to the Ingress' port 80 | `""` -`controller.service.nodePorts.https` | If `controller.service.type` is `NodePort` and this is non-empty, it sets the nodePort that maps to the Ingress' port 443 | `""` +`controller.service.nodePorts.http` | If `controller.service.type` is either `NodePort` or `LoadBalancer` and this is non-empty, it sets the nodePort that maps to the Ingress' port 80 | `""` +`controller.service.nodePorts.https` | If `controller.service.type` is either `NodePort` or `LoadBalancer` and this is non-empty, it sets the nodePort that maps to the Ingress' port 443 | `""` `controller.livenessProbe.initialDelaySeconds` | Delay before liveness probe is initiated | 10 `controller.livenessProbe.periodSeconds` | How often to perform the probe | 10 `controller.livenessProbe.timeoutSeconds` | When the probe times out | 5 diff --git a/stable/nginx-ingress/templates/controller-service.yaml b/stable/nginx-ingress/templates/controller-service.yaml index a81c81e0051a..413a3ee72792 100644 --- a/stable/nginx-ingress/templates/controller-service.yaml +++ b/stable/nginx-ingress/templates/controller-service.yaml @@ -37,12 +37,13 @@ spec: healthCheckNodePort: {{ .Values.controller.service.healthCheckNodePort }} {{- end }} ports: + {{- $setNodePorts := (or (eq .Values.controller.service.type "NodePort") (eq .Values.controller.service.type "LoadBalancer")) }} {{- if .Values.controller.service.enableHttp }} - name: http port: 80 protocol: TCP targetPort: {{ .Values.controller.service.targetPorts.http }} - {{- if (and (eq .Values.controller.service.type "NodePort") (not (empty .Values.controller.service.nodePorts.http))) }} + {{- if (and $setNodePorts (not (empty .Values.controller.service.nodePorts.http))) }} nodePort: {{ .Values.controller.service.nodePorts.http }} {{- end }} {{- end }} @@ -51,7 +52,7 @@ spec: port: 443 protocol: TCP targetPort: {{ .Values.controller.service.targetPorts.https }} - {{- if (and (eq .Values.controller.service.type "NodePort") (not (empty .Values.controller.service.nodePorts.https))) }} + {{- if (and $setNodePorts (not (empty .Values.controller.service.nodePorts.https))) }} nodePort: {{ .Values.controller.service.nodePorts.https }} {{- end }} {{- end }}