Skip to content

Commit a00aef6

Browse files
committed
KEP-277: Use Pod for /ephemeralcontainers
1 parent d4cb03d commit a00aef6

File tree

1 file changed

+16
-12
lines changed
  • keps/sig-node/277-ephemeral-containers

1 file changed

+16
-12
lines changed

keps/sig-node/277-ephemeral-containers/README.md

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -186,16 +186,22 @@ restrictions:
186186

187187
### Creating Ephemeral Containers
188188

189-
1. A client fetches the current list of Ephemeral Containers in a pod using
190-
`GetEphemeralContainers` in the generated client. This returns a
191-
`v1.EphemeralContainers` to which the client appends a new
192-
`EphemeralContainer` and then calls `UpdateEphemeralContainers`.
193-
1. The apiserver validates and performs the pod update, copying the new
194-
ephemeral container into `Pod.Spec.EphemeralContainers`.
189+
Ephemeral containers are described in the `EphemeralContainers` field of
190+
`Pod.Spec`. This must be updated using the `/ephemeralcontainers` subresource,
191+
similarly to updating `Pod.Status` via `/status`.
192+
193+
The end-to-end process for creating an ephemeral container is:
194+
195+
1. Fetch a `Pod` object from the `/pods` resource.
196+
1. Modify the object and write it back to the pod's `/ephemeralcontainers`
197+
subresource, for example using `UpdateEphemeralContainers` in the generated
198+
client. (Patching is also supported on `/ephemeralcontainers`.)
199+
1. The apiserver validates the update.
195200
1. Pod validation fails if container spec contains fields disallowed for
196201
Ephemeral Containers or the same name as a container in the spec or
197202
`EphemeralContainers`.
198-
1. API resource versioning resolves update races.
203+
1. Registered admission controllers receive an `AdmissionReview` request
204+
containing the entire `Pod`.
199205
1. The kubelet's pod watcher notices the update and triggers a `syncPod()`.
200206
During the sync, the kubelet calls `kuberuntime.StartEphemeralContainer()`
201207
for any new Ephemeral Container.
@@ -303,7 +309,7 @@ ephemeral container creation in a cluster.
303309

304310
Ephemeral Containers will stop when their command exits, such as exiting a
305311
shell, and they will not be restarted. Unlike `kubectl exec`, processes in
306-
Ephemeral Containers will not receive an EOF if their connection is
312+
Ephemeral Containers will not receive an EOF if their connections are
307313
interrupted, so shells won't automatically exit on disconnect. Without the
308314
ability to remove an Ephemeral Container via the API, the only way to exit the
309315
container is to send it an OS signal.
@@ -629,10 +635,7 @@ via this subresource. `EphemeralContainerStatuses` is updated in the same manner
629635
as everything else in `Pod.Status` via `/status`.
630636

631637
`Pod.Spec.EphemeralContainers` may be updated via `/ephemeralcontainers` as per
632-
normal (using PUT, PATCH, etc) except that existing Ephemeral Containers may not
633-
be modified or deleted. Deleting Ephemeral Containers is not supported in the
634-
initial implementation to reduce complexity. It could be added in the future,
635-
but see *Killing Ephemeral Containers* below for additional constraints.
638+
normal (using PUT, PATCH, etc).
636639

637640
The subresources `attach`, `exec`, `log`, and `portforward` are available for
638641
Ephemeral Containers and will be forwarded by the apiserver. This means `kubectl
@@ -1039,6 +1042,7 @@ _This section must be completed when targeting beta graduation to a release._
10391042
- *2019-04-24*: Added notes on Windows feature compatibility
10401043
- *2020-09-29*: Ported KEP to directory-based template.
10411044
- *2021-01-07*: Updated KEP for beta release in 1.21 and completed PRR section.
1045+
- *2021-04-12*: Switched `/ephemeralcontainers` API to use `Pod`.
10421046

10431047
## Drawbacks
10441048

0 commit comments

Comments
 (0)