pkg/cniprotocol/v1/cni.proto (54 lines of code) (raw):
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
syntax = "proto3";
option go_package = "github.com/Azure/kube-egress-gateway/pkg/cniprotocol/v1";
package pkg.cniprotocol.v1;
message PodInfo{
string pod_name = 1;
string pod_namespace = 2;
}
enum DefaultRoute {
DEFAULT_ROUTE_UNSPECIFIED = 0;
DEFAULT_ROUTE_STATIC_EGRESS_GATEWAY = 1;
DEFAULT_ROUTE_AZURE_NETWORKING = 2;
}
// CNIAddRequest is the request for cni add function.
message NicAddRequest {
PodInfo pod_config = 1;
int32 listen_port = 2;
string allowed_ip = 3;
string public_key = 4;
string gateway_name = 5;
}
// CNIAddResponse is the response for cni add function.
message NicAddResponse {
string endpoint_ip = 1;
int32 listen_port = 2;
string public_key = 3;
repeated string exception_cidrs = 4;
DefaultRoute default_route = 5;
}
// CNIDeleteRequest is the request for cni del function.
message NicDelRequest {
PodInfo pod_config = 1;
}
// CNIDeleteResponse is the response for cni del function.
message NicDelResponse {
}
// PodRetrieveRequest is the request for retrieving pod function.
message PodRetrieveRequest {
PodInfo pod_config = 1;
}
// PodRetrieveResponse is the response for retrieving pod function.
message PodRetrieveResponse {
map<string, string> annotations = 1;
}
// NicService is the nic management service.
service NicService {
// NicAdd: send pod public key and return gateway public key and endpoint ip
rpc NicAdd(NicAddRequest) returns (NicAddResponse) ;
// NicDel: delete pod endpoint resource
rpc NicDel(NicDelRequest) returns (NicDelResponse) ;
// PodRetrieve: send pod information and return pod information
rpc PodRetrieve(PodRetrieveRequest) returns (PodRetrieveResponse) ;
}