api.proto 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. // To regenerate api.pb.go run hack/update-generated-kubelet-plugin-registration.sh
  2. syntax = 'proto3';
  3. package pluginregistration;
  4. import "github.com/gogo/protobuf/gogoproto/gogo.proto";
  5. option (gogoproto.goproto_stringer_all) = false;
  6. option (gogoproto.stringer_all) = true;
  7. option (gogoproto.goproto_getters_all) = true;
  8. option (gogoproto.marshaler_all) = true;
  9. option (gogoproto.sizer_all) = true;
  10. option (gogoproto.unmarshaler_all) = true;
  11. option (gogoproto.goproto_unrecognized_all) = false;
  12. // PluginInfo is the message sent from a plugin to the Kubelet pluginwatcher for plugin registration
  13. message PluginInfo {
  14. // Type of the Plugin. CSIPlugin or DevicePlugin
  15. string type = 1;
  16. // Plugin name that uniquely identifies the plugin for the given plugin type.
  17. // For DevicePlugin, this is the resource name that the plugin manages and
  18. // should follow the extended resource name convention.
  19. // For CSI, this is the CSI driver registrar name.
  20. string name = 2;
  21. // Optional endpoint location. If found set by Kubelet component,
  22. // Kubelet component will use this endpoint for specific requests.
  23. // This allows the plugin to register using one endpoint and possibly use
  24. // a different socket for control operations. CSI uses this model to delegate
  25. // its registration external from the plugin.
  26. string endpoint = 3;
  27. // Plugin service API versions the plugin supports.
  28. // For DevicePlugin, this maps to the deviceplugin API versions the
  29. // plugin supports at the given socket.
  30. // The Kubelet component communicating with the plugin should be able
  31. // to choose any preferred version from this list, or returns an error
  32. // if none of the listed versions is supported.
  33. repeated string supported_versions = 4;
  34. }
  35. // RegistrationStatus is the message sent from Kubelet pluginwatcher to the plugin for notification on registration status
  36. message RegistrationStatus {
  37. // True if plugin gets registered successfully at Kubelet
  38. bool plugin_registered = 1;
  39. // Error message in case plugin fails to register, empty string otherwise
  40. string error = 2;
  41. }
  42. // RegistrationStatusResponse is sent by plugin to kubelet in response to RegistrationStatus RPC
  43. message RegistrationStatusResponse {
  44. }
  45. // InfoRequest is the empty request message from Kubelet
  46. message InfoRequest {
  47. }
  48. // Registration is the service advertised by the Plugins.
  49. service Registration {
  50. rpc GetInfo(InfoRequest) returns (PluginInfo) {}
  51. rpc NotifyRegistrationStatus(RegistrationStatus) returns (RegistrationStatusResponse) {}
  52. }