0

I am trying to invoke the gRPC API implementation in containerd using the below command of grpcurl:

.\grpcurl -plaintext -import-path "D:\github.com\containerd\api\services\containers\v1" -proto "D:\github.com\containerd\api\services\containers\v1\containers.proto" -d '{ \"filters\": \"k8s\" }' localhost:8080 containerd.services.containers.v1.Containers/List

The response I am getting is below:

ERROR:
  Code: Unimplemented
  Message: unknown service containerd.services.containers.v1.Containers

What is the right way to invoke the service using grpcurl?

I tried ctr.exe and it is responding according to expectations correctly. So, I conclude that the gRPC service is running.

Thanks!

Rasheed
  • 11
  • The package, Service, Method look correct **but** IIRC `containerd` does not expose a TCP socket but a UNIX socket .... On Linux .... `/run/containerd/containerd.sock`. If you're on Linux, check that there's a file in that location. If there is, try `grpcurl ... unix:///run/containerd/containerd.sock ...`, remove the `localhost:8080` and everything else unchanged. – DazWilkin Jun 22 '23 at 22:18
  • perhaps `-unix /run/containerd/containerd.sock`? I've not tried it. – DazWilkin Jun 22 '23 at 22:36
  • Thanks! I am running on Windows 11. I have the below debug output in console from containerd. time="2023-06-22T19:13:19.039788400-07:00" level=info msg=serving... address="\\\\.\\pipe\\containerd-containerd.ttrpc" time="2023-06-22T19:13:19.046224200-07:00" level=info msg=serving... address="127.0.0.1:8080" time="2023-06-22T19:13:19.050436800-07:00" level=info msg=serving... address="\\\\.\\pipe\\containerd-containerd" time="2023-06-22T19:13:19.059182400-07:00" level=info msg="containerd successfully booted in 0.091568s" – Rasheed Jun 23 '23 at 02:21
  • I'm unfamiliar with Windows, sorry. The debug output appears to include Windows Pipe variants (`\\\.\\pipe\\containerd-containerd`) of the UNIX sockets but I'm unsure whether you should be using those and whether gRPCurl supports using Windows Pipes. It's curious that you got a gRPC (error) response from the `localhost:8080` endpoint. Perhaps that is accessible for you? – DazWilkin Jun 23 '23 at 04:07
  • https://github.com/containerd/containerd/pull/6393 - states that "Some higher level APIs such as CRI can support TCP today and we are looking to more higher level APIs which may be exposed via TCP. However, we do not plan to support the existing containerd APIs over TCP." – Rasheed Jun 25 '23 at 21:02

0 Answers0