Stopping a running workload or triggering its failed condition #240
-
|
Hey guys,
Question:
thank you for the help. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
|
Hi @mrogonna, the following Ankaios manifest shows how to trigger a workload based on failed workload: apiVersion: v0.1
workloads:
willfail:
runtime: podman
agent: agent_A
runtimeConfig: |
image: docker.io/busybox:latest
commandArgs: ["sh", "-c", "exit 1"]
onfail:
runtime: podman
agent: agent_A
dependencies:
willfail: ADD_COND_FAILED
runtimeConfig: |
image: docker.io/busybox:latest
commandArgs: ["sh", "-c", "echo 'I have been triggered.'"]Save this to a file For debugging purpose you can use The startup configuration is only applied at startup. So if you have a running Ankaios cluster and want to start a clean setup, perform the following steps:
|
Beta Was this translation helpful? Give feedback.
-
|
If the workload should be restarted when it fails, Ankaios defines the In case you want to interact with a running workload you need to use the runtime tooling. So for the runtime |
Beta Was this translation helpful? Give feedback.
If the workload should be restarted when it fails, Ankaios defines the
restartPolicy: ALWAYSsettings. Note that it is not implemented yet but will be in the next release.In case you want to interact with a running workload you need to use the runtime tooling. So for the runtime
podmanyou might usepodman container stopto stop a workload. It is up to the workload to return the exit code when it received the signal to terminate.