1/* 2Copyright The Kubernetes Authors. 3 4Licensed under the Apache License, Version 2.0 (the "License"); 5you may not use this file except in compliance with the License. 6You may obtain a copy of the License at 7 8 http://www.apache.org/licenses/LICENSE-2.0 9 10Unless required by applicable law or agreed to in writing, software 11distributed under the License is distributed on an "AS IS" BASIS, 12WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13See the License for the specific language governing permissions and 14limitations under the License. 15*/ 16 17 18// This file was autogenerated by go-to-protobuf. Do not edit it manually! 19 20syntax = "proto2"; 21 22package k8s.io.api.storage.v1alpha1; 23 24import "k8s.io/api/core/v1/generated.proto"; 25import "k8s.io/apimachinery/pkg/api/resource/generated.proto"; 26import "k8s.io/apimachinery/pkg/apis/meta/v1/generated.proto"; 27import "k8s.io/apimachinery/pkg/runtime/generated.proto"; 28import "k8s.io/apimachinery/pkg/runtime/schema/generated.proto"; 29 30// Package-wide variables from generator "generated". 31option go_package = "v1alpha1"; 32 33// CSIStorageCapacity stores the result of one CSI GetCapacity call. 34// For a given StorageClass, this describes the available capacity in a 35// particular topology segment. This can be used when considering where to 36// instantiate new PersistentVolumes. 37// 38// For example this can express things like: 39// - StorageClass "standard" has "1234 GiB" available in "topology.kubernetes.io/zone=us-east1" 40// - StorageClass "localssd" has "10 GiB" available in "kubernetes.io/hostname=knode-abc123" 41// 42// The following three cases all imply that no capacity is available for 43// a certain combination: 44// - no object exists with suitable topology and storage class name 45// - such an object exists, but the capacity is unset 46// - such an object exists, but the capacity is zero 47// 48// The producer of these objects can decide which approach is more suitable. 49// 50// They are consumed by the kube-scheduler if the CSIStorageCapacity beta feature gate 51// is enabled there and a CSI driver opts into capacity-aware scheduling with 52// CSIDriver.StorageCapacity. 53message CSIStorageCapacity { 54 // Standard object's metadata. The name has no particular meaning. It must be 55 // be a DNS subdomain (dots allowed, 253 characters). To ensure that 56 // there are no conflicts with other CSI drivers on the cluster, the recommendation 57 // is to use csisc-<uuid>, a generated name, or a reverse-domain name which ends 58 // with the unique CSI driver name. 59 // 60 // Objects are namespaced. 61 // 62 // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata 63 // +optional 64 optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; 65 66 // NodeTopology defines which nodes have access to the storage 67 // for which capacity was reported. If not set, the storage is 68 // not accessible from any node in the cluster. If empty, the 69 // storage is accessible from all nodes. This field is 70 // immutable. 71 // 72 // +optional 73 optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector nodeTopology = 2; 74 75 // The name of the StorageClass that the reported capacity applies to. 76 // It must meet the same requirements as the name of a StorageClass 77 // object (non-empty, DNS subdomain). If that object no longer exists, 78 // the CSIStorageCapacity object is obsolete and should be removed by its 79 // creator. 80 // This field is immutable. 81 optional string storageClassName = 3; 82 83 // Capacity is the value reported by the CSI driver in its GetCapacityResponse 84 // for a GetCapacityRequest with topology and parameters that match the 85 // previous fields. 86 // 87 // The semantic is currently (CSI spec 1.2) defined as: 88 // The available capacity, in bytes, of the storage that can be used 89 // to provision volumes. If not set, that information is currently 90 // unavailable and treated like zero capacity. 91 // 92 // +optional 93 optional k8s.io.apimachinery.pkg.api.resource.Quantity capacity = 4; 94 95 // MaximumVolumeSize is the value reported by the CSI driver in its GetCapacityResponse 96 // for a GetCapacityRequest with topology and parameters that match the 97 // previous fields. 98 // 99 // This is defined since CSI spec 1.4.0 as the largest size 100 // that may be used in a 101 // CreateVolumeRequest.capacity_range.required_bytes field to 102 // create a volume with the same parameters as those in 103 // GetCapacityRequest. The corresponding value in the Kubernetes 104 // API is ResourceRequirements.Requests in a volume claim. 105 // 106 // +optional 107 optional k8s.io.apimachinery.pkg.api.resource.Quantity maximumVolumeSize = 5; 108} 109 110// CSIStorageCapacityList is a collection of CSIStorageCapacity objects. 111message CSIStorageCapacityList { 112 // Standard list metadata 113 // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata 114 // +optional 115 optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; 116 117 // Items is the list of CSIStorageCapacity objects. 118 // +listType=map 119 // +listMapKey=name 120 repeated CSIStorageCapacity items = 2; 121} 122 123// VolumeAttachment captures the intent to attach or detach the specified volume 124// to/from the specified node. 125// 126// VolumeAttachment objects are non-namespaced. 127message VolumeAttachment { 128 // Standard object metadata. 129 // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata 130 // +optional 131 optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; 132 133 // Specification of the desired attach/detach volume behavior. 134 // Populated by the Kubernetes system. 135 optional VolumeAttachmentSpec spec = 2; 136 137 // Status of the VolumeAttachment request. 138 // Populated by the entity completing the attach or detach 139 // operation, i.e. the external-attacher. 140 // +optional 141 optional VolumeAttachmentStatus status = 3; 142} 143 144// VolumeAttachmentList is a collection of VolumeAttachment objects. 145message VolumeAttachmentList { 146 // Standard list metadata 147 // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata 148 // +optional 149 optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; 150 151 // Items is the list of VolumeAttachments 152 repeated VolumeAttachment items = 2; 153} 154 155// VolumeAttachmentSource represents a volume that should be attached. 156// Right now only PersistenVolumes can be attached via external attacher, 157// in future we may allow also inline volumes in pods. 158// Exactly one member can be set. 159message VolumeAttachmentSource { 160 // Name of the persistent volume to attach. 161 // +optional 162 optional string persistentVolumeName = 1; 163 164 // inlineVolumeSpec contains all the information necessary to attach 165 // a persistent volume defined by a pod's inline VolumeSource. This field 166 // is populated only for the CSIMigration feature. It contains 167 // translated fields from a pod's inline VolumeSource to a 168 // PersistentVolumeSpec. This field is alpha-level and is only 169 // honored by servers that enabled the CSIMigration feature. 170 // +optional 171 optional k8s.io.api.core.v1.PersistentVolumeSpec inlineVolumeSpec = 2; 172} 173 174// VolumeAttachmentSpec is the specification of a VolumeAttachment request. 175message VolumeAttachmentSpec { 176 // Attacher indicates the name of the volume driver that MUST handle this 177 // request. This is the name returned by GetPluginName(). 178 optional string attacher = 1; 179 180 // Source represents the volume that should be attached. 181 optional VolumeAttachmentSource source = 2; 182 183 // The node that the volume should be attached to. 184 optional string nodeName = 3; 185} 186 187// VolumeAttachmentStatus is the status of a VolumeAttachment request. 188message VolumeAttachmentStatus { 189 // Indicates the volume is successfully attached. 190 // This field must only be set by the entity completing the attach 191 // operation, i.e. the external-attacher. 192 optional bool attached = 1; 193 194 // Upon successful attach, this field is populated with any 195 // information returned by the attach operation that must be passed 196 // into subsequent WaitForAttach or Mount calls. 197 // This field must only be set by the entity completing the attach 198 // operation, i.e. the external-attacher. 199 // +optional 200 map<string, string> attachmentMetadata = 2; 201 202 // The last error encountered during attach operation, if any. 203 // This field must only be set by the entity completing the attach 204 // operation, i.e. the external-attacher. 205 // +optional 206 optional VolumeError attachError = 3; 207 208 // The last error encountered during detach operation, if any. 209 // This field must only be set by the entity completing the detach 210 // operation, i.e. the external-attacher. 211 // +optional 212 optional VolumeError detachError = 4; 213} 214 215// VolumeError captures an error encountered during a volume operation. 216message VolumeError { 217 // Time the error was encountered. 218 // +optional 219 optional k8s.io.apimachinery.pkg.apis.meta.v1.Time time = 1; 220 221 // String detailing the error encountered during Attach or Detach operation. 222 // This string maybe logged, so it should not contain sensitive 223 // information. 224 // +optional 225 optional string message = 2; 226} 227 228