From e091b32c4b18ea9fc719aaa99648bb1bcbd69063 Mon Sep 17 00:00:00 2001 From: stal Date: Mon, 12 Apr 2021 19:35:29 +0100 Subject: [PATCH 1/6] use ClusterIP service when ingress type is Ingress --- roles/installer/templates/tower_service.yaml.j2 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/roles/installer/templates/tower_service.yaml.j2 b/roles/installer/templates/tower_service.yaml.j2 index 321a5909..387a479d 100644 --- a/roles/installer/templates/tower_service.yaml.j2 +++ b/roles/installer/templates/tower_service.yaml.j2 @@ -44,6 +44,8 @@ spec: app.kubernetes.io/component: awx {% if tower_ingress_type | lower == "loadbalancer" %} type: LoadBalancer +{% elif tower_ingress_type | lower == "ingress" %} + type: ClusterIP {% elif tower_ingress_type != "none" %} type: NodePort {% endif %} From 0f90847c07d4595f8ad19e287696bba65afb6f83 Mon Sep 17 00:00:00 2001 From: stal Date: Mon, 12 Apr 2021 21:14:54 +0100 Subject: [PATCH 2/6] Add Service types to docs based on Ingress used --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index 1920685c..13edc61e 100644 --- a/README.md +++ b/README.md @@ -150,6 +150,14 @@ spec: tower_loadbalancer_protocol: http ``` +The AWX `Service` that gets created will have a `type` set based on the `tower_ingress_type` being used: + +If `tower_ingress_type: LoadBalancer` is used the `Service` will be set as `type: LoadBalancer`. + +If `tower_ingress_type: Ingress` is used the `Service` will be set as `type: ClusterIP`. + +If `tower_ingress_type: Route`, or no `tower_ingress_type` is specified in the Custom Resource Definition, the `Service` will be set as `type: NodePort`. + #### TLS Termination * Route From 1b87616a117a5cfaee536353bf7dd9ee012c8f66 Mon Sep 17 00:00:00 2001 From: stal Date: Wed, 14 Apr 2021 20:15:15 +0100 Subject: [PATCH 3/6] Add tower_ingress_type NodePort --- README.md | 21 +++++++++++++------ .../installer/templates/tower_service.yaml.j2 | 8 +++---- 2 files changed, 19 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 13edc61e..43471a17 100644 --- a/README.md +++ b/README.md @@ -119,7 +119,7 @@ stringData: By default, the AWX operator is not opinionated and won't force a specific ingress type on you. So, if `tower_ingress_type` is not specified as part of the Custom Resource specification, it will default to `none` and nothing ingress-wise will be created. -The AWX operator provides support for three kinds of `Ingress` to access AWX: `Ingress`, `Route` and `LoadBalancer`, To toggle between these options, you can add the following to your AWX CR: +The AWX operator provides support for four kinds of `Ingress` to access AWX: `Ingress`, `Route`, `LoadBalancer` and `NodePort`, To toggle between these options, you can add the following to your AWX CR: * Route @@ -150,13 +150,22 @@ spec: tower_loadbalancer_protocol: http ``` + * NodePort + +```yaml +--- +spec: + ... + tower_ingress_type: NodePort +``` + The AWX `Service` that gets created will have a `type` set based on the `tower_ingress_type` being used: -If `tower_ingress_type: LoadBalancer` is used the `Service` will be set as `type: LoadBalancer`. - -If `tower_ingress_type: Ingress` is used the `Service` will be set as `type: ClusterIP`. - -If `tower_ingress_type: Route`, or no `tower_ingress_type` is specified in the Custom Resource Definition, the `Service` will be set as `type: NodePort`. +| Ingress Type `tower_ingress_type` | Service Type | +| ------------------------------------- | -------------- | +| `LoadBalancer` | `LoadBalancer` | +| `NodePort` | `NodePort` | +| `Ingress` or `Route` or not specified | `ClusterIP` | #### TLS Termination diff --git a/roles/installer/templates/tower_service.yaml.j2 b/roles/installer/templates/tower_service.yaml.j2 index 387a479d..4b0259c7 100644 --- a/roles/installer/templates/tower_service.yaml.j2 +++ b/roles/installer/templates/tower_service.yaml.j2 @@ -44,8 +44,8 @@ spec: app.kubernetes.io/component: awx {% if tower_ingress_type | lower == "loadbalancer" %} type: LoadBalancer -{% elif tower_ingress_type | lower == "ingress" %} - type: ClusterIP -{% elif tower_ingress_type != "none" %} +{% elif tower_ingress_type | lower == "nodeport" %} type: NodePort -{% endif %} +{% elif %} + type: ClusterIP +{% endif %} \ No newline at end of file From a00052a8ca069e4ae6a899f19b79c0f65f93628b Mon Sep 17 00:00:00 2001 From: TheStally Date: Thu, 22 Apr 2021 08:37:31 +0100 Subject: [PATCH 4/6] Fix template logic --- roles/installer/templates/tower_service.yaml.j2 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/roles/installer/templates/tower_service.yaml.j2 b/roles/installer/templates/tower_service.yaml.j2 index 4b0259c7..3b41e229 100644 --- a/roles/installer/templates/tower_service.yaml.j2 +++ b/roles/installer/templates/tower_service.yaml.j2 @@ -46,6 +46,6 @@ spec: type: LoadBalancer {% elif tower_ingress_type | lower == "nodeport" %} type: NodePort -{% elif %} +{% else %} type: ClusterIP -{% endif %} \ No newline at end of file +{% endif %} From 96b878f0492293d19a87d3c90839639dc144634b Mon Sep 17 00:00:00 2001 From: TheStally Date: Thu, 22 Apr 2021 08:39:28 +0100 Subject: [PATCH 5/6] Add NodePort to tower_ingress_type enum --- ansible/templates/crd.yml.j2 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ansible/templates/crd.yml.j2 b/ansible/templates/crd.yml.j2 index beec0b25..bc88be7a 100644 --- a/ansible/templates/crd.yml.j2 +++ b/ansible/templates/crd.yml.j2 @@ -69,6 +69,8 @@ spec: - route - LoadBalancer - loadbalancer + - NodePort + - nodeport tower_ingress_annotations: description: Annotations to add to the ingress type: string From 5b38c85f8afa18fb461d48fccda70af82c12e6fa Mon Sep 17 00:00:00 2001 From: stal Date: Sat, 24 Apr 2021 15:16:49 +0100 Subject: [PATCH 6/6] Extra changes for new tower_ingress_type NodePort --- deploy/awx-operator.yaml | 2 ++ deploy/crds/awx_v1beta1_crd.yaml | 2 ++ .../manifests/awx-operator.clusterserviceversion.yaml | 1 + .../awx-operator/manifests/awx.ansible.com_awxs_crd.yaml | 2 ++ 4 files changed, 7 insertions(+) diff --git a/deploy/awx-operator.yaml b/deploy/awx-operator.yaml index 60d4b34c..091f0baf 100644 --- a/deploy/awx-operator.yaml +++ b/deploy/awx-operator.yaml @@ -71,6 +71,8 @@ spec: - route - LoadBalancer - loadbalancer + - NodePort + - nodeport tower_ingress_annotations: description: Annotations to add to the ingress type: string diff --git a/deploy/crds/awx_v1beta1_crd.yaml b/deploy/crds/awx_v1beta1_crd.yaml index beec0b25..bc88be7a 100644 --- a/deploy/crds/awx_v1beta1_crd.yaml +++ b/deploy/crds/awx_v1beta1_crd.yaml @@ -69,6 +69,8 @@ spec: - route - LoadBalancer - loadbalancer + - NodePort + - nodeport tower_ingress_annotations: description: Annotations to add to the ingress type: string diff --git a/deploy/olm-catalog/awx-operator/manifests/awx-operator.clusterserviceversion.yaml b/deploy/olm-catalog/awx-operator/manifests/awx-operator.clusterserviceversion.yaml index 5755c63e..3a569d9c 100644 --- a/deploy/olm-catalog/awx-operator/manifests/awx-operator.clusterserviceversion.yaml +++ b/deploy/olm-catalog/awx-operator/manifests/awx-operator.clusterserviceversion.yaml @@ -91,6 +91,7 @@ spec: - urn:alm:descriptor:com.tectonic.ui:select:Ingress - urn:alm:descriptor:com.tectonic.ui:select:Route - urn:alm:descriptor:com.tectonic.ui:select:LoadBalancer + - urn:alm:descriptor:com.tectonic.ui:select:NodePort - displayName: Tower Ingress Annotations path: tower_ingress_annotations x-descriptors: diff --git a/deploy/olm-catalog/awx-operator/manifests/awx.ansible.com_awxs_crd.yaml b/deploy/olm-catalog/awx-operator/manifests/awx.ansible.com_awxs_crd.yaml index 00bf9aed..e1f8fc62 100644 --- a/deploy/olm-catalog/awx-operator/manifests/awx.ansible.com_awxs_crd.yaml +++ b/deploy/olm-catalog/awx-operator/manifests/awx.ansible.com_awxs_crd.yaml @@ -103,6 +103,8 @@ spec: - route - LoadBalancer - loadbalancer + - NodePort + - nodeport type: string tower_loadbalancer_annotations: description: Annotations to add to the loadbalancer