12345678910111213141516171819202122232425262728293031323334 |
- apiVersion: "v1"
- kind: "Service"
- metadata:
- name: "{{obj_name}}"
- {% if labels is defined%}
- labels:
- {% for key, value in labels.iteritems() %}
- {{key}}: {{value}}
- {% endfor %}
- {% endif %}
- spec:
- ports:
- {% for port in ports %}
- -
- {% for key, value in port.iteritems() %}
- {{key}}: {{value}}
- {% endfor %}
- {% if port.targetPort is undefined %}
- clusterIP: "None"
- {% endif %}
- {% endfor %}
- {% if service_targetPort is defined %}
- targetPort: {{service_targetPort}}
- {% endif %}
- selector:
- {% for key, value in selector.iteritems() %}
- {{key}}: {{value}}
- {% endfor %}
- {% if externalIPs is defined -%}
- externalIPs:
- {% for ip in externalIPs %}
- - {{ ip }}
- {% endfor %}
- {% endif %}
|