Skip to content

Add ControllerGetNodeInfo RPC (alpha)#603

Open
huww98 wants to merge 4 commits into
container-storage-interface:masterfrom
huww98:ControllerGetNodeInfo
Open

Add ControllerGetNodeInfo RPC (alpha)#603
huww98 wants to merge 4 commits into
container-storage-interface:masterfrom
huww98:ControllerGetNodeInfo

Conversation

@huww98

@huww98 huww98 commented Mar 21, 2026

Copy link
Copy Markdown
Contributor

What type of PR is this?

/kind feature

What this PR does / why we need it:

See KEP-6011: CSI ControllerGetNodeInfo for details

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Does this PR introduce an API-breaking change?:

Add ControllerGetNodeInfo RPC and corresponding new field in NodeGetInfo (alpha)

@jdef

jdef commented Mar 21, 2026 via email

Copy link
Copy Markdown
Member

@huww98
huww98 force-pushed the ControllerGetNodeInfo branch from a727d32 to a6f4f25 Compare March 21, 2026 14:58
@huww98

huww98 commented Mar 21, 2026

Copy link
Copy Markdown
Contributor Author

There's a lot of k8s stuff in this PR desc, probably better suited for a
KEP that this PR might reference.

Yes, I will propose this to Kubernetes if it looks fine on the CSI side.
I provide them here for additional context.

what alternatives were considered and why were
they not sufficient?

There are not many alternatives actually.

