generated.proto 17 KB

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