ansible / awx-operator

An Ansible AWX operator for Kubernetes built with Operator SDK and Ansible. 🤖
https://www.github.com/ansible/awx
Apache License 2.0
1.24k stars 625 forks source link

Add support for annotations on the task and web Deployments #1617

Open ubajze opened 11 months ago

ubajze commented 11 months ago

Please confirm the following

Feature Summary

I want to add custom annotations to the task and web Deployment objects. As far as I see, there are currently no options to add annotations to those two K8s manifests: https://github.com/ansible/awx-operator/blob/a8153d5ffb34412d6ea33a77d4f0a8393743697a/roles/installer/templates/deployments/task.yaml.j2#L4-L9 https://github.com/ansible/awx-operator/blob/a8153d5ffb34412d6ea33a77d4f0a8393743697a/roles/installer/templates/deployments/web.yaml.j2#L4-L10

My use case is the following. I create a ConfigMap with additional environmental variables. Then, I inject those into the task and web pods using this setting:

  web_extra_env: | 
    - name: MY_ADDITIONAL_ENV_VAR
      valueFrom:
        configMapKeyRef:
          name: extra-settings
          key: MY_ADDITIONAL_ENV_VAR

The environmental variables get injected into pods. If I change the variable's value in the ConfigMap, I have to go to the cluster and manually restart both deployments.

I often use the Reloader tool (https://github.com/stakater/Reloader) to perform this task automatically. Reloader periodically checks the ConfigMaps and restart deployments if a change is detected. To configure Reloader, you have to add annotation to Deployments.

ubajze commented 11 months ago

This can be a lower priority, I discovered the you can add the annotation to pods as well, and it works the same way.

djyasin commented 10 months ago

@ubajze We are so happy to hear that you were able to find a workaround! I will go ahead and add this to our backlog, but we are happy to hear you've found a solution for the interim.