Skip to content
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

WIP: Add pod and container statuses to CRI events #112555

Closed
wants to merge 1 commit into from

Conversation

harche
Copy link
Contributor

@harche harche commented Sep 19, 2022

Signed-off-by: Harshal Patil harpatil@redhat.com

What type of PR is this?

/kind api-change

What this PR does / why we need it:

While developing the Evente PLEG feature we realized that after receiving the CRI event, we don't have to make another call to the runtime to get the pod status if we package the pod status within the CRI event object while sending it from the runtime to the kubelet.

More discussion - https://kubernetes.slack.com/archives/C03HA69L6R1/p1663194480554129?thread_ts=1663111556.951889&cid=C03HA69L6R1

The PoC of the kubelet and runtime (crio) have been tested with this CRI change.

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?

None

Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:


Signed-off-by: Harshal Patil <harpatil@redhat.com>
@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Sep 19, 2022
@k8s-ci-robot
Copy link
Contributor

@harche: This issue is currently awaiting triage.

If a SIG or subproject determines this is a relevant issue, they will accept it by applying the triage/accepted label and provide further guidance.

The triage/accepted label can be added by org members by writing /triage accepted in a comment.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@k8s-ci-robot k8s-ci-robot added needs-priority Indicates a PR lacks a `priority/foo` label and requires one. area/kubelet sig/node Categorizes an issue or PR as relevant to SIG Node. and removed do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Sep 19, 2022
@harche
Copy link
Contributor Author

harche commented Sep 19, 2022

/sig node

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: harche
Once this PR has been reviewed and has the lgtm label, please assign klueska for approval by writing /assign @klueska in a comment. For more information see:The Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@@ -1589,6 +1589,12 @@ message ContainerEventResponse {

// ID of the sandbox container
PodSandboxMetadata pod_sandbox_metadata = 4;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With the status added do we still need pod_sandbox_metadata?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ruiwen-zhao we end up using the function determinePodSandboxIPs from kuberuntime_sandbox.go at,

https://github.com/kubernetes/kubernetes/pull/111384/files#diff-0e1a8d22b0f1dc42d412749c6a916b4c76394ead739d4bfbf26564faedd74a2fR968

which uses Name and Namespace fields (although only for logging)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gotcha, yeah in this case I guess it should be fine to keep it, as long as kubelet doesn't need to get pod status after receiving the events.

@ruiwen-zhao
Copy link
Contributor

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Sep 21, 2022
@@ -1589,6 +1589,12 @@ message ContainerEventResponse {

// ID of the sandbox container
PodSandboxMetadata pod_sandbox_metadata = 4;

// Sandbox statuses
repeated PodSandboxStatus pod_sandbox_statuses = 5;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how will we ensure that kubelet will work OK with the older CRI not supporting these statuses in the response?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In general, if CRI does not support GetContainerEvents but kubelet enables evented pleg, then kubelet will update the pod status using only generic pleg but with super long relist interval.

More specifically, if CRI somehow supports GetContainerEvents but just misses PodSandboxStatus (which I dont think will happen given that GetContainerEvents is pretty new), then it will depend on the error handling of evented pleg. IMO event_pleg should just error out if PodSandboxStatus is missing, and discard that event. In this case, all events will be discarded, and kubelet will rely only on generic pleg.

@SergeyKanzhelev SergeyKanzhelev moved this from Triage to Waiting on Author in SIG Node PR Triage Sep 29, 2022
@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Nov 6, 2022
@k8s-ci-robot
Copy link
Contributor

@harche: PR needs rebase.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@dims
Copy link
Member

dims commented Dec 12, 2022

If you still need this PR then please rebase, if not, please close the PR

@harche
Copy link
Contributor Author

harche commented Dec 12, 2022

/close

#111384 got the cri events support.

@harche harche closed this Dec 12, 2022
SIG Node PR Triage automation moved this from Waiting on Author to Done Dec 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/kubelet cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API lgtm "Looks good to me", indicates that a PR is ready to be merged. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. release-note-none Denotes a PR that doesn't merit a release note. sig/node Categorizes an issue or PR as relevant to SIG Node. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
Development

Successfully merging this pull request may close these issues.

None yet

5 participants