Skip to content

Commit 3215005

Browse files
committed
Secret updates
- allow CSI to be used only via PersistentVolumes, no inline volumes in Pods - use CSIPersistentVolumeSource instead of CSIVolumeSource - update json and protobuf tags - use SecretReference instead of ObjectReference
1 parent 58da984 commit 3215005

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

contributors/design-proposals/storage/container-storage-interface.md

+9-7
Original file line numberDiff line numberDiff line change
@@ -234,10 +234,10 @@ The existing Kubernetes volume components (attach/detach controller, PVC/PV cont
234234

235235
#### Proposed API
236236

237-
A new `CSIVolumeSource` object will be added to the Kubernetes API. It will be part of the existing `VolumeSource` and `PersistentVolumeSource` objects. This will enable Kubernetes users to use the new volume just like existing volume via a `PersistentVolume` or as a direct reference in a pod.
237+
A new `CSIPersistentVolumeSource` object will be added to the Kubernetes API. It will be part of the existing `PersistentVolumeSource` objects and thus can be used only via PersistentVolumes. For now we do not consider allowing CSI volumes directly from Pods without PersistentVolumeClaim.
238238

239239
```GO
240-
type CSIVolumeSource struct {
240+
type CSIPersistentVolumeSource struct {
241241
// Driver is the name of the driver to use for this volume.
242242
// Required.
243243
Driver string `json:"driver" protobuf:"bytes,1,opt,name=driver"`
@@ -250,25 +250,25 @@ type CSIVolumeSource struct {
250250
// sensitive information to pass to the CSI driver during NodePublish.
251251
// This may be empty if no secret is required. If the secret object contains
252252
// more than one secret, all secrets are passed.
253-
// This is a local object reference so only secrets within the same
254-
// namespace as the pod or PVC referencing this volume can be referenced.
255253
// +optional
256-
MountSecretRef *LocalObjectReference `json:"secretRef,omitempty" protobuf:"bytes,3,opt,name=secretRef"`
254+
MountSecretRef *SecretReference `json:"mountSecretRef,omitempty" protobuf:"bytes,3,opt,name=mountSecretRef"`
257255

258256
// Optional: AttachSecretRef is a reference to the secret object containing
259257
// sensitive information to pass to the CSI driver during ControllerPublish.
260258
// This may be empty if no secret is required. If the secret object contains
261259
// more than one secret, all secrets are passed.
262260
// +optional
263-
AttachSecretRef *ObjectReference `json:"secretRef,omitempty" protobuf:"bytes,3,opt,name=secretRef"`
261+
AttachSecretRef *SecretReference `json:"attachSecretRef,omitempty" protobuf:"bytes,4,opt,name=attachSecretRef"`
264262

265263
// Optional: The value to pass to ControllerPublishVolumeRequest.
266264
// Defaults to false (read/write).
267265
// +optional
268-
ReadOnly bool `json:"readOnly,omitempty" protobuf:"varint,4,opt,name=readOnly"`
266+
ReadOnly bool `json:"readOnly,omitempty" protobuf:"varint,5,opt,name=readOnly"`
269267
}
270268
```
271269

270+
Note that both attach and mount secrets are in a dedicated namespace where external AttachController and kubelet has access and they should not be visible to regular users. It is expected that either admin or external provisioner create these secrets when creating corresponding PV.
271+
272272
#### Internal Interfaces
273273

274274
The in-tree CSI volume plugin will implement the following internal Kubernetes volume interfaces:
@@ -286,6 +286,8 @@ The in-tree volume plugin’s SetUp and TearDown methods will trigger the `NodeP
286286

287287
The Kubernetes volume sub-system does not currently support block volumes (only file), so for alpha, the Kubernetes CSI volume plugin will only support file.
288288

289+
As part of kubelet work, NodeAuthorizer needs to be updated to allow kubelet accessing MountSecret for internal CSI volume plugin.
290+
289291
#### Attaching and Detaching
290292

291293
The attach/detach controller,running as part of the kube-controller-manager binary on the master, decides when a CSI volume must be attached or detached from a particular node.

0 commit comments

Comments
 (0)