generated.proto 12 KB

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