Add websocket configuration for contour ingress (#1320)

Co-authored-by: lumarel <lumarel@users.noreply.github.com>
This commit is contained in:
Lukas Magauer
2023-04-12 20:29:21 +02:00
committed by GitHub
parent 9bdbf4bacb
commit faf51c8b24
5 changed files with 46 additions and 1 deletions

View File

@@ -477,6 +477,23 @@ spec:
environment: testing
```
##### Specialized Ingress Controller configuration
Some Ingress Controllers need a special configuration to fully support AWX, add the following value with the `ingress_controller` variable, if you are using one of these:
| Ingress Controller name | value |
| ------------------------------------- | ------- |
| [Contour](https://projectcontour.io/) | contour |
```yaml
---
spec:
...
ingress_type: ingress
hostname: awx-demo.example.com
ingress_controller: contour
```
* Route
The following variables are customizable when `ingress_type=route`

View File

@@ -121,6 +121,9 @@ spec:
ingress_class_name:
description: The name of ingress class to use instead of the cluster default.
type: string
ingress_controller:
description: Special configuration for specific Ingress Controllers
type: string
loadbalancer_protocol:
description: Protocol to use for the loadbalancer
type: string

View File

@@ -251,6 +251,12 @@ spec:
- urn:alm:descriptor:com.tectonic.ui:advanced
- urn:alm:descriptor:io.kubernetes:Secret
- urn:alm:descriptor:com.tectonic.ui:fieldDependency:ingress_type:Ingress
- displayName: Ingress Controller
path: ingress_controller
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:advanced
- urn:alm:descriptor:com.tectonic.ui:text
- urn:alm:descriptor:com.tectonic.ui:fieldDependency:ingress_type:Ingress
- displayName: LoadBalancer Annotations
path: service_annotations
x-descriptors:

View File

@@ -36,6 +36,10 @@ ingress_annotations: ''
# certificate and key.
ingress_tls_secret: ''
# Special configuration for specific Ingress Controllers. E.g.:
# ingress_controller: contour
ingress_controller: ''
loadbalancer_protocol: 'http'
loadbalancer_port: '80'
service_annotations: ''

View File

@@ -9,10 +9,16 @@ metadata:
namespace: '{{ ansible_operator_meta.namespace }}'
labels:
{{ lookup("template", "../common/templates/labels/common.yaml.j2") | indent(width=4) | trim }}
{% if ingress_annotations %}
{% if ingress_annotations or ingress_controller|lower == "contour" %}
annotations:
{% if ingress_annotations %}
{{ ingress_annotations | indent(width=4) }}
{% endif %}
{% if ingress_controller|lower == "contour" %}
projectcontour.io/websocket-routes: "/websocket"
kubernetes.io/ingress.class: contour
{% endif %}
{% endif %}
spec:
{% if ingress_class_name %}
ingressClassName: '{{ ingress_class_name }}'
@@ -27,6 +33,15 @@ spec:
name: '{{ ansible_operator_meta.name }}-service'
port:
number: 80
{% if ingress_controller|lower == "contour" %}
- path: '{{ ingress_path }}/websocket'
pathType: '{{ ingress_path_type }}'
backend:
service:
name: '{{ ansible_operator_meta.name }}-service'
port:
number: 80
{% endif %}
{% if hostname %}
host: {{ hostname }}
{% endif %}