-
Notifications
You must be signed in to change notification settings - Fork 41.2k
Add image_id
to CRI Container
message
#123508
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add image_id
to CRI Container
message
#123508
Conversation
Using the implementation of kubernetes/kubernetes#123508 to fix cri-o#7143 Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
Using the implementation of kubernetes/kubernetes#123508 to fix cri-o#7143 Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
17116e7
to
bacde16
Compare
/retest |
This PR may require API review. If so, when the changes are ready, complete the pre-review checklist and request an API review. Status of requested reviews is tracked in the API Review project. |
/test pull-kubernetes-unit |
thanks for picking this up! I believe for backwards compatibility with the kube pod API we need to change https://github.com/kubernetes/kubernetes/blob/master/pkg/kubelet/kubelet_pods.go#L1903 to be |
@haircommander the |
Does this PR make any change that a Kubernetes cluster operator could observe (even indirectly, but without using a debugger or trace logging)? |
No, runtimes do not support that field yet so there will be no change. Only if runtimes set the value of the field, then it will influence how the image GC works. |
If I used the release of Kubernetes that included this change, and a container runtime with support, would I notice the behavior? If so, we should change log it so people know it's available. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see suggested comment doc edits
fair to say we should also fix the status response in a similar fashion.. perhaps in another pr? |
can someone help find where we propegate kuberuntime.ContainerStatus to the kube API? From my perspective, we are translating kuberuntime.ImageID -> ContainerStatus.ImageID somewhere but I am struggling to find where. If that's the case, then it feels like this PR would change it so that we're reporting ImageID (which is coming from the CRI as an ImageID, not ImageRef) and then we'd change the ContainerStatus to have the hash and not repo + digest. It sounds like this isn't what is happening though |
Yes, changed the release note for that. |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: mikebrow, mrunalp, saschagrunert The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Using the implementation of kubernetes/kubernetes#123508 to fix cri-o#7143 Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
There is a image ID test available: https://github.com/kubernetes/kubernetes/blob/master/test/e2e_node/image_id_test.go CRI-O still returns the image ID if the image is already present on disk, that's why the test allows both: kubernetes/test/e2e_node/image_id_test.go Lines 67 to 68 in 411c29c
|
There is a conversion function `ConvertPodStatusToRunningPod`, which can override the `Container.ImageID` into a digested reference from the `ContainerStatus` CRI RPC, which gets mapped from the `image_ref`: https://github.com/kubernetes/kubernetes/blob/411c29c39f03687a30a8667295c61590def8fc89/pkg/kubelet/container/helpers.go#L259-L292 To avoid that failure case, we now introduce the same `image_id` into the container status and let runtimes separate the fields. We also add a note that the mapping from the digested reference of the CRI to the Kubernetes Pod API `ImageID` field is intentional and should not change. Follow-up on: kubernetes#123508 Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
But there is a corner case when developers use |
There is a conversion function `ConvertPodStatusToRunningPod`, which can override the `Container.ImageID` into a digested reference from the `ContainerStatus` CRI RPC, which gets mapped from the `image_ref`: https://github.com/kubernetes/kubernetes/blob/411c29c39f03687a30a8667295c61590def8fc89/pkg/kubelet/container/helpers.go#L259-L292 To avoid that failure case, we now introduce the same `image_id` into the container status and let runtimes separate the fields. We also add a note that the mapping from the digested reference of the CRI to the Kubernetes Pod API `ImageID` field is intentional and should not change. Follow-up on: kubernetes#123508 Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
Using the implementation of kubernetes/kubernetes#123508 to fix cri-o#7143 Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
There is a conversion function `ConvertPodStatusToRunningPod`, which can override the `Container.ImageID` into a digested reference from the `ContainerStatus` CRI RPC, which gets mapped from the `image_ref`: https://github.com/kubernetes/kubernetes/blob/411c29c39f03687a30a8667295c61590def8fc89/pkg/kubelet/container/helpers.go#L259-L292 To avoid that failure case, we now introduce the same `image_id` into the container status and let runtimes separate the fields. We also add a note that the mapping from the digested reference of the CRI to the Kubernetes Pod API `ImageID` field is intentional and should not change. Follow-up on: kubernetes#123508 Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
There is a conversion function `ConvertPodStatusToRunningPod`, which can override the `Container.ImageID` into a digested reference from the `ContainerStatus` CRI RPC, which gets mapped from the `image_ref`: https://github.com/kubernetes/kubernetes/blob/411c29c39f03687a30a8667295c61590def8fc89/pkg/kubelet/container/helpers.go#L259-L292 To avoid that failure case, we now introduce the same `image_id` into the container status and let runtimes separate the fields. We also add a note that the mapping from the digested reference of the CRI to the Kubernetes Pod API `ImageID` field is intentional and should not change. Follow-up on: kubernetes/kubernetes#123508 Signed-off-by: Sascha Grunert <sgrunert@redhat.com> Kubernetes-commit: e38531e9a2359c2ba1505cb04d62d6810edc616e
Using the implementation of kubernetes/kubernetes#123508 to fix cri-o#7143 Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
Using the implementation of kubernetes/kubernetes#123508 to fix cri-o#7143 Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
Using the implementation of kubernetes/kubernetes#123508 to fix cri-o#7143 Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
Using the implementation of kubernetes/kubernetes#123508 to fix cri-o#7143 Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
Using the implementation of kubernetes/kubernetes#123508 to fix cri-o#7143 Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
Using the implementation of kubernetes/kubernetes#123508 to fix cri-o#7143 Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
Using the implementation of kubernetes/kubernetes#123508 to fix cri-o#7143 Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
There is a conversion function `ConvertPodStatusToRunningPod`, which can override the `Container.ImageID` into a digested reference from the `ContainerStatus` CRI RPC, which gets mapped from the `image_ref`: https://github.com/kubernetes/kubernetes/blob/411c29c39f03687a30a8667295c61590def8fc89/pkg/kubelet/container/helpers.go#L259-L292 To avoid that failure case, we now introduce the same `image_id` into the container status and let runtimes separate the fields. We also add a note that the mapping from the digested reference of the CRI to the Kubernetes Pod API `ImageID` field is intentional and should not change. Follow-up on: kubernetes#123508 Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
There is a conversion function `ConvertPodStatusToRunningPod`, which can override the `Container.ImageID` into a digested reference from the `ContainerStatus` CRI RPC, which gets mapped from the `image_ref`: https://github.com/kubernetes/kubernetes/blob/411c29c39f03687a30a8667295c61590def8fc89/pkg/kubelet/container/helpers.go#L259-L292 To avoid that failure case, we now introduce the same `image_id` into the container status and let runtimes separate the fields. We also add a note that the mapping from the digested reference of the CRI to the Kubernetes Pod API `ImageID` field is intentional and should not change. Follow-up on: kubernetes#123508 Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
Using the implementation of kubernetes/kubernetes#123508 to fix cri-o#7143 Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
There is a conversion function `ConvertPodStatusToRunningPod`, which can override the `Container.ImageID` into a digested reference from the `ContainerStatus` CRI RPC, which gets mapped from the `image_ref`: https://github.com/kubernetes/kubernetes/blob/411c29c39f03687a30a8667295c61590def8fc89/pkg/kubelet/container/helpers.go#L259-L292 To avoid that failure case, we now introduce the same `image_id` into the container status and let runtimes separate the fields. We also add a note that the mapping from the digested reference of the CRI to the Kubernetes Pod API `ImageID` field is intentional and should not change. Follow-up on: kubernetes#123508 Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
Using the implementation of kubernetes/kubernetes#123508 to fix cri-o#7143 Signed-off-by: Sascha Grunert <sgrunert@redhat.com> Signed-off-by: Peter Hunt <pehunt@redhat.com>
What type of PR is this?
/kind bug
What this PR does / why we need it:
This new field allows fixing the kubelet image garbage collection in container runtimes. The
image_ref
has been historically used by container runtimes to reference images by digest.Which issue(s) this PR fixes:
Allows to fix cri-o/cri-o#7143
Special notes for your reviewer:
cc @mrunalp @haircommander @kubernetes/sig-node-api-reviews
Does this PR introduce a user-facing change?
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: