generated.proto 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463
  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. //
  62. // This field is immutable.
  63. //
  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" if 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. //
  91. // This field is immutable.
  92. //
  93. // +optional
  94. optional bool podInfoOnMount = 2;
  95. // volumeLifecycleModes defines what kind of volumes this CSI volume driver supports.
  96. // The default if the list is empty is "Persistent", which is the usage
  97. // defined by the CSI specification and implemented in Kubernetes via the usual
  98. // PV/PVC mechanism.
  99. // The other mode is "Ephemeral". In this mode, volumes are defined inline
  100. // inside the pod spec with CSIVolumeSource and their lifecycle is tied to
  101. // the lifecycle of that pod. A driver has to be aware of this
  102. // because it is only going to get a NodePublishVolume call for such a volume.
  103. // For more information about implementing this mode, see
  104. // https://kubernetes-csi.github.io/docs/ephemeral-local-volumes.html
  105. // A driver can support one or more of these modes and
  106. // more modes may be added in the future.
  107. // This field is beta.
  108. //
  109. // This field is immutable.
  110. //
  111. // +optional
  112. // +listType=set
  113. repeated string volumeLifecycleModes = 3;
  114. // If set to true, storageCapacity indicates that the CSI
  115. // volume driver wants pod scheduling to consider the storage
  116. // capacity that the driver deployment will report by creating
  117. // CSIStorageCapacity objects with capacity information.
  118. //
  119. // The check can be enabled immediately when deploying a driver.
  120. // In that case, provisioning new volumes with late binding
  121. // will pause until the driver deployment has published
  122. // some suitable CSIStorageCapacity object.
  123. //
  124. // Alternatively, the driver can be deployed with the field
  125. // unset or false and it can be flipped later when storage
  126. // capacity information has been published.
  127. //
  128. // This field is immutable.
  129. //
  130. // This is a beta field and only available when the CSIStorageCapacity
  131. // feature is enabled. The default is false.
  132. //
  133. // +optional
  134. // +featureGate=CSIStorageCapacity
  135. optional bool storageCapacity = 4;
  136. // Defines if the underlying volume supports changing ownership and
  137. // permission of the volume before being mounted.
  138. // Refer to the specific FSGroupPolicy values for additional details.
  139. // This field is alpha-level, and is only honored by servers
  140. // that enable the CSIVolumeFSGroupPolicy feature gate.
  141. //
  142. // This field is immutable.
  143. //
  144. // +optional
  145. optional string fsGroupPolicy = 5;
  146. // TokenRequests indicates the CSI driver needs pods' service account
  147. // tokens it is mounting volume for to do necessary authentication. Kubelet
  148. // will pass the tokens in VolumeContext in the CSI NodePublishVolume calls.
  149. // The CSI driver should parse and validate the following VolumeContext:
  150. // "csi.storage.k8s.io/serviceAccount.tokens": {
  151. // "<audience>": {
  152. // "token": <token>,
  153. // "expirationTimestamp": <expiration timestamp in RFC3339>,
  154. // },
  155. // ...
  156. // }
  157. //
  158. // Note: Audience in each TokenRequest should be different and at
  159. // most one token is empty string. To receive a new token after expiry,
  160. // RequiresRepublish can be used to trigger NodePublishVolume periodically.
  161. //
  162. // This is a beta feature and only available when the
  163. // CSIServiceAccountToken feature is enabled.
  164. //
  165. // +optional
  166. // +listType=atomic
  167. repeated TokenRequest tokenRequests = 6;
  168. // RequiresRepublish indicates the CSI driver wants `NodePublishVolume`
  169. // being periodically called to reflect any possible change in the mounted
  170. // volume. This field defaults to false.
  171. //
  172. // Note: After a successful initial NodePublishVolume call, subsequent calls
  173. // to NodePublishVolume should only update the contents of the volume. New
  174. // mount points will not be seen by a running container.
  175. //
  176. // This is a beta feature and only available when the
  177. // CSIServiceAccountToken feature is enabled.
  178. //
  179. // +optional
  180. optional bool requiresRepublish = 7;
  181. }
  182. // CSINode holds information about all CSI drivers installed on a node.
  183. // CSI drivers do not need to create the CSINode object directly. As long as
  184. // they use the node-driver-registrar sidecar container, the kubelet will
  185. // automatically populate the CSINode object for the CSI driver as part of
  186. // kubelet plugin registration.
  187. // CSINode has the same name as a node. If the object is missing, it means either
  188. // there are no CSI Drivers available on the node, or the Kubelet version is low
  189. // enough that it doesn't create this object.
  190. // CSINode has an OwnerReference that points to the corresponding node object.
  191. message CSINode {
  192. // metadata.name must be the Kubernetes node name.
  193. optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
  194. // spec is the specification of CSINode
  195. optional CSINodeSpec spec = 2;
  196. }
  197. // CSINodeDriver holds information about the specification of one CSI driver installed on a node
  198. message CSINodeDriver {
  199. // This is the name of the CSI driver that this object refers to.
  200. // This MUST be the same name returned by the CSI GetPluginName() call for
  201. // that driver.
  202. optional string name = 1;
  203. // nodeID of the node from the driver point of view.
  204. // This field enables Kubernetes to communicate with storage systems that do
  205. // not share the same nomenclature for nodes. For example, Kubernetes may
  206. // refer to a given node as "node1", but the storage system may refer to
  207. // the same node as "nodeA". When Kubernetes issues a command to the storage
  208. // system to attach a volume to a specific node, it can use this field to
  209. // refer to the node name using the ID that the storage system will
  210. // understand, e.g. "nodeA" instead of "node1". This field is required.
  211. optional string nodeID = 2;
  212. // topologyKeys is the list of keys supported by the driver.
  213. // When a driver is initialized on a cluster, it provides a set of topology
  214. // keys that it understands (e.g. "company.com/zone", "company.com/region").
  215. // When a driver is initialized on a node, it provides the same topology keys
  216. // along with values. Kubelet will expose these topology keys as labels
  217. // on its own node object.
  218. // When Kubernetes does topology aware provisioning, it can use this list to
  219. // determine which labels it should retrieve from the node object and pass
  220. // back to the driver.
  221. // It is possible for different nodes to use different topology keys.
  222. // This can be empty if driver does not support topology.
  223. // +optional
  224. repeated string topologyKeys = 3;
  225. // allocatable represents the volume resources of a node that are available for scheduling.
  226. // This field is beta.
  227. // +optional
  228. optional VolumeNodeResources allocatable = 4;
  229. }
  230. // CSINodeList is a collection of CSINode objects.
  231. message CSINodeList {
  232. // Standard list metadata
  233. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
  234. // +optional
  235. optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
  236. // items is the list of CSINode
  237. repeated CSINode items = 2;
  238. }
  239. // CSINodeSpec holds information about the specification of all CSI drivers installed on a node
  240. message CSINodeSpec {
  241. // drivers is a list of information of all CSI Drivers existing on a node.
  242. // If all drivers in the list are uninstalled, this can become empty.
  243. // +patchMergeKey=name
  244. // +patchStrategy=merge
  245. repeated CSINodeDriver drivers = 1;
  246. }
  247. // StorageClass describes the parameters for a class of storage for
  248. // which PersistentVolumes can be dynamically provisioned.
  249. //
  250. // StorageClasses are non-namespaced; the name of the storage class
  251. // according to etcd is in ObjectMeta.Name.
  252. message StorageClass {
  253. // Standard object's 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. // Provisioner indicates the type of the provisioner.
  258. optional string provisioner = 2;
  259. // Parameters holds the parameters for the provisioner that should
  260. // create volumes of this storage class.
  261. // +optional
  262. map<string, string> parameters = 3;
  263. // Dynamically provisioned PersistentVolumes of this storage class are
  264. // created with this reclaimPolicy. Defaults to Delete.
  265. // +optional
  266. optional string reclaimPolicy = 4;
  267. // Dynamically provisioned PersistentVolumes of this storage class are
  268. // created with these mountOptions, e.g. ["ro", "soft"]. Not validated -
  269. // mount of the PVs will simply fail if one is invalid.
  270. // +optional
  271. repeated string mountOptions = 5;
  272. // AllowVolumeExpansion shows whether the storage class allow volume expand
  273. // +optional
  274. optional bool allowVolumeExpansion = 6;
  275. // VolumeBindingMode indicates how PersistentVolumeClaims should be
  276. // provisioned and bound. When unset, VolumeBindingImmediate is used.
  277. // This field is only honored by servers that enable the VolumeScheduling feature.
  278. // +optional
  279. optional string volumeBindingMode = 7;
  280. // Restrict the node topologies where volumes can be dynamically provisioned.
  281. // Each volume plugin defines its own supported topology specifications.
  282. // An empty TopologySelectorTerm list means there is no topology restriction.
  283. // This field is only honored by servers that enable the VolumeScheduling feature.
  284. // +optional
  285. repeated k8s.io.api.core.v1.TopologySelectorTerm allowedTopologies = 8;
  286. }
  287. // StorageClassList is a collection of storage classes.
  288. message StorageClassList {
  289. // Standard list metadata
  290. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
  291. // +optional
  292. optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
  293. // Items is the list of StorageClasses
  294. repeated StorageClass items = 2;
  295. }
  296. // TokenRequest contains parameters of a service account token.
  297. message TokenRequest {
  298. // Audience is the intended audience of the token in "TokenRequestSpec".
  299. // It will default to the audiences of kube apiserver.
  300. optional string audience = 1;
  301. // ExpirationSeconds is the duration of validity of the token in "TokenRequestSpec".
  302. // It has the same default value of "ExpirationSeconds" in "TokenRequestSpec".
  303. //
  304. // +optional
  305. optional int64 expirationSeconds = 2;
  306. }
  307. // VolumeAttachment captures the intent to attach or detach the specified volume
  308. // to/from the specified node.
  309. //
  310. // VolumeAttachment objects are non-namespaced.
  311. message VolumeAttachment {
  312. // Standard object metadata.
  313. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
  314. // +optional
  315. optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
  316. // Specification of the desired attach/detach volume behavior.
  317. // Populated by the Kubernetes system.
  318. optional VolumeAttachmentSpec spec = 2;
  319. // Status of the VolumeAttachment request.
  320. // Populated by the entity completing the attach or detach
  321. // operation, i.e. the external-attacher.
  322. // +optional
  323. optional VolumeAttachmentStatus status = 3;
  324. }
  325. // VolumeAttachmentList is a collection of VolumeAttachment objects.
  326. message VolumeAttachmentList {
  327. // Standard list metadata
  328. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
  329. // +optional
  330. optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
  331. // Items is the list of VolumeAttachments
  332. repeated VolumeAttachment items = 2;
  333. }
  334. // VolumeAttachmentSource represents a volume that should be attached.
  335. // Right now only PersistenVolumes can be attached via external attacher,
  336. // in future we may allow also inline volumes in pods.
  337. // Exactly one member can be set.
  338. message VolumeAttachmentSource {
  339. // Name of the persistent volume to attach.
  340. // +optional
  341. optional string persistentVolumeName = 1;
  342. // inlineVolumeSpec contains all the information necessary to attach
  343. // a persistent volume defined by a pod's inline VolumeSource. This field
  344. // is populated only for the CSIMigration feature. It contains
  345. // translated fields from a pod's inline VolumeSource to a
  346. // PersistentVolumeSpec. This field is beta-level and is only
  347. // honored by servers that enabled the CSIMigration feature.
  348. // +optional
  349. optional k8s.io.api.core.v1.PersistentVolumeSpec inlineVolumeSpec = 2;
  350. }
  351. // VolumeAttachmentSpec is the specification of a VolumeAttachment request.
  352. message VolumeAttachmentSpec {
  353. // Attacher indicates the name of the volume driver that MUST handle this
  354. // request. This is the name returned by GetPluginName().
  355. optional string attacher = 1;
  356. // Source represents the volume that should be attached.
  357. optional VolumeAttachmentSource source = 2;
  358. // The node that the volume should be attached to.
  359. optional string nodeName = 3;
  360. }
  361. // VolumeAttachmentStatus is the status of a VolumeAttachment request.
  362. message VolumeAttachmentStatus {
  363. // Indicates the volume is successfully attached.
  364. // This field must only be set by the entity completing the attach
  365. // operation, i.e. the external-attacher.
  366. optional bool attached = 1;
  367. // Upon successful attach, this field is populated with any
  368. // information returned by the attach operation that must be passed
  369. // into subsequent WaitForAttach or Mount calls.
  370. // This field must only be set by the entity completing the attach
  371. // operation, i.e. the external-attacher.
  372. // +optional
  373. map<string, string> attachmentMetadata = 2;
  374. // The last error encountered during attach operation, if any.
  375. // This field must only be set by the entity completing the attach
  376. // operation, i.e. the external-attacher.
  377. // +optional
  378. optional VolumeError attachError = 3;
  379. // The last error encountered during detach operation, if any.
  380. // This field must only be set by the entity completing the detach
  381. // operation, i.e. the external-attacher.
  382. // +optional
  383. optional VolumeError detachError = 4;
  384. }
  385. // VolumeError captures an error encountered during a volume operation.
  386. message VolumeError {
  387. // Time the error was encountered.
  388. // +optional
  389. optional k8s.io.apimachinery.pkg.apis.meta.v1.Time time = 1;
  390. // String detailing the error encountered during Attach or Detach operation.
  391. // This string may be logged, so it should not contain sensitive
  392. // information.
  393. // +optional
  394. optional string message = 2;
  395. }
  396. // VolumeNodeResources is a set of resource limits for scheduling of volumes.
  397. message VolumeNodeResources {
  398. // Maximum number of unique volumes managed by the CSI driver that can be used on a node.
  399. // A volume that is both attached and mounted on a node is considered to be used once, not twice.
  400. // The same rule applies for a unique volume that is shared among multiple pods on the same node.
  401. // If this field is not specified, then the supported number of volumes on this node is unbounded.
  402. // +optional
  403. optional int32 count = 1;
  404. }