blob: b236417f2e5c54441b7a14d5fa51e2caff43bd28 [file] [log] [blame]
{% from "kubernetes/map.jinja" import control with context %}
apiVersion: v1
kind: Service
metadata:
labels:
name: {{ service.service }}-{{ service.role }}
app: {{ service.service }}-{{ service.role }}
name: {{ service.service }}-{{ service.role }}
namespace: {{ service.namespace }}
spec:
ports:
{%- for port in service.ports %}
- port: {{ port.port }}
name: {{ port.name }}
{%- endfor %}
type: {{ service.type }}
selector:
app: {{ service.service }}-{{ service.role }}
{%- if service.cluster_ip is defined %}
clusterIP: {{ service.cluster_ip }}
{%- endif %}
{%- if service.external_ip is defined %}
externalIPs:
- "{{ service.external_ip }}"
{%- endif -%}