mirror of
https://github.com/ansible/awx-operator.git
synced 2026-05-07 22:02:53 +00:00
Add ingress and ingressroutetcp for awxmeshingress (#1646)
* fix: correct port number for internal receptor address * feat: add support for ingress for awxmeshingress cr * feat: add support for ingressroutetcp (for traefik) for awxmeshingress cr
This commit is contained in:
committed by
Christian Adams
parent
98d5ac126d
commit
da7e227f71
@@ -1,5 +1,12 @@
|
||||
---
|
||||
deployment_type: awx
|
||||
|
||||
ingress_type: none
|
||||
ingress_api_version: 'networking.k8s.io/v1'
|
||||
ingress_annotations: ''
|
||||
ingress_class_name: ''
|
||||
ingress_controller: ''
|
||||
|
||||
set_self_owneref: true
|
||||
|
||||
_control_plane_ee_image: quay.io/ansible/awx-ee:latest
|
||||
|
||||
@@ -65,7 +65,6 @@
|
||||
wait: yes
|
||||
wait_timeout: "120"
|
||||
register: route
|
||||
when: is_openshift | bool
|
||||
|
||||
# TODO: need to wait until the route is ready before we can get the hostname
|
||||
# right now this will rereconcile until the route is ready
|
||||
@@ -127,7 +126,7 @@
|
||||
namespace: "{{ ansible_operator_meta.namespace }}"
|
||||
pod: "{{ awx_task_pod_name }}"
|
||||
container: "{{ deployment_name }}-task"
|
||||
command: "awx-manage add_receptor_address --hostname {{ ansible_operator_meta.name }} --address {{ ansible_operator_meta.name }} --port 443 --protocol ws --is_internal --peers_from_control_nodes"
|
||||
command: "awx-manage add_receptor_address --hostname {{ ansible_operator_meta.name }} --address {{ ansible_operator_meta.name }} --port 27199 --protocol ws --is_internal --peers_from_control_nodes"
|
||||
|
||||
- name: Add external receptor address
|
||||
kubernetes.core.k8s_exec:
|
||||
|
||||
@@ -1,3 +1,66 @@
|
||||
{% if ingress_type|lower == "ingress" %}
|
||||
---
|
||||
{% if ingress_api_version is defined %}
|
||||
apiVersion: '{{ ingress_api_version }}'
|
||||
{% endif %}
|
||||
kind: Ingress
|
||||
metadata:
|
||||
name: {{ ansible_operator_meta.name }}
|
||||
namespace: {{ ansible_operator_meta.namespace }}
|
||||
annotations:
|
||||
{% if ingress_annotations %}
|
||||
{{ ingress_annotations | indent(width=4) }}
|
||||
{% endif %}
|
||||
{% if ingress_controller|lower == "nginx" %}
|
||||
nginx.ingress.kubernetes.io/ssl-passthrough: "true"
|
||||
{% endif %}
|
||||
spec:
|
||||
{% if ingress_class_name %}
|
||||
ingressClassName: '{{ ingress_class_name }}'
|
||||
{% endif %}
|
||||
rules:
|
||||
- http:
|
||||
paths:
|
||||
- path: /
|
||||
pathType: Prefix
|
||||
backend:
|
||||
service:
|
||||
name: {{ ansible_operator_meta.name }}
|
||||
port:
|
||||
number: 27199
|
||||
{% if external_hostname %}
|
||||
host: {{ external_hostname }}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
{% if ingress_type|lower == "ingressroutetcp" %}
|
||||
---
|
||||
{% if ingress_api_version is defined %}
|
||||
apiVersion: '{{ ingress_api_version }}'
|
||||
{% endif %}
|
||||
kind: IngressRouteTCP
|
||||
metadata:
|
||||
name: {{ ansible_operator_meta.name }}
|
||||
namespace: {{ ansible_operator_meta.namespace }}
|
||||
annotations:
|
||||
{% if ingress_annotations %}
|
||||
{{ ingress_annotations | indent(width=4) }}
|
||||
{% endif %}
|
||||
spec:
|
||||
entryPoints:
|
||||
- websecure
|
||||
routes:
|
||||
- services:
|
||||
- name: {{ ansible_operator_meta.name }}
|
||||
port: 27199
|
||||
{% if external_hostname %}
|
||||
match: HostSNI(`{{ external_hostname }}`)
|
||||
{% endif %}
|
||||
tls:
|
||||
passthrough: true
|
||||
{% endif %}
|
||||
|
||||
{% if ingress_type|lower == "route" %}
|
||||
---
|
||||
apiVersion: route.openshift.io/v1
|
||||
kind: Route
|
||||
@@ -17,3 +80,4 @@ spec:
|
||||
name: {{ ansible_operator_meta.name }}
|
||||
weight: 100
|
||||
wildcardPolicy: None
|
||||
{% endif %}
|
||||
|
||||
Reference in New Issue
Block a user