ankaios
ankaios copied to clipboard
Handle dependencies when reusing workloads
At startup, the Ankaios agent always tries to reuse workloads. When the agent starts and finds a workload that already exists (in Podman this would mean the container exists), it will reuse it and regard it as already started regardless of its state (could also be failed). As the workload is considered to be already started, the dependencies are not checked.
This behavior leads to unwanted end results.
Current Behavior
- if a workload has finished execution (with success or error):
- if the machines gets restarted or Ankaios agent is restarted: workload gets reused, dependencies are ignored. If restartsPolicy is configure it will not be applied regardless of the dependencies. In this use-case we would actually like that the workloads is started again while considering the dependencies.
- if a workload is running:
- Ankaios agent gets restarted (machine still runs): workload is reused and is still running without being restarted which is the desired behavior
- Machine gets restarted (along with the agent). Depending on the app the behavior is different:
- If the app exists properly when stopped, like nginx, the container is in state "exited" after the restart
- If the app does not handle the SIGTERM, the container is in state "Created" after the restart:
Ankaios sees the container as "pending(starting), created" and is stuck in this state:
In both cases the workload shall be started again considering the dependencies as it is currently not running
Expected Behavior
Running workloads shall be reused, all other workload shall be restarted.
Steps to Reproduce
Try out one of the described above use-cases.
Context (Environment)
Ankaios v0.3 Manjaro Linux
Logs
Additional Information
Final result
To be filled by the one closing the issue.