Skip to content

Commit eb2e9ea

Browse files
authored
metis: add adaptive ipam proto (#1008)
1 parent a7ecb66 commit eb2e9ea

1 file changed

Lines changed: 85 additions & 0 deletions

File tree

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
syntax = "proto3";
2+
3+
package adaptiveipam.v1;
4+
5+
option go_package = "k8s.io/metis/api/adaptiveipam/v1;adaptiveipam";
6+
7+
// AdaptiveIpam serves the request for cluster wide pod IP allocation. The IP
8+
// returned is from the initial cidr range, or dynamically fetched from cloud provider.
9+
service AdaptiveIpam {
10+
// AllocatePodIP allocates a pod IP based on the provided configuration.
11+
rpc AllocatePodIP(AllocatePodIPRequest) returns (AllocatePodIPResponse);
12+
13+
// DeallocatePodIP releases a previously allocated pod IP.
14+
// The completion of this RPC indicates the pod IP is released for the pod.
15+
// The IP can be reused for other pods on the node level, or will be eventually
16+
// released at the cloud provider.
17+
rpc DeallocatePodIP(DeallocatePodIPRequest) returns (DeallocatePodIPResponse);
18+
}
19+
20+
// IPConfig contains parameters required to allocate a pod IP.
21+
message IPConfig {
22+
// interface_name is the name of the pod interface.
23+
string interface_name = 1;
24+
// container_id is the id of the pod container.
25+
string container_id = 2;
26+
27+
// initial_pod_cidr is the CIDR block initially assigned to the node.
28+
// The CNI must provide this CIDR, which is used to allocate IPs for pods created
29+
// early in the node's lifecycle, typically including critical system pods.
30+
string initial_pod_cidr = 3;
31+
}
32+
33+
// AllocatePodIPRequest contains the parameters required to allocate a pod IP.
34+
// The allocation takes into account the specified network, the initial CIDR block, and the IP family
35+
// configuration (IPv4, IPv6, or dual-stack). If the node depletes its initial block of pod IPs,
36+
// supplementary IPs may be dynamically acquired from the cloud provider.
37+
// At least one of ipv4_config and ipv6_config must be populated.
38+
message AllocatePodIPRequest {
39+
// network is the name of the network for which the IP is requested.
40+
string network = 1;
41+
// ipv4_config specifies the pod configuration for IPv4 allocation.
42+
IPConfig ipv4_config = 2;
43+
// ipv6_config specifies the pod configuration for IPv6 allocation.
44+
IPConfig ipv6_config = 3;
45+
// pod_name is the name of the pod. This is for logging purposes.
46+
string pod_name = 4;
47+
// pod_namespace is the namespace of the pod. This is for logging purposes.
48+
string pod_namespace = 5;
49+
}
50+
51+
// PodIP is the result of the allocated IPs for the pod.
52+
message PodIP {
53+
// ip_address is the allocated IP address.
54+
string ip_address = 1;
55+
// cidr is the CIDR block the IP address belongs to.
56+
string cidr = 2;
57+
}
58+
59+
// AllocatePodIPResponse represents the result of a pod IP allocation request,
60+
// detailing the assigned IPv4 and/or IPv6 addresses and their respective CIDR blocks.
61+
message AllocatePodIPResponse {
62+
// ipv4 contains the allocated IPv4 details.
63+
PodIP ipv4 = 1;
64+
// ipv6 contains the allocated IPv6 details.
65+
PodIP ipv6 = 2;
66+
}
67+
68+
// DeallocatePodIPRequest contains the parameters required to deallocate a pod IP.
69+
message DeallocatePodIPRequest {
70+
// network is the name of the network from which the IP should be deallocated.
71+
string network = 1;
72+
// interface_name is the name of the pod interface.
73+
string interface_name = 2;
74+
// container_id is the id of the pod container.
75+
string container_id = 3;
76+
// pod_name is the name of the pod. This is for logging purposes.
77+
string pod_name = 4;
78+
// pod_namespace is the namespace of the pod. This is for logging purposes.
79+
string pod_namespace = 5;
80+
}
81+
82+
// DeallocatePodIPResponse represents the result of a pod IP deallocation request.
83+
// An empty message is returned on success; RPC errors are used to indicate failure.
84+
message DeallocatePodIPResponse {
85+
}

0 commit comments

Comments
 (0)