Accessing iSulad Services Through gRPC and REST Protocols

gRPC Service Access

The default communication protocol between iSula and iSulad is gRPC, which is mandatory for CRI implementations in Kubernetes environments.

Developers integrating with iSulad via gRPC should consult the protocol buffer definitions at https://atomgit.com/openeuler/iSulad/tree/master/src/api/services, organized by functional modules.

For debugging gRPC interactions, install the community-developed grpcurl utility:

sh
go get github.com/fullstorydev/grpcurl
go install github.com/fullstorydev/grpcurl/cmd/grpcurl

Sample debugging command:

sh
grpcurl -plaintext -H 'tls_mode:0' -proto=api.proto -import-path=../ -unix=true /var/run/isulad.sock runtime.v1alpha2.ImageService.ListImages

REST Service Access

To configure REST-based communication:

  1. Clone the iSulad repository.
  2. Follow the build instructions.

Enable REST mode during compilation:

sh
cmake -DENABLE_GRPC=OFF .../

Test REST endpoints using curl:

sh
curl -d "{}" --unix-socket /var/run/isulad.sock http://localhost/ContainerService/Version