Make tower_ingress_type to respect ClusterIP definition

This commit is contained in:
Marcelo Moreira de Mello
2021-05-18 14:22:56 -04:00
parent d6c9ebf35c
commit e37c091d17
15 changed files with 256 additions and 126 deletions

View File

@@ -7,6 +7,7 @@ database_name: "{{ deployment_type }}"
database_username: "{{ deployment_type }}"
task_privileged: false
service_type: ClusterIP
ingress_type: none
# Add annotations to the service account. Specify as literal block. E.g.:
@@ -51,7 +52,7 @@ route_tls_secret: ''
#
route_host: ''
hostname: '{{ deployment_type }}.example.com'
hostname: '{{ meta.name }}.example.com'
# Add a nodeSelector for the AWX pods. It must match a node's labels for the pod
# to be scheduled on that node. Specify as literal block. E.g.:

View File

@@ -1,4 +1,4 @@
{% if 'ingress' == ingress_type|lower %}
{% if ingress_type|lower == "ingress" %}
---
apiVersion: extensions/v1beta1
kind: Ingress
@@ -32,7 +32,7 @@ spec:
{% endif %}
{% endif %}
{% if 'route' == ingress_type|lower %}
{% if ingress_type|lower == "route" %}
---
apiVersion: route.openshift.io/v1
kind: Route

View File

@@ -17,7 +17,7 @@ metadata:
{% endif %}
spec:
ports:
{% if ingress_type | lower != 'loadbalancer' and loadbalancer_protocol | lower != 'https' %}
{% if service_type | lower != 'loadbalancer' and loadbalancer_protocol | lower != 'https' %}
- port: 80
protocol: TCP
targetPort: 8052
@@ -29,12 +29,12 @@ spec:
targetPort: 8053
name: https
{% endif %}
{% if ingress_type | lower == 'loadbalancer' and loadbalancer_protocol | lower == 'https' %}
{% if service_type | lower == 'loadbalancer' and loadbalancer_protocol | lower == 'https' %}
- port: {{ loadbalancer_port }}
protocol: TCP
targetPort: 8052
name: https
{% elif ingress_type | lower == 'loadbalancer' and loadbalancer_protocol | lower != 'https' %}
{% elif service_type | lower == 'loadbalancer' and loadbalancer_protocol | lower != 'https' %}
- port: {{ loadbalancer_port }}
protocol: TCP
targetPort: 8052
@@ -44,9 +44,9 @@ spec:
app.kubernetes.io/name: '{{ meta.name }}'
app.kubernetes.io/managed-by: '{{ deployment_type }}-operator'
app.kubernetes.io/component: '{{ deployment_type }}'
{% if ingress_type | lower == "loadbalancer" %}
{% if service_type | lower == "loadbalancer" %}
type: LoadBalancer
{% elif ingress_type != "none" %}
{% elif service_type | lower == "nodeport" %}
type: NodePort
{% else %}
type: ClusterIP