diff --git a/ansible/templates/crd.yml.j2 b/ansible/templates/crd.yml.j2 index ad8ca846..f617defe 100644 --- a/ansible/templates/crd.yml.j2 +++ b/ansible/templates/crd.yml.j2 @@ -118,6 +118,9 @@ spec: tower_node_selector: description: nodeSelector for the AWX pods type: string + tower_service_labels: + description: Additional labels to apply to the service + type: string tower_tolerations: description: node tolerations for the AWX pods type: string diff --git a/deploy/awx-operator.yaml b/deploy/awx-operator.yaml index 7c1f3636..bea182e5 100644 --- a/deploy/awx-operator.yaml +++ b/deploy/awx-operator.yaml @@ -120,6 +120,9 @@ spec: tower_node_selector: description: nodeSelector for the AWX pods type: string + tower_service_labels: + description: Additional labels to apply to the service + type: string tower_tolerations: description: node tolerations for the AWX pods type: string diff --git a/deploy/crds/awx_v1beta1_crd.yaml b/deploy/crds/awx_v1beta1_crd.yaml index ad8ca846..f617defe 100644 --- a/deploy/crds/awx_v1beta1_crd.yaml +++ b/deploy/crds/awx_v1beta1_crd.yaml @@ -118,6 +118,9 @@ spec: tower_node_selector: description: nodeSelector for the AWX pods type: string + tower_service_labels: + description: Additional labels to apply to the service + type: string tower_tolerations: description: node tolerations for the AWX pods 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 175433e6..e1036e2c 100644 --- a/deploy/olm-catalog/awx-operator/manifests/awx-operator.clusterserviceversion.yaml +++ b/deploy/olm-catalog/awx-operator/manifests/awx-operator.clusterserviceversion.yaml @@ -381,6 +381,11 @@ spec: x-descriptors: - urn:alm:descriptor:com.tectonic.ui:advanced - urn:alm:descriptor:com.tectonic.ui:hidden + - displayName: Tower Service Labels + path: tower_service_labels + x-descriptors: + - urn:alm:descriptor:com.tectonic.ui:advanced + - urn:alm:descriptor:com.tectonic.ui:text - displayName: Tower Tolerations path: tower_tolerations 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 57a52d6f..c241a63f 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 @@ -135,6 +135,9 @@ spec: tower_node_selector: description: nodeSelector for the AWX pods type: string + tower_service_labels: + description: Additional labels to apply to the service + type: string tower_old_postgres_configuration_secret: description: Secret where the old database configuration can be found for data migration diff --git a/roles/installer/defaults/main.yml b/roles/installer/defaults/main.yml index f5225614..7f8a0d60 100644 --- a/roles/installer/defaults/main.yml +++ b/roles/installer/defaults/main.yml @@ -9,6 +9,12 @@ database_username: "{{ deployment_type }}" tower_task_privileged: false tower_ingress_type: none +# Custom labels for the tower service. Specify as literal block. E.g.: +# tower_ingress_annotations: | +# environment: non-production +# zone: internal +tower_service_labels: '' + # Add annotations to the ingress. Specify as literal block. E.g.: # tower_ingress_annotations: | # kubernetes.io/ingress.class: nginx diff --git a/roles/installer/templates/tower_service.yaml.j2 b/roles/installer/templates/tower_service.yaml.j2 index 5f8a1582..ea303c61 100644 --- a/roles/installer/templates/tower_service.yaml.j2 +++ b/roles/installer/templates/tower_service.yaml.j2 @@ -9,6 +9,7 @@ metadata: app.kubernetes.io/part-of: '{{ meta.name }}' app.kubernetes.io/managed-by: '{{ deployment_type }}-operator' app.kubernetes.io/component: '{{ deployment_type }}' + {{ tower_service_labels | indent(width=4) }} {% if tower_ingress_type | lower == 'loadbalancer' and tower_loadbalancer_annotations %} annotations: {{ tower_loadbalancer_annotations | indent(width=4) }}