go-cni icon indicating copy to clipboard operation
go-cni copied to clipboard

[DRAFT] Implement CNI Status

Open MikeZappa87 opened this issue 1 year ago • 9 comments

The recent CNI specification provided a couple new verbs. This is to implement Status. GC and other verbs will be added in the future in different PR.

https://github.com/containernetworking/cni/blob/main/SPEC.md

MikeZappa87 avatar Feb 26 '24 20:02 MikeZappa87

@aojea Since the kubelet calls the CRI-API Status RPC: https://github.com/containerd/containerd/blob/6333db77015764f7d45b407094a3bc2cc05c239b/internal/cri/server/status.go#L49

Kubelet: https://github.com/kubernetes/kubernetes/blob/3718932d9a3ea459217ca11efe1ae9ead6aa92c1/pkg/kubelet/kubelet.go#L2886

The Status returning an error will set the node to not ready. I did notice after about 2 hours, the pods with netns, started going to completed. It might have been my test however I think we should discuss.

MikeZappa87 avatar Feb 29 '24 20:02 MikeZappa87

Hi @MikeZappa87, do you plan to work on this? If not, I can try to work on it as a new contributor.

architkulkarni avatar Jul 11 '24 17:07 architkulkarni

Hi @MikeZappa87, do you plan to work on this? If not, I can try to work on it as a new contributor.

Hello, I need to finish this up. I started it and we needed to get a few PR's merged prior to finishing this. If you want to take it on feel free! :-)

MikeZappa87 avatar Jul 11 '24 17:07 MikeZappa87

Thanks, I'll give it a shot!

architkulkarni avatar Jul 11 '24 23:07 architkulkarni

Hi @MikeZappa87, a couple basic questions for you if you have time:

  • What's the v2 API, is there a reference somewhere?
  • (Maybe related) The current draft PR changes the signature of Status(), and you mentioned above that kubelet calls this function already. How do we handle backwards compatibility for things like this?

More generally, it would be helpful to know what work is remaining and if we need to wait for any other PRs to be merged first. Thanks!

architkulkarni avatar Jul 15 '24 23:07 architkulkarni

@aojea Since the kubelet calls the CRI-API Status RPC: https://github.com/containerd/containerd/blob/6333db77015764f7d45b407094a3bc2cc05c239b/internal/cri/server/status.go#L49

Kubelet: https://github.com/kubernetes/kubernetes/blob/3718932d9a3ea459217ca11efe1ae9ead6aa92c1/pkg/kubelet/kubelet.go#L2886

The Status returning an error will set the node to not ready. I did notice after about 2 hours, the pods with netns, started going to completed. It might have been my test however I think we should discuss.

that is the bug we want to fix, though CNI implementations need to implement CNI STATUS wisely as with great power comes great responsibility

aojea avatar Aug 27 '24 07:08 aojea