Skip to content

Commit

Permalink
change to sidecar field in container spec
Browse files Browse the repository at this point in the history
  • Loading branch information
Joseph-Irving committed May 15, 2018
1 parent 68e4e68 commit f6965fd
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions keps/sig-apps/0008-sidecarcontainer.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ status: provisional

## Summary

To solve the issue of sidecars not being well supported we can create a new class of container in the Pod Spec called sidecarContainers which are handled like normal containers but with the caveat that a normal container's status could take precedence over the sidecar's status. This will solve the problem of Jobs not completing/failing when a sidecar container never exits due to it having no awareness of the 'primary' container.
To solve the issue of sidecars not being well supported we can create a new type of container called a sidecar which are handled like normal containers but with the caveat that a normal container's status could take precedence over the sidecar's status. This will solve the problem of Jobs not completing/failing when a sidecar container never exits due to it having no awareness of the 'primary' container.

## Motivation

Expand All @@ -50,8 +50,8 @@ Changing the way jobs are handled

## Proposal

Create a new class of containers called sidecarContainers, this will be an additional field to the Pod Spec.
e.g
Create a way to define containers as sidecars, this will be an additional field to the Container Spec: `sidecar: true`.
e.g:
```yaml
apiVersion: v1
kind: Pod
Expand All @@ -64,9 +64,9 @@ spec:
- name: myapp
image: myapp
command: ['do something']
sidecarContainers:
- name: sidecar
image: sidecar-image
sidecar: true
command: ["do something to help my app"]

```
Expand All @@ -83,7 +83,8 @@ This model assumes that the sidecars are not intended to reliant on your other c

### Risks and Mitigations

//WIP
You could set all containers to be `sidecar: true`, this seems wrong, so maybe the api should do a validation check that at least one container is not a sidecar.
Init containers would be able to have `sidecar: true` applied to them as it's an additional field to the container spec, there's no situation where this would make sense as init containers are executed sequentially. We could get around this by having the api throw a validation error if you try to use this field on an init container.

## Graduation Criteria

Expand All @@ -106,5 +107,5 @@ Major milestones might include

## Alternatives

One alternative would be to have a new field in the Container Spec of `sidecar: true` however this could be quite inefficient if you had a lot of sidecars.
One alternative would be to have a new field in the Pod Spec of `sidecarContainers:` where you could define a list of sidecar containers, however this would require a lot more work in terms of updating tooling to support this.
Another alternative would be to change the Job Spec to have a `primaryContainer` field to tell it which containers are important. However I feel this is perhaps too specific to job when this Sidecar concept could be useful in other scenarios.

0 comments on commit f6965fd

Please sign in to comment.