Search code examples
kubernetesrundeck

On Error not triggering on Rundeck from a Kubernetes app


I'm running a Kubernetes/Docker job on Rundeck 2.11.5-1. My job looks like:

Job
  Sub Job 1
    Remote Command (kubectl run command)
    On error 
      Sub Job
  Sub Job 2
    Remote Command (kubectl run command)
    On error 
      Sub Job

The problem I'm having is that if Sub Job 1 fails, its "On Error" does not trigger and Sub Job 2 runs as if all was well.

Is there something that kubectl needs to return to indicate there was an error?

What are some things I should look for/do to cause my job to stop on error.


Solution

  • I found the solution. Add --restart=Never to the kubectl statement and the Rundeck job now correctly terminates on an apps failure.