generated.proto 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231
  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. // +listType=map
  107. // +listMapKey=name
  108. repeated CSIStorageCapacity items = 2;
  109. }
  110. // VolumeAttachment captures the intent to attach or detach the specified volume
  111. // to/from the specified node.
  112. //
  113. // VolumeAttachment objects are non-namespaced.
  114. message VolumeAttachment {
  115. // Standard object metadata.
  116. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
  117. // +optional
  118. optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
  119. // spec represents specification of the desired attach/detach volume behavior.
  120. // Populated by the Kubernetes system.
  121. optional VolumeAttachmentSpec spec = 2;
  122. // status represents status of the VolumeAttachment request.
  123. // Populated by the entity completing the attach or detach
  124. // operation, i.e. the external-attacher.
  125. // +optional
  126. optional VolumeAttachmentStatus status = 3;
  127. }
  128. // VolumeAttachmentList is a collection of VolumeAttachment objects.
  129. message VolumeAttachmentList {
  130. // Standard list 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.ListMeta metadata = 1;
  134. // items is the list of VolumeAttachments
  135. repeated VolumeAttachment items = 2;
  136. }
  137. // VolumeAttachmentSource represents a volume that should be attached.
  138. // Right now only PersistenVolumes can be attached via external attacher,
  139. // in future we may allow also inline volumes in pods.
  140. // Exactly one member can be set.
  141. message VolumeAttachmentSource {
  142. // persistentVolumeName represents the name of the persistent volume to attach.
  143. // +optional
  144. optional string persistentVolumeName = 1;
  145. // inlineVolumeSpec contains all the information necessary to attach
  146. // a persistent volume defined by a pod's inline VolumeSource. This field
  147. // is populated only for the CSIMigration feature. It contains
  148. // translated fields from a pod's inline VolumeSource to a
  149. // PersistentVolumeSpec. This field is alpha-level and is only
  150. // honored by servers that enabled the CSIMigration feature.
  151. // +optional
  152. optional k8s.io.api.core.v1.PersistentVolumeSpec inlineVolumeSpec = 2;
  153. }
  154. // VolumeAttachmentSpec is the specification of a VolumeAttachment request.
  155. message VolumeAttachmentSpec {
  156. // attacher indicates the name of the volume driver that MUST handle this
  157. // request. This is the name returned by GetPluginName().
  158. optional string attacher = 1;
  159. // source represents the volume that should be attached.
  160. optional VolumeAttachmentSource source = 2;
  161. // nodeName represents the node that the volume should be attached to.
  162. optional string nodeName = 3;
  163. }
  164. // VolumeAttachmentStatus is the status of a VolumeAttachment request.
  165. message VolumeAttachmentStatus {
  166. // attached indicates the volume is successfully attached.
  167. // This field must only be set by the entity completing the attach
  168. // operation, i.e. the external-attacher.
  169. optional bool attached = 1;
  170. // attachmentMetadata is populated with any
  171. // information returned by the attach operation, upon successful attach, that must be passed
  172. // into subsequent WaitForAttach or Mount calls.
  173. // This field must only be set by the entity completing the attach
  174. // operation, i.e. the external-attacher.
  175. // +optional
  176. map<string, string> attachmentMetadata = 2;
  177. // attachError represents the last error encountered during attach operation, if any.
  178. // This field must only be set by the entity completing the attach
  179. // operation, i.e. the external-attacher.
  180. // +optional
  181. optional VolumeError attachError = 3;
  182. // detachError represents the last error encountered during detach operation, if any.
  183. // This field must only be set by the entity completing the detach
  184. // operation, i.e. the external-attacher.
  185. // +optional
  186. optional VolumeError detachError = 4;
  187. }
  188. // VolumeError captures an error encountered during a volume operation.
  189. message VolumeError {
  190. // time represents the time the error was encountered.
  191. // +optional
  192. optional k8s.io.apimachinery.pkg.apis.meta.v1.Time time = 1;
  193. // message represents the error encountered during Attach or Detach operation.
  194. // This string maybe logged, so it should not contain sensitive
  195. // information.
  196. // +optional
  197. optional string message = 2;
  198. }