From b1dcf16fc82bec5e6059a68d084056dad61020f8 Mon Sep 17 00:00:00 2001 From: Sean Davis Date: Mon, 4 Oct 2021 10:31:56 -0500 Subject: [PATCH] Add Ingress path type option (#1) * make ingress_path_type an option * add to spec --- README.md | 1 + config/crd/bases/awx.ansible.com_awxs.yaml | 3 +++ roles/installer/defaults/main.yml | 1 + roles/installer/templates/ingress.yaml.j2 | 2 +- 4 files changed, 6 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index abe13040..fe2b5722 100644 --- a/README.md +++ b/README.md @@ -320,6 +320,7 @@ The following variables are customizable when `ingress_type=ingress`. The `ingre | ingress_tls_secret | Secret that contains the TLS information | Empty string | | hostname | Define the FQDN | {{ meta.name }}.example.com | | ingress_path | Define the ingress path to the service | / | +| ingress_path_type | Define the type of the path (for LBs) | Prefix | ```yaml --- diff --git a/config/crd/bases/awx.ansible.com_awxs.yaml b/config/crd/bases/awx.ansible.com_awxs.yaml index 6fda7629..b45fe858 100644 --- a/config/crd/bases/awx.ansible.com_awxs.yaml +++ b/config/crd/bases/awx.ansible.com_awxs.yaml @@ -89,6 +89,9 @@ spec: ingress_path: description: The ingress path used to reach the deployed service type: string + ingress_path_type: + description: The ingress path type for the deployed service + type: string ingress_annotations: description: Annotations to add to the Ingress Controller type: string diff --git a/roles/installer/defaults/main.yml b/roles/installer/defaults/main.yml index 8ee66ee3..c166aecd 100644 --- a/roles/installer/defaults/main.yml +++ b/roles/installer/defaults/main.yml @@ -10,6 +10,7 @@ task_privileged: false service_type: ClusterIP ingress_type: none ingress_path: '/' +ingress_path_type: 'Prefix' # Add annotations to the service account. Specify as literal block. E.g.: # service_account_annotations: | # eks.amazonaws.com/role-arn: arn:aws:iam:::role/ diff --git a/roles/installer/templates/ingress.yaml.j2 b/roles/installer/templates/ingress.yaml.j2 index fb2a6f5f..57cf42e7 100644 --- a/roles/installer/templates/ingress.yaml.j2 +++ b/roles/installer/templates/ingress.yaml.j2 @@ -20,7 +20,7 @@ spec: - http: paths: - path: '{{ ingress_path }}' - pathType: Prefix + pathType: '{{ ingress_path_type }}' backend: service: name: '{{ ansible_operator_meta.name }}-service'