generated.proto 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662
  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/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/v1";
  23. // CSIDriver captures information about a Container Storage Interface (CSI)
  24. // volume driver deployed on the cluster.
  25. // Kubernetes attach detach controller uses this object to determine whether attach is required.
  26. // Kubelet uses this object to determine whether pod information needs to be passed on mount.
  27. // CSIDriver objects are non-namespaced.
  28. message CSIDriver {
  29. // Standard object metadata.
  30. // metadata.Name indicates the name of the CSI driver that this object
  31. // refers to; it MUST be the same name returned by the CSI GetPluginName()
  32. // call for that driver.
  33. // The driver name must be 63 characters or less, beginning and ending with
  34. // an alphanumeric character ([a-z0-9A-Z]) with dashes (-), dots (.), and
  35. // alphanumerics between.
  36. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
  37. optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
  38. // spec represents the specification of the CSI Driver.
  39. optional CSIDriverSpec spec = 2;
  40. }
  41. // CSIDriverList is a collection of CSIDriver objects.
  42. message CSIDriverList {
  43. // Standard list metadata
  44. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
  45. // +optional
  46. optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
  47. // items is the list of CSIDriver
  48. repeated CSIDriver items = 2;
  49. }
  50. // CSIDriverSpec is the specification of a CSIDriver.
  51. message CSIDriverSpec {
  52. // attachRequired indicates this CSI volume driver requires an attach
  53. // operation (because it implements the CSI ControllerPublishVolume()
  54. // method), and that the Kubernetes attach detach controller should call
  55. // the attach volume interface which checks the volumeattachment status
  56. // and waits until the volume is attached before proceeding to mounting.
  57. // The CSI external-attacher coordinates with CSI volume driver and updates
  58. // the volumeattachment status when the attach operation is complete.
  59. // If the value is 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. // podInfoOnMount indicates this CSI volume driver requires additional pod information (like podName, podUID, etc.)
  67. // during mount operations, if set to true.
  68. // If set to false, pod information will not be passed on mount.
  69. // Default is false.
  70. //
  71. // The CSI driver specifies podInfoOnMount as part of driver deployment.
  72. // If true, Kubelet will pass pod information as VolumeContext in the CSI NodePublishVolume() calls.
  73. // The CSI driver is responsible for parsing and validating the information passed in as VolumeContext.
  74. //
  75. // The following VolumeContext will be passed if podInfoOnMount is set to true.
  76. // This list might grow, but the prefix will be used.
  77. // "csi.storage.k8s.io/pod.name": pod.Name
  78. // "csi.storage.k8s.io/pod.namespace": pod.Namespace
  79. // "csi.storage.k8s.io/pod.uid": string(pod.UID)
  80. // "csi.storage.k8s.io/ephemeral": "true" if the volume is an ephemeral inline volume
  81. // defined by a CSIVolumeSource, otherwise "false"
  82. //
  83. // "csi.storage.k8s.io/ephemeral" is a new feature in Kubernetes 1.16. It is only
  84. // required for drivers which support both the "Persistent" and "Ephemeral" VolumeLifecycleMode.
  85. // Other drivers can leave pod info disabled and/or ignore this field.
  86. // As Kubernetes 1.15 doesn't support this field, drivers can only support one mode when
  87. // deployed on such a cluster and the deployment determines which mode that is, for example
  88. // via a command line parameter of the driver.
  89. //
  90. // This field was immutable in Kubernetes < 1.29 and now is mutable.
  91. //
  92. // +optional
  93. optional bool podInfoOnMount = 2;
  94. // volumeLifecycleModes defines what kind of volumes this CSI volume driver supports.
  95. // The default if the list is empty is "Persistent", which is the usage defined by the
  96. // CSI specification and implemented in Kubernetes via the usual PV/PVC mechanism.
  97. //
  98. // The other mode is "Ephemeral". In this mode, volumes are defined inline inside the pod spec
  99. // with CSIVolumeSource and their lifecycle is tied to the lifecycle of that pod.
  100. // A driver has to be aware of this because it is only going to get a NodePublishVolume call for such a volume.
  101. //
  102. // For more information about implementing this mode, see
  103. // https://kubernetes-csi.github.io/docs/ephemeral-local-volumes.html
  104. // A driver can support one or more of these modes and more modes may be added in the future.
  105. //
  106. // This field is beta.
  107. // This field is immutable.
  108. //
  109. // +optional
  110. // +listType=set
  111. repeated string volumeLifecycleModes = 3;
  112. // storageCapacity indicates that the CSI volume driver wants pod scheduling to consider the storage
  113. // capacity that the driver deployment will report by creating
  114. // CSIStorageCapacity objects with capacity information, if set to true.
  115. //
  116. // The check can be enabled immediately when deploying a driver.
  117. // In that case, provisioning new volumes with late binding
  118. // will pause until the driver deployment has published
  119. // some suitable CSIStorageCapacity object.
  120. //
  121. // Alternatively, the driver can be deployed with the field
  122. // unset or false and it can be flipped later when storage
  123. // capacity information has been published.
  124. //
  125. // This field was immutable in Kubernetes <= 1.22 and now is mutable.
  126. //
  127. // +optional
  128. // +featureGate=CSIStorageCapacity
  129. optional bool storageCapacity = 4;
  130. // fsGroupPolicy defines if the underlying volume supports changing ownership and
  131. // permission of the volume before being mounted.
  132. // Refer to the specific FSGroupPolicy values for additional details.
  133. //
  134. // This field was immutable in Kubernetes < 1.29 and now is mutable.
  135. //
  136. // Defaults to ReadWriteOnceWithFSType, which will examine each volume
  137. // to determine if Kubernetes should modify ownership and permissions of the volume.
  138. // With the default policy the defined fsGroup will only be applied
  139. // if a fstype is defined and the volume's access mode contains ReadWriteOnce.
  140. //
  141. // +optional
  142. optional string fsGroupPolicy = 5;
  143. // tokenRequests indicates the CSI driver needs pods' service account
  144. // tokens it is mounting volume for to do necessary authentication. Kubelet
  145. // will pass the tokens in VolumeContext in the CSI NodePublishVolume calls.
  146. // The CSI driver should parse and validate the following VolumeContext:
  147. // "csi.storage.k8s.io/serviceAccount.tokens": {
  148. // "<audience>": {
  149. // "token": <token>,
  150. // "expirationTimestamp": <expiration timestamp in RFC3339>,
  151. // },
  152. // ...
  153. // }
  154. //
  155. // Note: Audience in each TokenRequest should be different and at
  156. // most one token is empty string. To receive a new token after expiry,
  157. // RequiresRepublish can be used to trigger NodePublishVolume periodically.
  158. //
  159. // +optional
  160. // +listType=atomic
  161. repeated TokenRequest tokenRequests = 6;
  162. // requiresRepublish indicates the CSI driver wants `NodePublishVolume`
  163. // being periodically called to reflect any possible change in the mounted
  164. // volume. This field defaults to false.
  165. //
  166. // Note: After a successful initial NodePublishVolume call, subsequent calls
  167. // to NodePublishVolume should only update the contents of the volume. New
  168. // mount points will not be seen by a running container.
  169. //
  170. // +optional
  171. optional bool requiresRepublish = 7;
  172. // seLinuxMount specifies if the CSI driver supports "-o context"
  173. // mount option.
  174. //
  175. // When "true", the CSI driver must ensure that all volumes provided by this CSI
  176. // driver can be mounted separately with different `-o context` options. This is
  177. // typical for storage backends that provide volumes as filesystems on block
  178. // devices or as independent shared volumes.
  179. // Kubernetes will call NodeStage / NodePublish with "-o context=xyz" mount
  180. // option when mounting a ReadWriteOncePod volume used in Pod that has
  181. // explicitly set SELinux context. In the future, it may be expanded to other
  182. // volume AccessModes. In any case, Kubernetes will ensure that the volume is
  183. // mounted only with a single SELinux context.
  184. //
  185. // When "false", Kubernetes won't pass any special SELinux mount options to the driver.
  186. // This is typical for volumes that represent subdirectories of a bigger shared filesystem.
  187. //
  188. // Default is "false".
  189. //
  190. // +featureGate=SELinuxMountReadWriteOncePod
  191. // +optional
  192. optional bool seLinuxMount = 8;
  193. // nodeAllocatableUpdatePeriodSeconds specifies the interval between periodic updates of
  194. // the CSINode allocatable capacity for this driver. When set, both periodic updates and
  195. // updates triggered by capacity-related failures are enabled. If not set, no updates
  196. // occur (neither periodic nor upon detecting capacity-related failures), and the
  197. // allocatable.count remains static. The minimum allowed value for this field is 10 seconds.
  198. //
  199. // This is a beta feature and requires the MutableCSINodeAllocatableCount feature gate to be enabled.
  200. //
  201. // This field is mutable.
  202. //
  203. // +featureGate=MutableCSINodeAllocatableCount
  204. // +optional
  205. optional int64 nodeAllocatableUpdatePeriodSeconds = 9;
  206. // serviceAccountTokenInSecrets is an opt-in for CSI drivers to indicate that
  207. // service account tokens should be passed via the Secrets field in NodePublishVolumeRequest
  208. // instead of the VolumeContext field. The CSI specification provides a dedicated Secrets
  209. // field for sensitive information like tokens, which is the appropriate mechanism for
  210. // handling credentials. This addresses security concerns where sensitive tokens were being
  211. // logged as part of volume context.
  212. //
  213. // When "true", kubelet will pass the tokens only in the Secrets field with the key
  214. // "csi.storage.k8s.io/serviceAccount.tokens". The CSI driver must be updated to read
  215. // tokens from the Secrets field instead of VolumeContext.
  216. //
  217. // When "false" or not set, kubelet will pass the tokens in VolumeContext with the key
  218. // "csi.storage.k8s.io/serviceAccount.tokens" (existing behavior). This maintains backward
  219. // compatibility with existing CSI drivers.
  220. //
  221. // This field can only be set when TokenRequests is configured. The API server will reject
  222. // CSIDriver specs that set this field without TokenRequests.
  223. //
  224. // Default behavior if unset is to pass tokens in the VolumeContext field.
  225. //
  226. // +featureGate=CSIServiceAccountTokenSecrets
  227. // +optional
  228. optional bool serviceAccountTokenInSecrets = 10;
  229. }
  230. // CSINode holds information about all CSI drivers installed on a node.
  231. // CSI drivers do not need to create the CSINode object directly. As long as
  232. // they use the node-driver-registrar sidecar container, the kubelet will
  233. // automatically populate the CSINode object for the CSI driver as part of
  234. // kubelet plugin registration.
  235. // CSINode has the same name as a node. If the object is missing, it means either
  236. // there are no CSI Drivers available on the node, or the Kubelet version is low
  237. // enough that it doesn't create this object.
  238. // CSINode has an OwnerReference that points to the corresponding node object.
  239. message CSINode {
  240. // Standard object's metadata.
  241. // metadata.name must be the Kubernetes node name.
  242. optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
  243. // spec is the specification of CSINode
  244. optional CSINodeSpec spec = 2;
  245. }
  246. // CSINodeDriver holds information about the specification of one CSI driver installed on a node
  247. message CSINodeDriver {
  248. // name represents the name of the CSI driver that this object refers to.
  249. // This MUST be the same name returned by the CSI GetPluginName() call for
  250. // that driver.
  251. optional string name = 1;
  252. // nodeID of the node from the driver point of view.
  253. // This field enables Kubernetes to communicate with storage systems that do
  254. // not share the same nomenclature for nodes. For example, Kubernetes may
  255. // refer to a given node as "node1", but the storage system may refer to
  256. // the same node as "nodeA". When Kubernetes issues a command to the storage
  257. // system to attach a volume to a specific node, it can use this field to
  258. // refer to the node name using the ID that the storage system will
  259. // understand, e.g. "nodeA" instead of "node1". This field is required.
  260. optional string nodeID = 2;
  261. // topologyKeys is the list of keys supported by the driver.
  262. // When a driver is initialized on a cluster, it provides a set of topology
  263. // keys that it understands (e.g. "company.com/zone", "company.com/region").
  264. // When a driver is initialized on a node, it provides the same topology keys
  265. // along with values. Kubelet will expose these topology keys as labels
  266. // on its own node object.
  267. // When Kubernetes does topology aware provisioning, it can use this list to
  268. // determine which labels it should retrieve from the node object and pass
  269. // back to the driver.
  270. // It is possible for different nodes to use different topology keys.
  271. // This can be empty if driver does not support topology.
  272. // +optional
  273. // +listType=atomic
  274. repeated string topologyKeys = 3;
  275. // allocatable represents the volume resources of a node that are available for scheduling.
  276. // This field is beta.
  277. // +optional
  278. optional VolumeNodeResources allocatable = 4;
  279. }
  280. // CSINodeList is a collection of CSINode objects.
  281. message CSINodeList {
  282. // Standard list metadata
  283. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
  284. // +optional
  285. optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
  286. // items is the list of CSINode
  287. repeated CSINode items = 2;
  288. }
  289. // CSINodeSpec holds information about the specification of all CSI drivers installed on a node
  290. message CSINodeSpec {
  291. // drivers is a list of information of all CSI Drivers existing on a node.
  292. // If all drivers in the list are uninstalled, this can become empty.
  293. // +patchMergeKey=name
  294. // +patchStrategy=merge
  295. // +listType=map
  296. // +listMapKey=name
  297. repeated CSINodeDriver drivers = 1;
  298. }
  299. // CSIStorageCapacity stores the result of one CSI GetCapacity call.
  300. // For a given StorageClass, this describes the available capacity in a
  301. // particular topology segment. This can be used when considering where to
  302. // instantiate new PersistentVolumes.
  303. //
  304. // For example this can express things like:
  305. // - StorageClass "standard" has "1234 GiB" available in "topology.kubernetes.io/zone=us-east1"
  306. // - StorageClass "localssd" has "10 GiB" available in "kubernetes.io/hostname=knode-abc123"
  307. //
  308. // The following three cases all imply that no capacity is available for
  309. // a certain combination:
  310. // - no object exists with suitable topology and storage class name
  311. // - such an object exists, but the capacity is unset
  312. // - such an object exists, but the capacity is zero
  313. //
  314. // The producer of these objects can decide which approach is more suitable.
  315. //
  316. // They are consumed by the kube-scheduler when a CSI driver opts into
  317. // capacity-aware scheduling with CSIDriverSpec.StorageCapacity. The scheduler
  318. // compares the MaximumVolumeSize against the requested size of pending volumes
  319. // to filter out unsuitable nodes. If MaximumVolumeSize is unset, it falls back
  320. // to a comparison against the less precise Capacity. If that is also unset,
  321. // the scheduler assumes that capacity is insufficient and tries some other
  322. // node.
  323. message CSIStorageCapacity {
  324. // Standard object's metadata.
  325. // The name has no particular meaning. It must be a DNS subdomain (dots allowed, 253 characters).
  326. // To ensure that there are no conflicts with other CSI drivers on the cluster,
  327. // the recommendation is to use csisc-<uuid>, a generated name, or a reverse-domain name
  328. // which ends with the unique CSI driver name.
  329. //
  330. // Objects are namespaced.
  331. //
  332. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
  333. // +optional
  334. optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
  335. // nodeTopology defines which nodes have access to the storage
  336. // for which capacity was reported. If not set, the storage is
  337. // not accessible from any node in the cluster. If empty, the
  338. // storage is accessible from all nodes. This field is
  339. // immutable.
  340. //
  341. // +optional
  342. optional .k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector nodeTopology = 2;
  343. // storageClassName represents the name of the StorageClass that the reported capacity applies to.
  344. // It must meet the same requirements as the name of a StorageClass
  345. // object (non-empty, DNS subdomain). If that object no longer exists,
  346. // the CSIStorageCapacity object is obsolete and should be removed by its
  347. // creator.
  348. // This field is immutable.
  349. optional string storageClassName = 3;
  350. // capacity is the value reported by the CSI driver in its GetCapacityResponse
  351. // for a GetCapacityRequest with topology and parameters that match the
  352. // previous fields.
  353. //
  354. // The semantic is currently (CSI spec 1.2) defined as:
  355. // The available capacity, in bytes, of the storage that can be used
  356. // to provision volumes. If not set, that information is currently
  357. // unavailable.
  358. //
  359. // +optional
  360. optional .k8s.io.apimachinery.pkg.api.resource.Quantity capacity = 4;
  361. // maximumVolumeSize is the value reported by the CSI driver in its GetCapacityResponse
  362. // for a GetCapacityRequest with topology and parameters that match the
  363. // previous fields.
  364. //
  365. // This is defined since CSI spec 1.4.0 as the largest size
  366. // that may be used in a
  367. // CreateVolumeRequest.capacity_range.required_bytes field to
  368. // create a volume with the same parameters as those in
  369. // GetCapacityRequest. The corresponding value in the Kubernetes
  370. // API is ResourceRequirements.Requests in a volume claim.
  371. //
  372. // +optional
  373. optional .k8s.io.apimachinery.pkg.api.resource.Quantity maximumVolumeSize = 5;
  374. }
  375. // CSIStorageCapacityList is a collection of CSIStorageCapacity objects.
  376. message CSIStorageCapacityList {
  377. // Standard list metadata
  378. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
  379. // +optional
  380. optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
  381. // items is the list of CSIStorageCapacity objects.
  382. repeated CSIStorageCapacity items = 2;
  383. }
  384. // StorageClass describes the parameters for a class of storage for
  385. // which PersistentVolumes can be dynamically provisioned.
  386. //
  387. // StorageClasses are non-namespaced; the name of the storage class
  388. // according to etcd is in ObjectMeta.Name.
  389. message StorageClass {
  390. // Standard object's metadata.
  391. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
  392. // +optional
  393. optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
  394. // provisioner indicates the type of the provisioner.
  395. // +required
  396. // +k8s:required
  397. optional string provisioner = 2;
  398. // parameters holds the parameters for the provisioner that should
  399. // create volumes of this storage class.
  400. // +optional
  401. map<string, string> parameters = 3;
  402. // reclaimPolicy controls the reclaimPolicy for dynamically provisioned PersistentVolumes of this storage class.
  403. // Defaults to Delete.
  404. // +optional
  405. optional string reclaimPolicy = 4;
  406. // mountOptions controls the mountOptions for dynamically provisioned PersistentVolumes of this storage class.
  407. // e.g. ["ro", "soft"]. Not validated -
  408. // mount of the PVs will simply fail if one is invalid.
  409. // +optional
  410. // +listType=atomic
  411. repeated string mountOptions = 5;
  412. // allowVolumeExpansion shows whether the storage class allow volume expand.
  413. // +optional
  414. optional bool allowVolumeExpansion = 6;
  415. // volumeBindingMode indicates how PersistentVolumeClaims should be
  416. // provisioned and bound. When unset, VolumeBindingImmediate is used.
  417. // This field is only honored by servers that enable the VolumeScheduling feature.
  418. // +optional
  419. optional string volumeBindingMode = 7;
  420. // allowedTopologies restrict the node topologies where volumes can be dynamically provisioned.
  421. // Each volume plugin defines its own supported topology specifications.
  422. // An empty TopologySelectorTerm list means there is no topology restriction.
  423. // This field is only honored by servers that enable the VolumeScheduling feature.
  424. // +optional
  425. // +listType=atomic
  426. repeated .k8s.io.api.core.v1.TopologySelectorTerm allowedTopologies = 8;
  427. }
  428. // StorageClassList is a collection of storage classes.
  429. message StorageClassList {
  430. // Standard list metadata
  431. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
  432. // +optional
  433. optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
  434. // items is the list of StorageClasses
  435. repeated StorageClass items = 2;
  436. }
  437. // TokenRequest contains parameters of a service account token.
  438. message TokenRequest {
  439. // audience is the intended audience of the token in "TokenRequestSpec".
  440. // It will default to the audiences of kube apiserver.
  441. optional string audience = 1;
  442. // expirationSeconds is the duration of validity of the token in "TokenRequestSpec".
  443. // It has the same default value of "ExpirationSeconds" in "TokenRequestSpec".
  444. //
  445. // +optional
  446. optional int64 expirationSeconds = 2;
  447. }
  448. // VolumeAttachment captures the intent to attach or detach the specified volume
  449. // to/from the specified node.
  450. //
  451. // VolumeAttachment objects are non-namespaced.
  452. message VolumeAttachment {
  453. // Standard object metadata.
  454. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
  455. // +optional
  456. optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
  457. // spec represents specification of the desired attach/detach volume behavior.
  458. // Populated by the Kubernetes system.
  459. optional VolumeAttachmentSpec spec = 2;
  460. // status represents status of the VolumeAttachment request.
  461. // Populated by the entity completing the attach or detach
  462. // operation, i.e. the external-attacher.
  463. // +optional
  464. optional VolumeAttachmentStatus status = 3;
  465. }
  466. // VolumeAttachmentList is a collection of VolumeAttachment objects.
  467. message VolumeAttachmentList {
  468. // Standard list metadata
  469. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
  470. // +optional
  471. optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
  472. // items is the list of VolumeAttachments
  473. repeated VolumeAttachment items = 2;
  474. }
  475. // VolumeAttachmentSource represents a volume that should be attached.
  476. // Right now only PersistentVolumes can be attached via external attacher,
  477. // in the future we may allow also inline volumes in pods.
  478. // Exactly one member can be set.
  479. message VolumeAttachmentSource {
  480. // persistentVolumeName represents the name of the persistent volume to attach.
  481. // +optional
  482. optional string persistentVolumeName = 1;
  483. // inlineVolumeSpec contains all the information necessary to attach
  484. // a persistent volume defined by a pod's inline VolumeSource. This field
  485. // is populated only for the CSIMigration feature. It contains
  486. // translated fields from a pod's inline VolumeSource to a
  487. // PersistentVolumeSpec. This field is beta-level and is only
  488. // honored by servers that enabled the CSIMigration feature.
  489. // +optional
  490. optional .k8s.io.api.core.v1.PersistentVolumeSpec inlineVolumeSpec = 2;
  491. }
  492. // VolumeAttachmentSpec is the specification of a VolumeAttachment request.
  493. message VolumeAttachmentSpec {
  494. // attacher indicates the name of the volume driver that MUST handle this
  495. // request. This is the name returned by GetPluginName().
  496. optional string attacher = 1;
  497. // source represents the volume that should be attached.
  498. optional VolumeAttachmentSource source = 2;
  499. // nodeName represents the node that the volume should be attached to.
  500. optional string nodeName = 3;
  501. }
  502. // VolumeAttachmentStatus is the status of a VolumeAttachment request.
  503. message VolumeAttachmentStatus {
  504. // attached indicates the volume is successfully attached.
  505. // This field must only be set by the entity completing the attach
  506. // operation, i.e. the external-attacher.
  507. optional bool attached = 1;
  508. // attachmentMetadata is populated with any
  509. // information returned by the attach operation, upon successful attach, that must be passed
  510. // into subsequent WaitForAttach or Mount calls.
  511. // This field must only be set by the entity completing the attach
  512. // operation, i.e. the external-attacher.
  513. // +optional
  514. map<string, string> attachmentMetadata = 2;
  515. // attachError represents the last error encountered during attach operation, if any.
  516. // This field must only be set by the entity completing the attach
  517. // operation, i.e. the external-attacher.
  518. // +optional
  519. optional VolumeError attachError = 3;
  520. // detachError represents the last error encountered during detach operation, if any.
  521. // This field must only be set by the entity completing the detach
  522. // operation, i.e. the external-attacher.
  523. // +optional
  524. optional VolumeError detachError = 4;
  525. }
  526. // VolumeAttributesClass represents a specification of mutable volume attributes
  527. // defined by the CSI driver. The class can be specified during dynamic provisioning
  528. // of PersistentVolumeClaims, and changed in the PersistentVolumeClaim spec after provisioning.
  529. message VolumeAttributesClass {
  530. // Standard object's metadata.
  531. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
  532. // +optional
  533. optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
  534. // Name of the CSI driver
  535. // This field is immutable.
  536. optional string driverName = 2;
  537. // parameters hold volume attributes defined by the CSI driver. These values
  538. // are opaque to the Kubernetes and are passed directly to the CSI driver.
  539. // The underlying storage provider supports changing these attributes on an
  540. // existing volume, however the parameters field itself is immutable. To
  541. // invoke a volume update, a new VolumeAttributesClass should be created with
  542. // new parameters, and the PersistentVolumeClaim should be updated to reference
  543. // the new VolumeAttributesClass.
  544. //
  545. // This field is required and must contain at least one key/value pair.
  546. // The keys cannot be empty, and the maximum number of parameters is 512, with
  547. // a cumulative max size of 256K. If the CSI driver rejects invalid parameters,
  548. // the target PersistentVolumeClaim will be set to an "Infeasible" state in the
  549. // modifyVolumeStatus field.
  550. map<string, string> parameters = 3;
  551. }
  552. // VolumeAttributesClassList is a collection of VolumeAttributesClass objects.
  553. message VolumeAttributesClassList {
  554. // Standard list metadata
  555. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
  556. // +optional
  557. optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
  558. // items is the list of VolumeAttributesClass objects.
  559. repeated VolumeAttributesClass items = 2;
  560. }
  561. // VolumeError captures an error encountered during a volume operation.
  562. message VolumeError {
  563. // time represents the time the error was encountered.
  564. // +optional
  565. optional .k8s.io.apimachinery.pkg.apis.meta.v1.Time time = 1;
  566. // message represents the error encountered during Attach or Detach operation.
  567. // This string may be logged, so it should not contain sensitive
  568. // information.
  569. // +optional
  570. optional string message = 2;
  571. // errorCode is a numeric gRPC code representing the error encountered during Attach or Detach operations.
  572. //
  573. // This is an optional, beta field that requires the MutableCSINodeAllocatableCount feature gate being enabled to be set.
  574. //
  575. // +featureGate=MutableCSINodeAllocatableCount
  576. // +optional
  577. optional int32 errorCode = 3;
  578. }
  579. // VolumeNodeResources is a set of resource limits for scheduling of volumes.
  580. message VolumeNodeResources {
  581. // count indicates the maximum number of unique volumes managed by the CSI driver that can be used on a node.
  582. // A volume that is both attached and mounted on a node is considered to be used once, not twice.
  583. // The same rule applies for a unique volume that is shared among multiple pods on the same node.
  584. // If this field is not specified, then the supported number of volumes on this node is unbounded.
  585. // +optional
  586. optional int32 count = 1;
  587. }