forked from argoproj/argo-workflows
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(controller): Workflow-level
retryStrategy
/resubmit pending pod…
…s by default. Closes argoproj#3918 (argoproj#3965)
- Loading branch information
Showing
24 changed files
with
892 additions
and
614 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# Tolerating Pod Deletion | ||
|
||
> v2.12 and after | ||
In Kubernetes, pods are cattle and can be deleted at any time. Deletion could be manually via `kubectl delete pod`, during a node drain, or for other reasons. | ||
|
||
This can be very inconvenient, your workflow will error, but for reasons outside of your control. | ||
|
||
A [pod disruption budget](examples/default-pdb-support.yaml) can reduce the likelihood of this happening. But, it cannot entirely prevent it. | ||
|
||
To retry pods that were deleted, set `retryStrategy.retryPolicy: OnError`. | ||
|
||
This can be set at a workflow-level, template-level, or globally (using [workflow defaults](default-workflow-specs.md)) | ||
|
||
## Example | ||
|
||
Run the following workflow (which will sleep for 30s): | ||
|
||
```yaml | ||
apiVersion: argoproj.io/v1alpha1 | ||
kind: Workflow | ||
metadata: | ||
name: example | ||
spec: | ||
retryStrategy: | ||
retryPolicy: OnError | ||
limit: 1 | ||
entrypoint: main | ||
templates: | ||
- name: main | ||
container: | ||
image: docker/whalesay:latest | ||
command: | ||
- sleep | ||
- 30s | ||
``` | ||
|
||
Then execute `kubectl delete pod example`. You'll see that the errored node is automatically retried. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.