...
1/*
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.v1alpha1;
23
24import "k8s.io/api/core/v1/generated.proto";
25import "k8s.io/apimachinery/pkg/api/resource/generated.proto";
26import "k8s.io/apimachinery/pkg/apis/meta/v1/generated.proto";
27import "k8s.io/apimachinery/pkg/runtime/generated.proto";
28import "k8s.io/apimachinery/pkg/runtime/schema/generated.proto";
29
30// Package-wide variables from generator "generated".
31option go_package = "k8s.io/api/storage/v1alpha1";
32
33// CSIStorageCapacity stores the result of one CSI GetCapacity call.
34// For a given StorageClass, this describes the available capacity in a
35// particular topology segment. This can be used when considering where to
36// instantiate new PersistentVolumes.
37//
38// For example this can express things like:
39// - StorageClass "standard" has "1234 GiB" available in "topology.kubernetes.io/zone=us-east1"
40// - StorageClass "localssd" has "10 GiB" available in "kubernetes.io/hostname=knode-abc123"
41//
42// The following three cases all imply that no capacity is available for
43// a certain combination:
44// - no object exists with suitable topology and storage class name
45// - such an object exists, but the capacity is unset
46// - such an object exists, but the capacity is zero
47//
48// The producer of these objects can decide which approach is more suitable.
49//
50// They are consumed by the kube-scheduler when a CSI driver opts into
51// capacity-aware scheduling with CSIDriverSpec.StorageCapacity. The scheduler
52// compares the MaximumVolumeSize against the requested size of pending volumes
53// to filter out unsuitable nodes. If MaximumVolumeSize is unset, it falls back
54// to a comparison against the less precise Capacity. If that is also unset,
55// the scheduler assumes that capacity is insufficient and tries some other
56// node.
57message CSIStorageCapacity {
58 // Standard object's metadata. The name has no particular meaning. It must be
59 // be a DNS subdomain (dots allowed, 253 characters). To ensure that
60 // there are no conflicts with other CSI drivers on the cluster, the recommendation
61 // is to use csisc-<uuid>, a generated name, or a reverse-domain name which ends
62 // with the unique CSI driver name.
63 //
64 // Objects are namespaced.
65 //
66 // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
67 // +optional
68 optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
69
70 // nodeTopology defines which nodes have access to the storage
71 // for which capacity was reported. If not set, the storage is
72 // not accessible from any node in the cluster. If empty, the
73 // storage is accessible from all nodes. This field is
74 // immutable.
75 //
76 // +optional
77 optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector nodeTopology = 2;
78
79 // storageClassName represents the name of the StorageClass that the reported capacity applies to.
80 // It must meet the same requirements as the name of a StorageClass
81 // object (non-empty, DNS subdomain). If that object no longer exists,
82 // the CSIStorageCapacity object is obsolete and should be removed by its
83 // creator.
84 // This field is immutable.
85 optional string storageClassName = 3;
86
87 // capacity is the value reported by the CSI driver in its GetCapacityResponse
88 // for a GetCapacityRequest with topology and parameters that match the
89 // previous fields.
90 //
91 // The semantic is currently (CSI spec 1.2) defined as:
92 // The available capacity, in bytes, of the storage that can be used
93 // to provision volumes. If not set, that information is currently
94 // unavailable.
95 //
96 // +optional
97 optional k8s.io.apimachinery.pkg.api.resource.Quantity capacity = 4;
98
99 // maximumVolumeSize is the value reported by the CSI driver in its GetCapacityResponse
100 // for a GetCapacityRequest with topology and parameters that match the
101 // previous fields.
102 //
103 // This is defined since CSI spec 1.4.0 as the largest size
104 // that may be used in a
105 // CreateVolumeRequest.capacity_range.required_bytes field to
106 // create a volume with the same parameters as those in
107 // GetCapacityRequest. The corresponding value in the Kubernetes
108 // API is ResourceRequirements.Requests in a volume claim.
109 //
110 // +optional
111 optional k8s.io.apimachinery.pkg.api.resource.Quantity maximumVolumeSize = 5;
112}
113
114// CSIStorageCapacityList is a collection of CSIStorageCapacity objects.
115message CSIStorageCapacityList {
116 // Standard list metadata
117 // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
118 // +optional
119 optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
120
121 // items is the list of CSIStorageCapacity objects.
122 repeated CSIStorageCapacity items = 2;
123}
124
125// VolumeAttachment captures the intent to attach or detach the specified volume
126// to/from the specified node.
127//
128// VolumeAttachment objects are non-namespaced.
129message VolumeAttachment {
130 // Standard object metadata.
131 // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
132 // +optional
133 optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
134
135 // spec represents specification of the desired attach/detach volume behavior.
136 // Populated by the Kubernetes system.
137 optional VolumeAttachmentSpec spec = 2;
138
139 // status represents status of the VolumeAttachment request.
140 // Populated by the entity completing the attach or detach
141 // operation, i.e. the external-attacher.
142 // +optional
143 optional VolumeAttachmentStatus status = 3;
144}
145
146// VolumeAttachmentList is a collection of VolumeAttachment objects.
147message VolumeAttachmentList {
148 // Standard list metadata
149 // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
150 // +optional
151 optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
152
153 // items is the list of VolumeAttachments
154 repeated VolumeAttachment items = 2;
155}
156
157// VolumeAttachmentSource represents a volume that should be attached.
158// Right now only PersistenVolumes can be attached via external attacher,
159// in future we may allow also inline volumes in pods.
160// Exactly one member can be set.
161message VolumeAttachmentSource {
162 // persistentVolumeName represents the name of the persistent volume to attach.
163 // +optional
164 optional string persistentVolumeName = 1;
165
166 // inlineVolumeSpec contains all the information necessary to attach
167 // a persistent volume defined by a pod's inline VolumeSource. This field
168 // is populated only for the CSIMigration feature. It contains
169 // translated fields from a pod's inline VolumeSource to a
170 // PersistentVolumeSpec. This field is alpha-level and is only
171 // honored by servers that enabled the CSIMigration feature.
172 // +optional
173 optional k8s.io.api.core.v1.PersistentVolumeSpec inlineVolumeSpec = 2;
174}
175
176// VolumeAttachmentSpec is the specification of a VolumeAttachment request.
177message VolumeAttachmentSpec {
178 // attacher indicates the name of the volume driver that MUST handle this
179 // request. This is the name returned by GetPluginName().
180 optional string attacher = 1;
181
182 // source represents the volume that should be attached.
183 optional VolumeAttachmentSource source = 2;
184
185 // nodeName represents the node that the volume should be attached to.
186 optional string nodeName = 3;
187}
188
189// VolumeAttachmentStatus is the status of a VolumeAttachment request.
190message VolumeAttachmentStatus {
191 // attached indicates the volume is successfully attached.
192 // This field must only be set by the entity completing the attach
193 // operation, i.e. the external-attacher.
194 optional bool attached = 1;
195
196 // attachmentMetadata is populated with any
197 // information returned by the attach operation, upon successful attach, that must be passed
198 // into subsequent WaitForAttach or Mount calls.
199 // This field must only be set by the entity completing the attach
200 // operation, i.e. the external-attacher.
201 // +optional
202 map<string, string> attachmentMetadata = 2;
203
204 // attachError represents the last error encountered during attach operation, if any.
205 // This field must only be set by the entity completing the attach
206 // operation, i.e. the external-attacher.
207 // +optional
208 optional VolumeError attachError = 3;
209
210 // detachError represents the last error encountered during detach operation, if any.
211 // This field must only be set by the entity completing the detach
212 // operation, i.e. the external-attacher.
213 // +optional
214 optional VolumeError detachError = 4;
215}
216
217// VolumeAttributesClass represents a specification of mutable volume attributes
218// defined by the CSI driver. The class can be specified during dynamic provisioning
219// of PersistentVolumeClaims, and changed in the PersistentVolumeClaim spec after provisioning.
220message VolumeAttributesClass {
221 // Standard object's metadata.
222 // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
223 // +optional
224 optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
225
226 // Name of the CSI driver
227 // This field is immutable.
228 optional string driverName = 2;
229
230 // parameters hold volume attributes defined by the CSI driver. These values
231 // are opaque to the Kubernetes and are passed directly to the CSI driver.
232 // The underlying storage provider supports changing these attributes on an
233 // existing volume, however the parameters field itself is immutable. To
234 // invoke a volume update, a new VolumeAttributesClass should be created with
235 // new parameters, and the PersistentVolumeClaim should be updated to reference
236 // the new VolumeAttributesClass.
237 //
238 // This field is required and must contain at least one key/value pair.
239 // The keys cannot be empty, and the maximum number of parameters is 512, with
240 // a cumulative max size of 256K. If the CSI driver rejects invalid parameters,
241 // the target PersistentVolumeClaim will be set to an "Infeasible" state in the
242 // modifyVolumeStatus field.
243 map<string, string> parameters = 3;
244}
245
246// VolumeAttributesClassList is a collection of VolumeAttributesClass objects.
247message VolumeAttributesClassList {
248 // Standard list metadata
249 // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
250 // +optional
251 optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
252
253 // items is the list of VolumeAttributesClass objects.
254 repeated VolumeAttributesClass items = 2;
255}
256
257// VolumeError captures an error encountered during a volume operation.
258message VolumeError {
259 // time represents the time the error was encountered.
260 // +optional
261 optional k8s.io.apimachinery.pkg.apis.meta.v1.Time time = 1;
262
263 // message represents the error encountered during Attach or Detach operation.
264 // This string maybe logged, so it should not contain sensitive
265 // information.
266 // +optional
267 optional string message = 2;
268}
269
View as plain text