The instance metadata service (e.g., http://169.254.169.254 or http://100.100.100.200) typically only provides basic info like instance-id and zone. It does not provide disk attachment limits or supported disk categories, which require cloud API calls.

The information required by NodeGetInfo is not fetchable from node with the security requirement. We have considered adding a new private CRD and a new controller in Kubernetes. The controller watches for new node, fetches the required info and store them in a CR, then node watches for the CR to get the info. But this still have major drawbacks:

  • The permission to invoke Cloud API is replaced with a service account with CR read permission, which does not fundamentally solve the security issue.
  • Requires more network roundtrips
    • This proposal: Cloud -> csi-controller -> external-attacher -> APIServer(CSINode) -> scheduler
    • With CRD: Cloud -> new controller -> APIServer(CR) -> csi-node -> kubelet -> APIServer(CSINode) -> scheduler
  • Even harder considering the new capability to fetch max_volumes_per_node immediately after publish failure. Will need some way for node to tell controller to do an update immediately, which requires write permission, making things even worse.
  • This is Kubernetes specific, not resolving the security requirement for other CO.

The core insight is: max_volumes_per_node and accessible_topology is consumed by scheduler, not node. So this piece of infomation should not appear on node for optimal security, hence this proposal.

huww98 added a commit to huww98/enhancements that referenced this pull request Apr 14, 2026
…ller-side node info retrieval

This KEP proposes two new CSI RPCs to enable node topology and capacity
information retrieval from the controller side, eliminating the need for
cloud API credentials on worker nodes:

- NodeGetID: Returns only the node identifier without cloud API access
- ControllerGetNodeInfo: Fetches topology and capacity from controller side

Benefits:
- Security: Node components no longer require cloud API credentials
- Scalability: Controller can aggregate and cache API calls for large clusters
- Accuracy: Controller-side VolumeAttachment info enables accurate non-CSI attachment detection

Depends on CSI spec PR kubernetes#603: container-storage-interface/spec#603
huww98 added a commit to huww98/enhancements that referenced this pull request Apr 14, 2026
…ller-side node info retrieval

This KEP proposes two new CSI RPCs to enable node topology and capacity
information retrieval from the controller side, eliminating the need for
cloud API credentials on worker nodes:

- NodeGetID: Returns only the node identifier without cloud API access
- ControllerGetNodeInfo: Fetches topology and capacity from controller side

Benefits:
- Security: Node components no longer require cloud API credentials
- Scalability: Controller can aggregate and cache API calls for large clusters
- Accuracy: Controller-side VolumeAttachment info enables accurate non-CSI attachment detection

Depends on CSI spec PR kubernetes#603: container-storage-interface/spec#603
huww98 added a commit to huww98/enhancements that referenced this pull request Apr 14, 2026
…ller-side node info retrieval

This KEP proposes two new CSI RPCs to enable node topology and capacity
information retrieval from the controller side, eliminating the need for
cloud API credentials on worker nodes:

- NodeGetID: Returns only the node identifier without cloud API access
- ControllerGetNodeInfo: Fetches topology and capacity from controller side

Benefits:
- Security: Node components no longer require cloud API credentials
- Scalability: Controller can aggregate and cache API calls for large clusters
- Accuracy: Controller-side VolumeAttachment info enables accurate non-CSI attachment detection

Depends on CSI spec PR kubernetes#603: container-storage-interface/spec#603
huww98 added a commit to huww98/enhancements that referenced this pull request Apr 14, 2026
…ller-side node info retrieval

This KEP proposes two new CSI RPCs to enable node topology and capacity
information retrieval from the controller side, eliminating the need for
cloud API credentials on worker nodes:

- NodeGetID: Returns only the node identifier without cloud API access
- ControllerGetNodeInfo: Fetches topology and capacity from controller side

Benefits:
- Security: Node components no longer require cloud API credentials
- Scalability: Controller can aggregate and cache API calls for large clusters
- Accuracy: Controller-side VolumeAttachment info enables accurate non-CSI attachment detection

Depends on CSI spec PR kubernetes#603: container-storage-interface/spec#603
huww98 added a commit to huww98/enhancements that referenced this pull request Apr 14, 2026
…ller-side node info retrieval

This KEP proposes two new CSI RPCs to enable node topology and capacity
information retrieval from the controller side, eliminating the need for
cloud API credentials on worker nodes:

- NodeGetID: Returns only the node identifier without cloud API access
- ControllerGetNodeInfo: Fetches topology and capacity from controller side

Benefits:
- Security: Node components no longer require cloud API credentials
- Scalability: Controller can aggregate and cache API calls for large clusters
- Accuracy: Controller-side VolumeAttachment info enables accurate non-CSI attachment detection

Depends on CSI spec PR kubernetes#603: container-storage-interface/spec#603
huww98 added a commit to huww98/enhancements that referenced this pull request Apr 14, 2026
…ller-side node info retrieval

This KEP proposes two new CSI RPCs to enable node topology and capacity
information retrieval from the controller side, eliminating the need for
cloud API credentials on worker nodes:

- NodeGetID: Returns only the node identifier without cloud API access
- ControllerGetNodeInfo: Fetches topology and capacity from controller side

Benefits:
- Security: Node components no longer require cloud API credentials
- Scalability: Controller can aggregate and cache API calls for large clusters
- Accuracy: Controller-side VolumeAttachment info enables accurate non-CSI attachment detection

Depends on CSI spec PR kubernetes#603: container-storage-interface/spec#603
huww98 added a commit to huww98/enhancements that referenced this pull request Apr 14, 2026
…ller-side node info retrieval

This KEP proposes two new CSI RPCs to enable node topology and capacity
information retrieval from the controller side, eliminating the need for
cloud API credentials on worker nodes:

- NodeGetID: Returns only the node identifier without cloud API access
- ControllerGetNodeInfo: Fetches topology and capacity from controller side

Benefits:
- Security: Node components no longer require cloud API credentials
- Scalability: Controller can aggregate and cache API calls for large clusters
- Accuracy: Controller-side VolumeAttachment info enables accurate non-CSI attachment detection

Depends on CSI spec PR kubernetes#603: container-storage-interface/spec#603
@bswartz

bswartz commented Apr 22, 2026

Copy link
Copy Markdown
Contributor

I don't see any point to the NodeGetID RPC. NodeGetInfo already returns a superset of the information.

@huww98

huww98 commented Apr 22, 2026

Copy link
Copy Markdown
Contributor Author

I design NodeGetID as a per-node switch for this feature, so that we can upgrade controller first, then upgrade nodes gradually: if node reports GET_ID cap, we go for the new workflow, otherwise we go for the old flow. We can also safely install new CSI driver (with new sidecars) in old Kubernetes cluster this way: old kubelet don't call NodeGetID, then new sidecar should not call ControllerGetNodeInfo, even if both sidecar and CSI driver support this.

As just discussed in the meeting, an operator may choose to remove credential from node side, so that NodeGetInfo can no longer retrieve topology info. I think it would be better for SP to fail NodeGetInfo instead of returning incomplete info.

Alternative: Adding a new field in NodeGetInfoResponse (say incomplete) as the switch stated above. But for old CO (kubelet) that don't understand this field, it may silently accept the incomplete topology or capacity, leading to confusing scheduling result. Also we may need to consider what to do if node and controller returns conflicting topology.

For the periodical update scalability issue, I take the number from https://kubernetes.io/docs/setup/best-practices/cluster-large/:

No more than 150,000 total pods
No more than 300,000 total containers

if every container have a volume, we can have 300,000 volumes in the cluster (we didn't tested this large scale). Our DescribeDisks API call can return at most 500 disks per-call. The default rate limit is 1000/60s in a region. So we can actually finish the query of the whole cluster in less than 1 min. So I think this is fine.

I can see that it could be hard for SPs that want to determine topology at controller side but capacity from node side. But I haven't come up with a better idea though.

@huww98
huww98 force-pushed the ControllerGetNodeInfo branch from 172f8f5 to 5e8c20a Compare May 27, 2026 05:38
@huww98 huww98 changed the title Add ControllerGetNodeInfo and NodeGetID RPCs (alpha) Add ControllerGetNodeInfo RPC (alpha) Jul 16, 2026
huww98 added 4 commits July 16, 2026 13:16
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>
Remove the separate NodeGetID RPC and instead add a
controller_get_node_info flag to NodeGetInfoRequest. When set, the SP
MAY omit accessible_topology and max_volumes_per_node from
NodeGetInfoResponse and return only node_id; the CO obtains topology and
capacity from ControllerGetNodeInfo. The node capability GET_ID is
renamed to NODE_INFO_FROM_CONTROLLER accordingly.

This lets the >100 existing CSI drivers adopt the controller-side flow
with only a capability plus one optional field rather than implementing
a new RPC, and keeps node_id on a single node-side message.

Regenerate csi.proto and Go bindings.
@huww98
huww98 force-pushed the ControllerGetNodeInfo branch from 020daf5 to f67692f Compare July 16, 2026 05:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants