Expose websockets on api prefix v2 (#1842)

Expose websockets on controller v2
This commit is contained in:
jamesmarshall24
2024-05-01 15:47:23 -04:00
committed by GitHub
parent 9638a2b284
commit b49d68ca92
4 changed files with 17 additions and 0 deletions

View File

@@ -144,6 +144,9 @@ spec:
ingress_controller: ingress_controller:
description: Special configuration for specific Ingress Controllers description: Special configuration for specific Ingress Controllers
type: string type: string
api_urlpattern_prefix:
description: An optional configuration to add a prefix in the API URL path
type: string
loadbalancer_protocol: loadbalancer_protocol:
description: Protocol to use for the loadbalancer description: Protocol to use for the loadbalancer
type: string type: string

View File

@@ -58,6 +58,11 @@ spec:
path: ingress_controller path: ingress_controller
x-descriptors: x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:text - urn:alm:descriptor:com.tectonic.ui:text
- displayName: Optional API URLPATTERN Prefix
path: api_urlpattern_prefix
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:advanced
- urn:alm:descriptor:com.tectonic.ui:text
- displayName: Image Pull Secrets - displayName: Image Pull Secrets
path: image_pull_secrets path: image_pull_secrets
x-descriptors: x-descriptors:

View File

@@ -13,6 +13,7 @@ ingress_class_name: ''
ingress_path: '/' ingress_path: '/'
ingress_path_type: 'Prefix' ingress_path_type: 'Prefix'
ingress_api_version: 'networking.k8s.io/v1' ingress_api_version: 'networking.k8s.io/v1'
api_urlpattern_prefix: ''
# Add annotations to the service account. Specify as literal block. E.g.: # Add annotations to the service account. Specify as literal block. E.g.:
# service_account_annotations: | # service_account_annotations: |
# eks.amazonaws.com/role-arn: arn:aws:iam::<ACCOUNT_ID>:role/<IAM_ROLE_NAME> # eks.amazonaws.com/role-arn: arn:aws:iam::<ACCOUNT_ID>:role/<IAM_ROLE_NAME>

View File

@@ -54,6 +54,10 @@ data:
INTERNAL_API_URL = 'http://127.0.0.1:8052' INTERNAL_API_URL = 'http://127.0.0.1:8052'
{% if api_urlpattern_prefix | length > 0 %}
OPTIONAL_API_URLPATTERN_PREFIX = '{{ api_urlpattern_prefix }}'
{% endif %}
# Container environments don't like chroots # Container environments don't like chroots
AWX_PROOT_ENABLED = False AWX_PROOT_ENABLED = False
@@ -192,7 +196,11 @@ data:
alias /var/lib/awx/public/static/media/favicon.ico; alias /var/lib/awx/public/static/media/favicon.ico;
} }
{% if api_urlpattern_prefix | length > 0 %}
location ~ ^({{ (ingress_path + '/websocket/').replace('//', '/') }}|{{ (ingress_path + '/api/websocket/').replace('//', '/') }}|{{ (ingress_path + '/api/' + api_urlpattern_prefix + '/v2/websocket/').replace('//', '/') }}) {
{% else %}
location ~ ^({{ (ingress_path + '/websocket/').replace('//', '/') }}|{{ (ingress_path + '/api/websocket/').replace('//', '/') }}) { location ~ ^({{ (ingress_path + '/websocket/').replace('//', '/') }}|{{ (ingress_path + '/api/websocket/').replace('//', '/') }}) {
{% endif %}
# Pass request to the upstream alias # Pass request to the upstream alias
proxy_pass http://daphne; proxy_pass http://daphne;
# Require http version 1.1 to allow for upgrade requests # Require http version 1.1 to allow for upgrade requests