From 872dd678b0ea08be23700337665ea2125dab4d0d Mon Sep 17 00:00:00 2001 From: Matt Peters Date: Thu, 23 Apr 2020 18:39:16 -0500 Subject: [PATCH] [stable/nginx-ingress] allow nodePort for tcp/udp services --- stable/nginx-ingress/templates/controller-service.yaml | 10 ++++++++++ stable/nginx-ingress/values.yaml | 4 ++++ 2 files changed, 14 insertions(+) diff --git a/stable/nginx-ingress/templates/controller-service.yaml b/stable/nginx-ingress/templates/controller-service.yaml index a81c81e..6389c14 100644 --- a/stable/nginx-ingress/templates/controller-service.yaml +++ b/stable/nginx-ingress/templates/controller-service.yaml @@ -60,12 +60,22 @@ spec: port: {{ $key }} protocol: TCP targetPort: "{{ $key }}-tcp" + {{- if $.Values.controller.service.nodePorts.tcp }} + {{- if index $.Values.controller.service.nodePorts.tcp $key }} + nodePort: {{ index $.Values.controller.service.nodePorts.tcp $key }} + {{- end }} + {{- end }} {{- end }} {{- range $key, $value := .Values.udp }} - name: "{{ $key }}-udp" port: {{ $key }} protocol: UDP targetPort: "{{ $key }}-udp" + {{- if $.Values.controller.service.nodePorts.udp }} + {{- if index $.Values.controller.service.nodePorts.udp $key }} + nodePort: {{ index $.Values.controller.service.nodePorts.udp $key }} + {{- end }} + {{- end }} {{- end }} selector: app: {{ template "nginx-ingress.name" . }} diff --git a/stable/nginx-ingress/values.yaml b/stable/nginx-ingress/values.yaml index 80bc1a6..71bbcb3 100644 --- a/stable/nginx-ingress/values.yaml +++ b/stable/nginx-ingress/values.yaml @@ -192,9 +192,13 @@ controller: # nodePorts: # http: 32080 # https: 32443 + # tcp: + # 8080: 32808 nodePorts: http: "" https: "" + tcp: {} + udp: {} extraContainers: [] ## Additional containers to be added to the controller pod. -- 2.24.0