summaryrefslogtreecommitdiffstats
path: root/roles/openshift_metrics/templates/service.j2
blob: 4d23982f11a215943cc1784e88ade3b118bded8f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
apiVersion: "v1"
kind: "Service"
metadata:
  name: "{{obj_name}}"
{% if annotations is defined%}
  annotations:
{% for key, value in annotations.items() %}
    {{key}}: {{value}}
{% endfor %}
{% endif %}
{% if labels is defined%}
  labels:
{% for key, value in labels.items() %}
    {{key}}: {{value}}
{% endfor %}
{% endif %}
spec:
{% if headless is defined and headless %}
  portalIP: None
  clusterIP: None
{% endif %}
  ports:
{% for port in ports %}
  -
{% for key, value in port.items() %}
    {{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.items() %}
  {{key}}: {{value}}
  {% endfor %}