ansible / eda-server

Event Driven Ansible for AAP
Apache License 2.0
59 stars 35 forks source link

Add wait-for-migrations script to be used in eda-server container on k8s #925

Closed rooftopcellist closed 1 month ago

rooftopcellist commented 1 month ago

Add wait-for-migrations script to be used in eda-server container on k8s.

This will allow us to wait until migrations are complete before fully starting the scheduler and worker pods. It will be run in an initContainer for those deployments.

Alex-Izquierdo commented 1 month ago

As we discussed privately, I think this approach can be difficult to manage as it requires changes in multiple places, specially if this is a temporal workaround. I propose a configmap instead, so everything is contained in the operator and it can be removed easily in later versions when the script would be no longer needed.

rooftopcellist commented 1 month ago

@Alex-Izquierdo The configmap approach won't work because of permissions issues on Openshift:

$ oc logs -f -c wait-for-migrations eda-scheduler-9cdbdf445-cb4mc 
chmod: changing permissions of '/usr/bin/wait-for-migrations': Read-only file system

Similarly, if I remove the chmod, I get:

$ oc logs -f eda-default-worker-5996c98859-cnzdl -c wait-for-migrations
/bin/bash: line 1: /usr/bin/wait-for-migrations: Permission denied
Alex-Izquierdo commented 1 month ago

Look at https://github.com/ansible/eda-server/pull/927 @rooftopcellist

Alex-Izquierdo commented 1 month ago

closed in favor of https://github.com/ansible/eda-server/pull/927