generated.proto 17 KB

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