From ae8ef2c026b6f4b5081ac59a182d98cbda72a128 Mon Sep 17 00:00:00 2001 From: Miro Prasil Date: Mon, 16 Sep 2019 17:08:38 +0100 Subject: [PATCH] [stable/rabbitmq-ha] Only set the nodePort for NodePort service type (#17160) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Only set the nodePort for NodePort service type This resolves an issue with older version of kubernetes that fails on parsing the `null` value as it only expects integer values. (which means that on older clusters the chart as is now fails to install) ``` ... failed: Service in version "v1" cannot be handled as a Service: v1.Service: Spec: v1.ServiceSpec: Ports: []v1.ServicePort: v1.ServicePort: NodePort: readUint32: unexpected character: �, parsing 304 ...odePort":n... ... ``` Signed-off-by: Miroslav Prasil * Just bump the bugfix number Signed-off-by: Miroslav Prasil * Also use nodePort for LoadBalancer service type Signed-off-by: Miroslav Prasil --- stable/rabbitmq-ha/Chart.yaml | 2 +- stable/rabbitmq-ha/templates/service.yaml | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/stable/rabbitmq-ha/Chart.yaml b/stable/rabbitmq-ha/Chart.yaml index 3c78951633..ad92d56f44 100644 --- a/stable/rabbitmq-ha/Chart.yaml +++ b/stable/rabbitmq-ha/Chart.yaml @@ -1,7 +1,7 @@ name: rabbitmq-ha apiVersion: v1 appVersion: 3.7.15 -version: 1.32.0 +version: 1.32.1 description: Highly available RabbitMQ cluster, the open source message broker software that implements the Advanced Message Queuing Protocol (AMQP). keywords: diff --git a/stable/rabbitmq-ha/templates/service.yaml b/stable/rabbitmq-ha/templates/service.yaml index 8a6ac8a2dd..b8738bed76 100644 --- a/stable/rabbitmq-ha/templates/service.yaml +++ b/stable/rabbitmq-ha/templates/service.yaml @@ -40,17 +40,23 @@ spec: - name: http protocol: TCP port: {{ .Values.rabbitmqManagerPort }} + {{- if eq .Values.service.type "NodePort" "LoadBalancer" }} nodePort: {{ .Values.service.managerNodePort }} + {{- end }} targetPort: http - name: amqp protocol: TCP port: {{ .Values.rabbitmqNodePort }} + {{- if eq .Values.service.type "NodePort" "LoadBalancer" }} nodePort: {{ .Values.service.amqpNodePort }} + {{- end }} targetPort: amqp - name: epmd protocol: TCP port: {{ .Values.rabbitmqEpmdPort }} + {{- if eq .Values.service.type "NodePort" "LoadBalancer" }} nodePort: {{ .Values.service.epmdNodePort }} + {{- end }} targetPort: epmd {{- if .Values.rabbitmqSTOMPPlugin.enabled }} - name: stomp-tcp