blob: a3526ca4e43246c3650bf13da5e1bf1382e8fac3 [file] [log] [blame]
Matteo Scandoloa4285862020-12-01 18:10:10 -08001/*
2Copyright 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
17
18// This file was autogenerated by go-to-protobuf. Do not edit it manually!
19
20syntax = 'proto2';
21
22package k8s.io.api.storage.v1;
23
24import "k8s.io/api/core/v1/generated.proto";
25import "k8s.io/apimachinery/pkg/apis/meta/v1/generated.proto";
26import "k8s.io/apimachinery/pkg/runtime/generated.proto";
27import "k8s.io/apimachinery/pkg/runtime/schema/generated.proto";
28
29// Package-wide variables from generator "generated".
30option go_package = "v1";
31
32// CSIDriver captures information about a Container Storage Interface (CSI)
33// volume driver deployed on the cluster.
34// Kubernetes attach detach controller uses this object to determine whether attach is required.
35// Kubelet uses this object to determine whether pod information needs to be passed on mount.
36// CSIDriver objects are non-namespaced.
37message CSIDriver {
38 // Standard object metadata.
39 // metadata.Name indicates the name of the CSI driver that this object
40 // refers to; it MUST be the same name returned by the CSI GetPluginName()
41 // call for that driver.
42 // The driver name must be 63 characters or less, beginning and ending with
43 // an alphanumeric character ([a-z0-9A-Z]) with dashes (-), dots (.), and
44 // alphanumerics between.
45 // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
46 optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
47
48 // Specification of the CSI Driver.
49 optional CSIDriverSpec spec = 2;
50}
51
52// CSIDriverList is a collection of CSIDriver objects.
53message CSIDriverList {
54 // Standard list metadata
55 // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
56 // +optional
57 optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
58
59 // items is the list of CSIDriver
60 repeated CSIDriver items = 2;
61}
62
63// CSIDriverSpec is the specification of a CSIDriver.
64message CSIDriverSpec {
65 // attachRequired indicates this CSI volume driver requires an attach
66 // operation (because it implements the CSI ControllerPublishVolume()
67 // method), and that the Kubernetes attach detach controller should call
68 // the attach volume interface which checks the volumeattachment status
69 // and waits until the volume is attached before proceeding to mounting.
70 // The CSI external-attacher coordinates with CSI volume driver and updates
71 // the volumeattachment status when the attach operation is complete.
72 // If the CSIDriverRegistry feature gate is enabled and the value is
73 // specified to false, the attach operation will be skipped.
74 // Otherwise the attach operation will be called.
75 // +optional
76 optional bool attachRequired = 1;
77
78 // If set to true, podInfoOnMount indicates this CSI volume driver
79 // requires additional pod information (like podName, podUID, etc.) during
80 // mount operations.
81 // If set to false, pod information will not be passed on mount.
82 // Default is false.
83 // The CSI driver specifies podInfoOnMount as part of driver deployment.
84 // If true, Kubelet will pass pod information as VolumeContext in the CSI
85 // NodePublishVolume() calls.
86 // The CSI driver is responsible for parsing and validating the information
87 // passed in as VolumeContext.
88 // The following VolumeConext will be passed if podInfoOnMount is set to true.
89 // This list might grow, but the prefix will be used.
90 // "csi.storage.k8s.io/pod.name": pod.Name
91 // "csi.storage.k8s.io/pod.namespace": pod.Namespace
92 // "csi.storage.k8s.io/pod.uid": string(pod.UID)
93 // "csi.storage.k8s.io/ephemeral": "true" iff the volume is an ephemeral inline volume
94 // defined by a CSIVolumeSource, otherwise "false"
95 //
96 // "csi.storage.k8s.io/ephemeral" is a new feature in Kubernetes 1.16. It is only
97 // required for drivers which support both the "Persistent" and "Ephemeral" VolumeLifecycleMode.
98 // Other drivers can leave pod info disabled and/or ignore this field.
99 // As Kubernetes 1.15 doesn't support this field, drivers can only support one mode when
100 // deployed on such a cluster and the deployment determines which mode that is, for example
101 // via a command line parameter of the driver.
102 // +optional
103 optional bool podInfoOnMount = 2;
104
105 // volumeLifecycleModes defines what kind of volumes this CSI volume driver supports.
106 // The default if the list is empty is "Persistent", which is the usage
107 // defined by the CSI specification and implemented in Kubernetes via the usual
108 // PV/PVC mechanism.
109 // The other mode is "Ephemeral". In this mode, volumes are defined inline
110 // inside the pod spec with CSIVolumeSource and their lifecycle is tied to
111 // the lifecycle of that pod. A driver has to be aware of this
112 // because it is only going to get a NodePublishVolume call for such a volume.
113 // For more information about implementing this mode, see
114 // https://kubernetes-csi.github.io/docs/ephemeral-local-volumes.html
115 // A driver can support one or more of these modes and
116 // more modes may be added in the future.
117 // This field is beta.
118 // +optional
119 // +listType=set
120 repeated string volumeLifecycleModes = 3;
121
122 // If set to true, storageCapacity indicates that the CSI
123 // volume driver wants pod scheduling to consider the storage
124 // capacity that the driver deployment will report by creating
125 // CSIStorageCapacity objects with capacity information.
126 //
127 // The check can be enabled immediately when deploying a driver.
128 // In that case, provisioning new volumes with late binding
129 // will pause until the driver deployment has published
130 // some suitable CSIStorageCapacity object.
131 //
132 // Alternatively, the driver can be deployed with the field
133 // unset or false and it can be flipped later when storage
134 // capacity information has been published.
135 //
136 // This is an alpha field and only available when the CSIStorageCapacity
137 // feature is enabled. The default is false.
138 //
139 // +optional
140 optional bool storageCapacity = 4;
141
142 // Defines if the underlying volume supports changing ownership and
143 // permission of the volume before being mounted.
144 // Refer to the specific FSGroupPolicy values for additional details.
145 // This field is alpha-level, and is only honored by servers
146 // that enable the CSIVolumeFSGroupPolicy feature gate.
147 // +optional
148 optional string fsGroupPolicy = 5;
149}
150
151// CSINode holds information about all CSI drivers installed on a node.
152// CSI drivers do not need to create the CSINode object directly. As long as
153// they use the node-driver-registrar sidecar container, the kubelet will
154// automatically populate the CSINode object for the CSI driver as part of
155// kubelet plugin registration.
156// CSINode has the same name as a node. If the object is missing, it means either
157// there are no CSI Drivers available on the node, or the Kubelet version is low
158// enough that it doesn't create this object.
159// CSINode has an OwnerReference that points to the corresponding node object.
160message CSINode {
161 // metadata.name must be the Kubernetes node name.
162 optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
163
164 // spec is the specification of CSINode
165 optional CSINodeSpec spec = 2;
166}
167
168// CSINodeDriver holds information about the specification of one CSI driver installed on a node
169message CSINodeDriver {
170 // This is the name of the CSI driver that this object refers to.
171 // This MUST be the same name returned by the CSI GetPluginName() call for
172 // that driver.
173 optional string name = 1;
174
175 // nodeID of the node from the driver point of view.
176 // This field enables Kubernetes to communicate with storage systems that do
177 // not share the same nomenclature for nodes. For example, Kubernetes may
178 // refer to a given node as "node1", but the storage system may refer to
179 // the same node as "nodeA". When Kubernetes issues a command to the storage
180 // system to attach a volume to a specific node, it can use this field to
181 // refer to the node name using the ID that the storage system will
182 // understand, e.g. "nodeA" instead of "node1". This field is required.
183 optional string nodeID = 2;
184
185 // topologyKeys is the list of keys supported by the driver.
186 // When a driver is initialized on a cluster, it provides a set of topology
187 // keys that it understands (e.g. "company.com/zone", "company.com/region").
188 // When a driver is initialized on a node, it provides the same topology keys
189 // along with values. Kubelet will expose these topology keys as labels
190 // on its own node object.
191 // When Kubernetes does topology aware provisioning, it can use this list to
192 // determine which labels it should retrieve from the node object and pass
193 // back to the driver.
194 // It is possible for different nodes to use different topology keys.
195 // This can be empty if driver does not support topology.
196 // +optional
197 repeated string topologyKeys = 3;
198
199 // allocatable represents the volume resources of a node that are available for scheduling.
200 // This field is beta.
201 // +optional
202 optional VolumeNodeResources allocatable = 4;
203}
204
205// CSINodeList is a collection of CSINode objects.
206message CSINodeList {
207 // Standard list metadata
208 // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
209 // +optional
210 optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
211
212 // items is the list of CSINode
213 repeated CSINode items = 2;
214}
215
216// CSINodeSpec holds information about the specification of all CSI drivers installed on a node
217message CSINodeSpec {
218 // drivers is a list of information of all CSI Drivers existing on a node.
219 // If all drivers in the list are uninstalled, this can become empty.
220 // +patchMergeKey=name
221 // +patchStrategy=merge
222 repeated CSINodeDriver drivers = 1;
223}
224
225// StorageClass describes the parameters for a class of storage for
226// which PersistentVolumes can be dynamically provisioned.
227//
228// StorageClasses are non-namespaced; the name of the storage class
229// according to etcd is in ObjectMeta.Name.
230message StorageClass {
231 // Standard object's metadata.
232 // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
233 // +optional
234 optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
235
236 // Provisioner indicates the type of the provisioner.
237 optional string provisioner = 2;
238
239 // Parameters holds the parameters for the provisioner that should
240 // create volumes of this storage class.
241 // +optional
242 map<string, string> parameters = 3;
243
244 // Dynamically provisioned PersistentVolumes of this storage class are
245 // created with this reclaimPolicy. Defaults to Delete.
246 // +optional
247 optional string reclaimPolicy = 4;
248
249 // Dynamically provisioned PersistentVolumes of this storage class are
250 // created with these mountOptions, e.g. ["ro", "soft"]. Not validated -
251 // mount of the PVs will simply fail if one is invalid.
252 // +optional
253 repeated string mountOptions = 5;
254
255 // AllowVolumeExpansion shows whether the storage class allow volume expand
256 // +optional
257 optional bool allowVolumeExpansion = 6;
258
259 // VolumeBindingMode indicates how PersistentVolumeClaims should be
260 // provisioned and bound. When unset, VolumeBindingImmediate is used.
261 // This field is only honored by servers that enable the VolumeScheduling feature.
262 // +optional
263 optional string volumeBindingMode = 7;
264
265 // Restrict the node topologies where volumes can be dynamically provisioned.
266 // Each volume plugin defines its own supported topology specifications.
267 // An empty TopologySelectorTerm list means there is no topology restriction.
268 // This field is only honored by servers that enable the VolumeScheduling feature.
269 // +optional
270 repeated k8s.io.api.core.v1.TopologySelectorTerm allowedTopologies = 8;
271}
272
273// StorageClassList is a collection of storage classes.
274message StorageClassList {
275 // Standard list metadata
276 // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
277 // +optional
278 optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
279
280 // Items is the list of StorageClasses
281 repeated StorageClass items = 2;
282}
283
284// VolumeAttachment captures the intent to attach or detach the specified volume
285// to/from the specified node.
286//
287// VolumeAttachment objects are non-namespaced.
288message VolumeAttachment {
289 // Standard object metadata.
290 // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
291 // +optional
292 optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
293
294 // Specification of the desired attach/detach volume behavior.
295 // Populated by the Kubernetes system.
296 optional VolumeAttachmentSpec spec = 2;
297
298 // Status of the VolumeAttachment request.
299 // Populated by the entity completing the attach or detach
300 // operation, i.e. the external-attacher.
301 // +optional
302 optional VolumeAttachmentStatus status = 3;
303}
304
305// VolumeAttachmentList is a collection of VolumeAttachment objects.
306message VolumeAttachmentList {
307 // Standard list metadata
308 // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
309 // +optional
310 optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
311
312 // Items is the list of VolumeAttachments
313 repeated VolumeAttachment items = 2;
314}
315
316// VolumeAttachmentSource represents a volume that should be attached.
317// Right now only PersistenVolumes can be attached via external attacher,
318// in future we may allow also inline volumes in pods.
319// Exactly one member can be set.
320message VolumeAttachmentSource {
321 // Name of the persistent volume to attach.
322 // +optional
323 optional string persistentVolumeName = 1;
324
325 // inlineVolumeSpec contains all the information necessary to attach
326 // a persistent volume defined by a pod's inline VolumeSource. This field
327 // is populated only for the CSIMigration feature. It contains
328 // translated fields from a pod's inline VolumeSource to a
329 // PersistentVolumeSpec. This field is alpha-level and is only
330 // honored by servers that enabled the CSIMigration feature.
331 // +optional
332 optional k8s.io.api.core.v1.PersistentVolumeSpec inlineVolumeSpec = 2;
333}
334
335// VolumeAttachmentSpec is the specification of a VolumeAttachment request.
336message VolumeAttachmentSpec {
337 // Attacher indicates the name of the volume driver that MUST handle this
338 // request. This is the name returned by GetPluginName().
339 optional string attacher = 1;
340
341 // Source represents the volume that should be attached.
342 optional VolumeAttachmentSource source = 2;
343
344 // The node that the volume should be attached to.
345 optional string nodeName = 3;
346}
347
348// VolumeAttachmentStatus is the status of a VolumeAttachment request.
349message VolumeAttachmentStatus {
350 // Indicates the volume is successfully attached.
351 // This field must only be set by the entity completing the attach
352 // operation, i.e. the external-attacher.
353 optional bool attached = 1;
354
355 // Upon successful attach, this field is populated with any
356 // information returned by the attach operation that must be passed
357 // into subsequent WaitForAttach or Mount calls.
358 // This field must only be set by the entity completing the attach
359 // operation, i.e. the external-attacher.
360 // +optional
361 map<string, string> attachmentMetadata = 2;
362
363 // The last error encountered during attach operation, if any.
364 // This field must only be set by the entity completing the attach
365 // operation, i.e. the external-attacher.
366 // +optional
367 optional VolumeError attachError = 3;
368
369 // The last error encountered during detach operation, if any.
370 // This field must only be set by the entity completing the detach
371 // operation, i.e. the external-attacher.
372 // +optional
373 optional VolumeError detachError = 4;
374}
375
376// VolumeError captures an error encountered during a volume operation.
377message VolumeError {
378 // Time the error was encountered.
379 // +optional
380 optional k8s.io.apimachinery.pkg.apis.meta.v1.Time time = 1;
381
382 // String detailing the error encountered during Attach or Detach operation.
383 // This string may be logged, so it should not contain sensitive
384 // information.
385 // +optional
386 optional string message = 2;
387}
388
389// VolumeNodeResources is a set of resource limits for scheduling of volumes.
390message VolumeNodeResources {
391 // Maximum number of unique volumes managed by the CSI driver that can be used on a node.
392 // A volume that is both attached and mounted on a node is considered to be used once, not twice.
393 // The same rule applies for a unique volume that is shared among multiple pods on the same node.
394 // If this field is not specified, then the supported number of volumes on this node is unbounded.
395 // +optional
396 optional int32 count = 1;
397}
398