diff --git a/roles/installer/templates/service.yaml.j2 b/roles/installer/templates/service.yaml.j2 index 77b1048e..3408a312 100644 --- a/roles/installer/templates/service.yaml.j2 +++ b/roles/installer/templates/service.yaml.j2 @@ -17,7 +17,14 @@ metadata: {% endif %} spec: ports: -{% if service_type | lower != 'loadbalancer' and loadbalancer_protocol | lower != 'https' %} + +{% if service_type | lower == "nodeport" %} + - port: 80 + protocol: TCP + targetPort: 8052 + name: http + nodePort: {{ nodeport_port }} +{% elif service_type | lower != 'loadbalancer' and loadbalancer_protocol | lower != 'https' %} - port: 80 protocol: TCP targetPort: 8052 @@ -39,18 +46,14 @@ 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 }}' app.kubernetes.io/managed-by: '{{ deployment_type }}-operator' app.kubernetes.io/component: '{{ deployment_type }}' -{% if service_type | lower == "loadbalancer" %} +{% if service_type | lower == "nodeport" %} + type: NodePort +{% elif service_type | lower == "loadbalancer" %} type: LoadBalancer {% else %} type: ClusterIP