From 536d7dc84271a80f0a02e5a327cfe08564af2b8b Mon Sep 17 00:00:00 2001 From: Uros Bajzelj Date: Fri, 11 Feb 2022 10:57:43 +0000 Subject: [PATCH] Fix the NodePort port specification --- roles/installer/templates/service.yaml.j2 | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/roles/installer/templates/service.yaml.j2 b/roles/installer/templates/service.yaml.j2 index 5eac078f..180f9605 100644 --- a/roles/installer/templates/service.yaml.j2 +++ b/roles/installer/templates/service.yaml.j2 @@ -39,6 +39,12 @@ spec: protocol: TCP targetPort: 8052 name: http +{% elif service_type | lower == "nodeport" %} + - port: {{ nodeport_port }} + protocol: TCP + targetPort: 8052 + name: http + type: NodePort {% endif %} selector: app.kubernetes.io/name: '{{ ansible_operator_meta.name }}' @@ -46,8 +52,6 @@ spec: app.kubernetes.io/component: '{{ deployment_type }}' {% if service_type | lower == "loadbalancer" %} type: LoadBalancer -{% elif service_type | lower == "nodeport" %} - type: NodePort {% else %} type: ClusterIP {% endif %}