mirror of
https://github.com/ansible/awx-operator.git
synced 2026-03-26 21:33:14 +00:00
53 lines
1.7 KiB
Django/Jinja
53 lines
1.7 KiB
Django/Jinja
---
|
|
apiVersion: v1
|
|
kind: Service
|
|
metadata:
|
|
name: '{{ meta.name }}-service'
|
|
namespace: '{{ meta.namespace }}'
|
|
labels:
|
|
app.kubernetes.io/name: '{{ meta.name }}'
|
|
app.kubernetes.io/part-of: '{{ meta.name }}'
|
|
app.kubernetes.io/managed-by: '{{ deployment_type }}-operator'
|
|
app.kubernetes.io/component: '{{ deployment_type }}'
|
|
{{ tower_service_labels | indent(width=4) }}
|
|
{% if tower_ingress_type | lower == 'loadbalancer' and tower_loadbalancer_annotations %}
|
|
annotations:
|
|
{{ tower_loadbalancer_annotations | indent(width=4) }}
|
|
{% endif %}
|
|
spec:
|
|
ports:
|
|
{% if tower_ingress_type | lower != 'loadbalancer' and tower_loadbalancer_protocol | lower != 'https' %}
|
|
- port: 80
|
|
protocol: TCP
|
|
targetPort: 8052
|
|
name: http
|
|
{% endif %}
|
|
{% if tower_ingress_type | lower == 'route' and tower_route_tls_termination_mechanism | lower == 'passthrough' %}
|
|
- port: 443
|
|
protocol: TCP
|
|
targetPort: 8053
|
|
name: https
|
|
{% endif %}
|
|
{% if tower_ingress_type | lower == 'loadbalancer' and tower_loadbalancer_protocol | lower == 'https' %}
|
|
- port: {{ tower_loadbalancer_port }}
|
|
protocol: TCP
|
|
targetPort: 8052
|
|
name: https
|
|
{% elif tower_ingress_type | lower == 'loadbalancer' and tower_loadbalancer_protocol | lower != 'https' %}
|
|
- port: {{ tower_loadbalancer_port }}
|
|
protocol: TCP
|
|
targetPort: 8052
|
|
name: http
|
|
{% endif %}
|
|
selector:
|
|
app.kubernetes.io/name: '{{ meta.name }}'
|
|
app.kubernetes.io/managed-by: '{{ deployment_type }}-operator'
|
|
app.kubernetes.io/component: '{{ deployment_type }}'
|
|
{% if tower_ingress_type | lower == "loadbalancer" %}
|
|
type: LoadBalancer
|
|
{% elif tower_ingress_type != "none" %}
|
|
type: NodePort
|
|
{% else %}
|
|
type: ClusterIP
|
|
{% endif %}
|