From 9ca14cef93e9e9f9198e67331cc9dca40045038f Mon Sep 17 00:00:00 2001 From: MrBones757 Date: Fri, 25 Feb 2022 09:49:46 +0800 Subject: [PATCH] added support for pod annotations to awx deployment --- README.md | 1 + config/crd/bases/awx.ansible.com_awxs.yaml | 3 +++ config/manifests/bases/olm-parameters.yaml | 5 +++++ roles/installer/defaults/main.yml | 6 ++++++ roles/installer/templates/deployment.yaml.j2 | 4 ++++ 5 files changed, 19 insertions(+) diff --git a/README.md b/README.md index ea9ef201..3ded42b7 100644 --- a/README.md +++ b/README.md @@ -574,6 +574,7 @@ The ability to specify topologySpreadConstraints is also allowed through `topolo | node_selector | AWX pods' nodeSelector | '' | | topology_spread_constraints | AWX pods' topologySpreadConstraints | '' | | tolerations | AWX pods' tolerations | '' | +| annotations | AWX pods' annotations | '' | | postgres_selector | Postgres pods' nodeSelector | '' | | postgres_tolerations | Postgres pods' tolerations | '' | diff --git a/config/crd/bases/awx.ansible.com_awxs.yaml b/config/crd/bases/awx.ansible.com_awxs.yaml index 82ff8087..fdb3089f 100644 --- a/config/crd/bases/awx.ansible.com_awxs.yaml +++ b/config/crd/bases/awx.ansible.com_awxs.yaml @@ -140,6 +140,9 @@ spec: service_labels: description: Additional labels to apply to the service type: string + annotations: + description: annotations for the pods + type: string tolerations: description: node tolerations for the pods type: string diff --git a/config/manifests/bases/olm-parameters.yaml b/config/manifests/bases/olm-parameters.yaml index e65edf14..f81c875b 100644 --- a/config/manifests/bases/olm-parameters.yaml +++ b/config/manifests/bases/olm-parameters.yaml @@ -527,6 +527,11 @@ - urn:alm:descriptor:com.tectonic.ui:advanced - urn:alm:descriptor:com.tectonic.ui:text - urn:alm:descriptor:com.tectonic.ui:hidden + - displayName: Annotations + path: annotations + x-descriptors: + - urn:alm:descriptor:com.tectonic.ui:advanced + - urn:alm:descriptor:com.tectonic.ui:hidden - displayName: Tolerations path: tolerations x-descriptors: diff --git a/roles/installer/defaults/main.yml b/roles/installer/defaults/main.yml index a4bc8874..ebe7612b 100644 --- a/roles/installer/defaults/main.yml +++ b/roles/installer/defaults/main.yml @@ -83,6 +83,12 @@ topology_spread_constraints: '' # effect: "NoSchedule" tolerations: '' +# Add annotations to awx pods. Specify as literal block. E.g.: +# annotations: | +# my.annotation/1: value +# my.annotation/2: value2 +annotations: '' + admin_user: admin admin_email: test@example.com diff --git a/roles/installer/templates/deployment.yaml.j2 b/roles/installer/templates/deployment.yaml.j2 index 4207a398..f737568b 100644 --- a/roles/installer/templates/deployment.yaml.j2 +++ b/roles/installer/templates/deployment.yaml.j2 @@ -27,6 +27,10 @@ spec: app.kubernetes.io/part-of: '{{ ansible_operator_meta.name }}' app.kubernetes.io/managed-by: '{{ deployment_type }}-operator' app.kubernetes.io/component: '{{ deployment_type }}' +{% if annotations %} + annotations: + {{ annotations | indent(width=8) }} +{% endif %} spec: serviceAccountName: '{{ ansible_operator_meta.name }}' {% if image_pull_secret %}