diff --git a/README.md b/README.md index 23938302..f2ecf03f 100644 --- a/README.md +++ b/README.md @@ -257,12 +257,15 @@ The following variables are customizable for any `service_type` | Name | Description | Default | | ------------------------------------- | --------------------------------------------- | --------------------------------- | | service_labels | Add custom labels | Empty string | +| service_annotations | Add service annotations | Empty string | ```yaml --- spec: ... service_type: ClusterIP + service_annotations: | + environment: testing service_labels: | environment: testing ``` @@ -273,7 +276,6 @@ The following variables are customizable only when `service_type=LoadBalancer` | Name | Description | Default | | ------------------------------ | ---------------------------------------- | ------------- | -| loadbalancer_annotations | LoadBalancer annotations | Empty string | | loadbalancer_protocol | Protocol to use for Loadbalancer ingress | http | | loadbalancer_port | Port used for Loadbalancer ingress | 80 | @@ -284,7 +286,7 @@ spec: service_type: LoadBalancer loadbalancer_protocol: https loadbalancer_port: 443 - loadbalancer_annotations: | + service_annotations: | environment: testing service_labels: | environment: testing diff --git a/config/crd/bases/awx.ansible.com_awxs.yaml b/config/crd/bases/awx.ansible.com_awxs.yaml index 2623b4ad..82ff8087 100644 --- a/config/crd/bases/awx.ansible.com_awxs.yaml +++ b/config/crd/bases/awx.ansible.com_awxs.yaml @@ -67,6 +67,9 @@ spec: extra_volumes: description: Specify extra volumes to add to the application pod type: string + service_annotations: + description: Annotations to add to the service + type: string service_type: description: The service type to be used on the deployed instance type: string @@ -98,9 +101,6 @@ spec: ingress_tls_secret: description: Secret where the Ingress TLS secret can be found type: string - loadbalancer_annotations: - description: Annotations to add to the loadbalancer - type: string loadbalancer_protocol: description: Protocol to use for the loadbalancer type: string diff --git a/config/manifests/bases/olm-parameters.yaml b/config/manifests/bases/olm-parameters.yaml index 637b1dd9..e65edf14 100644 --- a/config/manifests/bases/olm-parameters.yaml +++ b/config/manifests/bases/olm-parameters.yaml @@ -199,7 +199,7 @@ - urn:alm:descriptor:io.kubernetes:Secret - urn:alm:descriptor:com.tectonic.ui:fieldDependency:ingress_type:Ingress - displayName: Tower LoadBalancer Annotations - path: loadbalancer_annotations + path: service_annotations x-descriptors: - urn:alm:descriptor:com.tectonic.ui:advanced - urn:alm:descriptor:com.tectonic.ui:text diff --git a/roles/installer/defaults/main.yml b/roles/installer/defaults/main.yml index 78e9415d..a4bc8874 100644 --- a/roles/installer/defaults/main.yml +++ b/roles/installer/defaults/main.yml @@ -36,7 +36,7 @@ ingress_tls_secret: '' loadbalancer_protocol: 'http' loadbalancer_port: '80' -loadbalancer_annotations: '' +service_annotations: '' nodeport_port: '30080' # The TLS termination mechanism to use to access diff --git a/roles/installer/templates/service.yaml.j2 b/roles/installer/templates/service.yaml.j2 index 5eac078f..3c5cc268 100644 --- a/roles/installer/templates/service.yaml.j2 +++ b/roles/installer/templates/service.yaml.j2 @@ -11,9 +11,9 @@ metadata: app.kubernetes.io/component: '{{ deployment_type }}' app.kubernetes.io/operator-version: '{{ lookup("env", "OPERATOR_VERSION") }}' {{ service_labels | indent(width=4) }} -{% if service_type | lower == 'loadbalancer' and loadbalancer_annotations %} +{% if service_annotations %} annotations: - {{ loadbalancer_annotations | indent(width=4) }} + {{ service_annotations | indent(width=4) }} {% endif %} spec: ports: