blob: 7946663a3f7c80a0e91831c974ce6b097c4311fc [file] [log] [blame]
Matteo Scandoloa4285862020-12-01 18:10:10 -08001/*
2Copyright 2016 The Kubernetes Authors.
3
4Licensed under the Apache License, Version 2.0 (the "License");
5you may not use this file except in compliance with the License.
6You may obtain a copy of the License at
7
8 http://www.apache.org/licenses/LICENSE-2.0
9
10Unless required by applicable law or agreed to in writing, software
11distributed under the License is distributed on an "AS IS" BASIS,
12WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13See the License for the specific language governing permissions and
14limitations under the License.
15*/
16
17package v1beta1
18
19import (
20 v1 "k8s.io/api/core/v1"
21 metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
22)
23
24// +genclient
25// +genclient:nonNamespaced
26// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
27// +k8s:prerelease-lifecycle-gen:introduced=1.4
28// +k8s:prerelease-lifecycle-gen:deprecated=1.19
29// +k8s:prerelease-lifecycle-gen:replacement=storage.k8s.io,v1,StorageClass
30
31// StorageClass describes the parameters for a class of storage for
32// which PersistentVolumes can be dynamically provisioned.
33//
34// StorageClasses are non-namespaced; the name of the storage class
35// according to etcd is in ObjectMeta.Name.
36type StorageClass struct {
37 metav1.TypeMeta `json:",inline"`
38 // Standard object's metadata.
39 // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
40 // +optional
41 metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
42
43 // Provisioner indicates the type of the provisioner.
44 Provisioner string `json:"provisioner" protobuf:"bytes,2,opt,name=provisioner"`
45
46 // Parameters holds the parameters for the provisioner that should
47 // create volumes of this storage class.
48 // +optional
49 Parameters map[string]string `json:"parameters,omitempty" protobuf:"bytes,3,rep,name=parameters"`
50
51 // Dynamically provisioned PersistentVolumes of this storage class are
52 // created with this reclaimPolicy. Defaults to Delete.
53 // +optional
54 ReclaimPolicy *v1.PersistentVolumeReclaimPolicy `json:"reclaimPolicy,omitempty" protobuf:"bytes,4,opt,name=reclaimPolicy,casttype=k8s.io/api/core/v1.PersistentVolumeReclaimPolicy"`
55
56 // Dynamically provisioned PersistentVolumes of this storage class are
57 // created with these mountOptions, e.g. ["ro", "soft"]. Not validated -
58 // mount of the PVs will simply fail if one is invalid.
59 // +optional
60 MountOptions []string `json:"mountOptions,omitempty" protobuf:"bytes,5,opt,name=mountOptions"`
61
62 // AllowVolumeExpansion shows whether the storage class allow volume expand
63 // +optional
64 AllowVolumeExpansion *bool `json:"allowVolumeExpansion,omitempty" protobuf:"varint,6,opt,name=allowVolumeExpansion"`
65
66 // VolumeBindingMode indicates how PersistentVolumeClaims should be
67 // provisioned and bound. When unset, VolumeBindingImmediate is used.
68 // This field is only honored by servers that enable the VolumeScheduling feature.
69 // +optional
70 VolumeBindingMode *VolumeBindingMode `json:"volumeBindingMode,omitempty" protobuf:"bytes,7,opt,name=volumeBindingMode"`
71
72 // Restrict the node topologies where volumes can be dynamically provisioned.
73 // Each volume plugin defines its own supported topology specifications.
74 // An empty TopologySelectorTerm list means there is no topology restriction.
75 // This field is only honored by servers that enable the VolumeScheduling feature.
76 // +optional
77 AllowedTopologies []v1.TopologySelectorTerm `json:"allowedTopologies,omitempty" protobuf:"bytes,8,rep,name=allowedTopologies"`
78}
79
80// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
81// +k8s:prerelease-lifecycle-gen:introduced=1.4
82// +k8s:prerelease-lifecycle-gen:deprecated=1.19
83// +k8s:prerelease-lifecycle-gen:replacement=storage.k8s.io,v1,StorageClassList
84
85// StorageClassList is a collection of storage classes.
86type StorageClassList struct {
87 metav1.TypeMeta `json:",inline"`
88 // Standard list metadata
89 // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
90 // +optional
91 metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
92
93 // Items is the list of StorageClasses
94 Items []StorageClass `json:"items" protobuf:"bytes,2,rep,name=items"`
95}
96
97// VolumeBindingMode indicates how PersistentVolumeClaims should be bound.
98type VolumeBindingMode string
99
100const (
101 // VolumeBindingImmediate indicates that PersistentVolumeClaims should be
102 // immediately provisioned and bound. This is the default mode.
103 VolumeBindingImmediate VolumeBindingMode = "Immediate"
104
105 // VolumeBindingWaitForFirstConsumer indicates that PersistentVolumeClaims
106 // should not be provisioned and bound until the first Pod is created that
107 // references the PeristentVolumeClaim. The volume provisioning and
108 // binding will occur during Pod scheduing.
109 VolumeBindingWaitForFirstConsumer VolumeBindingMode = "WaitForFirstConsumer"
110)
111
112// +genclient
113// +genclient:nonNamespaced
114// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
115// +k8s:prerelease-lifecycle-gen:introduced=1.10
116// +k8s:prerelease-lifecycle-gen:deprecated=1.19
117// +k8s:prerelease-lifecycle-gen:replacement=storage.k8s.io,v1,VolumeAttachment
118
119// VolumeAttachment captures the intent to attach or detach the specified volume
120// to/from the specified node.
121//
122// VolumeAttachment objects are non-namespaced.
123type VolumeAttachment struct {
124 metav1.TypeMeta `json:",inline"`
125
126 // Standard object metadata.
127 // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
128 // +optional
129 metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
130
131 // Specification of the desired attach/detach volume behavior.
132 // Populated by the Kubernetes system.
133 Spec VolumeAttachmentSpec `json:"spec" protobuf:"bytes,2,opt,name=spec"`
134
135 // Status of the VolumeAttachment request.
136 // Populated by the entity completing the attach or detach
137 // operation, i.e. the external-attacher.
138 // +optional
139 Status VolumeAttachmentStatus `json:"status,omitempty" protobuf:"bytes,3,opt,name=status"`
140}
141
142// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
143// +k8s:prerelease-lifecycle-gen:introduced=1.10
144// +k8s:prerelease-lifecycle-gen:deprecated=1.19
145// +k8s:prerelease-lifecycle-gen:replacement=storage.k8s.io,v1,VolumeAttachmentList
146
147// VolumeAttachmentList is a collection of VolumeAttachment objects.
148type VolumeAttachmentList struct {
149 metav1.TypeMeta `json:",inline"`
150 // Standard list metadata
151 // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
152 // +optional
153 metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
154
155 // Items is the list of VolumeAttachments
156 Items []VolumeAttachment `json:"items" protobuf:"bytes,2,rep,name=items"`
157}
158
159// VolumeAttachmentSpec is the specification of a VolumeAttachment request.
160type VolumeAttachmentSpec struct {
161 // Attacher indicates the name of the volume driver that MUST handle this
162 // request. This is the name returned by GetPluginName().
163 Attacher string `json:"attacher" protobuf:"bytes,1,opt,name=attacher"`
164
165 // Source represents the volume that should be attached.
166 Source VolumeAttachmentSource `json:"source" protobuf:"bytes,2,opt,name=source"`
167
168 // The node that the volume should be attached to.
169 NodeName string `json:"nodeName" protobuf:"bytes,3,opt,name=nodeName"`
170}
171
172// VolumeAttachmentSource represents a volume that should be attached.
173// Right now only PersistenVolumes can be attached via external attacher,
174// in future we may allow also inline volumes in pods.
175// Exactly one member can be set.
176type VolumeAttachmentSource struct {
177 // Name of the persistent volume to attach.
178 // +optional
179 PersistentVolumeName *string `json:"persistentVolumeName,omitempty" protobuf:"bytes,1,opt,name=persistentVolumeName"`
180
181 // inlineVolumeSpec contains all the information necessary to attach
182 // a persistent volume defined by a pod's inline VolumeSource. This field
183 // is populated only for the CSIMigration feature. It contains
184 // translated fields from a pod's inline VolumeSource to a
185 // PersistentVolumeSpec. This field is alpha-level and is only
186 // honored by servers that enabled the CSIMigration feature.
187 // +optional
188 InlineVolumeSpec *v1.PersistentVolumeSpec `json:"inlineVolumeSpec,omitempty" protobuf:"bytes,2,opt,name=inlineVolumeSpec"`
189}
190
191// VolumeAttachmentStatus is the status of a VolumeAttachment request.
192type VolumeAttachmentStatus struct {
193 // Indicates the volume is successfully attached.
194 // This field must only be set by the entity completing the attach
195 // operation, i.e. the external-attacher.
196 Attached bool `json:"attached" protobuf:"varint,1,opt,name=attached"`
197
198 // Upon successful attach, this field is populated with any
199 // information returned by the attach operation that must be passed
200 // into subsequent WaitForAttach or Mount calls.
201 // This field must only be set by the entity completing the attach
202 // operation, i.e. the external-attacher.
203 // +optional
204 AttachmentMetadata map[string]string `json:"attachmentMetadata,omitempty" protobuf:"bytes,2,rep,name=attachmentMetadata"`
205
206 // The last error encountered during attach operation, if any.
207 // This field must only be set by the entity completing the attach
208 // operation, i.e. the external-attacher.
209 // +optional
210 AttachError *VolumeError `json:"attachError,omitempty" protobuf:"bytes,3,opt,name=attachError,casttype=VolumeError"`
211
212 // The last error encountered during detach operation, if any.
213 // This field must only be set by the entity completing the detach
214 // operation, i.e. the external-attacher.
215 // +optional
216 DetachError *VolumeError `json:"detachError,omitempty" protobuf:"bytes,4,opt,name=detachError,casttype=VolumeError"`
217}
218
219// VolumeError captures an error encountered during a volume operation.
220type VolumeError struct {
221 // Time the error was encountered.
222 // +optional
223 Time metav1.Time `json:"time,omitempty" protobuf:"bytes,1,opt,name=time"`
224
225 // String detailing the error encountered during Attach or Detach operation.
226 // This string may be logged, so it should not contain sensitive
227 // information.
228 // +optional
229 Message string `json:"message,omitempty" protobuf:"bytes,2,opt,name=message"`
230}
231
232// +genclient
233// +genclient:nonNamespaced
234// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
235// +k8s:prerelease-lifecycle-gen:introduced=1.14
236// +k8s:prerelease-lifecycle-gen:deprecated=1.19
237// +k8s:prerelease-lifecycle-gen:replacement=storage.k8s.io,v1,CSIDriver
238
239// CSIDriver captures information about a Container Storage Interface (CSI)
240// volume driver deployed on the cluster.
241// CSI drivers do not need to create the CSIDriver object directly. Instead they may use the
242// cluster-driver-registrar sidecar container. When deployed with a CSI driver it automatically
243// creates a CSIDriver object representing the driver.
244// Kubernetes attach detach controller uses this object to determine whether attach is required.
245// Kubelet uses this object to determine whether pod information needs to be passed on mount.
246// CSIDriver objects are non-namespaced.
247type CSIDriver struct {
248 metav1.TypeMeta `json:",inline"`
249
250 // Standard object metadata.
251 // metadata.Name indicates the name of the CSI driver that this object
252 // refers to; it MUST be the same name returned by the CSI GetPluginName()
253 // call for that driver.
254 // The driver name must be 63 characters or less, beginning and ending with
255 // an alphanumeric character ([a-z0-9A-Z]) with dashes (-), dots (.), and
256 // alphanumerics between.
257 // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
258 metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
259
260 // Specification of the CSI Driver.
261 Spec CSIDriverSpec `json:"spec" protobuf:"bytes,2,opt,name=spec"`
262}
263
264// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
265// +k8s:prerelease-lifecycle-gen:introduced=1.14
266// +k8s:prerelease-lifecycle-gen:deprecated=1.19
267// +k8s:prerelease-lifecycle-gen:replacement=storage.k8s.io,v1,CSIDriverList
268
269// CSIDriverList is a collection of CSIDriver objects.
270type CSIDriverList struct {
271 metav1.TypeMeta `json:",inline"`
272
273 // Standard list metadata
274 // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
275 // +optional
276 metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
277
278 // items is the list of CSIDriver
279 Items []CSIDriver `json:"items" protobuf:"bytes,2,rep,name=items"`
280}
281
282// CSIDriverSpec is the specification of a CSIDriver.
283type CSIDriverSpec struct {
284 // attachRequired indicates this CSI volume driver requires an attach
285 // operation (because it implements the CSI ControllerPublishVolume()
286 // method), and that the Kubernetes attach detach controller should call
287 // the attach volume interface which checks the volumeattachment status
288 // and waits until the volume is attached before proceeding to mounting.
289 // The CSI external-attacher coordinates with CSI volume driver and updates
290 // the volumeattachment status when the attach operation is complete.
291 // If the CSIDriverRegistry feature gate is enabled and the value is
292 // specified to false, the attach operation will be skipped.
293 // Otherwise the attach operation will be called.
294 // +optional
295 AttachRequired *bool `json:"attachRequired,omitempty" protobuf:"varint,1,opt,name=attachRequired"`
296
297 // If set to true, podInfoOnMount indicates this CSI volume driver
298 // requires additional pod information (like podName, podUID, etc.) during
299 // mount operations.
300 // If set to false, pod information will not be passed on mount.
301 // Default is false.
302 // The CSI driver specifies podInfoOnMount as part of driver deployment.
303 // If true, Kubelet will pass pod information as VolumeContext in the CSI
304 // NodePublishVolume() calls.
305 // The CSI driver is responsible for parsing and validating the information
306 // passed in as VolumeContext.
307 // The following VolumeConext will be passed if podInfoOnMount is set to true.
308 // This list might grow, but the prefix will be used.
309 // "csi.storage.k8s.io/pod.name": pod.Name
310 // "csi.storage.k8s.io/pod.namespace": pod.Namespace
311 // "csi.storage.k8s.io/pod.uid": string(pod.UID)
312 // "csi.storage.k8s.io/ephemeral": "true" iff the volume is an ephemeral inline volume
313 // defined by a CSIVolumeSource, otherwise "false"
314 //
315 // "csi.storage.k8s.io/ephemeral" is a new feature in Kubernetes 1.16. It is only
316 // required for drivers which support both the "Persistent" and "Ephemeral" VolumeLifecycleMode.
317 // Other drivers can leave pod info disabled and/or ignore this field.
318 // As Kubernetes 1.15 doesn't support this field, drivers can only support one mode when
319 // deployed on such a cluster and the deployment determines which mode that is, for example
320 // via a command line parameter of the driver.
321 // +optional
322 PodInfoOnMount *bool `json:"podInfoOnMount,omitempty" protobuf:"bytes,2,opt,name=podInfoOnMount"`
323
324 // VolumeLifecycleModes defines what kind of volumes this CSI volume driver supports.
325 // The default if the list is empty is "Persistent", which is the usage
326 // defined by the CSI specification and implemented in Kubernetes via the usual
327 // PV/PVC mechanism.
328 // The other mode is "Ephemeral". In this mode, volumes are defined inline
329 // inside the pod spec with CSIVolumeSource and their lifecycle is tied to
330 // the lifecycle of that pod. A driver has to be aware of this
331 // because it is only going to get a NodePublishVolume call for such a volume.
332 // For more information about implementing this mode, see
333 // https://kubernetes-csi.github.io/docs/ephemeral-local-volumes.html
334 // A driver can support one or more of these modes and
335 // more modes may be added in the future.
336 // +optional
337 VolumeLifecycleModes []VolumeLifecycleMode `json:"volumeLifecycleModes,omitempty" protobuf:"bytes,3,opt,name=volumeLifecycleModes"`
338
339 // If set to true, storageCapacity indicates that the CSI
340 // volume driver wants pod scheduling to consider the storage
341 // capacity that the driver deployment will report by creating
342 // CSIStorageCapacity objects with capacity information.
343 //
344 //
345 // The check can be enabled immediately when deploying a driver.
346 // In that case, provisioning new volumes with late binding
347 // will pause until the driver deployment has published
348 // some suitable CSIStorageCapacity object.
349 //
350 // Alternatively, the driver can be deployed with the field
351 // unset or false and it can be flipped later when storage
352 // capacity information has been published.
353 //
354 // This is an alpha field and only available when the CSIStorageCapacity
355 // feature is enabled. The default is false.
356 //
357 // +optional
358 StorageCapacity *bool `json:"storageCapacity,omitempty" protobuf:"bytes,4,opt,name=storageCapacity"`
359
360 // Defines if the underlying volume supports changing ownership and
361 // permission of the volume before being mounted.
362 // Refer to the specific FSGroupPolicy values for additional details.
363 // This field is alpha-level, and is only honored by servers
364 // that enable the CSIVolumeFSGroupPolicy feature gate.
365 // +optional
366 FSGroupPolicy *FSGroupPolicy `json:"fsGroupPolicy,omitempty" protobuf:"bytes,5,opt,name=fsGroupPolicy"`
367}
368
369// FSGroupPolicy specifies if a CSI Driver supports modifying
370// volume ownership and permissions of the volume to be mounted.
371// More modes may be added in the future.
372type FSGroupPolicy string
373
374const (
375 // ReadWriteOnceWithFSTypeFSGroupPolicy indicates that each volume will be examined
376 // to determine if the volume ownership and permissions
377 // should be modified. If a fstype is defined and the volume's access mode
378 // contains ReadWriteOnce, then the defined fsGroup will be applied.
379 // This is the default behavior if no other FSGroupPolicy is defined.
380 ReadWriteOnceWithFSTypeFSGroupPolicy FSGroupPolicy = "ReadWriteOnceWithFSType"
381
382 // FileFSGroupPolicy indicates that CSI driver supports volume ownership
383 // and permission change via fsGroup, and Kubernetes may use fsGroup
384 // to change permissions and ownership of the volume to match user requested fsGroup in
385 // the pod's SecurityPolicy regardless of fstype or access mode.
386 FileFSGroupPolicy FSGroupPolicy = "File"
387
388 // None indicates that volumes will be mounted without performing
389 // any ownership or permission modifications, as the CSIDriver does not support
390 // these operations.
391 NoneFSGroupPolicy FSGroupPolicy = "None"
392)
393
394// VolumeLifecycleMode is an enumeration of possible usage modes for a volume
395// provided by a CSI driver. More modes may be added in the future.
396type VolumeLifecycleMode string
397
398const (
399 // VolumeLifecyclePersistent explicitly confirms that the driver implements
400 // the full CSI spec. It is the default when CSIDriverSpec.VolumeLifecycleModes is not
401 // set. Such volumes are managed in Kubernetes via the persistent volume
402 // claim mechanism and have a lifecycle that is independent of the pods which
403 // use them.
404 VolumeLifecyclePersistent VolumeLifecycleMode = "Persistent"
405
406 // VolumeLifecycleEphemeral indicates that the driver can be used for
407 // ephemeral inline volumes. Such volumes are specified inside the pod
408 // spec with a CSIVolumeSource and, as far as Kubernetes is concerned, have
409 // a lifecycle that is tied to the lifecycle of the pod. For example, such
410 // a volume might contain data that gets created specifically for that pod,
411 // like secrets.
412 // But how the volume actually gets created and managed is entirely up to
413 // the driver. It might also use reference counting to share the same volume
414 // instance among different pods if the CSIVolumeSource of those pods is
415 // identical.
416 VolumeLifecycleEphemeral VolumeLifecycleMode = "Ephemeral"
417)
418
419// +genclient
420// +genclient:nonNamespaced
421// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
422// +k8s:prerelease-lifecycle-gen:introduced=1.14
423// +k8s:prerelease-lifecycle-gen:deprecated=1.17
424// +k8s:prerelease-lifecycle-gen:removed=1.22
425// +k8s:prerelease-lifecycle-gen:replacement=storage.k8s.io,v1,CSINode
426
427// DEPRECATED - This group version of CSINode is deprecated by storage/v1/CSINode.
428// See the release notes for more information.
429// CSINode holds information about all CSI drivers installed on a node.
430// CSI drivers do not need to create the CSINode object directly. As long as
431// they use the node-driver-registrar sidecar container, the kubelet will
432// automatically populate the CSINode object for the CSI driver as part of
433// kubelet plugin registration.
434// CSINode has the same name as a node. If the object is missing, it means either
435// there are no CSI Drivers available on the node, or the Kubelet version is low
436// enough that it doesn't create this object.
437// CSINode has an OwnerReference that points to the corresponding node object.
438type CSINode struct {
439 metav1.TypeMeta `json:",inline"`
440
441 // metadata.name must be the Kubernetes node name.
442 metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
443
444 // spec is the specification of CSINode
445 Spec CSINodeSpec `json:"spec" protobuf:"bytes,2,opt,name=spec"`
446}
447
448// CSINodeSpec holds information about the specification of all CSI drivers installed on a node
449type CSINodeSpec struct {
450 // drivers is a list of information of all CSI Drivers existing on a node.
451 // If all drivers in the list are uninstalled, this can become empty.
452 // +patchMergeKey=name
453 // +patchStrategy=merge
454 Drivers []CSINodeDriver `json:"drivers" patchStrategy:"merge" patchMergeKey:"name" protobuf:"bytes,1,rep,name=drivers"`
455}
456
457// CSINodeDriver holds information about the specification of one CSI driver installed on a node
458type CSINodeDriver struct {
459 // This is the name of the CSI driver that this object refers to.
460 // This MUST be the same name returned by the CSI GetPluginName() call for
461 // that driver.
462 Name string `json:"name" protobuf:"bytes,1,opt,name=name"`
463
464 // nodeID of the node from the driver point of view.
465 // This field enables Kubernetes to communicate with storage systems that do
466 // not share the same nomenclature for nodes. For example, Kubernetes may
467 // refer to a given node as "node1", but the storage system may refer to
468 // the same node as "nodeA". When Kubernetes issues a command to the storage
469 // system to attach a volume to a specific node, it can use this field to
470 // refer to the node name using the ID that the storage system will
471 // understand, e.g. "nodeA" instead of "node1". This field is required.
472 NodeID string `json:"nodeID" protobuf:"bytes,2,opt,name=nodeID"`
473
474 // topologyKeys is the list of keys supported by the driver.
475 // When a driver is initialized on a cluster, it provides a set of topology
476 // keys that it understands (e.g. "company.com/zone", "company.com/region").
477 // When a driver is initialized on a node, it provides the same topology keys
478 // along with values. Kubelet will expose these topology keys as labels
479 // on its own node object.
480 // When Kubernetes does topology aware provisioning, it can use this list to
481 // determine which labels it should retrieve from the node object and pass
482 // back to the driver.
483 // It is possible for different nodes to use different topology keys.
484 // This can be empty if driver does not support topology.
485 // +optional
486 TopologyKeys []string `json:"topologyKeys" protobuf:"bytes,3,rep,name=topologyKeys"`
487
488 // allocatable represents the volume resources of a node that are available for scheduling.
489 // +optional
490 Allocatable *VolumeNodeResources `json:"allocatable,omitempty" protobuf:"bytes,4,opt,name=allocatable"`
491}
492
493// VolumeNodeResources is a set of resource limits for scheduling of volumes.
494type VolumeNodeResources struct {
495 // Maximum number of unique volumes managed by the CSI driver that can be used on a node.
496 // A volume that is both attached and mounted on a node is considered to be used once, not twice.
497 // The same rule applies for a unique volume that is shared among multiple pods on the same node.
498 // If this field is nil, then the supported number of volumes on this node is unbounded.
499 // +optional
500 Count *int32 `json:"count,omitempty" protobuf:"varint,1,opt,name=count"`
501}
502
503// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
504// +k8s:prerelease-lifecycle-gen:introduced=1.14
505// +k8s:prerelease-lifecycle-gen:deprecated=1.17
506// +k8s:prerelease-lifecycle-gen:removed=1.22
507// +k8s:prerelease-lifecycle-gen:replacement=storage.k8s.io,v1,CSINode
508
509// CSINodeList is a collection of CSINode objects.
510type CSINodeList struct {
511 metav1.TypeMeta `json:",inline"`
512
513 // Standard list metadata
514 // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
515 // +optional
516 metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
517
518 // items is the list of CSINode
519 Items []CSINode `json:"items" protobuf:"bytes,2,rep,name=items"`
520}