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

Implement CNI STATUS #120

Draft
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

architkulkarni
Copy link

@architkulkarni architkulkarni commented Sep 3, 2024

Based on the earlier PR #114.

This PR implements the STATUS CNI verb.

This is the summary of how Status is called:

  1. Kubelet calls the containerd Status() function via a CRI-API RPC: https://github.com/kubernetes/kubernetes/blob/3718932d9a3ea459217ca11efe1ae9ead6aa92c1/pkg/kubelet/kubelet.go#L2871 and checks if it’s ready. It calls this every 5 seconds .

  2. The containerd Status() function in turn calls the go-cni Status() function: https://github.com/containerd/containerd/blob/6333db77015764f7d45b407094a3bc2cc05c239b/internal/cri/server/status.go#L49

  3. Here is the go-cni Status() function.

    go-cni/cni.go

    Line 137 in 1c1be5e

    func (c *libcni) Status() error {
    Before this PR, it just checks if the required number of networks are "ready" where "ready" means the network config file exists.

In this PR, we update the go-cni Status() function to call STATUS on all of the plugins for each network (after doing the same "ready" check as before, which is now moved to a new function Ready()).

It returns without error only if all of the STATUS calls return without error. This is the main difference between this PR and the previous PR #114 (i.e. in this PR we use the "AND" of all the network statuses instead of returning a list of statuses.)

The reason for this is to keep the signature of Status() the same to make the API backwards compatible, so that we don't have to synchronize this change with the containerd v2.0 release.

Related info:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants