You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: contributors/design-proposals/storage/container-storage-interface.md
+9-4
Original file line number
Diff line number
Diff line change
@@ -83,7 +83,13 @@ This document recommends a standard mechanism for deploying an arbitrary contain
83
83
84
84
#### Kubelet to CSI Driver Communication
85
85
86
-
Kubelet (responsible for mount and unmount) will communicate with an external “CSI volume driver” running on the same host machine (whether containerized or not) via a Unix Domain Socket. The Unix Domain Socket will be registered with kubelet using the [Device Plugin Unix Domain Socket Registration](https://github.com/kubernetes/community/blob/master/contributors/design-proposals/resource-management/device-plugin.md#unix-socket) mechanism. This mechanism will need to be extended to support registration of CSI volume drivers.
86
+
Kubelet (responsible for mount and unmount) will communicate with an external “CSI volume driver” running on the same host machine (whether containerized or not) via a Unix Domain Socket.
87
+
88
+
The Unix Domain Socket will be registered with kubelet using the [Device Plugin Unix Domain Socket Registration](https://github.com/kubernetes/community/blob/master/contributors/design-proposals/resource-management/device-plugin.md#unix-socket) mechanism. This mechanism will need to be extended to support registration of CSI volume drivers.
89
+
90
+
Upon initialization of the external “CSI volume driver”, some external component should call `GetNodeId` to get the mapping from Kubernetes NodeId to CSI driver NodeId. It should then add the CSI driver NodeId as a label to the Kubernetes Node API object. The key of the label should be `csi.volume.kubernetes.io/<CsiDriverName>/nodeID`. This will enable the component that will issue `ControllerPublishVolume` calls to use the label as a mapping from cluster node ID to storage node ID.
91
+
92
+
The Kubernetes team will provide a helper container that can manage the UDS registration and NodeId initialization (see “Recommended Mechanism for Deployment” below for details).
87
93
88
94
#### Master to CSI Driver Communication
89
95
@@ -111,13 +117,12 @@ Attach/detach operations must also be handled by an external component (an “at
111
117
112
118
More specifically, an external “attacher” must watch the Kubernetes API on behalf of the external CSI volume driver to handle attach/detach requests.
113
119
114
-
Upon initialization the `external-attacher` should call `GetNodeId` for each node in the cluster and create a mapping from cluster node ID to storage node ID. When issuing `ControllerPublishVolume` calls it should use the mapping.
115
-
116
120
Once the following conditions are true, the external-attacher should call `ControllerPublishVolume` against the CSI volume driver to attach the volume to the specified node:
117
121
118
122
1. A new `VolumeAttachment` Kubernetes API objects is created by Kubernetes.
119
123
2. The `VolumeAttachment.Spec.Attacher` value in that object corresponds to the name of the external attacher.
120
124
3. The `VolumeAttachment.Status.IsAttached` value is not yet set to true.
125
+
4. A Kubernetes Node API object exists with the name matching `VolumeAttachment.Spec.NodeName` and that object contains a `csi.volume.kubernetes.io/<CsiDriverName>/nodeID` label corresponding to the CSI volume driver so that the CSI Driver’s NodeId mapping can be retrieved and used in the `ControllerPublishVolume` calls.
121
126
122
127
If the operation completes successfully, the external-attacher will:
123
128
@@ -335,7 +340,7 @@ To deploy a containerized third-party CSI volume driver, it is recommended that
335
340
* A DaemonSet will ensure that 1 instance of the pod is deployed on every node (to facilitate communication from every instance of kubelet).
336
341
* Contain the following containers
337
342
* The “CSI volume driver” container created by the storage vendor.
338
-
* The “Kubernetes CSI Helper” container provided by the Kubernetes team responsible for registering the unix domain socket with kubelet.
343
+
* The “Kubernetes CSI Helper” container provided by the Kubernetes team responsible for registering the unix domain socket with kubelet and NodeId initialization.
339
344
* Have the following volumes:
340
345
*`hostpath` volume
341
346
* Expose `/var/lib/kubelet/device-plugins/kubelet.sock` from the host.
0 commit comments