blob: b78d59aa58afa32f26568b4b97aa5f74ebb68a09 [file] [log] [blame]
Zack Williamse940c7a2019-08-21 14:25:39 -07001/*
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.v1beta1;
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 = "v1beta1";
31
32// CSIDriver captures information about a Container Storage Interface (CSI)
33// volume driver deployed on the cluster.
34// CSI drivers do not need to create the CSIDriver object directly. Instead they may use the
35// cluster-driver-registrar sidecar container. When deployed with a CSI driver it automatically
36// creates a CSIDriver object representing the driver.
37// Kubernetes attach detach controller uses this object to determine whether attach is required.
38// Kubelet uses this object to determine whether pod information needs to be passed on mount.
39// CSIDriver objects are non-namespaced.
40message CSIDriver {
41 // Standard object metadata.
42 // metadata.Name indicates the name of the CSI driver that this object
43 // refers to; it MUST be the same name returned by the CSI GetPluginName()
44 // call for that driver.
45 // The driver name must be 63 characters or less, beginning and ending with
46 // an alphanumeric character ([a-z0-9A-Z]) with dashes (-), dots (.), and
47 // alphanumerics between.
48 // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
49 optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
50
51 // Specification of the CSI Driver.
52 optional CSIDriverSpec spec = 2;
53}
54
55// CSIDriverList is a collection of CSIDriver objects.
56message CSIDriverList {
57 // Standard list metadata
58 // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
59 // +optional
60 optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
61
62 // items is the list of CSIDriver
63 repeated CSIDriver items = 2;
64}
65
66// CSIDriverSpec is the specification of a CSIDriver.
67message CSIDriverSpec {
68 // attachRequired indicates this CSI volume driver requires an attach
69 // operation (because it implements the CSI ControllerPublishVolume()
70 // method), and that the Kubernetes attach detach controller should call
71 // the attach volume interface which checks the volumeattachment status
72 // and waits until the volume is attached before proceeding to mounting.
73 // The CSI external-attacher coordinates with CSI volume driver and updates
74 // the volumeattachment status when the attach operation is complete.
75 // If the CSIDriverRegistry feature gate is enabled and the value is
76 // specified to false, the attach operation will be skipped.
77 // Otherwise the attach operation will be called.
78 // +optional
79 optional bool attachRequired = 1;
80
81 // If set to true, podInfoOnMount indicates this CSI volume driver
82 // requires additional pod information (like podName, podUID, etc.) during
83 // mount operations.
84 // If set to false, pod information will not be passed on mount.
85 // Default is false.
86 // The CSI driver specifies podInfoOnMount as part of driver deployment.
87 // If true, Kubelet will pass pod information as VolumeContext in the CSI
88 // NodePublishVolume() calls.
89 // The CSI driver is responsible for parsing and validating the information
90 // passed in as VolumeContext.
91 // The following VolumeConext will be passed if podInfoOnMount is set to true.
92 // This list might grow, but the prefix will be used.
93 // "csi.storage.k8s.io/pod.name": pod.Name
94 // "csi.storage.k8s.io/pod.namespace": pod.Namespace
95 // "csi.storage.k8s.io/pod.uid": string(pod.UID)
96 // +optional
97 optional bool podInfoOnMount = 2;
98}
99
100// CSINode holds information about all CSI drivers installed on a node.
101// CSI drivers do not need to create the CSINode object directly. As long as
102// they use the node-driver-registrar sidecar container, the kubelet will
103// automatically populate the CSINode object for the CSI driver as part of
104// kubelet plugin registration.
105// CSINode has the same name as a node. If the object is missing, it means either
106// there are no CSI Drivers available on the node, or the Kubelet version is low
107// enough that it doesn't create this object.
108// CSINode has an OwnerReference that points to the corresponding node object.
109message CSINode {
110 // metadata.name must be the Kubernetes node name.
111 optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
112
113 // spec is the specification of CSINode
114 optional CSINodeSpec spec = 2;
115}
116
117// CSINodeDriver holds information about the specification of one CSI driver installed on a node
118message CSINodeDriver {
119 // This is the name of the CSI driver that this object refers to.
120 // This MUST be the same name returned by the CSI GetPluginName() call for
121 // that driver.
122 optional string name = 1;
123
124 // nodeID of the node from the driver point of view.
125 // This field enables Kubernetes to communicate with storage systems that do
126 // not share the same nomenclature for nodes. For example, Kubernetes may
127 // refer to a given node as "node1", but the storage system may refer to
128 // the same node as "nodeA". When Kubernetes issues a command to the storage
129 // system to attach a volume to a specific node, it can use this field to
130 // refer to the node name using the ID that the storage system will
131 // understand, e.g. "nodeA" instead of "node1". This field is required.
132 optional string nodeID = 2;
133
134 // topologyKeys is the list of keys supported by the driver.
135 // When a driver is initialized on a cluster, it provides a set of topology
136 // keys that it understands (e.g. "company.com/zone", "company.com/region").
137 // When a driver is initialized on a node, it provides the same topology keys
138 // along with values. Kubelet will expose these topology keys as labels
139 // on its own node object.
140 // When Kubernetes does topology aware provisioning, it can use this list to
141 // determine which labels it should retrieve from the node object and pass
142 // back to the driver.
143 // It is possible for different nodes to use different topology keys.
144 // This can be empty if driver does not support topology.
145 // +optional
146 repeated string topologyKeys = 3;
147}
148
149// CSINodeList is a collection of CSINode objects.
150message CSINodeList {
151 // Standard list metadata
152 // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
153 // +optional
154 optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
155
156 // items is the list of CSINode
157 repeated CSINode items = 2;
158}
159
160// CSINodeSpec holds information about the specification of all CSI drivers installed on a node
161message CSINodeSpec {
162 // drivers is a list of information of all CSI Drivers existing on a node.
163 // If all drivers in the list are uninstalled, this can become empty.
164 // +patchMergeKey=name
165 // +patchStrategy=merge
166 repeated CSINodeDriver drivers = 1;
167}
168
169// StorageClass describes the parameters for a class of storage for
170// which PersistentVolumes can be dynamically provisioned.
171//
172// StorageClasses are non-namespaced; the name of the storage class
173// according to etcd is in ObjectMeta.Name.
174message StorageClass {
175 // Standard object's metadata.
176 // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
177 // +optional
178 optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
179
180 // Provisioner indicates the type of the provisioner.
181 optional string provisioner = 2;
182
183 // Parameters holds the parameters for the provisioner that should
184 // create volumes of this storage class.
185 // +optional
186 map<string, string> parameters = 3;
187
188 // Dynamically provisioned PersistentVolumes of this storage class are
189 // created with this reclaimPolicy. Defaults to Delete.
190 // +optional
191 optional string reclaimPolicy = 4;
192
193 // Dynamically provisioned PersistentVolumes of this storage class are
194 // created with these mountOptions, e.g. ["ro", "soft"]. Not validated -
195 // mount of the PVs will simply fail if one is invalid.
196 // +optional
197 repeated string mountOptions = 5;
198
199 // AllowVolumeExpansion shows whether the storage class allow volume expand
200 // +optional
201 optional bool allowVolumeExpansion = 6;
202
203 // VolumeBindingMode indicates how PersistentVolumeClaims should be
204 // provisioned and bound. When unset, VolumeBindingImmediate is used.
205 // This field is only honored by servers that enable the VolumeScheduling feature.
206 // +optional
207 optional string volumeBindingMode = 7;
208
209 // Restrict the node topologies where volumes can be dynamically provisioned.
210 // Each volume plugin defines its own supported topology specifications.
211 // An empty TopologySelectorTerm list means there is no topology restriction.
212 // This field is only honored by servers that enable the VolumeScheduling feature.
213 // +optional
214 repeated k8s.io.api.core.v1.TopologySelectorTerm allowedTopologies = 8;
215}
216
217// StorageClassList is a collection of storage classes.
218message StorageClassList {
219 // Standard list metadata
220 // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
221 // +optional
222 optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
223
224 // Items is the list of StorageClasses
225 repeated StorageClass items = 2;
226}
227
228// VolumeAttachment captures the intent to attach or detach the specified volume
229// to/from the specified node.
230//
231// VolumeAttachment objects are non-namespaced.
232message VolumeAttachment {
233 // Standard object metadata.
234 // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
235 // +optional
236 optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
237
238 // Specification of the desired attach/detach volume behavior.
239 // Populated by the Kubernetes system.
240 optional VolumeAttachmentSpec spec = 2;
241
242 // Status of the VolumeAttachment request.
243 // Populated by the entity completing the attach or detach
244 // operation, i.e. the external-attacher.
245 // +optional
246 optional VolumeAttachmentStatus status = 3;
247}
248
249// VolumeAttachmentList is a collection of VolumeAttachment objects.
250message VolumeAttachmentList {
251 // Standard list metadata
252 // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
253 // +optional
254 optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
255
256 // Items is the list of VolumeAttachments
257 repeated VolumeAttachment items = 2;
258}
259
260// VolumeAttachmentSource represents a volume that should be attached.
261// Right now only PersistenVolumes can be attached via external attacher,
262// in future we may allow also inline volumes in pods.
263// Exactly one member can be set.
264message VolumeAttachmentSource {
265 // Name of the persistent volume to attach.
266 // +optional
267 optional string persistentVolumeName = 1;
268
269 // inlineVolumeSpec contains all the information necessary to attach
270 // a persistent volume defined by a pod's inline VolumeSource. This field
271 // is populated only for the CSIMigration feature. It contains
272 // translated fields from a pod's inline VolumeSource to a
273 // PersistentVolumeSpec. This field is alpha-level and is only
274 // honored by servers that enabled the CSIMigration feature.
275 // +optional
276 optional k8s.io.api.core.v1.PersistentVolumeSpec inlineVolumeSpec = 2;
277}
278
279// VolumeAttachmentSpec is the specification of a VolumeAttachment request.
280message VolumeAttachmentSpec {
281 // Attacher indicates the name of the volume driver that MUST handle this
282 // request. This is the name returned by GetPluginName().
283 optional string attacher = 1;
284
285 // Source represents the volume that should be attached.
286 optional VolumeAttachmentSource source = 2;
287
288 // The node that the volume should be attached to.
289 optional string nodeName = 3;
290}
291
292// VolumeAttachmentStatus is the status of a VolumeAttachment request.
293message VolumeAttachmentStatus {
294 // Indicates the volume is successfully attached.
295 // This field must only be set by the entity completing the attach
296 // operation, i.e. the external-attacher.
297 optional bool attached = 1;
298
299 // Upon successful attach, this field is populated with any
300 // information returned by the attach operation that must be passed
301 // into subsequent WaitForAttach or Mount calls.
302 // This field must only be set by the entity completing the attach
303 // operation, i.e. the external-attacher.
304 // +optional
305 map<string, string> attachmentMetadata = 2;
306
307 // The last error encountered during attach operation, if any.
308 // This field must only be set by the entity completing the attach
309 // operation, i.e. the external-attacher.
310 // +optional
311 optional VolumeError attachError = 3;
312
313 // The last error encountered during detach operation, if any.
314 // This field must only be set by the entity completing the detach
315 // operation, i.e. the external-attacher.
316 // +optional
317 optional VolumeError detachError = 4;
318}
319
320// VolumeError captures an error encountered during a volume operation.
321message VolumeError {
322 // Time the error was encountered.
323 // +optional
324 optional k8s.io.apimachinery.pkg.apis.meta.v1.Time time = 1;
325
326 // String detailing the error encountered during Attach or Detach operation.
327 // This string may be logged, so it should not contain sensitive
328 // information.
329 // +optional
330 optional string message = 2;
331}
332