Skip to content

Commit a727d32

Browse files
committed
Add ControllerGetNodeInfo and NodeGetID RPCs (alpha)
This proposal adds two new RPCs to enable node registration without requiring cloud API credentials on the node side: - NodeGetID: Returns only the node identifier, which can be obtained locally (e.g., from instance metadata) without cloud API access. - ControllerGetNodeInfo: Fetches node topology and max_volumes_per_node from the controller side, where cloud API credentials are available. New capabilities: - NodeServiceCapability.RPC.GET_ID - ControllerServiceCapability.RPC.GET_NODE_INFO Key design decisions: - If SP supports GET_ID, it MUST also support GET_NODE_INFO - published_volume_ids field allows accurate calculation of remaining attachable volumes by distinguishing CSI-managed vs non-CSI volumes - Both RPCs are marked as alpha This addresses security requirements where cloud API credentials should not be distributed to node components. Signed-off-by: 胡玮文 <huweiwen.hww@alibaba-inc.com>
1 parent cd4eba7 commit a727d32

4 files changed

Lines changed: 1987 additions & 1320 deletions

File tree

csi.proto

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,11 @@ service Controller {
110110
rpc ControllerModifyVolume (ControllerModifyVolumeRequest)
111111
returns (ControllerModifyVolumeResponse) {
112112
}
113+
114+
rpc ControllerGetNodeInfo (ControllerGetNodeInfoRequest)
115+
returns (ControllerGetNodeInfoResponse) {
116+
option (alpha_method) = true;
117+
}
113118
}
114119

115120
service GroupController {
@@ -167,6 +172,11 @@ service Node {
167172

168173
rpc NodeGetInfo (NodeGetInfoRequest)
169174
returns (NodeGetInfoResponse) {}
175+
176+
rpc NodeGetID (NodeGetIDRequest)
177+
returns (NodeGetIDResponse) {
178+
option (alpha_method) = true;
179+
}
170180
}
171181
message GetPluginInfoRequest {
172182
// Intentionally empty.
@@ -1043,6 +1053,55 @@ message ControllerModifyVolumeRequest {
10431053
message ControllerModifyVolumeResponse {
10441054
}
10451055

1056+
message ControllerGetNodeInfoRequest {
1057+
// The identifier of the node as understood by the SP.
1058+
// This field is REQUIRED.
1059+
// This field MUST match the node_id returned by `NodeGetInfo` or
1060+
// `NodeGetID`.
1061+
// This field overrides the general CSI size limit.
1062+
// The size of this field SHALL NOT exceed 256 bytes.
1063+
string node_id = 1;
1064+
1065+
// The volume IDs that the CO believes are currently published to this
1066+
// node. This field is OPTIONAL.
1067+
// This SHOULD include all volumes that the CO considers published,
1068+
// including those with uncertain status (e.g., publish RPC failed).
1069+
// The SP MAY use this information to calculate the maximum number
1070+
// of volumes that can be published to the node.
1071+
// For example, if the node has a maximum of 16 publishable volumes
1072+
// and 10 volumes are already published, but only 8 reported by the
1073+
// CO, then the SP SHOULD infer that the remaining 2 volumes are not
1074+
// managed by CSI and only report 14 max_volumes_per_node.
1075+
repeated string published_volume_ids = 2;
1076+
}
1077+
1078+
message ControllerGetNodeInfoResponse {
1079+
// Maximum number of volumes that controller can publish to the node.
1080+
// If value is not set or zero CO SHALL decide how many volumes of
1081+
// this type can be published by the controller to the node. The
1082+
// plugin MUST NOT set negative values here.
1083+
// This field is OPTIONAL.
1084+
int64 max_volumes_per_node = 1;
1085+
1086+
// Specifies where (regions, zones, racks, etc.) the node is
1087+
// accessible from.
1088+
// A plugin that returns this field MUST also set the
1089+
// VOLUME_ACCESSIBILITY_CONSTRAINTS plugin capability.
1090+
// COs MAY use this information along with the topology information
1091+
// returned in CreateVolumeResponse to ensure that a given volume is
1092+
// accessible from a given node when scheduling workloads.
1093+
// This field is OPTIONAL. If it is not specified, the CO MAY assume
1094+
// the node is not subject to any topological constraint, and MAY
1095+
// schedule workloads that reference any volume V, such that there are
1096+
// no topological constraints declared for V.
1097+
//
1098+
// Example 1:
1099+
// accessible_topology =
1100+
// {"region": "R1", "zone": "Z2"}
1101+
// Indicates the node exists within the "region" "R1" and the "zone"
1102+
// "Z2".
1103+
Topology accessible_topology = 2;
1104+
}
10461105
message GetCapacityRequest {
10471106
// If specified, the Plugin SHALL report the capacity of the storage
10481107
// that can be used to provision volumes that satisfy ALL of the
@@ -1190,6 +1249,12 @@ message ControllerServiceCapability {
11901249
// Indicates the SP supports the GetSnapshot RPC.
11911250
// This enables COs to fetch an existing snapshot.
11921251
GET_SNAPSHOT = 15 [(alpha_enum_value) = true];
1252+
1253+
// Indicates the SP supports the ControllerGetNodeInfo RPC.
1254+
// This enables COs to fetch node topology and capacity
1255+
// information from the controller side, avoiding the need for
1256+
// cloud API credentials on the node side.
1257+
GET_NODE_INFO = 16 [(alpha_enum_value) = true];
11931258
}
11941259

11951260
Type type = 1;
@@ -1672,6 +1737,15 @@ message NodeServiceCapability {
16721737
// with provided volume group identifier during node stage
16731738
// or node publish RPC calls.
16741739
VOLUME_MOUNT_GROUP = 6;
1740+
1741+
// Indicates the SP supports the NodeGetID RPC.
1742+
// This enables COs to fetch only the node identifier from
1743+
// the node side without requiring cloud API credentials.
1744+
// The topology and capacity information can then be fetched
1745+
// via ControllerGetNodeInfo.
1746+
// If the SP supports GET_ID, it MUST also support
1747+
// GET_NODE_INFO controller capability.
1748+
GET_ID = 7 [(alpha_enum_value) = true];
16751749
}
16761750

16771751
Type type = 1;
@@ -1726,6 +1800,26 @@ message NodeGetInfoResponse {
17261800
// "Z2".
17271801
Topology accessible_topology = 3;
17281802
}
1803+
message NodeGetIDRequest {
1804+
// Intentionally empty.
1805+
}
1806+
1807+
message NodeGetIDResponse {
1808+
// The identifier of the node as understood by the SP.
1809+
// This field is REQUIRED.
1810+
// This field MUST contain enough information to uniquely identify
1811+
// this specific node vs all other nodes supported by this plugin.
1812+
// This field SHALL be used by the CO in subsequent calls, including
1813+
// `ControllerPublishVolume` and `ControllerGetNodeInfo`, to refer to
1814+
// this node.
1815+
// The SP is NOT responsible for global uniqueness of node_id across
1816+
// multiple SPs.
1817+
// This field overrides the general CSI size limit.
1818+
// The size of this field SHALL NOT exceed 256 bytes. The general
1819+
// CSI size limit, 128 byte, is RECOMMENDED for best backwards
1820+
// compatibility.
1821+
string node_id = 1;
1822+
}
17291823
message NodeExpandVolumeRequest {
17301824
// The ID of the volume. This field is REQUIRED.
17311825
string volume_id = 1;

0 commit comments

Comments
 (0)