diff --git a/README.md b/README.md index 2ffea332..aaa25259 100644 --- a/README.md +++ b/README.md @@ -403,12 +403,14 @@ The following variables are customizable only when `service_type=LoadBalancer` | --------------------- | ---------------------------------------- | ------- | | loadbalancer_protocol | Protocol to use for Loadbalancer ingress | http | | loadbalancer_port | Port used for Loadbalancer ingress | 80 | +| loadbalancer_ip | Assign Loadbalancer IP | '' | ```yaml --- spec: ... service_type: LoadBalancer + loadbalancer_ip: '192.168.10.25' loadbalancer_protocol: https loadbalancer_port: 443 service_annotations: | diff --git a/config/crd/bases/awx.ansible.com_awxs.yaml b/config/crd/bases/awx.ansible.com_awxs.yaml index d47ec361..9e30b9cb 100644 --- a/config/crd/bases/awx.ansible.com_awxs.yaml +++ b/config/crd/bases/awx.ansible.com_awxs.yaml @@ -132,6 +132,10 @@ spec: description: Port to use for the loadbalancer type: integer default: 80 + loadbalancer_ip: + description: Assign LoadBalancer IP address + type: string + default: '' route_host: description: The DNS to use to points to the instance type: string diff --git a/config/manifests/bases/awx-operator.clusterserviceversion.yaml b/config/manifests/bases/awx-operator.clusterserviceversion.yaml index 940e5887..13cf8d1d 100644 --- a/config/manifests/bases/awx-operator.clusterserviceversion.yaml +++ b/config/manifests/bases/awx-operator.clusterserviceversion.yaml @@ -270,6 +270,12 @@ spec: - urn:alm:descriptor:com.tectonic.ui:advanced - urn:alm:descriptor:com.tectonic.ui:number - urn:alm:descriptor:com.tectonic.ui:fieldDependency:service_type:LoadBalancer + - displayName: LoadBalancer IP + path: loadbalancer_ip + x-descriptors: + - urn:alm:descriptor:com.tectonic.ui:advanced + - urn:alm:descriptor:com.tectonic.ui:string + - urn:alm:descriptor:com.tectonic.ui:fieldDependency:service_type:LoadBalancer - displayName: Route API Version path: route_api_version x-descriptors: diff --git a/roles/installer/templates/networking/service.yaml.j2 b/roles/installer/templates/networking/service.yaml.j2 index 72ad544d..a006d01e 100644 --- a/roles/installer/templates/networking/service.yaml.j2 +++ b/roles/installer/templates/networking/service.yaml.j2 @@ -53,6 +53,9 @@ spec: type: NodePort {% elif service_type | lower == "loadbalancer" %} type: LoadBalancer +{% if variable is defined and variable|length %} + loadbalancerip: '{{ loadbalancer_ip }}' +{% endif %} {% else %} type: ClusterIP {% endif %}