You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A container image digest is a unique identifier for a specific version of a container image.
202
+
It is a hash of the image's content, which serves as a unique fingerprint for that image,
203
+
ensuring that it is the exact version that originally used by the container.
204
+
This is unlike a tag, which can be reused or changed over time.
205
+
206
+
Just like container digests are advertised in the pod's status for containers,
207
+
the same should be done for ImageVolumes with very similar use-cases,
208
+
like reporting the image used through monitoring or debug tools,
209
+
supporting git-ops workflows that rely on the image digest,
210
+
and more (see Goals section below).
211
+
212
+
A special use-case for this KEP is using live-migration in Kubevirt.
213
+
Kubevirt runs VMs inside pods, and supports to move a VM instance between nodes.
214
+
Behind the scenes, this is done by creating a similar pod (with the same images), then transferring the VM state.
215
+
An image digest would ensure that the same image is used on both nodes, which is crucial for live-migrations to succeed.
216
+
187
217
### Goals
188
218
189
219
<!--
190
220
List the specific goals of the KEP. What is it trying to achieve? How will we
191
221
know that this has succeeded?
192
222
-->
193
223
224
+
* Add a new field to the pod's status that will contain the digest of the image used for ImageVolumes.
225
+
194
226
### Non-Goals
195
227
196
228
<!--
197
229
What is out of scope for this KEP? Listing non-goals helps to focus discussion
198
230
and make progress.
199
231
-->
200
232
233
+
* This KEP does not aim to change the way ImageVolumes are defined in the pod spec.
234
+
The image digest will be added to the pod's status, but the pod spec will remain unchanged.
235
+
201
236
## Proposal
202
237
203
238
<!--
@@ -220,8 +255,19 @@ bogged down.
220
255
221
256
#### Story 1
222
257
258
+
As a user, I want to monitor which images are used by my pods, so I can ensure that the correct versions are running.
259
+
This is important for ensuring the images are updated, not containing CVEs, etc.
260
+
223
261
#### Story 2
224
262
263
+
As a user, I want to use git-ops workflows that rely on the image digest,
264
+
so I can ensure that the correct versions are running.
265
+
266
+
#### Story 3
267
+
268
+
As a user, I want to use live-migration in Kubevirt relying on ImageVolumes,
269
+
so I can move my VM instances between nodes without downtime.
270
+
225
271
### Notes/Constraints/Caveats (Optional)
226
272
227
273
<!--
@@ -254,6 +300,59 @@ required) or even code snippets. If there's any ambiguity about HOW your
254
300
proposal will be implemented, this is the place to discuss them.
255
301
-->
256
302
303
+
### API Changes
304
+
305
+
This KEP proposes to add an `ImageRef` to the `VolumeMountStatus`[struct](https://github.com/kubernetes/kubernetes/blob/70540c9f43e2fb7604924a120799206c27cbbd28/staging/src/k8s.io/api/core/v1/types.go#L3450-L3465)
306
+
(which is part of the pod's status):
307
+
```go
308
+
// VolumeMountStatus shows status of volume mounts.
309
+
typeVolumeMountStatusstruct {
310
+
// Name corresponds to the name of the original VolumeMount.
Note that the `ImageRef` field is a pointer and should be omitted whenever the volume source is not an ImageVolume.
331
+
In addition, during admission, it should be disallowed to populate the `ImageRef` field for non-ImageVolume sources.
332
+
333
+
In addition, the KEP proposes to add an `ImageRef` field to the `ImageSpec` cri-api [struct](https://github.com/kubernetes/kubernetes/blob/cc466aa355f9e47709a108dd6774ad4aa716a984/staging/src/k8s.io/cri-api/pkg/apis/runtime/v1/api.proto#L833-L848):
334
+
```protobuf
335
+
// ImageSpec is an internal representation of an image.
336
+
message ImageSpec {
337
+
// Container's Image field (e.g. imageID or imageDigest). Might not contain the image's digest.
0 commit comments