-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Signed-off-by: Alex Collins <alex_collins@intuit.com>
- Loading branch information
Showing
19 changed files
with
323 additions
and
86 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# Sidecar Injection | ||
|
||
Automatic (i.e. mutating webhook based) sidecar injection systems, including service meshes such as Anthos and Istio | ||
Proxy, create a unique problem for Kubernetes workloads that run to completion. | ||
|
||
Because sidecars are injected outside of the view of the workflow controller, the controller has no awareness of them. | ||
It has no opportunity to rewrite the containers command (when using the Emissary Executor) and as the sidecar's process | ||
will run as PID 1, which is protected. It can be impossible for the wait container to terminate the sidecar. | ||
|
||
You will minimize problems by not using Istio with Argo Workflows. | ||
|
||
See [#1282](https://github.com/argoproj/argo-workflows/issues/1282). | ||
|
||
## How We Kill Sidecars | ||
|
||
Kubernetes does not provide a way to kill a single container. You can delete a pod, but this kills all containers, and loses all information | ||
and logs of that pod. | ||
|
||
Instead, try to mimic the Kubernetes termination behaviour, which is: | ||
|
||
1. SIGTERM PID 1 | ||
1. Wait for the pod's `terminateGracePeriodSeconds` (30s by default). | ||
1. SIGKILL PID 1 | ||
|
||
The following are not supported: | ||
|
||
* `preStop` | ||
* `STOPSIGNAL` | ||
|
||
### Support Matrix | ||
|
||
Key: | ||
|
||
* Any - we can kill any image | ||
* Shell - we can only kill images with `/bin/sh` installed on them (e.g. Debian) | ||
* None - we cannot kill these images | ||
|
||
| Executor | Sidecar | Injected Sidecar | | ||
|---|---|---| | ||
| `docker` | Any | Any | | ||
| `emissary` | Any | None | | ||
| `k8sapi` | Shell | Shell | | ||
| `kubelet` | Shell | Shell | | ||
| `pns` | Any | Any | |
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
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
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,22 @@ | ||
apiVersion: argoproj.io/v1alpha1 | ||
kind: Workflow | ||
metadata: | ||
generateName: sidecar-injected- | ||
spec: | ||
entrypoint: main | ||
podSpecPatch: | | ||
terminationGracePeriodSeconds: 3 | ||
containers: | ||
- name: wait | ||
- name: main | ||
- name: sidecar | ||
image: argoproj/argosay:v1 | ||
command: | ||
- sh | ||
- -c | ||
args: | ||
- "sleep 999" | ||
templates: | ||
- name: main | ||
container: | ||
image: argoproj/argosay:v1 |
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.