1/* 2Copyright 2015 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 17package v1 18 19import ( 20 "k8s.io/apimachinery/pkg/api/resource" 21 metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" 22 "k8s.io/apimachinery/pkg/types" 23 "k8s.io/apimachinery/pkg/util/intstr" 24) 25 26const ( 27 // NamespaceDefault means the object is in the default namespace which is applied when not specified by clients 28 NamespaceDefault string = "default" 29 // NamespaceAll is the default argument to specify on a context when you want to list or filter resources across all namespaces 30 NamespaceAll string = "" 31 // NamespaceNodeLease is the namespace where we place node lease objects (used for node heartbeats) 32 NamespaceNodeLease string = "kube-node-lease" 33 // TopologyKeyAny is the service topology key that matches any node 34 TopologyKeyAny string = "*" 35) 36 37// Volume represents a named volume in a pod that may be accessed by any container in the pod. 38type Volume struct { 39 // Volume's name. 40 // Must be a DNS_LABEL and unique within the pod. 41 // More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names 42 Name string `json:"name" protobuf:"bytes,1,opt,name=name"` 43 // VolumeSource represents the location and type of the mounted volume. 44 // If not specified, the Volume is implied to be an EmptyDir. 45 // This implied behavior is deprecated and will be removed in a future version. 46 VolumeSource `json:",inline" protobuf:"bytes,2,opt,name=volumeSource"` 47} 48 49// Represents the source of a volume to mount. 50// Only one of its members may be specified. 51type VolumeSource struct { 52 // HostPath represents a pre-existing file or directory on the host 53 // machine that is directly exposed to the container. This is generally 54 // used for system agents or other privileged things that are allowed 55 // to see the host machine. Most containers will NOT need this. 56 // More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath 57 // --- 58 // TODO(jonesdl) We need to restrict who can use host directory mounts and who can/can not 59 // mount host directories as read/write. 60 // +optional 61 HostPath *HostPathVolumeSource `json:"hostPath,omitempty" protobuf:"bytes,1,opt,name=hostPath"` 62 // EmptyDir represents a temporary directory that shares a pod's lifetime. 63 // More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir 64 // +optional 65 EmptyDir *EmptyDirVolumeSource `json:"emptyDir,omitempty" protobuf:"bytes,2,opt,name=emptyDir"` 66 // GCEPersistentDisk represents a GCE Disk resource that is attached to a 67 // kubelet's host machine and then exposed to the pod. 68 // More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk 69 // +optional 70 GCEPersistentDisk *GCEPersistentDiskVolumeSource `json:"gcePersistentDisk,omitempty" protobuf:"bytes,3,opt,name=gcePersistentDisk"` 71 // AWSElasticBlockStore represents an AWS Disk resource that is attached to a 72 // kubelet's host machine and then exposed to the pod. 73 // More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore 74 // +optional 75 AWSElasticBlockStore *AWSElasticBlockStoreVolumeSource `json:"awsElasticBlockStore,omitempty" protobuf:"bytes,4,opt,name=awsElasticBlockStore"` 76 // GitRepo represents a git repository at a particular revision. 77 // DEPRECATED: GitRepo is deprecated. To provision a container with a git repo, mount an 78 // EmptyDir into an InitContainer that clones the repo using git, then mount the EmptyDir 79 // into the Pod's container. 80 // +optional 81 GitRepo *GitRepoVolumeSource `json:"gitRepo,omitempty" protobuf:"bytes,5,opt,name=gitRepo"` 82 // Secret represents a secret that should populate this volume. 83 // More info: https://kubernetes.io/docs/concepts/storage/volumes#secret 84 // +optional 85 Secret *SecretVolumeSource `json:"secret,omitempty" protobuf:"bytes,6,opt,name=secret"` 86 // NFS represents an NFS mount on the host that shares a pod's lifetime 87 // More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs 88 // +optional 89 NFS *NFSVolumeSource `json:"nfs,omitempty" protobuf:"bytes,7,opt,name=nfs"` 90 // ISCSI represents an ISCSI Disk resource that is attached to a 91 // kubelet's host machine and then exposed to the pod. 92 // More info: https://examples.k8s.io/volumes/iscsi/README.md 93 // +optional 94 ISCSI *ISCSIVolumeSource `json:"iscsi,omitempty" protobuf:"bytes,8,opt,name=iscsi"` 95 // Glusterfs represents a Glusterfs mount on the host that shares a pod's lifetime. 96 // More info: https://examples.k8s.io/volumes/glusterfs/README.md 97 // +optional 98 Glusterfs *GlusterfsVolumeSource `json:"glusterfs,omitempty" protobuf:"bytes,9,opt,name=glusterfs"` 99 // PersistentVolumeClaimVolumeSource represents a reference to a 100 // PersistentVolumeClaim in the same namespace. 101 // More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims 102 // +optional 103 PersistentVolumeClaim *PersistentVolumeClaimVolumeSource `json:"persistentVolumeClaim,omitempty" protobuf:"bytes,10,opt,name=persistentVolumeClaim"` 104 // RBD represents a Rados Block Device mount on the host that shares a pod's lifetime. 105 // More info: https://examples.k8s.io/volumes/rbd/README.md 106 // +optional 107 RBD *RBDVolumeSource `json:"rbd,omitempty" protobuf:"bytes,11,opt,name=rbd"` 108 // FlexVolume represents a generic volume resource that is 109 // provisioned/attached using an exec based plugin. 110 // +optional 111 FlexVolume *FlexVolumeSource `json:"flexVolume,omitempty" protobuf:"bytes,12,opt,name=flexVolume"` 112 // Cinder represents a cinder volume attached and mounted on kubelets host machine. 113 // More info: https://examples.k8s.io/mysql-cinder-pd/README.md 114 // +optional 115 Cinder *CinderVolumeSource `json:"cinder,omitempty" protobuf:"bytes,13,opt,name=cinder"` 116 // CephFS represents a Ceph FS mount on the host that shares a pod's lifetime 117 // +optional 118 CephFS *CephFSVolumeSource `json:"cephfs,omitempty" protobuf:"bytes,14,opt,name=cephfs"` 119 // Flocker represents a Flocker volume attached to a kubelet's host machine. This depends on the Flocker control service being running 120 // +optional 121 Flocker *FlockerVolumeSource `json:"flocker,omitempty" protobuf:"bytes,15,opt,name=flocker"` 122 // DownwardAPI represents downward API about the pod that should populate this volume 123 // +optional 124 DownwardAPI *DownwardAPIVolumeSource `json:"downwardAPI,omitempty" protobuf:"bytes,16,opt,name=downwardAPI"` 125 // FC represents a Fibre Channel resource that is attached to a kubelet's host machine and then exposed to the pod. 126 // +optional 127 FC *FCVolumeSource `json:"fc,omitempty" protobuf:"bytes,17,opt,name=fc"` 128 // AzureFile represents an Azure File Service mount on the host and bind mount to the pod. 129 // +optional 130 AzureFile *AzureFileVolumeSource `json:"azureFile,omitempty" protobuf:"bytes,18,opt,name=azureFile"` 131 // ConfigMap represents a configMap that should populate this volume 132 // +optional 133 ConfigMap *ConfigMapVolumeSource `json:"configMap,omitempty" protobuf:"bytes,19,opt,name=configMap"` 134 // VsphereVolume represents a vSphere volume attached and mounted on kubelets host machine 135 // +optional 136 VsphereVolume *VsphereVirtualDiskVolumeSource `json:"vsphereVolume,omitempty" protobuf:"bytes,20,opt,name=vsphereVolume"` 137 // Quobyte represents a Quobyte mount on the host that shares a pod's lifetime 138 // +optional 139 Quobyte *QuobyteVolumeSource `json:"quobyte,omitempty" protobuf:"bytes,21,opt,name=quobyte"` 140 // AzureDisk represents an Azure Data Disk mount on the host and bind mount to the pod. 141 // +optional 142 AzureDisk *AzureDiskVolumeSource `json:"azureDisk,omitempty" protobuf:"bytes,22,opt,name=azureDisk"` 143 // PhotonPersistentDisk represents a PhotonController persistent disk attached and mounted on kubelets host machine 144 PhotonPersistentDisk *PhotonPersistentDiskVolumeSource `json:"photonPersistentDisk,omitempty" protobuf:"bytes,23,opt,name=photonPersistentDisk"` 145 // Items for all in one resources secrets, configmaps, and downward API 146 Projected *ProjectedVolumeSource `json:"projected,omitempty" protobuf:"bytes,26,opt,name=projected"` 147 // PortworxVolume represents a portworx volume attached and mounted on kubelets host machine 148 // +optional 149 PortworxVolume *PortworxVolumeSource `json:"portworxVolume,omitempty" protobuf:"bytes,24,opt,name=portworxVolume"` 150 // ScaleIO represents a ScaleIO persistent volume attached and mounted on Kubernetes nodes. 151 // +optional 152 ScaleIO *ScaleIOVolumeSource `json:"scaleIO,omitempty" protobuf:"bytes,25,opt,name=scaleIO"` 153 // StorageOS represents a StorageOS volume attached and mounted on Kubernetes nodes. 154 // +optional 155 StorageOS *StorageOSVolumeSource `json:"storageos,omitempty" protobuf:"bytes,27,opt,name=storageos"` 156 // CSI (Container Storage Interface) represents ephemeral storage that is handled by certain external CSI drivers (Beta feature). 157 // +optional 158 CSI *CSIVolumeSource `json:"csi,omitempty" protobuf:"bytes,28,opt,name=csi"` 159 // Ephemeral represents a volume that is handled by a cluster storage driver (Alpha feature). 160 // The volume's lifecycle is tied to the pod that defines it - it will be created before the pod starts, 161 // and deleted when the pod is removed. 162 // 163 // Use this if: 164 // a) the volume is only needed while the pod runs, 165 // b) features of normal volumes like restoring from snapshot or capacity 166 // tracking are needed, 167 // c) the storage driver is specified through a storage class, and 168 // d) the storage driver supports dynamic volume provisioning through 169 // a PersistentVolumeClaim (see EphemeralVolumeSource for more 170 // information on the connection between this volume type 171 // and PersistentVolumeClaim). 172 // 173 // Use PersistentVolumeClaim or one of the vendor-specific 174 // APIs for volumes that persist for longer than the lifecycle 175 // of an individual pod. 176 // 177 // Use CSI for light-weight local ephemeral volumes if the CSI driver is meant to 178 // be used that way - see the documentation of the driver for 179 // more information. 180 // 181 // A pod can use both types of ephemeral volumes and 182 // persistent volumes at the same time. 183 // 184 // +optional 185 Ephemeral *EphemeralVolumeSource `json:"ephemeral,omitempty" protobuf:"bytes,29,opt,name=ephemeral"` 186} 187 188// PersistentVolumeClaimVolumeSource references the user's PVC in the same namespace. 189// This volume finds the bound PV and mounts that volume for the pod. A 190// PersistentVolumeClaimVolumeSource is, essentially, a wrapper around another 191// type of volume that is owned by someone else (the system). 192type PersistentVolumeClaimVolumeSource struct { 193 // ClaimName is the name of a PersistentVolumeClaim in the same namespace as the pod using this volume. 194 // More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims 195 ClaimName string `json:"claimName" protobuf:"bytes,1,opt,name=claimName"` 196 // Will force the ReadOnly setting in VolumeMounts. 197 // Default false. 198 // +optional 199 ReadOnly bool `json:"readOnly,omitempty" protobuf:"varint,2,opt,name=readOnly"` 200} 201 202// PersistentVolumeSource is similar to VolumeSource but meant for the 203// administrator who creates PVs. Exactly one of its members must be set. 204type PersistentVolumeSource struct { 205 // GCEPersistentDisk represents a GCE Disk resource that is attached to a 206 // kubelet's host machine and then exposed to the pod. Provisioned by an admin. 207 // More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk 208 // +optional 209 GCEPersistentDisk *GCEPersistentDiskVolumeSource `json:"gcePersistentDisk,omitempty" protobuf:"bytes,1,opt,name=gcePersistentDisk"` 210 // AWSElasticBlockStore represents an AWS Disk resource that is attached to a 211 // kubelet's host machine and then exposed to the pod. 212 // More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore 213 // +optional 214 AWSElasticBlockStore *AWSElasticBlockStoreVolumeSource `json:"awsElasticBlockStore,omitempty" protobuf:"bytes,2,opt,name=awsElasticBlockStore"` 215 // HostPath represents a directory on the host. 216 // Provisioned by a developer or tester. 217 // This is useful for single-node development and testing only! 218 // On-host storage is not supported in any way and WILL NOT WORK in a multi-node cluster. 219 // More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath 220 // +optional 221 HostPath *HostPathVolumeSource `json:"hostPath,omitempty" protobuf:"bytes,3,opt,name=hostPath"` 222 // Glusterfs represents a Glusterfs volume that is attached to a host and 223 // exposed to the pod. Provisioned by an admin. 224 // More info: https://examples.k8s.io/volumes/glusterfs/README.md 225 // +optional 226 Glusterfs *GlusterfsPersistentVolumeSource `json:"glusterfs,omitempty" protobuf:"bytes,4,opt,name=glusterfs"` 227 // NFS represents an NFS mount on the host. Provisioned by an admin. 228 // More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs 229 // +optional 230 NFS *NFSVolumeSource `json:"nfs,omitempty" protobuf:"bytes,5,opt,name=nfs"` 231 // RBD represents a Rados Block Device mount on the host that shares a pod's lifetime. 232 // More info: https://examples.k8s.io/volumes/rbd/README.md 233 // +optional 234 RBD *RBDPersistentVolumeSource `json:"rbd,omitempty" protobuf:"bytes,6,opt,name=rbd"` 235 // ISCSI represents an ISCSI Disk resource that is attached to a 236 // kubelet's host machine and then exposed to the pod. Provisioned by an admin. 237 // +optional 238 ISCSI *ISCSIPersistentVolumeSource `json:"iscsi,omitempty" protobuf:"bytes,7,opt,name=iscsi"` 239 // Cinder represents a cinder volume attached and mounted on kubelets host machine. 240 // More info: https://examples.k8s.io/mysql-cinder-pd/README.md 241 // +optional 242 Cinder *CinderPersistentVolumeSource `json:"cinder,omitempty" protobuf:"bytes,8,opt,name=cinder"` 243 // CephFS represents a Ceph FS mount on the host that shares a pod's lifetime 244 // +optional 245 CephFS *CephFSPersistentVolumeSource `json:"cephfs,omitempty" protobuf:"bytes,9,opt,name=cephfs"` 246 // FC represents a Fibre Channel resource that is attached to a kubelet's host machine and then exposed to the pod. 247 // +optional 248 FC *FCVolumeSource `json:"fc,omitempty" protobuf:"bytes,10,opt,name=fc"` 249 // Flocker represents a Flocker volume attached to a kubelet's host machine and exposed to the pod for its usage. This depends on the Flocker control service being running 250 // +optional 251 Flocker *FlockerVolumeSource `json:"flocker,omitempty" protobuf:"bytes,11,opt,name=flocker"` 252 // FlexVolume represents a generic volume resource that is 253 // provisioned/attached using an exec based plugin. 254 // +optional 255 FlexVolume *FlexPersistentVolumeSource `json:"flexVolume,omitempty" protobuf:"bytes,12,opt,name=flexVolume"` 256 // AzureFile represents an Azure File Service mount on the host and bind mount to the pod. 257 // +optional 258 AzureFile *AzureFilePersistentVolumeSource `json:"azureFile,omitempty" protobuf:"bytes,13,opt,name=azureFile"` 259 // VsphereVolume represents a vSphere volume attached and mounted on kubelets host machine 260 // +optional 261 VsphereVolume *VsphereVirtualDiskVolumeSource `json:"vsphereVolume,omitempty" protobuf:"bytes,14,opt,name=vsphereVolume"` 262 // Quobyte represents a Quobyte mount on the host that shares a pod's lifetime 263 // +optional 264 Quobyte *QuobyteVolumeSource `json:"quobyte,omitempty" protobuf:"bytes,15,opt,name=quobyte"` 265 // AzureDisk represents an Azure Data Disk mount on the host and bind mount to the pod. 266 // +optional 267 AzureDisk *AzureDiskVolumeSource `json:"azureDisk,omitempty" protobuf:"bytes,16,opt,name=azureDisk"` 268 // PhotonPersistentDisk represents a PhotonController persistent disk attached and mounted on kubelets host machine 269 PhotonPersistentDisk *PhotonPersistentDiskVolumeSource `json:"photonPersistentDisk,omitempty" protobuf:"bytes,17,opt,name=photonPersistentDisk"` 270 // PortworxVolume represents a portworx volume attached and mounted on kubelets host machine 271 // +optional 272 PortworxVolume *PortworxVolumeSource `json:"portworxVolume,omitempty" protobuf:"bytes,18,opt,name=portworxVolume"` 273 // ScaleIO represents a ScaleIO persistent volume attached and mounted on Kubernetes nodes. 274 // +optional 275 ScaleIO *ScaleIOPersistentVolumeSource `json:"scaleIO,omitempty" protobuf:"bytes,19,opt,name=scaleIO"` 276 // Local represents directly-attached storage with node affinity 277 // +optional 278 Local *LocalVolumeSource `json:"local,omitempty" protobuf:"bytes,20,opt,name=local"` 279 // StorageOS represents a StorageOS volume that is attached to the kubelet's host machine and mounted into the pod 280 // More info: https://examples.k8s.io/volumes/storageos/README.md 281 // +optional 282 StorageOS *StorageOSPersistentVolumeSource `json:"storageos,omitempty" protobuf:"bytes,21,opt,name=storageos"` 283 // CSI represents storage that is handled by an external CSI driver (Beta feature). 284 // +optional 285 CSI *CSIPersistentVolumeSource `json:"csi,omitempty" protobuf:"bytes,22,opt,name=csi"` 286} 287 288const ( 289 // BetaStorageClassAnnotation represents the beta/previous StorageClass annotation. 290 // It's currently still used and will be held for backwards compatibility 291 BetaStorageClassAnnotation = "volume.beta.kubernetes.io/storage-class" 292 293 // MountOptionAnnotation defines mount option annotation used in PVs 294 MountOptionAnnotation = "volume.beta.kubernetes.io/mount-options" 295) 296 297// +genclient 298// +genclient:nonNamespaced 299// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object 300 301// PersistentVolume (PV) is a storage resource provisioned by an administrator. 302// It is analogous to a node. 303// More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes 304type PersistentVolume struct { 305 metav1.TypeMeta `json:",inline"` 306 // Standard object's metadata. 307 // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata 308 // +optional 309 metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` 310 311 // Spec defines a specification of a persistent volume owned by the cluster. 312 // Provisioned by an administrator. 313 // More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistent-volumes 314 // +optional 315 Spec PersistentVolumeSpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"` 316 317 // Status represents the current information/status for the persistent volume. 318 // Populated by the system. 319 // Read-only. 320 // More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistent-volumes 321 // +optional 322 Status PersistentVolumeStatus `json:"status,omitempty" protobuf:"bytes,3,opt,name=status"` 323} 324 325// PersistentVolumeSpec is the specification of a persistent volume. 326type PersistentVolumeSpec struct { 327 // A description of the persistent volume's resources and capacity. 328 // More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#capacity 329 // +optional 330 Capacity ResourceList `json:"capacity,omitempty" protobuf:"bytes,1,rep,name=capacity,casttype=ResourceList,castkey=ResourceName"` 331 // The actual volume backing the persistent volume. 332 PersistentVolumeSource `json:",inline" protobuf:"bytes,2,opt,name=persistentVolumeSource"` 333 // AccessModes contains all ways the volume can be mounted. 334 // More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes 335 // +optional 336 AccessModes []PersistentVolumeAccessMode `json:"accessModes,omitempty" protobuf:"bytes,3,rep,name=accessModes,casttype=PersistentVolumeAccessMode"` 337 // ClaimRef is part of a bi-directional binding between PersistentVolume and PersistentVolumeClaim. 338 // Expected to be non-nil when bound. 339 // claim.VolumeName is the authoritative bind between PV and PVC. 340 // More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#binding 341 // +optional 342 ClaimRef *ObjectReference `json:"claimRef,omitempty" protobuf:"bytes,4,opt,name=claimRef"` 343 // What happens to a persistent volume when released from its claim. 344 // Valid options are Retain (default for manually created PersistentVolumes), Delete (default 345 // for dynamically provisioned PersistentVolumes), and Recycle (deprecated). 346 // Recycle must be supported by the volume plugin underlying this PersistentVolume. 347 // More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#reclaiming 348 // +optional 349 PersistentVolumeReclaimPolicy PersistentVolumeReclaimPolicy `json:"persistentVolumeReclaimPolicy,omitempty" protobuf:"bytes,5,opt,name=persistentVolumeReclaimPolicy,casttype=PersistentVolumeReclaimPolicy"` 350 // Name of StorageClass to which this persistent volume belongs. Empty value 351 // means that this volume does not belong to any StorageClass. 352 // +optional 353 StorageClassName string `json:"storageClassName,omitempty" protobuf:"bytes,6,opt,name=storageClassName"` 354 // A list of mount options, e.g. ["ro", "soft"]. Not validated - mount will 355 // simply fail if one is invalid. 356 // More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes/#mount-options 357 // +optional 358 MountOptions []string `json:"mountOptions,omitempty" protobuf:"bytes,7,opt,name=mountOptions"` 359 // volumeMode defines if a volume is intended to be used with a formatted filesystem 360 // or to remain in raw block state. Value of Filesystem is implied when not included in spec. 361 // +optional 362 VolumeMode *PersistentVolumeMode `json:"volumeMode,omitempty" protobuf:"bytes,8,opt,name=volumeMode,casttype=PersistentVolumeMode"` 363 // NodeAffinity defines constraints that limit what nodes this volume can be accessed from. 364 // This field influences the scheduling of pods that use this volume. 365 // +optional 366 NodeAffinity *VolumeNodeAffinity `json:"nodeAffinity,omitempty" protobuf:"bytes,9,opt,name=nodeAffinity"` 367} 368 369// VolumeNodeAffinity defines constraints that limit what nodes this volume can be accessed from. 370type VolumeNodeAffinity struct { 371 // Required specifies hard node constraints that must be met. 372 Required *NodeSelector `json:"required,omitempty" protobuf:"bytes,1,opt,name=required"` 373} 374 375// PersistentVolumeReclaimPolicy describes a policy for end-of-life maintenance of persistent volumes. 376type PersistentVolumeReclaimPolicy string 377 378const ( 379 // PersistentVolumeReclaimRecycle means the volume will be recycled back into the pool of unbound persistent volumes on release from its claim. 380 // The volume plugin must support Recycling. 381 PersistentVolumeReclaimRecycle PersistentVolumeReclaimPolicy = "Recycle" 382 // PersistentVolumeReclaimDelete means the volume will be deleted from Kubernetes on release from its claim. 383 // The volume plugin must support Deletion. 384 PersistentVolumeReclaimDelete PersistentVolumeReclaimPolicy = "Delete" 385 // PersistentVolumeReclaimRetain means the volume will be left in its current phase (Released) for manual reclamation by the administrator. 386 // The default policy is Retain. 387 PersistentVolumeReclaimRetain PersistentVolumeReclaimPolicy = "Retain" 388) 389 390// PersistentVolumeMode describes how a volume is intended to be consumed, either Block or Filesystem. 391type PersistentVolumeMode string 392 393const ( 394 // PersistentVolumeBlock means the volume will not be formatted with a filesystem and will remain a raw block device. 395 PersistentVolumeBlock PersistentVolumeMode = "Block" 396 // PersistentVolumeFilesystem means the volume will be or is formatted with a filesystem. 397 PersistentVolumeFilesystem PersistentVolumeMode = "Filesystem" 398) 399 400// PersistentVolumeStatus is the current status of a persistent volume. 401type PersistentVolumeStatus struct { 402 // Phase indicates if a volume is available, bound to a claim, or released by a claim. 403 // More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#phase 404 // +optional 405 Phase PersistentVolumePhase `json:"phase,omitempty" protobuf:"bytes,1,opt,name=phase,casttype=PersistentVolumePhase"` 406 // A human-readable message indicating details about why the volume is in this state. 407 // +optional 408 Message string `json:"message,omitempty" protobuf:"bytes,2,opt,name=message"` 409 // Reason is a brief CamelCase string that describes any failure and is meant 410 // for machine parsing and tidy display in the CLI. 411 // +optional 412 Reason string `json:"reason,omitempty" protobuf:"bytes,3,opt,name=reason"` 413} 414 415// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object 416 417// PersistentVolumeList is a list of PersistentVolume items. 418type PersistentVolumeList struct { 419 metav1.TypeMeta `json:",inline"` 420 // Standard list metadata. 421 // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds 422 // +optional 423 metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` 424 // List of persistent volumes. 425 // More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes 426 Items []PersistentVolume `json:"items" protobuf:"bytes,2,rep,name=items"` 427} 428 429// +genclient 430// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object 431 432// PersistentVolumeClaim is a user's request for and claim to a persistent volume 433type PersistentVolumeClaim struct { 434 metav1.TypeMeta `json:",inline"` 435 // Standard object's metadata. 436 // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata 437 // +optional 438 metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` 439 440 // Spec defines the desired characteristics of a volume requested by a pod author. 441 // More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims 442 // +optional 443 Spec PersistentVolumeClaimSpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"` 444 445 // Status represents the current information/status of a persistent volume claim. 446 // Read-only. 447 // More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims 448 // +optional 449 Status PersistentVolumeClaimStatus `json:"status,omitempty" protobuf:"bytes,3,opt,name=status"` 450} 451 452// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object 453 454// PersistentVolumeClaimList is a list of PersistentVolumeClaim items. 455type PersistentVolumeClaimList struct { 456 metav1.TypeMeta `json:",inline"` 457 // Standard list metadata. 458 // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds 459 // +optional 460 metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` 461 // A list of persistent volume claims. 462 // More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims 463 Items []PersistentVolumeClaim `json:"items" protobuf:"bytes,2,rep,name=items"` 464} 465 466// PersistentVolumeClaimSpec describes the common attributes of storage devices 467// and allows a Source for provider-specific attributes 468type PersistentVolumeClaimSpec struct { 469 // AccessModes contains the desired access modes the volume should have. 470 // More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes-1 471 // +optional 472 AccessModes []PersistentVolumeAccessMode `json:"accessModes,omitempty" protobuf:"bytes,1,rep,name=accessModes,casttype=PersistentVolumeAccessMode"` 473 // A label query over volumes to consider for binding. 474 // +optional 475 Selector *metav1.LabelSelector `json:"selector,omitempty" protobuf:"bytes,4,opt,name=selector"` 476 // Resources represents the minimum resources the volume should have. 477 // More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources 478 // +optional 479 Resources ResourceRequirements `json:"resources,omitempty" protobuf:"bytes,2,opt,name=resources"` 480 // VolumeName is the binding reference to the PersistentVolume backing this claim. 481 // +optional 482 VolumeName string `json:"volumeName,omitempty" protobuf:"bytes,3,opt,name=volumeName"` 483 // Name of the StorageClass required by the claim. 484 // More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#class-1 485 // +optional 486 StorageClassName *string `json:"storageClassName,omitempty" protobuf:"bytes,5,opt,name=storageClassName"` 487 // volumeMode defines what type of volume is required by the claim. 488 // Value of Filesystem is implied when not included in claim spec. 489 // +optional 490 VolumeMode *PersistentVolumeMode `json:"volumeMode,omitempty" protobuf:"bytes,6,opt,name=volumeMode,casttype=PersistentVolumeMode"` 491 // This field can be used to specify either: 492 // * An existing VolumeSnapshot object (snapshot.storage.k8s.io/VolumeSnapshot) 493 // * An existing PVC (PersistentVolumeClaim) 494 // * An existing custom resource that implements data population (Alpha) 495 // In order to use custom resource types that implement data population, 496 // the AnyVolumeDataSource feature gate must be enabled. 497 // If the provisioner or an external controller can support the specified data source, 498 // it will create a new volume based on the contents of the specified data source. 499 // +optional 500 DataSource *TypedLocalObjectReference `json:"dataSource,omitempty" protobuf:"bytes,7,opt,name=dataSource"` 501} 502 503// PersistentVolumeClaimConditionType is a valid value of PersistentVolumeClaimCondition.Type 504type PersistentVolumeClaimConditionType string 505 506const ( 507 // PersistentVolumeClaimResizing - a user trigger resize of pvc has been started 508 PersistentVolumeClaimResizing PersistentVolumeClaimConditionType = "Resizing" 509 // PersistentVolumeClaimFileSystemResizePending - controller resize is finished and a file system resize is pending on node 510 PersistentVolumeClaimFileSystemResizePending PersistentVolumeClaimConditionType = "FileSystemResizePending" 511) 512 513// PersistentVolumeClaimCondition contails details about state of pvc 514type PersistentVolumeClaimCondition struct { 515 Type PersistentVolumeClaimConditionType `json:"type" protobuf:"bytes,1,opt,name=type,casttype=PersistentVolumeClaimConditionType"` 516 Status ConditionStatus `json:"status" protobuf:"bytes,2,opt,name=status,casttype=ConditionStatus"` 517 // Last time we probed the condition. 518 // +optional 519 LastProbeTime metav1.Time `json:"lastProbeTime,omitempty" protobuf:"bytes,3,opt,name=lastProbeTime"` 520 // Last time the condition transitioned from one status to another. 521 // +optional 522 LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty" protobuf:"bytes,4,opt,name=lastTransitionTime"` 523 // Unique, this should be a short, machine understandable string that gives the reason 524 // for condition's last transition. If it reports "ResizeStarted" that means the underlying 525 // persistent volume is being resized. 526 // +optional 527 Reason string `json:"reason,omitempty" protobuf:"bytes,5,opt,name=reason"` 528 // Human-readable message indicating details about last transition. 529 // +optional 530 Message string `json:"message,omitempty" protobuf:"bytes,6,opt,name=message"` 531} 532 533// PersistentVolumeClaimStatus is the current status of a persistent volume claim. 534type PersistentVolumeClaimStatus struct { 535 // Phase represents the current phase of PersistentVolumeClaim. 536 // +optional 537 Phase PersistentVolumeClaimPhase `json:"phase,omitempty" protobuf:"bytes,1,opt,name=phase,casttype=PersistentVolumeClaimPhase"` 538 // AccessModes contains the actual access modes the volume backing the PVC has. 539 // More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes-1 540 // +optional 541 AccessModes []PersistentVolumeAccessMode `json:"accessModes,omitempty" protobuf:"bytes,2,rep,name=accessModes,casttype=PersistentVolumeAccessMode"` 542 // Represents the actual resources of the underlying volume. 543 // +optional 544 Capacity ResourceList `json:"capacity,omitempty" protobuf:"bytes,3,rep,name=capacity,casttype=ResourceList,castkey=ResourceName"` 545 // Current Condition of persistent volume claim. If underlying persistent volume is being 546 // resized then the Condition will be set to 'ResizeStarted'. 547 // +optional 548 // +patchMergeKey=type 549 // +patchStrategy=merge 550 Conditions []PersistentVolumeClaimCondition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type" protobuf:"bytes,4,rep,name=conditions"` 551} 552 553type PersistentVolumeAccessMode string 554 555const ( 556 // can be mounted in read/write mode to exactly 1 host 557 ReadWriteOnce PersistentVolumeAccessMode = "ReadWriteOnce" 558 // can be mounted in read-only mode to many hosts 559 ReadOnlyMany PersistentVolumeAccessMode = "ReadOnlyMany" 560 // can be mounted in read/write mode to many hosts 561 ReadWriteMany PersistentVolumeAccessMode = "ReadWriteMany" 562) 563 564type PersistentVolumePhase string 565 566const ( 567 // used for PersistentVolumes that are not available 568 VolumePending PersistentVolumePhase = "Pending" 569 // used for PersistentVolumes that are not yet bound 570 // Available volumes are held by the binder and matched to PersistentVolumeClaims 571 VolumeAvailable PersistentVolumePhase = "Available" 572 // used for PersistentVolumes that are bound 573 VolumeBound PersistentVolumePhase = "Bound" 574 // used for PersistentVolumes where the bound PersistentVolumeClaim was deleted 575 // released volumes must be recycled before becoming available again 576 // this phase is used by the persistent volume claim binder to signal to another process to reclaim the resource 577 VolumeReleased PersistentVolumePhase = "Released" 578 // used for PersistentVolumes that failed to be correctly recycled or deleted after being released from a claim 579 VolumeFailed PersistentVolumePhase = "Failed" 580) 581 582type PersistentVolumeClaimPhase string 583 584const ( 585 // used for PersistentVolumeClaims that are not yet bound 586 ClaimPending PersistentVolumeClaimPhase = "Pending" 587 // used for PersistentVolumeClaims that are bound 588 ClaimBound PersistentVolumeClaimPhase = "Bound" 589 // used for PersistentVolumeClaims that lost their underlying 590 // PersistentVolume. The claim was bound to a PersistentVolume and this 591 // volume does not exist any longer and all data on it was lost. 592 ClaimLost PersistentVolumeClaimPhase = "Lost" 593) 594 595type HostPathType string 596 597const ( 598 // For backwards compatible, leave it empty if unset 599 HostPathUnset HostPathType = "" 600 // If nothing exists at the given path, an empty directory will be created there 601 // as needed with file mode 0755, having the same group and ownership with Kubelet. 602 HostPathDirectoryOrCreate HostPathType = "DirectoryOrCreate" 603 // A directory must exist at the given path 604 HostPathDirectory HostPathType = "Directory" 605 // If nothing exists at the given path, an empty file will be created there 606 // as needed with file mode 0644, having the same group and ownership with Kubelet. 607 HostPathFileOrCreate HostPathType = "FileOrCreate" 608 // A file must exist at the given path 609 HostPathFile HostPathType = "File" 610 // A UNIX socket must exist at the given path 611 HostPathSocket HostPathType = "Socket" 612 // A character device must exist at the given path 613 HostPathCharDev HostPathType = "CharDevice" 614 // A block device must exist at the given path 615 HostPathBlockDev HostPathType = "BlockDevice" 616) 617 618// Represents a host path mapped into a pod. 619// Host path volumes do not support ownership management or SELinux relabeling. 620type HostPathVolumeSource struct { 621 // Path of the directory on the host. 622 // If the path is a symlink, it will follow the link to the real path. 623 // More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath 624 Path string `json:"path" protobuf:"bytes,1,opt,name=path"` 625 // Type for HostPath Volume 626 // Defaults to "" 627 // More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath 628 // +optional 629 Type *HostPathType `json:"type,omitempty" protobuf:"bytes,2,opt,name=type"` 630} 631 632// Represents an empty directory for a pod. 633// Empty directory volumes support ownership management and SELinux relabeling. 634type EmptyDirVolumeSource struct { 635 // What type of storage medium should back this directory. 636 // The default is "" which means to use the node's default medium. 637 // Must be an empty string (default) or Memory. 638 // More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir 639 // +optional 640 Medium StorageMedium `json:"medium,omitempty" protobuf:"bytes,1,opt,name=medium,casttype=StorageMedium"` 641 // Total amount of local storage required for this EmptyDir volume. 642 // The size limit is also applicable for memory medium. 643 // The maximum usage on memory medium EmptyDir would be the minimum value between 644 // the SizeLimit specified here and the sum of memory limits of all containers in a pod. 645 // The default is nil which means that the limit is undefined. 646 // More info: http://kubernetes.io/docs/user-guide/volumes#emptydir 647 // +optional 648 SizeLimit *resource.Quantity `json:"sizeLimit,omitempty" protobuf:"bytes,2,opt,name=sizeLimit"` 649} 650 651// Represents a Glusterfs mount that lasts the lifetime of a pod. 652// Glusterfs volumes do not support ownership management or SELinux relabeling. 653type GlusterfsVolumeSource struct { 654 // EndpointsName is the endpoint name that details Glusterfs topology. 655 // More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod 656 EndpointsName string `json:"endpoints" protobuf:"bytes,1,opt,name=endpoints"` 657 658 // Path is the Glusterfs volume path. 659 // More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod 660 Path string `json:"path" protobuf:"bytes,2,opt,name=path"` 661 662 // ReadOnly here will force the Glusterfs volume to be mounted with read-only permissions. 663 // Defaults to false. 664 // More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod 665 // +optional 666 ReadOnly bool `json:"readOnly,omitempty" protobuf:"varint,3,opt,name=readOnly"` 667} 668 669// Represents a Glusterfs mount that lasts the lifetime of a pod. 670// Glusterfs volumes do not support ownership management or SELinux relabeling. 671type GlusterfsPersistentVolumeSource struct { 672 // EndpointsName is the endpoint name that details Glusterfs topology. 673 // More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod 674 EndpointsName string `json:"endpoints" protobuf:"bytes,1,opt,name=endpoints"` 675 676 // Path is the Glusterfs volume path. 677 // More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod 678 Path string `json:"path" protobuf:"bytes,2,opt,name=path"` 679 680 // ReadOnly here will force the Glusterfs volume to be mounted with read-only permissions. 681 // Defaults to false. 682 // More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod 683 // +optional 684 ReadOnly bool `json:"readOnly,omitempty" protobuf:"varint,3,opt,name=readOnly"` 685 686 // EndpointsNamespace is the namespace that contains Glusterfs endpoint. 687 // If this field is empty, the EndpointNamespace defaults to the same namespace as the bound PVC. 688 // More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod 689 // +optional 690 EndpointsNamespace *string `json:"endpointsNamespace,omitempty" protobuf:"bytes,4,opt,name=endpointsNamespace"` 691} 692 693// Represents a Rados Block Device mount that lasts the lifetime of a pod. 694// RBD volumes support ownership management and SELinux relabeling. 695type RBDVolumeSource struct { 696 // A collection of Ceph monitors. 697 // More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it 698 CephMonitors []string `json:"monitors" protobuf:"bytes,1,rep,name=monitors"` 699 // The rados image name. 700 // More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it 701 RBDImage string `json:"image" protobuf:"bytes,2,opt,name=image"` 702 // Filesystem type of the volume that you want to mount. 703 // Tip: Ensure that the filesystem type is supported by the host operating system. 704 // Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. 705 // More info: https://kubernetes.io/docs/concepts/storage/volumes#rbd 706 // TODO: how do we prevent errors in the filesystem from compromising the machine 707 // +optional 708 FSType string `json:"fsType,omitempty" protobuf:"bytes,3,opt,name=fsType"` 709 // The rados pool name. 710 // Default is rbd. 711 // More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it 712 // +optional 713 RBDPool string `json:"pool,omitempty" protobuf:"bytes,4,opt,name=pool"` 714 // The rados user name. 715 // Default is admin. 716 // More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it 717 // +optional 718 RadosUser string `json:"user,omitempty" protobuf:"bytes,5,opt,name=user"` 719 // Keyring is the path to key ring for RBDUser. 720 // Default is /etc/ceph/keyring. 721 // More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it 722 // +optional 723 Keyring string `json:"keyring,omitempty" protobuf:"bytes,6,opt,name=keyring"` 724 // SecretRef is name of the authentication secret for RBDUser. If provided 725 // overrides keyring. 726 // Default is nil. 727 // More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it 728 // +optional 729 SecretRef *LocalObjectReference `json:"secretRef,omitempty" protobuf:"bytes,7,opt,name=secretRef"` 730 // ReadOnly here will force the ReadOnly setting in VolumeMounts. 731 // Defaults to false. 732 // More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it 733 // +optional 734 ReadOnly bool `json:"readOnly,omitempty" protobuf:"varint,8,opt,name=readOnly"` 735} 736 737// Represents a Rados Block Device mount that lasts the lifetime of a pod. 738// RBD volumes support ownership management and SELinux relabeling. 739type RBDPersistentVolumeSource struct { 740 // A collection of Ceph monitors. 741 // More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it 742 CephMonitors []string `json:"monitors" protobuf:"bytes,1,rep,name=monitors"` 743 // The rados image name. 744 // More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it 745 RBDImage string `json:"image" protobuf:"bytes,2,opt,name=image"` 746 // Filesystem type of the volume that you want to mount. 747 // Tip: Ensure that the filesystem type is supported by the host operating system. 748 // Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. 749 // More info: https://kubernetes.io/docs/concepts/storage/volumes#rbd 750 // TODO: how do we prevent errors in the filesystem from compromising the machine 751 // +optional 752 FSType string `json:"fsType,omitempty" protobuf:"bytes,3,opt,name=fsType"` 753 // The rados pool name. 754 // Default is rbd. 755 // More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it 756 // +optional 757 RBDPool string `json:"pool,omitempty" protobuf:"bytes,4,opt,name=pool"` 758 // The rados user name. 759 // Default is admin. 760 // More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it 761 // +optional 762 RadosUser string `json:"user,omitempty" protobuf:"bytes,5,opt,name=user"` 763 // Keyring is the path to key ring for RBDUser. 764 // Default is /etc/ceph/keyring. 765 // More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it 766 // +optional 767 Keyring string `json:"keyring,omitempty" protobuf:"bytes,6,opt,name=keyring"` 768 // SecretRef is name of the authentication secret for RBDUser. If provided 769 // overrides keyring. 770 // Default is nil. 771 // More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it 772 // +optional 773 SecretRef *SecretReference `json:"secretRef,omitempty" protobuf:"bytes,7,opt,name=secretRef"` 774 // ReadOnly here will force the ReadOnly setting in VolumeMounts. 775 // Defaults to false. 776 // More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it 777 // +optional 778 ReadOnly bool `json:"readOnly,omitempty" protobuf:"varint,8,opt,name=readOnly"` 779} 780 781// Represents a cinder volume resource in Openstack. 782// A Cinder volume must exist before mounting to a container. 783// The volume must also be in the same region as the kubelet. 784// Cinder volumes support ownership management and SELinux relabeling. 785type CinderVolumeSource struct { 786 // volume id used to identify the volume in cinder. 787 // More info: https://examples.k8s.io/mysql-cinder-pd/README.md 788 VolumeID string `json:"volumeID" protobuf:"bytes,1,opt,name=volumeID"` 789 // Filesystem type to mount. 790 // Must be a filesystem type supported by the host operating system. 791 // Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. 792 // More info: https://examples.k8s.io/mysql-cinder-pd/README.md 793 // +optional 794 FSType string `json:"fsType,omitempty" protobuf:"bytes,2,opt,name=fsType"` 795 // Optional: Defaults to false (read/write). ReadOnly here will force 796 // the ReadOnly setting in VolumeMounts. 797 // More info: https://examples.k8s.io/mysql-cinder-pd/README.md 798 // +optional 799 ReadOnly bool `json:"readOnly,omitempty" protobuf:"varint,3,opt,name=readOnly"` 800 // Optional: points to a secret object containing parameters used to connect 801 // to OpenStack. 802 // +optional 803 SecretRef *LocalObjectReference `json:"secretRef,omitempty" protobuf:"bytes,4,opt,name=secretRef"` 804} 805 806// Represents a cinder volume resource in Openstack. 807// A Cinder volume must exist before mounting to a container. 808// The volume must also be in the same region as the kubelet. 809// Cinder volumes support ownership management and SELinux relabeling. 810type CinderPersistentVolumeSource struct { 811 // volume id used to identify the volume in cinder. 812 // More info: https://examples.k8s.io/mysql-cinder-pd/README.md 813 VolumeID string `json:"volumeID" protobuf:"bytes,1,opt,name=volumeID"` 814 // Filesystem type to mount. 815 // Must be a filesystem type supported by the host operating system. 816 // Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. 817 // More info: https://examples.k8s.io/mysql-cinder-pd/README.md 818 // +optional 819 FSType string `json:"fsType,omitempty" protobuf:"bytes,2,opt,name=fsType"` 820 // Optional: Defaults to false (read/write). ReadOnly here will force 821 // the ReadOnly setting in VolumeMounts. 822 // More info: https://examples.k8s.io/mysql-cinder-pd/README.md 823 // +optional 824 ReadOnly bool `json:"readOnly,omitempty" protobuf:"varint,3,opt,name=readOnly"` 825 // Optional: points to a secret object containing parameters used to connect 826 // to OpenStack. 827 // +optional 828 SecretRef *SecretReference `json:"secretRef,omitempty" protobuf:"bytes,4,opt,name=secretRef"` 829} 830 831// Represents a Ceph Filesystem mount that lasts the lifetime of a pod 832// Cephfs volumes do not support ownership management or SELinux relabeling. 833type CephFSVolumeSource struct { 834 // Required: Monitors is a collection of Ceph monitors 835 // More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it 836 Monitors []string `json:"monitors" protobuf:"bytes,1,rep,name=monitors"` 837 // Optional: Used as the mounted root, rather than the full Ceph tree, default is / 838 // +optional 839 Path string `json:"path,omitempty" protobuf:"bytes,2,opt,name=path"` 840 // Optional: User is the rados user name, default is admin 841 // More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it 842 // +optional 843 User string `json:"user,omitempty" protobuf:"bytes,3,opt,name=user"` 844 // Optional: SecretFile is the path to key ring for User, default is /etc/ceph/user.secret 845 // More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it 846 // +optional 847 SecretFile string `json:"secretFile,omitempty" protobuf:"bytes,4,opt,name=secretFile"` 848 // Optional: SecretRef is reference to the authentication secret for User, default is empty. 849 // More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it 850 // +optional 851 SecretRef *LocalObjectReference `json:"secretRef,omitempty" protobuf:"bytes,5,opt,name=secretRef"` 852 // Optional: Defaults to false (read/write). ReadOnly here will force 853 // the ReadOnly setting in VolumeMounts. 854 // More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it 855 // +optional 856 ReadOnly bool `json:"readOnly,omitempty" protobuf:"varint,6,opt,name=readOnly"` 857} 858 859// SecretReference represents a Secret Reference. It has enough information to retrieve secret 860// in any namespace 861type SecretReference struct { 862 // Name is unique within a namespace to reference a secret resource. 863 // +optional 864 Name string `json:"name,omitempty" protobuf:"bytes,1,opt,name=name"` 865 // Namespace defines the space within which the secret name must be unique. 866 // +optional 867 Namespace string `json:"namespace,omitempty" protobuf:"bytes,2,opt,name=namespace"` 868} 869 870// Represents a Ceph Filesystem mount that lasts the lifetime of a pod 871// Cephfs volumes do not support ownership management or SELinux relabeling. 872type CephFSPersistentVolumeSource struct { 873 // Required: Monitors is a collection of Ceph monitors 874 // More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it 875 Monitors []string `json:"monitors" protobuf:"bytes,1,rep,name=monitors"` 876 // Optional: Used as the mounted root, rather than the full Ceph tree, default is / 877 // +optional 878 Path string `json:"path,omitempty" protobuf:"bytes,2,opt,name=path"` 879 // Optional: User is the rados user name, default is admin 880 // More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it 881 // +optional 882 User string `json:"user,omitempty" protobuf:"bytes,3,opt,name=user"` 883 // Optional: SecretFile is the path to key ring for User, default is /etc/ceph/user.secret 884 // More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it 885 // +optional 886 SecretFile string `json:"secretFile,omitempty" protobuf:"bytes,4,opt,name=secretFile"` 887 // Optional: SecretRef is reference to the authentication secret for User, default is empty. 888 // More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it 889 // +optional 890 SecretRef *SecretReference `json:"secretRef,omitempty" protobuf:"bytes,5,opt,name=secretRef"` 891 // Optional: Defaults to false (read/write). ReadOnly here will force 892 // the ReadOnly setting in VolumeMounts. 893 // More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it 894 // +optional 895 ReadOnly bool `json:"readOnly,omitempty" protobuf:"varint,6,opt,name=readOnly"` 896} 897 898// Represents a Flocker volume mounted by the Flocker agent. 899// One and only one of datasetName and datasetUUID should be set. 900// Flocker volumes do not support ownership management or SELinux relabeling. 901type FlockerVolumeSource struct { 902 // Name of the dataset stored as metadata -> name on the dataset for Flocker 903 // should be considered as deprecated 904 // +optional 905 DatasetName string `json:"datasetName,omitempty" protobuf:"bytes,1,opt,name=datasetName"` 906 // UUID of the dataset. This is unique identifier of a Flocker dataset 907 // +optional 908 DatasetUUID string `json:"datasetUUID,omitempty" protobuf:"bytes,2,opt,name=datasetUUID"` 909} 910 911// StorageMedium defines ways that storage can be allocated to a volume. 912type StorageMedium string 913 914const ( 915 StorageMediumDefault StorageMedium = "" // use whatever the default is for the node, assume anything we don't explicitly handle is this 916 StorageMediumMemory StorageMedium = "Memory" // use memory (e.g. tmpfs on linux) 917 StorageMediumHugePages StorageMedium = "HugePages" // use hugepages 918 StorageMediumHugePagesPrefix StorageMedium = "HugePages-" // prefix for full medium notation HugePages-<size> 919) 920 921// Protocol defines network protocols supported for things like container ports. 922type Protocol string 923 924const ( 925 // ProtocolTCP is the TCP protocol. 926 ProtocolTCP Protocol = "TCP" 927 // ProtocolUDP is the UDP protocol. 928 ProtocolUDP Protocol = "UDP" 929 // ProtocolSCTP is the SCTP protocol. 930 ProtocolSCTP Protocol = "SCTP" 931) 932 933// Represents a Persistent Disk resource in Google Compute Engine. 934// 935// A GCE PD must exist before mounting to a container. The disk must 936// also be in the same GCE project and zone as the kubelet. A GCE PD 937// can only be mounted as read/write once or read-only many times. GCE 938// PDs support ownership management and SELinux relabeling. 939type GCEPersistentDiskVolumeSource struct { 940 // Unique name of the PD resource in GCE. Used to identify the disk in GCE. 941 // More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk 942 PDName string `json:"pdName" protobuf:"bytes,1,opt,name=pdName"` 943 // Filesystem type of the volume that you want to mount. 944 // Tip: Ensure that the filesystem type is supported by the host operating system. 945 // Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. 946 // More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk 947 // TODO: how do we prevent errors in the filesystem from compromising the machine 948 // +optional 949 FSType string `json:"fsType,omitempty" protobuf:"bytes,2,opt,name=fsType"` 950 // The partition in the volume that you want to mount. 951 // If omitted, the default is to mount by volume name. 952 // Examples: For volume /dev/sda1, you specify the partition as "1". 953 // Similarly, the volume partition for /dev/sda is "0" (or you can leave the property empty). 954 // More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk 955 // +optional 956 Partition int32 `json:"partition,omitempty" protobuf:"varint,3,opt,name=partition"` 957 // ReadOnly here will force the ReadOnly setting in VolumeMounts. 958 // Defaults to false. 959 // More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk 960 // +optional 961 ReadOnly bool `json:"readOnly,omitempty" protobuf:"varint,4,opt,name=readOnly"` 962} 963 964// Represents a Quobyte mount that lasts the lifetime of a pod. 965// Quobyte volumes do not support ownership management or SELinux relabeling. 966type QuobyteVolumeSource struct { 967 // Registry represents a single or multiple Quobyte Registry services 968 // specified as a string as host:port pair (multiple entries are separated with commas) 969 // which acts as the central registry for volumes 970 Registry string `json:"registry" protobuf:"bytes,1,opt,name=registry"` 971 972 // Volume is a string that references an already created Quobyte volume by name. 973 Volume string `json:"volume" protobuf:"bytes,2,opt,name=volume"` 974 975 // ReadOnly here will force the Quobyte volume to be mounted with read-only permissions. 976 // Defaults to false. 977 // +optional 978 ReadOnly bool `json:"readOnly,omitempty" protobuf:"varint,3,opt,name=readOnly"` 979 980 // User to map volume access to 981 // Defaults to serivceaccount user 982 // +optional 983 User string `json:"user,omitempty" protobuf:"bytes,4,opt,name=user"` 984 985 // Group to map volume access to 986 // Default is no group 987 // +optional 988 Group string `json:"group,omitempty" protobuf:"bytes,5,opt,name=group"` 989 990 // Tenant owning the given Quobyte volume in the Backend 991 // Used with dynamically provisioned Quobyte volumes, value is set by the plugin 992 // +optional 993 Tenant string `json:"tenant,omitempty" protobuf:"bytes,6,opt,name=tenant"` 994} 995 996// FlexPersistentVolumeSource represents a generic persistent volume resource that is 997// provisioned/attached using an exec based plugin. 998type FlexPersistentVolumeSource struct { 999 // Driver is the name of the driver to use for this volume. 1000 Driver string `json:"driver" protobuf:"bytes,1,opt,name=driver"` 1001 // Filesystem type to mount. 1002 // Must be a filesystem type supported by the host operating system. 1003 // Ex. "ext4", "xfs", "ntfs". The default filesystem depends on FlexVolume script. 1004 // +optional 1005 FSType string `json:"fsType,omitempty" protobuf:"bytes,2,opt,name=fsType"` 1006 // Optional: SecretRef is reference to the secret object containing 1007 // sensitive information to pass to the plugin scripts. This may be 1008 // empty if no secret object is specified. If the secret object 1009 // contains more than one secret, all secrets are passed to the plugin 1010 // scripts. 1011 // +optional 1012 SecretRef *SecretReference `json:"secretRef,omitempty" protobuf:"bytes,3,opt,name=secretRef"` 1013 // Optional: Defaults to false (read/write). ReadOnly here will force 1014 // the ReadOnly setting in VolumeMounts. 1015 // +optional 1016 ReadOnly bool `json:"readOnly,omitempty" protobuf:"varint,4,opt,name=readOnly"` 1017 // Optional: Extra command options if any. 1018 // +optional 1019 Options map[string]string `json:"options,omitempty" protobuf:"bytes,5,rep,name=options"` 1020} 1021 1022// FlexVolume represents a generic volume resource that is 1023// provisioned/attached using an exec based plugin. 1024type FlexVolumeSource struct { 1025 // Driver is the name of the driver to use for this volume. 1026 Driver string `json:"driver" protobuf:"bytes,1,opt,name=driver"` 1027 // Filesystem type to mount. 1028 // Must be a filesystem type supported by the host operating system. 1029 // Ex. "ext4", "xfs", "ntfs". The default filesystem depends on FlexVolume script. 1030 // +optional 1031 FSType string `json:"fsType,omitempty" protobuf:"bytes,2,opt,name=fsType"` 1032 // Optional: SecretRef is reference to the secret object containing 1033 // sensitive information to pass to the plugin scripts. This may be 1034 // empty if no secret object is specified. If the secret object 1035 // contains more than one secret, all secrets are passed to the plugin 1036 // scripts. 1037 // +optional 1038 SecretRef *LocalObjectReference `json:"secretRef,omitempty" protobuf:"bytes,3,opt,name=secretRef"` 1039 // Optional: Defaults to false (read/write). ReadOnly here will force 1040 // the ReadOnly setting in VolumeMounts. 1041 // +optional 1042 ReadOnly bool `json:"readOnly,omitempty" protobuf:"varint,4,opt,name=readOnly"` 1043 // Optional: Extra command options if any. 1044 // +optional 1045 Options map[string]string `json:"options,omitempty" protobuf:"bytes,5,rep,name=options"` 1046} 1047 1048// Represents a Persistent Disk resource in AWS. 1049// 1050// An AWS EBS disk must exist before mounting to a container. The disk 1051// must also be in the same AWS zone as the kubelet. An AWS EBS disk 1052// can only be mounted as read/write once. AWS EBS volumes support 1053// ownership management and SELinux relabeling. 1054type AWSElasticBlockStoreVolumeSource struct { 1055 // Unique ID of the persistent disk resource in AWS (Amazon EBS volume). 1056 // More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore 1057 VolumeID string `json:"volumeID" protobuf:"bytes,1,opt,name=volumeID"` 1058 // Filesystem type of the volume that you want to mount. 1059 // Tip: Ensure that the filesystem type is supported by the host operating system. 1060 // Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. 1061 // More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore 1062 // TODO: how do we prevent errors in the filesystem from compromising the machine 1063 // +optional 1064 FSType string `json:"fsType,omitempty" protobuf:"bytes,2,opt,name=fsType"` 1065 // The partition in the volume that you want to mount. 1066 // If omitted, the default is to mount by volume name. 1067 // Examples: For volume /dev/sda1, you specify the partition as "1". 1068 // Similarly, the volume partition for /dev/sda is "0" (or you can leave the property empty). 1069 // +optional 1070 Partition int32 `json:"partition,omitempty" protobuf:"varint,3,opt,name=partition"` 1071 // Specify "true" to force and set the ReadOnly property in VolumeMounts to "true". 1072 // If omitted, the default is "false". 1073 // More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore 1074 // +optional 1075 ReadOnly bool `json:"readOnly,omitempty" protobuf:"varint,4,opt,name=readOnly"` 1076} 1077 1078// Represents a volume that is populated with the contents of a git repository. 1079// Git repo volumes do not support ownership management. 1080// Git repo volumes support SELinux relabeling. 1081// 1082// DEPRECATED: GitRepo is deprecated. To provision a container with a git repo, mount an 1083// EmptyDir into an InitContainer that clones the repo using git, then mount the EmptyDir 1084// into the Pod's container. 1085type GitRepoVolumeSource struct { 1086 // Repository URL 1087 Repository string `json:"repository" protobuf:"bytes,1,opt,name=repository"` 1088 // Commit hash for the specified revision. 1089 // +optional 1090 Revision string `json:"revision,omitempty" protobuf:"bytes,2,opt,name=revision"` 1091 // Target directory name. 1092 // Must not contain or start with '..'. If '.' is supplied, the volume directory will be the 1093 // git repository. Otherwise, if specified, the volume will contain the git repository in 1094 // the subdirectory with the given name. 1095 // +optional 1096 Directory string `json:"directory,omitempty" protobuf:"bytes,3,opt,name=directory"` 1097} 1098 1099// Adapts a Secret into a volume. 1100// 1101// The contents of the target Secret's Data field will be presented in a volume 1102// as files using the keys in the Data field as the file names. 1103// Secret volumes support ownership management and SELinux relabeling. 1104type SecretVolumeSource struct { 1105 // Name of the secret in the pod's namespace to use. 1106 // More info: https://kubernetes.io/docs/concepts/storage/volumes#secret 1107 // +optional 1108 SecretName string `json:"secretName,omitempty" protobuf:"bytes,1,opt,name=secretName"` 1109 // If unspecified, each key-value pair in the Data field of the referenced 1110 // Secret will be projected into the volume as a file whose name is the 1111 // key and content is the value. If specified, the listed keys will be 1112 // projected into the specified paths, and unlisted keys will not be 1113 // present. If a key is specified which is not present in the Secret, 1114 // the volume setup will error unless it is marked optional. Paths must be 1115 // relative and may not contain the '..' path or start with '..'. 1116 // +optional 1117 Items []KeyToPath `json:"items,omitempty" protobuf:"bytes,2,rep,name=items"` 1118 // Optional: mode bits used to set permissions on created files by default. 1119 // Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. 1120 // YAML accepts both octal and decimal values, JSON requires decimal values 1121 // for mode bits. Defaults to 0644. 1122 // Directories within the path are not affected by this setting. 1123 // This might be in conflict with other options that affect the file 1124 // mode, like fsGroup, and the result can be other mode bits set. 1125 // +optional 1126 DefaultMode *int32 `json:"defaultMode,omitempty" protobuf:"bytes,3,opt,name=defaultMode"` 1127 // Specify whether the Secret or its keys must be defined 1128 // +optional 1129 Optional *bool `json:"optional,omitempty" protobuf:"varint,4,opt,name=optional"` 1130} 1131 1132const ( 1133 SecretVolumeSourceDefaultMode int32 = 0644 1134) 1135 1136// Adapts a secret into a projected volume. 1137// 1138// The contents of the target Secret's Data field will be presented in a 1139// projected volume as files using the keys in the Data field as the file names. 1140// Note that this is identical to a secret volume source without the default 1141// mode. 1142type SecretProjection struct { 1143 LocalObjectReference `json:",inline" protobuf:"bytes,1,opt,name=localObjectReference"` 1144 // If unspecified, each key-value pair in the Data field of the referenced 1145 // Secret will be projected into the volume as a file whose name is the 1146 // key and content is the value. If specified, the listed keys will be 1147 // projected into the specified paths, and unlisted keys will not be 1148 // present. If a key is specified which is not present in the Secret, 1149 // the volume setup will error unless it is marked optional. Paths must be 1150 // relative and may not contain the '..' path or start with '..'. 1151 // +optional 1152 Items []KeyToPath `json:"items,omitempty" protobuf:"bytes,2,rep,name=items"` 1153 // Specify whether the Secret or its key must be defined 1154 // +optional 1155 Optional *bool `json:"optional,omitempty" protobuf:"varint,4,opt,name=optional"` 1156} 1157 1158// Represents an NFS mount that lasts the lifetime of a pod. 1159// NFS volumes do not support ownership management or SELinux relabeling. 1160type NFSVolumeSource struct { 1161 // Server is the hostname or IP address of the NFS server. 1162 // More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs 1163 Server string `json:"server" protobuf:"bytes,1,opt,name=server"` 1164 1165 // Path that is exported by the NFS server. 1166 // More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs 1167 Path string `json:"path" protobuf:"bytes,2,opt,name=path"` 1168 1169 // ReadOnly here will force 1170 // the NFS export to be mounted with read-only permissions. 1171 // Defaults to false. 1172 // More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs 1173 // +optional 1174 ReadOnly bool `json:"readOnly,omitempty" protobuf:"varint,3,opt,name=readOnly"` 1175} 1176 1177// Represents an ISCSI disk. 1178// ISCSI volumes can only be mounted as read/write once. 1179// ISCSI volumes support ownership management and SELinux relabeling. 1180type ISCSIVolumeSource struct { 1181 // iSCSI Target Portal. The Portal is either an IP or ip_addr:port if the port 1182 // is other than default (typically TCP ports 860 and 3260). 1183 TargetPortal string `json:"targetPortal" protobuf:"bytes,1,opt,name=targetPortal"` 1184 // Target iSCSI Qualified Name. 1185 IQN string `json:"iqn" protobuf:"bytes,2,opt,name=iqn"` 1186 // iSCSI Target Lun number. 1187 Lun int32 `json:"lun" protobuf:"varint,3,opt,name=lun"` 1188 // iSCSI Interface Name that uses an iSCSI transport. 1189 // Defaults to 'default' (tcp). 1190 // +optional 1191 ISCSIInterface string `json:"iscsiInterface,omitempty" protobuf:"bytes,4,opt,name=iscsiInterface"` 1192 // Filesystem type of the volume that you want to mount. 1193 // Tip: Ensure that the filesystem type is supported by the host operating system. 1194 // Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. 1195 // More info: https://kubernetes.io/docs/concepts/storage/volumes#iscsi 1196 // TODO: how do we prevent errors in the filesystem from compromising the machine 1197 // +optional 1198 FSType string `json:"fsType,omitempty" protobuf:"bytes,5,opt,name=fsType"` 1199 // ReadOnly here will force the ReadOnly setting in VolumeMounts. 1200 // Defaults to false. 1201 // +optional 1202 ReadOnly bool `json:"readOnly,omitempty" protobuf:"varint,6,opt,name=readOnly"` 1203 // iSCSI Target Portal List. The portal is either an IP or ip_addr:port if the port 1204 // is other than default (typically TCP ports 860 and 3260). 1205 // +optional 1206 Portals []string `json:"portals,omitempty" protobuf:"bytes,7,opt,name=portals"` 1207 // whether support iSCSI Discovery CHAP authentication 1208 // +optional 1209 DiscoveryCHAPAuth bool `json:"chapAuthDiscovery,omitempty" protobuf:"varint,8,opt,name=chapAuthDiscovery"` 1210 // whether support iSCSI Session CHAP authentication 1211 // +optional 1212 SessionCHAPAuth bool `json:"chapAuthSession,omitempty" protobuf:"varint,11,opt,name=chapAuthSession"` 1213 // CHAP Secret for iSCSI target and initiator authentication 1214 // +optional 1215 SecretRef *LocalObjectReference `json:"secretRef,omitempty" protobuf:"bytes,10,opt,name=secretRef"` 1216 // Custom iSCSI Initiator Name. 1217 // If initiatorName is specified with iscsiInterface simultaneously, new iSCSI interface 1218 // <target portal>:<volume name> will be created for the connection. 1219 // +optional 1220 InitiatorName *string `json:"initiatorName,omitempty" protobuf:"bytes,12,opt,name=initiatorName"` 1221} 1222 1223// ISCSIPersistentVolumeSource represents an ISCSI disk. 1224// ISCSI volumes can only be mounted as read/write once. 1225// ISCSI volumes support ownership management and SELinux relabeling. 1226type ISCSIPersistentVolumeSource struct { 1227 // iSCSI Target Portal. The Portal is either an IP or ip_addr:port if the port 1228 // is other than default (typically TCP ports 860 and 3260). 1229 TargetPortal string `json:"targetPortal" protobuf:"bytes,1,opt,name=targetPortal"` 1230 // Target iSCSI Qualified Name. 1231 IQN string `json:"iqn" protobuf:"bytes,2,opt,name=iqn"` 1232 // iSCSI Target Lun number. 1233 Lun int32 `json:"lun" protobuf:"varint,3,opt,name=lun"` 1234 // iSCSI Interface Name that uses an iSCSI transport. 1235 // Defaults to 'default' (tcp). 1236 // +optional 1237 ISCSIInterface string `json:"iscsiInterface,omitempty" protobuf:"bytes,4,opt,name=iscsiInterface"` 1238 // Filesystem type of the volume that you want to mount. 1239 // Tip: Ensure that the filesystem type is supported by the host operating system. 1240 // Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. 1241 // More info: https://kubernetes.io/docs/concepts/storage/volumes#iscsi 1242 // TODO: how do we prevent errors in the filesystem from compromising the machine 1243 // +optional 1244 FSType string `json:"fsType,omitempty" protobuf:"bytes,5,opt,name=fsType"` 1245 // ReadOnly here will force the ReadOnly setting in VolumeMounts. 1246 // Defaults to false. 1247 // +optional 1248 ReadOnly bool `json:"readOnly,omitempty" protobuf:"varint,6,opt,name=readOnly"` 1249 // iSCSI Target Portal List. The Portal is either an IP or ip_addr:port if the port 1250 // is other than default (typically TCP ports 860 and 3260). 1251 // +optional 1252 Portals []string `json:"portals,omitempty" protobuf:"bytes,7,opt,name=portals"` 1253 // whether support iSCSI Discovery CHAP authentication 1254 // +optional 1255 DiscoveryCHAPAuth bool `json:"chapAuthDiscovery,omitempty" protobuf:"varint,8,opt,name=chapAuthDiscovery"` 1256 // whether support iSCSI Session CHAP authentication 1257 // +optional 1258 SessionCHAPAuth bool `json:"chapAuthSession,omitempty" protobuf:"varint,11,opt,name=chapAuthSession"` 1259 // CHAP Secret for iSCSI target and initiator authentication 1260 // +optional 1261 SecretRef *SecretReference `json:"secretRef,omitempty" protobuf:"bytes,10,opt,name=secretRef"` 1262 // Custom iSCSI Initiator Name. 1263 // If initiatorName is specified with iscsiInterface simultaneously, new iSCSI interface 1264 // <target portal>:<volume name> will be created for the connection. 1265 // +optional 1266 InitiatorName *string `json:"initiatorName,omitempty" protobuf:"bytes,12,opt,name=initiatorName"` 1267} 1268 1269// Represents a Fibre Channel volume. 1270// Fibre Channel volumes can only be mounted as read/write once. 1271// Fibre Channel volumes support ownership management and SELinux relabeling. 1272type FCVolumeSource struct { 1273 // Optional: FC target worldwide names (WWNs) 1274 // +optional 1275 TargetWWNs []string `json:"targetWWNs,omitempty" protobuf:"bytes,1,rep,name=targetWWNs"` 1276 // Optional: FC target lun number 1277 // +optional 1278 Lun *int32 `json:"lun,omitempty" protobuf:"varint,2,opt,name=lun"` 1279 // Filesystem type to mount. 1280 // Must be a filesystem type supported by the host operating system. 1281 // Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. 1282 // TODO: how do we prevent errors in the filesystem from compromising the machine 1283 // +optional 1284 FSType string `json:"fsType,omitempty" protobuf:"bytes,3,opt,name=fsType"` 1285 // Optional: Defaults to false (read/write). ReadOnly here will force 1286 // the ReadOnly setting in VolumeMounts. 1287 // +optional 1288 ReadOnly bool `json:"readOnly,omitempty" protobuf:"varint,4,opt,name=readOnly"` 1289 // Optional: FC volume world wide identifiers (wwids) 1290 // Either wwids or combination of targetWWNs and lun must be set, but not both simultaneously. 1291 // +optional 1292 WWIDs []string `json:"wwids,omitempty" protobuf:"bytes,5,rep,name=wwids"` 1293} 1294 1295// AzureFile represents an Azure File Service mount on the host and bind mount to the pod. 1296type AzureFileVolumeSource struct { 1297 // the name of secret that contains Azure Storage Account Name and Key 1298 SecretName string `json:"secretName" protobuf:"bytes,1,opt,name=secretName"` 1299 // Share Name 1300 ShareName string `json:"shareName" protobuf:"bytes,2,opt,name=shareName"` 1301 // Defaults to false (read/write). ReadOnly here will force 1302 // the ReadOnly setting in VolumeMounts. 1303 // +optional 1304 ReadOnly bool `json:"readOnly,omitempty" protobuf:"varint,3,opt,name=readOnly"` 1305} 1306 1307// AzureFile represents an Azure File Service mount on the host and bind mount to the pod. 1308type AzureFilePersistentVolumeSource struct { 1309 // the name of secret that contains Azure Storage Account Name and Key 1310 SecretName string `json:"secretName" protobuf:"bytes,1,opt,name=secretName"` 1311 // Share Name 1312 ShareName string `json:"shareName" protobuf:"bytes,2,opt,name=shareName"` 1313 // Defaults to false (read/write). ReadOnly here will force 1314 // the ReadOnly setting in VolumeMounts. 1315 // +optional 1316 ReadOnly bool `json:"readOnly,omitempty" protobuf:"varint,3,opt,name=readOnly"` 1317 // the namespace of the secret that contains Azure Storage Account Name and Key 1318 // default is the same as the Pod 1319 // +optional 1320 SecretNamespace *string `json:"secretNamespace" protobuf:"bytes,4,opt,name=secretNamespace"` 1321} 1322 1323// Represents a vSphere volume resource. 1324type VsphereVirtualDiskVolumeSource struct { 1325 // Path that identifies vSphere volume vmdk 1326 VolumePath string `json:"volumePath" protobuf:"bytes,1,opt,name=volumePath"` 1327 // Filesystem type to mount. 1328 // Must be a filesystem type supported by the host operating system. 1329 // Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. 1330 // +optional 1331 FSType string `json:"fsType,omitempty" protobuf:"bytes,2,opt,name=fsType"` 1332 // Storage Policy Based Management (SPBM) profile name. 1333 // +optional 1334 StoragePolicyName string `json:"storagePolicyName,omitempty" protobuf:"bytes,3,opt,name=storagePolicyName"` 1335 // Storage Policy Based Management (SPBM) profile ID associated with the StoragePolicyName. 1336 // +optional 1337 StoragePolicyID string `json:"storagePolicyID,omitempty" protobuf:"bytes,4,opt,name=storagePolicyID"` 1338} 1339 1340// Represents a Photon Controller persistent disk resource. 1341type PhotonPersistentDiskVolumeSource struct { 1342 // ID that identifies Photon Controller persistent disk 1343 PdID string `json:"pdID" protobuf:"bytes,1,opt,name=pdID"` 1344 // Filesystem type to mount. 1345 // Must be a filesystem type supported by the host operating system. 1346 // Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. 1347 FSType string `json:"fsType,omitempty" protobuf:"bytes,2,opt,name=fsType"` 1348} 1349 1350type AzureDataDiskCachingMode string 1351type AzureDataDiskKind string 1352 1353const ( 1354 AzureDataDiskCachingNone AzureDataDiskCachingMode = "None" 1355 AzureDataDiskCachingReadOnly AzureDataDiskCachingMode = "ReadOnly" 1356 AzureDataDiskCachingReadWrite AzureDataDiskCachingMode = "ReadWrite" 1357 1358 AzureSharedBlobDisk AzureDataDiskKind = "Shared" 1359 AzureDedicatedBlobDisk AzureDataDiskKind = "Dedicated" 1360 AzureManagedDisk AzureDataDiskKind = "Managed" 1361) 1362 1363// AzureDisk represents an Azure Data Disk mount on the host and bind mount to the pod. 1364type AzureDiskVolumeSource struct { 1365 // The Name of the data disk in the blob storage 1366 DiskName string `json:"diskName" protobuf:"bytes,1,opt,name=diskName"` 1367 // The URI the data disk in the blob storage 1368 DataDiskURI string `json:"diskURI" protobuf:"bytes,2,opt,name=diskURI"` 1369 // Host Caching mode: None, Read Only, Read Write. 1370 // +optional 1371 CachingMode *AzureDataDiskCachingMode `json:"cachingMode,omitempty" protobuf:"bytes,3,opt,name=cachingMode,casttype=AzureDataDiskCachingMode"` 1372 // Filesystem type to mount. 1373 // Must be a filesystem type supported by the host operating system. 1374 // Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. 1375 // +optional 1376 FSType *string `json:"fsType,omitempty" protobuf:"bytes,4,opt,name=fsType"` 1377 // Defaults to false (read/write). ReadOnly here will force 1378 // the ReadOnly setting in VolumeMounts. 1379 // +optional 1380 ReadOnly *bool `json:"readOnly,omitempty" protobuf:"varint,5,opt,name=readOnly"` 1381 // Expected values Shared: multiple blob disks per storage account Dedicated: single blob disk per storage account Managed: azure managed data disk (only in managed availability set). defaults to shared 1382 Kind *AzureDataDiskKind `json:"kind,omitempty" protobuf:"bytes,6,opt,name=kind,casttype=AzureDataDiskKind"` 1383} 1384 1385// PortworxVolumeSource represents a Portworx volume resource. 1386type PortworxVolumeSource struct { 1387 // VolumeID uniquely identifies a Portworx volume 1388 VolumeID string `json:"volumeID" protobuf:"bytes,1,opt,name=volumeID"` 1389 // FSType represents the filesystem type to mount 1390 // Must be a filesystem type supported by the host operating system. 1391 // Ex. "ext4", "xfs". Implicitly inferred to be "ext4" if unspecified. 1392 FSType string `json:"fsType,omitempty" protobuf:"bytes,2,opt,name=fsType"` 1393 // Defaults to false (read/write). ReadOnly here will force 1394 // the ReadOnly setting in VolumeMounts. 1395 // +optional 1396 ReadOnly bool `json:"readOnly,omitempty" protobuf:"varint,3,opt,name=readOnly"` 1397} 1398 1399// ScaleIOVolumeSource represents a persistent ScaleIO volume 1400type ScaleIOVolumeSource struct { 1401 // The host address of the ScaleIO API Gateway. 1402 Gateway string `json:"gateway" protobuf:"bytes,1,opt,name=gateway"` 1403 // The name of the storage system as configured in ScaleIO. 1404 System string `json:"system" protobuf:"bytes,2,opt,name=system"` 1405 // SecretRef references to the secret for ScaleIO user and other 1406 // sensitive information. If this is not provided, Login operation will fail. 1407 SecretRef *LocalObjectReference `json:"secretRef" protobuf:"bytes,3,opt,name=secretRef"` 1408 // Flag to enable/disable SSL communication with Gateway, default false 1409 // +optional 1410 SSLEnabled bool `json:"sslEnabled,omitempty" protobuf:"varint,4,opt,name=sslEnabled"` 1411 // The name of the ScaleIO Protection Domain for the configured storage. 1412 // +optional 1413 ProtectionDomain string `json:"protectionDomain,omitempty" protobuf:"bytes,5,opt,name=protectionDomain"` 1414 // The ScaleIO Storage Pool associated with the protection domain. 1415 // +optional 1416 StoragePool string `json:"storagePool,omitempty" protobuf:"bytes,6,opt,name=storagePool"` 1417 // Indicates whether the storage for a volume should be ThickProvisioned or ThinProvisioned. 1418 // Default is ThinProvisioned. 1419 // +optional 1420 StorageMode string `json:"storageMode,omitempty" protobuf:"bytes,7,opt,name=storageMode"` 1421 // The name of a volume already created in the ScaleIO system 1422 // that is associated with this volume source. 1423 VolumeName string `json:"volumeName,omitempty" protobuf:"bytes,8,opt,name=volumeName"` 1424 // Filesystem type to mount. 1425 // Must be a filesystem type supported by the host operating system. 1426 // Ex. "ext4", "xfs", "ntfs". 1427 // Default is "xfs". 1428 // +optional 1429 FSType string `json:"fsType,omitempty" protobuf:"bytes,9,opt,name=fsType"` 1430 // Defaults to false (read/write). ReadOnly here will force 1431 // the ReadOnly setting in VolumeMounts. 1432 // +optional 1433 ReadOnly bool `json:"readOnly,omitempty" protobuf:"varint,10,opt,name=readOnly"` 1434} 1435 1436// ScaleIOPersistentVolumeSource represents a persistent ScaleIO volume 1437type ScaleIOPersistentVolumeSource struct { 1438 // The host address of the ScaleIO API Gateway. 1439 Gateway string `json:"gateway" protobuf:"bytes,1,opt,name=gateway"` 1440 // The name of the storage system as configured in ScaleIO. 1441 System string `json:"system" protobuf:"bytes,2,opt,name=system"` 1442 // SecretRef references to the secret for ScaleIO user and other 1443 // sensitive information. If this is not provided, Login operation will fail. 1444 SecretRef *SecretReference `json:"secretRef" protobuf:"bytes,3,opt,name=secretRef"` 1445 // Flag to enable/disable SSL communication with Gateway, default false 1446 // +optional 1447 SSLEnabled bool `json:"sslEnabled,omitempty" protobuf:"varint,4,opt,name=sslEnabled"` 1448 // The name of the ScaleIO Protection Domain for the configured storage. 1449 // +optional 1450 ProtectionDomain string `json:"protectionDomain,omitempty" protobuf:"bytes,5,opt,name=protectionDomain"` 1451 // The ScaleIO Storage Pool associated with the protection domain. 1452 // +optional 1453 StoragePool string `json:"storagePool,omitempty" protobuf:"bytes,6,opt,name=storagePool"` 1454 // Indicates whether the storage for a volume should be ThickProvisioned or ThinProvisioned. 1455 // Default is ThinProvisioned. 1456 // +optional 1457 StorageMode string `json:"storageMode,omitempty" protobuf:"bytes,7,opt,name=storageMode"` 1458 // The name of a volume already created in the ScaleIO system 1459 // that is associated with this volume source. 1460 VolumeName string `json:"volumeName,omitempty" protobuf:"bytes,8,opt,name=volumeName"` 1461 // Filesystem type to mount. 1462 // Must be a filesystem type supported by the host operating system. 1463 // Ex. "ext4", "xfs", "ntfs". 1464 // Default is "xfs" 1465 // +optional 1466 FSType string `json:"fsType,omitempty" protobuf:"bytes,9,opt,name=fsType"` 1467 // Defaults to false (read/write). ReadOnly here will force 1468 // the ReadOnly setting in VolumeMounts. 1469 // +optional 1470 ReadOnly bool `json:"readOnly,omitempty" protobuf:"varint,10,opt,name=readOnly"` 1471} 1472 1473// Represents a StorageOS persistent volume resource. 1474type StorageOSVolumeSource struct { 1475 // VolumeName is the human-readable name of the StorageOS volume. Volume 1476 // names are only unique within a namespace. 1477 VolumeName string `json:"volumeName,omitempty" protobuf:"bytes,1,opt,name=volumeName"` 1478 // VolumeNamespace specifies the scope of the volume within StorageOS. If no 1479 // namespace is specified then the Pod's namespace will be used. This allows the 1480 // Kubernetes name scoping to be mirrored within StorageOS for tighter integration. 1481 // Set VolumeName to any name to override the default behaviour. 1482 // Set to "default" if you are not using namespaces within StorageOS. 1483 // Namespaces that do not pre-exist within StorageOS will be created. 1484 // +optional 1485 VolumeNamespace string `json:"volumeNamespace,omitempty" protobuf:"bytes,2,opt,name=volumeNamespace"` 1486 // Filesystem type to mount. 1487 // Must be a filesystem type supported by the host operating system. 1488 // Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. 1489 // +optional 1490 FSType string `json:"fsType,omitempty" protobuf:"bytes,3,opt,name=fsType"` 1491 // Defaults to false (read/write). ReadOnly here will force 1492 // the ReadOnly setting in VolumeMounts. 1493 // +optional 1494 ReadOnly bool `json:"readOnly,omitempty" protobuf:"varint,4,opt,name=readOnly"` 1495 // SecretRef specifies the secret to use for obtaining the StorageOS API 1496 // credentials. If not specified, default values will be attempted. 1497 // +optional 1498 SecretRef *LocalObjectReference `json:"secretRef,omitempty" protobuf:"bytes,5,opt,name=secretRef"` 1499} 1500 1501// Represents a StorageOS persistent volume resource. 1502type StorageOSPersistentVolumeSource struct { 1503 // VolumeName is the human-readable name of the StorageOS volume. Volume 1504 // names are only unique within a namespace. 1505 VolumeName string `json:"volumeName,omitempty" protobuf:"bytes,1,opt,name=volumeName"` 1506 // VolumeNamespace specifies the scope of the volume within StorageOS. If no 1507 // namespace is specified then the Pod's namespace will be used. This allows the 1508 // Kubernetes name scoping to be mirrored within StorageOS for tighter integration. 1509 // Set VolumeName to any name to override the default behaviour. 1510 // Set to "default" if you are not using namespaces within StorageOS. 1511 // Namespaces that do not pre-exist within StorageOS will be created. 1512 // +optional 1513 VolumeNamespace string `json:"volumeNamespace,omitempty" protobuf:"bytes,2,opt,name=volumeNamespace"` 1514 // Filesystem type to mount. 1515 // Must be a filesystem type supported by the host operating system. 1516 // Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. 1517 // +optional 1518 FSType string `json:"fsType,omitempty" protobuf:"bytes,3,opt,name=fsType"` 1519 // Defaults to false (read/write). ReadOnly here will force 1520 // the ReadOnly setting in VolumeMounts. 1521 // +optional 1522 ReadOnly bool `json:"readOnly,omitempty" protobuf:"varint,4,opt,name=readOnly"` 1523 // SecretRef specifies the secret to use for obtaining the StorageOS API 1524 // credentials. If not specified, default values will be attempted. 1525 // +optional 1526 SecretRef *ObjectReference `json:"secretRef,omitempty" protobuf:"bytes,5,opt,name=secretRef"` 1527} 1528 1529// Adapts a ConfigMap into a volume. 1530// 1531// The contents of the target ConfigMap's Data field will be presented in a 1532// volume as files using the keys in the Data field as the file names, unless 1533// the items element is populated with specific mappings of keys to paths. 1534// ConfigMap volumes support ownership management and SELinux relabeling. 1535type ConfigMapVolumeSource struct { 1536 LocalObjectReference `json:",inline" protobuf:"bytes,1,opt,name=localObjectReference"` 1537 // If unspecified, each key-value pair in the Data field of the referenced 1538 // ConfigMap will be projected into the volume as a file whose name is the 1539 // key and content is the value. If specified, the listed keys will be 1540 // projected into the specified paths, and unlisted keys will not be 1541 // present. If a key is specified which is not present in the ConfigMap, 1542 // the volume setup will error unless it is marked optional. Paths must be 1543 // relative and may not contain the '..' path or start with '..'. 1544 // +optional 1545 Items []KeyToPath `json:"items,omitempty" protobuf:"bytes,2,rep,name=items"` 1546 // Optional: mode bits used to set permissions on created files by default. 1547 // Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. 1548 // YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. 1549 // Defaults to 0644. 1550 // Directories within the path are not affected by this setting. 1551 // This might be in conflict with other options that affect the file 1552 // mode, like fsGroup, and the result can be other mode bits set. 1553 // +optional 1554 DefaultMode *int32 `json:"defaultMode,omitempty" protobuf:"varint,3,opt,name=defaultMode"` 1555 // Specify whether the ConfigMap or its keys must be defined 1556 // +optional 1557 Optional *bool `json:"optional,omitempty" protobuf:"varint,4,opt,name=optional"` 1558} 1559 1560const ( 1561 ConfigMapVolumeSourceDefaultMode int32 = 0644 1562) 1563 1564// Adapts a ConfigMap into a projected volume. 1565// 1566// The contents of the target ConfigMap's Data field will be presented in a 1567// projected volume as files using the keys in the Data field as the file names, 1568// unless the items element is populated with specific mappings of keys to paths. 1569// Note that this is identical to a configmap volume source without the default 1570// mode. 1571type ConfigMapProjection struct { 1572 LocalObjectReference `json:",inline" protobuf:"bytes,1,opt,name=localObjectReference"` 1573 // If unspecified, each key-value pair in the Data field of the referenced 1574 // ConfigMap will be projected into the volume as a file whose name is the 1575 // key and content is the value. If specified, the listed keys will be 1576 // projected into the specified paths, and unlisted keys will not be 1577 // present. If a key is specified which is not present in the ConfigMap, 1578 // the volume setup will error unless it is marked optional. Paths must be 1579 // relative and may not contain the '..' path or start with '..'. 1580 // +optional 1581 Items []KeyToPath `json:"items,omitempty" protobuf:"bytes,2,rep,name=items"` 1582 // Specify whether the ConfigMap or its keys must be defined 1583 // +optional 1584 Optional *bool `json:"optional,omitempty" protobuf:"varint,4,opt,name=optional"` 1585} 1586 1587// ServiceAccountTokenProjection represents a projected service account token 1588// volume. This projection can be used to insert a service account token into 1589// the pods runtime filesystem for use against APIs (Kubernetes API Server or 1590// otherwise). 1591type ServiceAccountTokenProjection struct { 1592 // Audience is the intended audience of the token. A recipient of a token 1593 // must identify itself with an identifier specified in the audience of the 1594 // token, and otherwise should reject the token. The audience defaults to the 1595 // identifier of the apiserver. 1596 //+optional 1597 Audience string `json:"audience,omitempty" protobuf:"bytes,1,rep,name=audience"` 1598 // ExpirationSeconds is the requested duration of validity of the service 1599 // account token. As the token approaches expiration, the kubelet volume 1600 // plugin will proactively rotate the service account token. The kubelet will 1601 // start trying to rotate the token if the token is older than 80 percent of 1602 // its time to live or if the token is older than 24 hours.Defaults to 1 hour 1603 // and must be at least 10 minutes. 1604 //+optional 1605 ExpirationSeconds *int64 `json:"expirationSeconds,omitempty" protobuf:"varint,2,opt,name=expirationSeconds"` 1606 // Path is the path relative to the mount point of the file to project the 1607 // token into. 1608 Path string `json:"path" protobuf:"bytes,3,opt,name=path"` 1609} 1610 1611// Represents a projected volume source 1612type ProjectedVolumeSource struct { 1613 // list of volume projections 1614 // +optional 1615 Sources []VolumeProjection `json:"sources" protobuf:"bytes,1,rep,name=sources"` 1616 // Mode bits used to set permissions on created files by default. 1617 // Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. 1618 // YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. 1619 // Directories within the path are not affected by this setting. 1620 // This might be in conflict with other options that affect the file 1621 // mode, like fsGroup, and the result can be other mode bits set. 1622 // +optional 1623 DefaultMode *int32 `json:"defaultMode,omitempty" protobuf:"varint,2,opt,name=defaultMode"` 1624} 1625 1626// Projection that may be projected along with other supported volume types 1627type VolumeProjection struct { 1628 // all types below are the supported types for projection into the same volume 1629 1630 // information about the secret data to project 1631 // +optional 1632 Secret *SecretProjection `json:"secret,omitempty" protobuf:"bytes,1,opt,name=secret"` 1633 // information about the downwardAPI data to project 1634 // +optional 1635 DownwardAPI *DownwardAPIProjection `json:"downwardAPI,omitempty" protobuf:"bytes,2,opt,name=downwardAPI"` 1636 // information about the configMap data to project 1637 // +optional 1638 ConfigMap *ConfigMapProjection `json:"configMap,omitempty" protobuf:"bytes,3,opt,name=configMap"` 1639 // information about the serviceAccountToken data to project 1640 // +optional 1641 ServiceAccountToken *ServiceAccountTokenProjection `json:"serviceAccountToken,omitempty" protobuf:"bytes,4,opt,name=serviceAccountToken"` 1642} 1643 1644const ( 1645 ProjectedVolumeSourceDefaultMode int32 = 0644 1646) 1647 1648// Maps a string key to a path within a volume. 1649type KeyToPath struct { 1650 // The key to project. 1651 Key string `json:"key" protobuf:"bytes,1,opt,name=key"` 1652 1653 // The relative path of the file to map the key to. 1654 // May not be an absolute path. 1655 // May not contain the path element '..'. 1656 // May not start with the string '..'. 1657 Path string `json:"path" protobuf:"bytes,2,opt,name=path"` 1658 // Optional: mode bits used to set permissions on this file. 1659 // Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. 1660 // YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. 1661 // If not specified, the volume defaultMode will be used. 1662 // This might be in conflict with other options that affect the file 1663 // mode, like fsGroup, and the result can be other mode bits set. 1664 // +optional 1665 Mode *int32 `json:"mode,omitempty" protobuf:"varint,3,opt,name=mode"` 1666} 1667 1668// Local represents directly-attached storage with node affinity (Beta feature) 1669type LocalVolumeSource struct { 1670 // The full path to the volume on the node. 1671 // It can be either a directory or block device (disk, partition, ...). 1672 Path string `json:"path" protobuf:"bytes,1,opt,name=path"` 1673 1674 // Filesystem type to mount. 1675 // It applies only when the Path is a block device. 1676 // Must be a filesystem type supported by the host operating system. 1677 // Ex. "ext4", "xfs", "ntfs". The default value is to auto-select a fileystem if unspecified. 1678 // +optional 1679 FSType *string `json:"fsType,omitempty" protobuf:"bytes,2,opt,name=fsType"` 1680} 1681 1682// Represents storage that is managed by an external CSI volume driver (Beta feature) 1683type CSIPersistentVolumeSource struct { 1684 // Driver is the name of the driver to use for this volume. 1685 // Required. 1686 Driver string `json:"driver" protobuf:"bytes,1,opt,name=driver"` 1687 1688 // VolumeHandle is the unique volume name returned by the CSI volume 1689 // plugin’s CreateVolume to refer to the volume on all subsequent calls. 1690 // Required. 1691 VolumeHandle string `json:"volumeHandle" protobuf:"bytes,2,opt,name=volumeHandle"` 1692 1693 // Optional: The value to pass to ControllerPublishVolumeRequest. 1694 // Defaults to false (read/write). 1695 // +optional 1696 ReadOnly bool `json:"readOnly,omitempty" protobuf:"varint,3,opt,name=readOnly"` 1697 1698 // Filesystem type to mount. 1699 // Must be a filesystem type supported by the host operating system. 1700 // Ex. "ext4", "xfs", "ntfs". 1701 // +optional 1702 FSType string `json:"fsType,omitempty" protobuf:"bytes,4,opt,name=fsType"` 1703 1704 // Attributes of the volume to publish. 1705 // +optional 1706 VolumeAttributes map[string]string `json:"volumeAttributes,omitempty" protobuf:"bytes,5,rep,name=volumeAttributes"` 1707 1708 // ControllerPublishSecretRef is a reference to the secret object containing 1709 // sensitive information to pass to the CSI driver to complete the CSI 1710 // ControllerPublishVolume and ControllerUnpublishVolume calls. 1711 // This field is optional, and may be empty if no secret is required. If the 1712 // secret object contains more than one secret, all secrets are passed. 1713 // +optional 1714 ControllerPublishSecretRef *SecretReference `json:"controllerPublishSecretRef,omitempty" protobuf:"bytes,6,opt,name=controllerPublishSecretRef"` 1715 1716 // NodeStageSecretRef is a reference to the secret object containing sensitive 1717 // information to pass to the CSI driver to complete the CSI NodeStageVolume 1718 // and NodeStageVolume and NodeUnstageVolume calls. 1719 // This field is optional, and may be empty if no secret is required. If the 1720 // secret object contains more than one secret, all secrets are passed. 1721 // +optional 1722 NodeStageSecretRef *SecretReference `json:"nodeStageSecretRef,omitempty" protobuf:"bytes,7,opt,name=nodeStageSecretRef"` 1723 1724 // NodePublishSecretRef is a reference to the secret object containing 1725 // sensitive information to pass to the CSI driver to complete the CSI 1726 // NodePublishVolume and NodeUnpublishVolume calls. 1727 // This field is optional, and may be empty if no secret is required. If the 1728 // secret object contains more than one secret, all secrets are passed. 1729 // +optional 1730 NodePublishSecretRef *SecretReference `json:"nodePublishSecretRef,omitempty" protobuf:"bytes,8,opt,name=nodePublishSecretRef"` 1731 1732 // ControllerExpandSecretRef is a reference to the secret object containing 1733 // sensitive information to pass to the CSI driver to complete the CSI 1734 // ControllerExpandVolume call. 1735 // This is an alpha field and requires enabling ExpandCSIVolumes feature gate. 1736 // This field is optional, and may be empty if no secret is required. If the 1737 // secret object contains more than one secret, all secrets are passed. 1738 // +optional 1739 ControllerExpandSecretRef *SecretReference `json:"controllerExpandSecretRef,omitempty" protobuf:"bytes,9,opt,name=controllerExpandSecretRef"` 1740} 1741 1742// Represents a source location of a volume to mount, managed by an external CSI driver 1743type CSIVolumeSource struct { 1744 // Driver is the name of the CSI driver that handles this volume. 1745 // Consult with your admin for the correct name as registered in the cluster. 1746 Driver string `json:"driver" protobuf:"bytes,1,opt,name=driver"` 1747 1748 // Specifies a read-only configuration for the volume. 1749 // Defaults to false (read/write). 1750 // +optional 1751 ReadOnly *bool `json:"readOnly,omitempty" protobuf:"varint,2,opt,name=readOnly"` 1752 1753 // Filesystem type to mount. Ex. "ext4", "xfs", "ntfs". 1754 // If not provided, the empty value is passed to the associated CSI driver 1755 // which will determine the default filesystem to apply. 1756 // +optional 1757 FSType *string `json:"fsType,omitempty" protobuf:"bytes,3,opt,name=fsType"` 1758 1759 // VolumeAttributes stores driver-specific properties that are passed to the CSI 1760 // driver. Consult your driver's documentation for supported values. 1761 // +optional 1762 VolumeAttributes map[string]string `json:"volumeAttributes,omitempty" protobuf:"bytes,4,rep,name=volumeAttributes"` 1763 1764 // NodePublishSecretRef is a reference to the secret object containing 1765 // sensitive information to pass to the CSI driver to complete the CSI 1766 // NodePublishVolume and NodeUnpublishVolume calls. 1767 // This field is optional, and may be empty if no secret is required. If the 1768 // secret object contains more than one secret, all secret references are passed. 1769 // +optional 1770 NodePublishSecretRef *LocalObjectReference `json:"nodePublishSecretRef,omitempty" protobuf:"bytes,5,opt,name=nodePublishSecretRef"` 1771} 1772 1773// Represents an ephemeral volume that is handled by a normal storage driver. 1774type EphemeralVolumeSource struct { 1775 // Will be used to create a stand-alone PVC to provision the volume. 1776 // The pod in which this EphemeralVolumeSource is embedded will be the 1777 // owner of the PVC, i.e. the PVC will be deleted together with the 1778 // pod. The name of the PVC will be `<pod name>-<volume name>` where 1779 // `<volume name>` is the name from the `PodSpec.Volumes` array 1780 // entry. Pod validation will reject the pod if the concatenated name 1781 // is not valid for a PVC (for example, too long). 1782 // 1783 // An existing PVC with that name that is not owned by the pod 1784 // will *not* be used for the pod to avoid using an unrelated 1785 // volume by mistake. Starting the pod is then blocked until 1786 // the unrelated PVC is removed. If such a pre-created PVC is 1787 // meant to be used by the pod, the PVC has to updated with an 1788 // owner reference to the pod once the pod exists. Normally 1789 // this should not be necessary, but it may be useful when 1790 // manually reconstructing a broken cluster. 1791 // 1792 // This field is read-only and no changes will be made by Kubernetes 1793 // to the PVC after it has been created. 1794 // 1795 // Required, must not be nil. 1796 VolumeClaimTemplate *PersistentVolumeClaimTemplate `json:"volumeClaimTemplate,omitempty" protobuf:"bytes,1,opt,name=volumeClaimTemplate"` 1797 1798 // Specifies a read-only configuration for the volume. 1799 // Defaults to false (read/write). 1800 // +optional 1801 ReadOnly bool `json:"readOnly,omitempty" protobuf:"varint,2,opt,name=readOnly"` 1802} 1803 1804// PersistentVolumeClaimTemplate is used to produce 1805// PersistentVolumeClaim objects as part of an EphemeralVolumeSource. 1806type PersistentVolumeClaimTemplate struct { 1807 // May contain labels and annotations that will be copied into the PVC 1808 // when creating it. No other fields are allowed and will be rejected during 1809 // validation. 1810 // 1811 // +optional 1812 metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` 1813 1814 // The specification for the PersistentVolumeClaim. The entire content is 1815 // copied unchanged into the PVC that gets created from this 1816 // template. The same fields as in a PersistentVolumeClaim 1817 // are also valid here. 1818 Spec PersistentVolumeClaimSpec `json:"spec" protobuf:"bytes,2,name=spec"` 1819} 1820 1821// ContainerPort represents a network port in a single container. 1822type ContainerPort struct { 1823 // If specified, this must be an IANA_SVC_NAME and unique within the pod. Each 1824 // named port in a pod must have a unique name. Name for the port that can be 1825 // referred to by services. 1826 // +optional 1827 Name string `json:"name,omitempty" protobuf:"bytes,1,opt,name=name"` 1828 // Number of port to expose on the host. 1829 // If specified, this must be a valid port number, 0 < x < 65536. 1830 // If HostNetwork is specified, this must match ContainerPort. 1831 // Most containers do not need this. 1832 // +optional 1833 HostPort int32 `json:"hostPort,omitempty" protobuf:"varint,2,opt,name=hostPort"` 1834 // Number of port to expose on the pod's IP address. 1835 // This must be a valid port number, 0 < x < 65536. 1836 ContainerPort int32 `json:"containerPort" protobuf:"varint,3,opt,name=containerPort"` 1837 // Protocol for port. Must be UDP, TCP, or SCTP. 1838 // Defaults to "TCP". 1839 // +optional 1840 // +default="TCP" 1841 Protocol Protocol `json:"protocol,omitempty" protobuf:"bytes,4,opt,name=protocol,casttype=Protocol"` 1842 // What host IP to bind the external port to. 1843 // +optional 1844 HostIP string `json:"hostIP,omitempty" protobuf:"bytes,5,opt,name=hostIP"` 1845} 1846 1847// VolumeMount describes a mounting of a Volume within a container. 1848type VolumeMount struct { 1849 // This must match the Name of a Volume. 1850 Name string `json:"name" protobuf:"bytes,1,opt,name=name"` 1851 // Mounted read-only if true, read-write otherwise (false or unspecified). 1852 // Defaults to false. 1853 // +optional 1854 ReadOnly bool `json:"readOnly,omitempty" protobuf:"varint,2,opt,name=readOnly"` 1855 // Path within the container at which the volume should be mounted. Must 1856 // not contain ':'. 1857 MountPath string `json:"mountPath" protobuf:"bytes,3,opt,name=mountPath"` 1858 // Path within the volume from which the container's volume should be mounted. 1859 // Defaults to "" (volume's root). 1860 // +optional 1861 SubPath string `json:"subPath,omitempty" protobuf:"bytes,4,opt,name=subPath"` 1862 // mountPropagation determines how mounts are propagated from the host 1863 // to container and the other way around. 1864 // When not set, MountPropagationNone is used. 1865 // This field is beta in 1.10. 1866 // +optional 1867 MountPropagation *MountPropagationMode `json:"mountPropagation,omitempty" protobuf:"bytes,5,opt,name=mountPropagation,casttype=MountPropagationMode"` 1868 // Expanded path within the volume from which the container's volume should be mounted. 1869 // Behaves similarly to SubPath but environment variable references $(VAR_NAME) are expanded using the container's environment. 1870 // Defaults to "" (volume's root). 1871 // SubPathExpr and SubPath are mutually exclusive. 1872 // +optional 1873 SubPathExpr string `json:"subPathExpr,omitempty" protobuf:"bytes,6,opt,name=subPathExpr"` 1874} 1875 1876// MountPropagationMode describes mount propagation. 1877type MountPropagationMode string 1878 1879const ( 1880 // MountPropagationNone means that the volume in a container will 1881 // not receive new mounts from the host or other containers, and filesystems 1882 // mounted inside the container won't be propagated to the host or other 1883 // containers. 1884 // Note that this mode corresponds to "private" in Linux terminology. 1885 MountPropagationNone MountPropagationMode = "None" 1886 // MountPropagationHostToContainer means that the volume in a container will 1887 // receive new mounts from the host or other containers, but filesystems 1888 // mounted inside the container won't be propagated to the host or other 1889 // containers. 1890 // Note that this mode is recursively applied to all mounts in the volume 1891 // ("rslave" in Linux terminology). 1892 MountPropagationHostToContainer MountPropagationMode = "HostToContainer" 1893 // MountPropagationBidirectional means that the volume in a container will 1894 // receive new mounts from the host or other containers, and its own mounts 1895 // will be propagated from the container to the host or other containers. 1896 // Note that this mode is recursively applied to all mounts in the volume 1897 // ("rshared" in Linux terminology). 1898 MountPropagationBidirectional MountPropagationMode = "Bidirectional" 1899) 1900 1901// volumeDevice describes a mapping of a raw block device within a container. 1902type VolumeDevice struct { 1903 // name must match the name of a persistentVolumeClaim in the pod 1904 Name string `json:"name" protobuf:"bytes,1,opt,name=name"` 1905 // devicePath is the path inside of the container that the device will be mapped to. 1906 DevicePath string `json:"devicePath" protobuf:"bytes,2,opt,name=devicePath"` 1907} 1908 1909// EnvVar represents an environment variable present in a Container. 1910type EnvVar struct { 1911 // Name of the environment variable. Must be a C_IDENTIFIER. 1912 Name string `json:"name" protobuf:"bytes,1,opt,name=name"` 1913 1914 // Optional: no more than one of the following may be specified. 1915 1916 // Variable references $(VAR_NAME) are expanded 1917 // using the previous defined environment variables in the container and 1918 // any service environment variables. If a variable cannot be resolved, 1919 // the reference in the input string will be unchanged. The $(VAR_NAME) 1920 // syntax can be escaped with a double $$, ie: $$(VAR_NAME). Escaped 1921 // references will never be expanded, regardless of whether the variable 1922 // exists or not. 1923 // Defaults to "". 1924 // +optional 1925 Value string `json:"value,omitempty" protobuf:"bytes,2,opt,name=value"` 1926 // Source for the environment variable's value. Cannot be used if value is not empty. 1927 // +optional 1928 ValueFrom *EnvVarSource `json:"valueFrom,omitempty" protobuf:"bytes,3,opt,name=valueFrom"` 1929} 1930 1931// EnvVarSource represents a source for the value of an EnvVar. 1932type EnvVarSource struct { 1933 // Selects a field of the pod: supports metadata.name, metadata.namespace, `metadata.labels['<KEY>']`, `metadata.annotations['<KEY>']`, 1934 // spec.nodeName, spec.serviceAccountName, status.hostIP, status.podIP, status.podIPs. 1935 // +optional 1936 FieldRef *ObjectFieldSelector `json:"fieldRef,omitempty" protobuf:"bytes,1,opt,name=fieldRef"` 1937 // Selects a resource of the container: only resources limits and requests 1938 // (limits.cpu, limits.memory, limits.ephemeral-storage, requests.cpu, requests.memory and requests.ephemeral-storage) are currently supported. 1939 // +optional 1940 ResourceFieldRef *ResourceFieldSelector `json:"resourceFieldRef,omitempty" protobuf:"bytes,2,opt,name=resourceFieldRef"` 1941 // Selects a key of a ConfigMap. 1942 // +optional 1943 ConfigMapKeyRef *ConfigMapKeySelector `json:"configMapKeyRef,omitempty" protobuf:"bytes,3,opt,name=configMapKeyRef"` 1944 // Selects a key of a secret in the pod's namespace 1945 // +optional 1946 SecretKeyRef *SecretKeySelector `json:"secretKeyRef,omitempty" protobuf:"bytes,4,opt,name=secretKeyRef"` 1947} 1948 1949// ObjectFieldSelector selects an APIVersioned field of an object. 1950type ObjectFieldSelector struct { 1951 // Version of the schema the FieldPath is written in terms of, defaults to "v1". 1952 // +optional 1953 APIVersion string `json:"apiVersion,omitempty" protobuf:"bytes,1,opt,name=apiVersion"` 1954 // Path of the field to select in the specified API version. 1955 FieldPath string `json:"fieldPath" protobuf:"bytes,2,opt,name=fieldPath"` 1956} 1957 1958// ResourceFieldSelector represents container resources (cpu, memory) and their output format 1959type ResourceFieldSelector struct { 1960 // Container name: required for volumes, optional for env vars 1961 // +optional 1962 ContainerName string `json:"containerName,omitempty" protobuf:"bytes,1,opt,name=containerName"` 1963 // Required: resource to select 1964 Resource string `json:"resource" protobuf:"bytes,2,opt,name=resource"` 1965 // Specifies the output format of the exposed resources, defaults to "1" 1966 // +optional 1967 Divisor resource.Quantity `json:"divisor,omitempty" protobuf:"bytes,3,opt,name=divisor"` 1968} 1969 1970// Selects a key from a ConfigMap. 1971type ConfigMapKeySelector struct { 1972 // The ConfigMap to select from. 1973 LocalObjectReference `json:",inline" protobuf:"bytes,1,opt,name=localObjectReference"` 1974 // The key to select. 1975 Key string `json:"key" protobuf:"bytes,2,opt,name=key"` 1976 // Specify whether the ConfigMap or its key must be defined 1977 // +optional 1978 Optional *bool `json:"optional,omitempty" protobuf:"varint,3,opt,name=optional"` 1979} 1980 1981// SecretKeySelector selects a key of a Secret. 1982type SecretKeySelector struct { 1983 // The name of the secret in the pod's namespace to select from. 1984 LocalObjectReference `json:",inline" protobuf:"bytes,1,opt,name=localObjectReference"` 1985 // The key of the secret to select from. Must be a valid secret key. 1986 Key string `json:"key" protobuf:"bytes,2,opt,name=key"` 1987 // Specify whether the Secret or its key must be defined 1988 // +optional 1989 Optional *bool `json:"optional,omitempty" protobuf:"varint,3,opt,name=optional"` 1990} 1991 1992// EnvFromSource represents the source of a set of ConfigMaps 1993type EnvFromSource struct { 1994 // An optional identifier to prepend to each key in the ConfigMap. Must be a C_IDENTIFIER. 1995 // +optional 1996 Prefix string `json:"prefix,omitempty" protobuf:"bytes,1,opt,name=prefix"` 1997 // The ConfigMap to select from 1998 // +optional 1999 ConfigMapRef *ConfigMapEnvSource `json:"configMapRef,omitempty" protobuf:"bytes,2,opt,name=configMapRef"` 2000 // The Secret to select from 2001 // +optional 2002 SecretRef *SecretEnvSource `json:"secretRef,omitempty" protobuf:"bytes,3,opt,name=secretRef"` 2003} 2004 2005// ConfigMapEnvSource selects a ConfigMap to populate the environment 2006// variables with. 2007// 2008// The contents of the target ConfigMap's Data field will represent the 2009// key-value pairs as environment variables. 2010type ConfigMapEnvSource struct { 2011 // The ConfigMap to select from. 2012 LocalObjectReference `json:",inline" protobuf:"bytes,1,opt,name=localObjectReference"` 2013 // Specify whether the ConfigMap must be defined 2014 // +optional 2015 Optional *bool `json:"optional,omitempty" protobuf:"varint,2,opt,name=optional"` 2016} 2017 2018// SecretEnvSource selects a Secret to populate the environment 2019// variables with. 2020// 2021// The contents of the target Secret's Data field will represent the 2022// key-value pairs as environment variables. 2023type SecretEnvSource struct { 2024 // The Secret to select from. 2025 LocalObjectReference `json:",inline" protobuf:"bytes,1,opt,name=localObjectReference"` 2026 // Specify whether the Secret must be defined 2027 // +optional 2028 Optional *bool `json:"optional,omitempty" protobuf:"varint,2,opt,name=optional"` 2029} 2030 2031// HTTPHeader describes a custom header to be used in HTTP probes 2032type HTTPHeader struct { 2033 // The header field name 2034 Name string `json:"name" protobuf:"bytes,1,opt,name=name"` 2035 // The header field value 2036 Value string `json:"value" protobuf:"bytes,2,opt,name=value"` 2037} 2038 2039// HTTPGetAction describes an action based on HTTP Get requests. 2040type HTTPGetAction struct { 2041 // Path to access on the HTTP server. 2042 // +optional 2043 Path string `json:"path,omitempty" protobuf:"bytes,1,opt,name=path"` 2044 // Name or number of the port to access on the container. 2045 // Number must be in the range 1 to 65535. 2046 // Name must be an IANA_SVC_NAME. 2047 Port intstr.IntOrString `json:"port" protobuf:"bytes,2,opt,name=port"` 2048 // Host name to connect to, defaults to the pod IP. You probably want to set 2049 // "Host" in httpHeaders instead. 2050 // +optional 2051 Host string `json:"host,omitempty" protobuf:"bytes,3,opt,name=host"` 2052 // Scheme to use for connecting to the host. 2053 // Defaults to HTTP. 2054 // +optional 2055 Scheme URIScheme `json:"scheme,omitempty" protobuf:"bytes,4,opt,name=scheme,casttype=URIScheme"` 2056 // Custom headers to set in the request. HTTP allows repeated headers. 2057 // +optional 2058 HTTPHeaders []HTTPHeader `json:"httpHeaders,omitempty" protobuf:"bytes,5,rep,name=httpHeaders"` 2059} 2060 2061// URIScheme identifies the scheme used for connection to a host for Get actions 2062type URIScheme string 2063 2064const ( 2065 // URISchemeHTTP means that the scheme used will be http:// 2066 URISchemeHTTP URIScheme = "HTTP" 2067 // URISchemeHTTPS means that the scheme used will be https:// 2068 URISchemeHTTPS URIScheme = "HTTPS" 2069) 2070 2071// TCPSocketAction describes an action based on opening a socket 2072type TCPSocketAction struct { 2073 // Number or name of the port to access on the container. 2074 // Number must be in the range 1 to 65535. 2075 // Name must be an IANA_SVC_NAME. 2076 Port intstr.IntOrString `json:"port" protobuf:"bytes,1,opt,name=port"` 2077 // Optional: Host name to connect to, defaults to the pod IP. 2078 // +optional 2079 Host string `json:"host,omitempty" protobuf:"bytes,2,opt,name=host"` 2080} 2081 2082// ExecAction describes a "run in container" action. 2083type ExecAction struct { 2084 // Command is the command line to execute inside the container, the working directory for the 2085 // command is root ('/') in the container's filesystem. The command is simply exec'd, it is 2086 // not run inside a shell, so traditional shell instructions ('|', etc) won't work. To use 2087 // a shell, you need to explicitly call out to that shell. 2088 // Exit status of 0 is treated as live/healthy and non-zero is unhealthy. 2089 // +optional 2090 Command []string `json:"command,omitempty" protobuf:"bytes,1,rep,name=command"` 2091} 2092 2093// Probe describes a health check to be performed against a container to determine whether it is 2094// alive or ready to receive traffic. 2095type Probe struct { 2096 // The action taken to determine the health of a container 2097 Handler `json:",inline" protobuf:"bytes,1,opt,name=handler"` 2098 // Number of seconds after the container has started before liveness probes are initiated. 2099 // More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes 2100 // +optional 2101 InitialDelaySeconds int32 `json:"initialDelaySeconds,omitempty" protobuf:"varint,2,opt,name=initialDelaySeconds"` 2102 // Number of seconds after which the probe times out. 2103 // Defaults to 1 second. Minimum value is 1. 2104 // More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes 2105 // +optional 2106 TimeoutSeconds int32 `json:"timeoutSeconds,omitempty" protobuf:"varint,3,opt,name=timeoutSeconds"` 2107 // How often (in seconds) to perform the probe. 2108 // Default to 10 seconds. Minimum value is 1. 2109 // +optional 2110 PeriodSeconds int32 `json:"periodSeconds,omitempty" protobuf:"varint,4,opt,name=periodSeconds"` 2111 // Minimum consecutive successes for the probe to be considered successful after having failed. 2112 // Defaults to 1. Must be 1 for liveness and startup. Minimum value is 1. 2113 // +optional 2114 SuccessThreshold int32 `json:"successThreshold,omitempty" protobuf:"varint,5,opt,name=successThreshold"` 2115 // Minimum consecutive failures for the probe to be considered failed after having succeeded. 2116 // Defaults to 3. Minimum value is 1. 2117 // +optional 2118 FailureThreshold int32 `json:"failureThreshold,omitempty" protobuf:"varint,6,opt,name=failureThreshold"` 2119} 2120 2121// PullPolicy describes a policy for if/when to pull a container image 2122type PullPolicy string 2123 2124const ( 2125 // PullAlways means that kubelet always attempts to pull the latest image. Container will fail If the pull fails. 2126 PullAlways PullPolicy = "Always" 2127 // PullNever means that kubelet never pulls an image, but only uses a local image. Container will fail if the image isn't present 2128 PullNever PullPolicy = "Never" 2129 // PullIfNotPresent means that kubelet pulls if the image isn't present on disk. Container will fail if the image isn't present and the pull fails. 2130 PullIfNotPresent PullPolicy = "IfNotPresent" 2131) 2132 2133// PreemptionPolicy describes a policy for if/when to preempt a pod. 2134type PreemptionPolicy string 2135 2136const ( 2137 // PreemptLowerPriority means that pod can preempt other pods with lower priority. 2138 PreemptLowerPriority PreemptionPolicy = "PreemptLowerPriority" 2139 // PreemptNever means that pod never preempts other pods with lower priority. 2140 PreemptNever PreemptionPolicy = "Never" 2141) 2142 2143// TerminationMessagePolicy describes how termination messages are retrieved from a container. 2144type TerminationMessagePolicy string 2145 2146const ( 2147 // TerminationMessageReadFile is the default behavior and will set the container status message to 2148 // the contents of the container's terminationMessagePath when the container exits. 2149 TerminationMessageReadFile TerminationMessagePolicy = "File" 2150 // TerminationMessageFallbackToLogsOnError will read the most recent contents of the container logs 2151 // for the container status message when the container exits with an error and the 2152 // terminationMessagePath has no contents. 2153 TerminationMessageFallbackToLogsOnError TerminationMessagePolicy = "FallbackToLogsOnError" 2154) 2155 2156// Capability represent POSIX capabilities type 2157type Capability string 2158 2159// Adds and removes POSIX capabilities from running containers. 2160type Capabilities struct { 2161 // Added capabilities 2162 // +optional 2163 Add []Capability `json:"add,omitempty" protobuf:"bytes,1,rep,name=add,casttype=Capability"` 2164 // Removed capabilities 2165 // +optional 2166 Drop []Capability `json:"drop,omitempty" protobuf:"bytes,2,rep,name=drop,casttype=Capability"` 2167} 2168 2169// ResourceRequirements describes the compute resource requirements. 2170type ResourceRequirements struct { 2171 // Limits describes the maximum amount of compute resources allowed. 2172 // More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/ 2173 // +optional 2174 Limits ResourceList `json:"limits,omitempty" protobuf:"bytes,1,rep,name=limits,casttype=ResourceList,castkey=ResourceName"` 2175 // Requests describes the minimum amount of compute resources required. 2176 // If Requests is omitted for a container, it defaults to Limits if that is explicitly specified, 2177 // otherwise to an implementation-defined value. 2178 // More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/ 2179 // +optional 2180 Requests ResourceList `json:"requests,omitempty" protobuf:"bytes,2,rep,name=requests,casttype=ResourceList,castkey=ResourceName"` 2181} 2182 2183const ( 2184 // TerminationMessagePathDefault means the default path to capture the application termination message running in a container 2185 TerminationMessagePathDefault string = "/dev/termination-log" 2186) 2187 2188// A single application container that you want to run within a pod. 2189type Container struct { 2190 // Name of the container specified as a DNS_LABEL. 2191 // Each container in a pod must have a unique name (DNS_LABEL). 2192 // Cannot be updated. 2193 Name string `json:"name" protobuf:"bytes,1,opt,name=name"` 2194 // Docker image name. 2195 // More info: https://kubernetes.io/docs/concepts/containers/images 2196 // This field is optional to allow higher level config management to default or override 2197 // container images in workload controllers like Deployments and StatefulSets. 2198 // +optional 2199 Image string `json:"image,omitempty" protobuf:"bytes,2,opt,name=image"` 2200 // Entrypoint array. Not executed within a shell. 2201 // The docker image's ENTRYPOINT is used if this is not provided. 2202 // Variable references $(VAR_NAME) are expanded using the container's environment. If a variable 2203 // cannot be resolved, the reference in the input string will be unchanged. The $(VAR_NAME) syntax 2204 // can be escaped with a double $$, ie: $$(VAR_NAME). Escaped references will never be expanded, 2205 // regardless of whether the variable exists or not. 2206 // Cannot be updated. 2207 // More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell 2208 // +optional 2209 Command []string `json:"command,omitempty" protobuf:"bytes,3,rep,name=command"` 2210 // Arguments to the entrypoint. 2211 // The docker image's CMD is used if this is not provided. 2212 // Variable references $(VAR_NAME) are expanded using the container's environment. If a variable 2213 // cannot be resolved, the reference in the input string will be unchanged. The $(VAR_NAME) syntax 2214 // can be escaped with a double $$, ie: $$(VAR_NAME). Escaped references will never be expanded, 2215 // regardless of whether the variable exists or not. 2216 // Cannot be updated. 2217 // More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell 2218 // +optional 2219 Args []string `json:"args,omitempty" protobuf:"bytes,4,rep,name=args"` 2220 // Container's working directory. 2221 // If not specified, the container runtime's default will be used, which 2222 // might be configured in the container image. 2223 // Cannot be updated. 2224 // +optional 2225 WorkingDir string `json:"workingDir,omitempty" protobuf:"bytes,5,opt,name=workingDir"` 2226 // List of ports to expose from the container. Exposing a port here gives 2227 // the system additional information about the network connections a 2228 // container uses, but is primarily informational. Not specifying a port here 2229 // DOES NOT prevent that port from being exposed. Any port which is 2230 // listening on the default "0.0.0.0" address inside a container will be 2231 // accessible from the network. 2232 // Cannot be updated. 2233 // +optional 2234 // +patchMergeKey=containerPort 2235 // +patchStrategy=merge 2236 // +listType=map 2237 // +listMapKey=containerPort 2238 // +listMapKey=protocol 2239 Ports []ContainerPort `json:"ports,omitempty" patchStrategy:"merge" patchMergeKey:"containerPort" protobuf:"bytes,6,rep,name=ports"` 2240 // List of sources to populate environment variables in the container. 2241 // The keys defined within a source must be a C_IDENTIFIER. All invalid keys 2242 // will be reported as an event when the container is starting. When a key exists in multiple 2243 // sources, the value associated with the last source will take precedence. 2244 // Values defined by an Env with a duplicate key will take precedence. 2245 // Cannot be updated. 2246 // +optional 2247 EnvFrom []EnvFromSource `json:"envFrom,omitempty" protobuf:"bytes,19,rep,name=envFrom"` 2248 // List of environment variables to set in the container. 2249 // Cannot be updated. 2250 // +optional 2251 // +patchMergeKey=name 2252 // +patchStrategy=merge 2253 Env []EnvVar `json:"env,omitempty" patchStrategy:"merge" patchMergeKey:"name" protobuf:"bytes,7,rep,name=env"` 2254 // Compute Resources required by this container. 2255 // Cannot be updated. 2256 // More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/ 2257 // +optional 2258 Resources ResourceRequirements `json:"resources,omitempty" protobuf:"bytes,8,opt,name=resources"` 2259 // Pod volumes to mount into the container's filesystem. 2260 // Cannot be updated. 2261 // +optional 2262 // +patchMergeKey=mountPath 2263 // +patchStrategy=merge 2264 VolumeMounts []VolumeMount `json:"volumeMounts,omitempty" patchStrategy:"merge" patchMergeKey:"mountPath" protobuf:"bytes,9,rep,name=volumeMounts"` 2265 // volumeDevices is the list of block devices to be used by the container. 2266 // +patchMergeKey=devicePath 2267 // +patchStrategy=merge 2268 // +optional 2269 VolumeDevices []VolumeDevice `json:"volumeDevices,omitempty" patchStrategy:"merge" patchMergeKey:"devicePath" protobuf:"bytes,21,rep,name=volumeDevices"` 2270 // Periodic probe of container liveness. 2271 // Container will be restarted if the probe fails. 2272 // Cannot be updated. 2273 // More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes 2274 // +optional 2275 LivenessProbe *Probe `json:"livenessProbe,omitempty" protobuf:"bytes,10,opt,name=livenessProbe"` 2276 // Periodic probe of container service readiness. 2277 // Container will be removed from service endpoints if the probe fails. 2278 // Cannot be updated. 2279 // More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes 2280 // +optional 2281 ReadinessProbe *Probe `json:"readinessProbe,omitempty" protobuf:"bytes,11,opt,name=readinessProbe"` 2282 // StartupProbe indicates that the Pod has successfully initialized. 2283 // If specified, no other probes are executed until this completes successfully. 2284 // If this probe fails, the Pod will be restarted, just as if the livenessProbe failed. 2285 // This can be used to provide different probe parameters at the beginning of a Pod's lifecycle, 2286 // when it might take a long time to load data or warm a cache, than during steady-state operation. 2287 // This cannot be updated. 2288 // More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes 2289 // +optional 2290 StartupProbe *Probe `json:"startupProbe,omitempty" protobuf:"bytes,22,opt,name=startupProbe"` 2291 // Actions that the management system should take in response to container lifecycle events. 2292 // Cannot be updated. 2293 // +optional 2294 Lifecycle *Lifecycle `json:"lifecycle,omitempty" protobuf:"bytes,12,opt,name=lifecycle"` 2295 // Optional: Path at which the file to which the container's termination message 2296 // will be written is mounted into the container's filesystem. 2297 // Message written is intended to be brief final status, such as an assertion failure message. 2298 // Will be truncated by the node if greater than 4096 bytes. The total message length across 2299 // all containers will be limited to 12kb. 2300 // Defaults to /dev/termination-log. 2301 // Cannot be updated. 2302 // +optional 2303 TerminationMessagePath string `json:"terminationMessagePath,omitempty" protobuf:"bytes,13,opt,name=terminationMessagePath"` 2304 // Indicate how the termination message should be populated. File will use the contents of 2305 // terminationMessagePath to populate the container status message on both success and failure. 2306 // FallbackToLogsOnError will use the last chunk of container log output if the termination 2307 // message file is empty and the container exited with an error. 2308 // The log output is limited to 2048 bytes or 80 lines, whichever is smaller. 2309 // Defaults to File. 2310 // Cannot be updated. 2311 // +optional 2312 TerminationMessagePolicy TerminationMessagePolicy `json:"terminationMessagePolicy,omitempty" protobuf:"bytes,20,opt,name=terminationMessagePolicy,casttype=TerminationMessagePolicy"` 2313 // Image pull policy. 2314 // One of Always, Never, IfNotPresent. 2315 // Defaults to Always if :latest tag is specified, or IfNotPresent otherwise. 2316 // Cannot be updated. 2317 // More info: https://kubernetes.io/docs/concepts/containers/images#updating-images 2318 // +optional 2319 ImagePullPolicy PullPolicy `json:"imagePullPolicy,omitempty" protobuf:"bytes,14,opt,name=imagePullPolicy,casttype=PullPolicy"` 2320 // Security options the pod should run with. 2321 // More info: https://kubernetes.io/docs/concepts/policy/security-context/ 2322 // More info: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/ 2323 // +optional 2324 SecurityContext *SecurityContext `json:"securityContext,omitempty" protobuf:"bytes,15,opt,name=securityContext"` 2325 2326 // Variables for interactive containers, these have very specialized use-cases (e.g. debugging) 2327 // and shouldn't be used for general purpose containers. 2328 2329 // Whether this container should allocate a buffer for stdin in the container runtime. If this 2330 // is not set, reads from stdin in the container will always result in EOF. 2331 // Default is false. 2332 // +optional 2333 Stdin bool `json:"stdin,omitempty" protobuf:"varint,16,opt,name=stdin"` 2334 // Whether the container runtime should close the stdin channel after it has been opened by 2335 // a single attach. When stdin is true the stdin stream will remain open across multiple attach 2336 // sessions. If stdinOnce is set to true, stdin is opened on container start, is empty until the 2337 // first client attaches to stdin, and then remains open and accepts data until the client disconnects, 2338 // at which time stdin is closed and remains closed until the container is restarted. If this 2339 // flag is false, a container processes that reads from stdin will never receive an EOF. 2340 // Default is false 2341 // +optional 2342 StdinOnce bool `json:"stdinOnce,omitempty" protobuf:"varint,17,opt,name=stdinOnce"` 2343 // Whether this container should allocate a TTY for itself, also requires 'stdin' to be true. 2344 // Default is false. 2345 // +optional 2346 TTY bool `json:"tty,omitempty" protobuf:"varint,18,opt,name=tty"` 2347} 2348 2349// Handler defines a specific action that should be taken 2350// TODO: pass structured data to these actions, and document that data here. 2351type Handler struct { 2352 // One and only one of the following should be specified. 2353 // Exec specifies the action to take. 2354 // +optional 2355 Exec *ExecAction `json:"exec,omitempty" protobuf:"bytes,1,opt,name=exec"` 2356 // HTTPGet specifies the http request to perform. 2357 // +optional 2358 HTTPGet *HTTPGetAction `json:"httpGet,omitempty" protobuf:"bytes,2,opt,name=httpGet"` 2359 // TCPSocket specifies an action involving a TCP port. 2360 // TCP hooks not yet supported 2361 // TODO: implement a realistic TCP lifecycle hook 2362 // +optional 2363 TCPSocket *TCPSocketAction `json:"tcpSocket,omitempty" protobuf:"bytes,3,opt,name=tcpSocket"` 2364} 2365 2366// Lifecycle describes actions that the management system should take in response to container lifecycle 2367// events. For the PostStart and PreStop lifecycle handlers, management of the container blocks 2368// until the action is complete, unless the container process fails, in which case the handler is aborted. 2369type Lifecycle struct { 2370 // PostStart is called immediately after a container is created. If the handler fails, 2371 // the container is terminated and restarted according to its restart policy. 2372 // Other management of the container blocks until the hook completes. 2373 // More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks 2374 // +optional 2375 PostStart *Handler `json:"postStart,omitempty" protobuf:"bytes,1,opt,name=postStart"` 2376 // PreStop is called immediately before a container is terminated due to an 2377 // API request or management event such as liveness/startup probe failure, 2378 // preemption, resource contention, etc. The handler is not called if the 2379 // container crashes or exits. The reason for termination is passed to the 2380 // handler. The Pod's termination grace period countdown begins before the 2381 // PreStop hooked is executed. Regardless of the outcome of the handler, the 2382 // container will eventually terminate within the Pod's termination grace 2383 // period. Other management of the container blocks until the hook completes 2384 // or until the termination grace period is reached. 2385 // More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks 2386 // +optional 2387 PreStop *Handler `json:"preStop,omitempty" protobuf:"bytes,2,opt,name=preStop"` 2388} 2389 2390type ConditionStatus string 2391 2392// These are valid condition statuses. "ConditionTrue" means a resource is in the condition. 2393// "ConditionFalse" means a resource is not in the condition. "ConditionUnknown" means kubernetes 2394// can't decide if a resource is in the condition or not. In the future, we could add other 2395// intermediate conditions, e.g. ConditionDegraded. 2396const ( 2397 ConditionTrue ConditionStatus = "True" 2398 ConditionFalse ConditionStatus = "False" 2399 ConditionUnknown ConditionStatus = "Unknown" 2400) 2401 2402// ContainerStateWaiting is a waiting state of a container. 2403type ContainerStateWaiting struct { 2404 // (brief) reason the container is not yet running. 2405 // +optional 2406 Reason string `json:"reason,omitempty" protobuf:"bytes,1,opt,name=reason"` 2407 // Message regarding why the container is not yet running. 2408 // +optional 2409 Message string `json:"message,omitempty" protobuf:"bytes,2,opt,name=message"` 2410} 2411 2412// ContainerStateRunning is a running state of a container. 2413type ContainerStateRunning struct { 2414 // Time at which the container was last (re-)started 2415 // +optional 2416 StartedAt metav1.Time `json:"startedAt,omitempty" protobuf:"bytes,1,opt,name=startedAt"` 2417} 2418 2419// ContainerStateTerminated is a terminated state of a container. 2420type ContainerStateTerminated struct { 2421 // Exit status from the last termination of the container 2422 ExitCode int32 `json:"exitCode" protobuf:"varint,1,opt,name=exitCode"` 2423 // Signal from the last termination of the container 2424 // +optional 2425 Signal int32 `json:"signal,omitempty" protobuf:"varint,2,opt,name=signal"` 2426 // (brief) reason from the last termination of the container 2427 // +optional 2428 Reason string `json:"reason,omitempty" protobuf:"bytes,3,opt,name=reason"` 2429 // Message regarding the last termination of the container 2430 // +optional 2431 Message string `json:"message,omitempty" protobuf:"bytes,4,opt,name=message"` 2432 // Time at which previous execution of the container started 2433 // +optional 2434 StartedAt metav1.Time `json:"startedAt,omitempty" protobuf:"bytes,5,opt,name=startedAt"` 2435 // Time at which the container last terminated 2436 // +optional 2437 FinishedAt metav1.Time `json:"finishedAt,omitempty" protobuf:"bytes,6,opt,name=finishedAt"` 2438 // Container's ID in the format 'docker://<container_id>' 2439 // +optional 2440 ContainerID string `json:"containerID,omitempty" protobuf:"bytes,7,opt,name=containerID"` 2441} 2442 2443// ContainerState holds a possible state of container. 2444// Only one of its members may be specified. 2445// If none of them is specified, the default one is ContainerStateWaiting. 2446type ContainerState struct { 2447 // Details about a waiting container 2448 // +optional 2449 Waiting *ContainerStateWaiting `json:"waiting,omitempty" protobuf:"bytes,1,opt,name=waiting"` 2450 // Details about a running container 2451 // +optional 2452 Running *ContainerStateRunning `json:"running,omitempty" protobuf:"bytes,2,opt,name=running"` 2453 // Details about a terminated container 2454 // +optional 2455 Terminated *ContainerStateTerminated `json:"terminated,omitempty" protobuf:"bytes,3,opt,name=terminated"` 2456} 2457 2458// ContainerStatus contains details for the current status of this container. 2459type ContainerStatus struct { 2460 // This must be a DNS_LABEL. Each container in a pod must have a unique name. 2461 // Cannot be updated. 2462 Name string `json:"name" protobuf:"bytes,1,opt,name=name"` 2463 // Details about the container's current condition. 2464 // +optional 2465 State ContainerState `json:"state,omitempty" protobuf:"bytes,2,opt,name=state"` 2466 // Details about the container's last termination condition. 2467 // +optional 2468 LastTerminationState ContainerState `json:"lastState,omitempty" protobuf:"bytes,3,opt,name=lastState"` 2469 // Specifies whether the container has passed its readiness probe. 2470 Ready bool `json:"ready" protobuf:"varint,4,opt,name=ready"` 2471 // The number of times the container has been restarted, currently based on 2472 // the number of dead containers that have not yet been removed. 2473 // Note that this is calculated from dead containers. But those containers are subject to 2474 // garbage collection. This value will get capped at 5 by GC. 2475 RestartCount int32 `json:"restartCount" protobuf:"varint,5,opt,name=restartCount"` 2476 // The image the container is running. 2477 // More info: https://kubernetes.io/docs/concepts/containers/images 2478 // TODO(dchen1107): Which image the container is running with? 2479 Image string `json:"image" protobuf:"bytes,6,opt,name=image"` 2480 // ImageID of the container's image. 2481 ImageID string `json:"imageID" protobuf:"bytes,7,opt,name=imageID"` 2482 // Container's ID in the format 'docker://<container_id>'. 2483 // +optional 2484 ContainerID string `json:"containerID,omitempty" protobuf:"bytes,8,opt,name=containerID"` 2485 // Specifies whether the container has passed its startup probe. 2486 // Initialized as false, becomes true after startupProbe is considered successful. 2487 // Resets to false when the container is restarted, or if kubelet loses state temporarily. 2488 // Is always true when no startupProbe is defined. 2489 // +optional 2490 Started *bool `json:"started,omitempty" protobuf:"varint,9,opt,name=started"` 2491} 2492 2493// PodPhase is a label for the condition of a pod at the current time. 2494type PodPhase string 2495 2496// These are the valid statuses of pods. 2497const ( 2498 // PodPending means the pod has been accepted by the system, but one or more of the containers 2499 // has not been started. This includes time before being bound to a node, as well as time spent 2500 // pulling images onto the host. 2501 PodPending PodPhase = "Pending" 2502 // PodRunning means the pod has been bound to a node and all of the containers have been started. 2503 // At least one container is still running or is in the process of being restarted. 2504 PodRunning PodPhase = "Running" 2505 // PodSucceeded means that all containers in the pod have voluntarily terminated 2506 // with a container exit code of 0, and the system is not going to restart any of these containers. 2507 PodSucceeded PodPhase = "Succeeded" 2508 // PodFailed means that all containers in the pod have terminated, and at least one container has 2509 // terminated in a failure (exited with a non-zero exit code or was stopped by the system). 2510 PodFailed PodPhase = "Failed" 2511 // PodUnknown means that for some reason the state of the pod could not be obtained, typically due 2512 // to an error in communicating with the host of the pod. 2513 PodUnknown PodPhase = "Unknown" 2514) 2515 2516// PodConditionType is a valid value for PodCondition.Type 2517type PodConditionType string 2518 2519// These are valid conditions of pod. 2520const ( 2521 // ContainersReady indicates whether all containers in the pod are ready. 2522 ContainersReady PodConditionType = "ContainersReady" 2523 // PodInitialized means that all init containers in the pod have started successfully. 2524 PodInitialized PodConditionType = "Initialized" 2525 // PodReady means the pod is able to service requests and should be added to the 2526 // load balancing pools of all matching services. 2527 PodReady PodConditionType = "Ready" 2528 // PodScheduled represents status of the scheduling process for this pod. 2529 PodScheduled PodConditionType = "PodScheduled" 2530) 2531 2532// These are reasons for a pod's transition to a condition. 2533const ( 2534 // PodReasonUnschedulable reason in PodScheduled PodCondition means that the scheduler 2535 // can't schedule the pod right now, for example due to insufficient resources in the cluster. 2536 PodReasonUnschedulable = "Unschedulable" 2537) 2538 2539// PodCondition contains details for the current condition of this pod. 2540type PodCondition struct { 2541 // Type is the type of the condition. 2542 // More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#pod-conditions 2543 Type PodConditionType `json:"type" protobuf:"bytes,1,opt,name=type,casttype=PodConditionType"` 2544 // Status is the status of the condition. 2545 // Can be True, False, Unknown. 2546 // More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#pod-conditions 2547 Status ConditionStatus `json:"status" protobuf:"bytes,2,opt,name=status,casttype=ConditionStatus"` 2548 // Last time we probed the condition. 2549 // +optional 2550 LastProbeTime metav1.Time `json:"lastProbeTime,omitempty" protobuf:"bytes,3,opt,name=lastProbeTime"` 2551 // Last time the condition transitioned from one status to another. 2552 // +optional 2553 LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty" protobuf:"bytes,4,opt,name=lastTransitionTime"` 2554 // Unique, one-word, CamelCase reason for the condition's last transition. 2555 // +optional 2556 Reason string `json:"reason,omitempty" protobuf:"bytes,5,opt,name=reason"` 2557 // Human-readable message indicating details about last transition. 2558 // +optional 2559 Message string `json:"message,omitempty" protobuf:"bytes,6,opt,name=message"` 2560} 2561 2562// RestartPolicy describes how the container should be restarted. 2563// Only one of the following restart policies may be specified. 2564// If none of the following policies is specified, the default one 2565// is RestartPolicyAlways. 2566type RestartPolicy string 2567 2568const ( 2569 RestartPolicyAlways RestartPolicy = "Always" 2570 RestartPolicyOnFailure RestartPolicy = "OnFailure" 2571 RestartPolicyNever RestartPolicy = "Never" 2572) 2573 2574// DNSPolicy defines how a pod's DNS will be configured. 2575type DNSPolicy string 2576 2577const ( 2578 // DNSClusterFirstWithHostNet indicates that the pod should use cluster DNS 2579 // first, if it is available, then fall back on the default 2580 // (as determined by kubelet) DNS settings. 2581 DNSClusterFirstWithHostNet DNSPolicy = "ClusterFirstWithHostNet" 2582 2583 // DNSClusterFirst indicates that the pod should use cluster DNS 2584 // first unless hostNetwork is true, if it is available, then 2585 // fall back on the default (as determined by kubelet) DNS settings. 2586 DNSClusterFirst DNSPolicy = "ClusterFirst" 2587 2588 // DNSDefault indicates that the pod should use the default (as 2589 // determined by kubelet) DNS settings. 2590 DNSDefault DNSPolicy = "Default" 2591 2592 // DNSNone indicates that the pod should use empty DNS settings. DNS 2593 // parameters such as nameservers and search paths should be defined via 2594 // DNSConfig. 2595 DNSNone DNSPolicy = "None" 2596) 2597 2598const ( 2599 // DefaultTerminationGracePeriodSeconds indicates the default duration in 2600 // seconds a pod needs to terminate gracefully. 2601 DefaultTerminationGracePeriodSeconds = 30 2602) 2603 2604// A node selector represents the union of the results of one or more label queries 2605// over a set of nodes; that is, it represents the OR of the selectors represented 2606// by the node selector terms. 2607type NodeSelector struct { 2608 //Required. A list of node selector terms. The terms are ORed. 2609 NodeSelectorTerms []NodeSelectorTerm `json:"nodeSelectorTerms" protobuf:"bytes,1,rep,name=nodeSelectorTerms"` 2610} 2611 2612// A null or empty node selector term matches no objects. The requirements of 2613// them are ANDed. 2614// The TopologySelectorTerm type implements a subset of the NodeSelectorTerm. 2615type NodeSelectorTerm struct { 2616 // A list of node selector requirements by node's labels. 2617 // +optional 2618 MatchExpressions []NodeSelectorRequirement `json:"matchExpressions,omitempty" protobuf:"bytes,1,rep,name=matchExpressions"` 2619 // A list of node selector requirements by node's fields. 2620 // +optional 2621 MatchFields []NodeSelectorRequirement `json:"matchFields,omitempty" protobuf:"bytes,2,rep,name=matchFields"` 2622} 2623 2624// A node selector requirement is a selector that contains values, a key, and an operator 2625// that relates the key and values. 2626type NodeSelectorRequirement struct { 2627 // The label key that the selector applies to. 2628 Key string `json:"key" protobuf:"bytes,1,opt,name=key"` 2629 // Represents a key's relationship to a set of values. 2630 // Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt. 2631 Operator NodeSelectorOperator `json:"operator" protobuf:"bytes,2,opt,name=operator,casttype=NodeSelectorOperator"` 2632 // An array of string values. If the operator is In or NotIn, 2633 // the values array must be non-empty. If the operator is Exists or DoesNotExist, 2634 // the values array must be empty. If the operator is Gt or Lt, the values 2635 // array must have a single element, which will be interpreted as an integer. 2636 // This array is replaced during a strategic merge patch. 2637 // +optional 2638 Values []string `json:"values,omitempty" protobuf:"bytes,3,rep,name=values"` 2639} 2640 2641// A node selector operator is the set of operators that can be used in 2642// a node selector requirement. 2643type NodeSelectorOperator string 2644 2645const ( 2646 NodeSelectorOpIn NodeSelectorOperator = "In" 2647 NodeSelectorOpNotIn NodeSelectorOperator = "NotIn" 2648 NodeSelectorOpExists NodeSelectorOperator = "Exists" 2649 NodeSelectorOpDoesNotExist NodeSelectorOperator = "DoesNotExist" 2650 NodeSelectorOpGt NodeSelectorOperator = "Gt" 2651 NodeSelectorOpLt NodeSelectorOperator = "Lt" 2652) 2653 2654// A topology selector term represents the result of label queries. 2655// A null or empty topology selector term matches no objects. 2656// The requirements of them are ANDed. 2657// It provides a subset of functionality as NodeSelectorTerm. 2658// This is an alpha feature and may change in the future. 2659type TopologySelectorTerm struct { 2660 // A list of topology selector requirements by labels. 2661 // +optional 2662 MatchLabelExpressions []TopologySelectorLabelRequirement `json:"matchLabelExpressions,omitempty" protobuf:"bytes,1,rep,name=matchLabelExpressions"` 2663} 2664 2665// A topology selector requirement is a selector that matches given label. 2666// This is an alpha feature and may change in the future. 2667type TopologySelectorLabelRequirement struct { 2668 // The label key that the selector applies to. 2669 Key string `json:"key" protobuf:"bytes,1,opt,name=key"` 2670 // An array of string values. One value must match the label to be selected. 2671 // Each entry in Values is ORed. 2672 Values []string `json:"values" protobuf:"bytes,2,rep,name=values"` 2673} 2674 2675// Affinity is a group of affinity scheduling rules. 2676type Affinity struct { 2677 // Describes node affinity scheduling rules for the pod. 2678 // +optional 2679 NodeAffinity *NodeAffinity `json:"nodeAffinity,omitempty" protobuf:"bytes,1,opt,name=nodeAffinity"` 2680 // Describes pod affinity scheduling rules (e.g. co-locate this pod in the same node, zone, etc. as some other pod(s)). 2681 // +optional 2682 PodAffinity *PodAffinity `json:"podAffinity,omitempty" protobuf:"bytes,2,opt,name=podAffinity"` 2683 // Describes pod anti-affinity scheduling rules (e.g. avoid putting this pod in the same node, zone, etc. as some other pod(s)). 2684 // +optional 2685 PodAntiAffinity *PodAntiAffinity `json:"podAntiAffinity,omitempty" protobuf:"bytes,3,opt,name=podAntiAffinity"` 2686} 2687 2688// Pod affinity is a group of inter pod affinity scheduling rules. 2689type PodAffinity struct { 2690 // NOT YET IMPLEMENTED. TODO: Uncomment field once it is implemented. 2691 // If the affinity requirements specified by this field are not met at 2692 // scheduling time, the pod will not be scheduled onto the node. 2693 // If the affinity requirements specified by this field cease to be met 2694 // at some point during pod execution (e.g. due to a pod label update), the 2695 // system will try to eventually evict the pod from its node. 2696 // When there are multiple elements, the lists of nodes corresponding to each 2697 // podAffinityTerm are intersected, i.e. all terms must be satisfied. 2698 // +optional 2699 // RequiredDuringSchedulingRequiredDuringExecution []PodAffinityTerm `json:"requiredDuringSchedulingRequiredDuringExecution,omitempty"` 2700 2701 // If the affinity requirements specified by this field are not met at 2702 // scheduling time, the pod will not be scheduled onto the node. 2703 // If the affinity requirements specified by this field cease to be met 2704 // at some point during pod execution (e.g. due to a pod label update), the 2705 // system may or may not try to eventually evict the pod from its node. 2706 // When there are multiple elements, the lists of nodes corresponding to each 2707 // podAffinityTerm are intersected, i.e. all terms must be satisfied. 2708 // +optional 2709 RequiredDuringSchedulingIgnoredDuringExecution []PodAffinityTerm `json:"requiredDuringSchedulingIgnoredDuringExecution,omitempty" protobuf:"bytes,1,rep,name=requiredDuringSchedulingIgnoredDuringExecution"` 2710 // The scheduler will prefer to schedule pods to nodes that satisfy 2711 // the affinity expressions specified by this field, but it may choose 2712 // a node that violates one or more of the expressions. The node that is 2713 // most preferred is the one with the greatest sum of weights, i.e. 2714 // for each node that meets all of the scheduling requirements (resource 2715 // request, requiredDuringScheduling affinity expressions, etc.), 2716 // compute a sum by iterating through the elements of this field and adding 2717 // "weight" to the sum if the node has pods which matches the corresponding podAffinityTerm; the 2718 // node(s) with the highest sum are the most preferred. 2719 // +optional 2720 PreferredDuringSchedulingIgnoredDuringExecution []WeightedPodAffinityTerm `json:"preferredDuringSchedulingIgnoredDuringExecution,omitempty" protobuf:"bytes,2,rep,name=preferredDuringSchedulingIgnoredDuringExecution"` 2721} 2722 2723// Pod anti affinity is a group of inter pod anti affinity scheduling rules. 2724type PodAntiAffinity struct { 2725 // NOT YET IMPLEMENTED. TODO: Uncomment field once it is implemented. 2726 // If the anti-affinity requirements specified by this field are not met at 2727 // scheduling time, the pod will not be scheduled onto the node. 2728 // If the anti-affinity requirements specified by this field cease to be met 2729 // at some point during pod execution (e.g. due to a pod label update), the 2730 // system will try to eventually evict the pod from its node. 2731 // When there are multiple elements, the lists of nodes corresponding to each 2732 // podAffinityTerm are intersected, i.e. all terms must be satisfied. 2733 // +optional 2734 // RequiredDuringSchedulingRequiredDuringExecution []PodAffinityTerm `json:"requiredDuringSchedulingRequiredDuringExecution,omitempty"` 2735 2736 // If the anti-affinity requirements specified by this field are not met at 2737 // scheduling time, the pod will not be scheduled onto the node. 2738 // If the anti-affinity requirements specified by this field cease to be met 2739 // at some point during pod execution (e.g. due to a pod label update), the 2740 // system may or may not try to eventually evict the pod from its node. 2741 // When there are multiple elements, the lists of nodes corresponding to each 2742 // podAffinityTerm are intersected, i.e. all terms must be satisfied. 2743 // +optional 2744 RequiredDuringSchedulingIgnoredDuringExecution []PodAffinityTerm `json:"requiredDuringSchedulingIgnoredDuringExecution,omitempty" protobuf:"bytes,1,rep,name=requiredDuringSchedulingIgnoredDuringExecution"` 2745 // The scheduler will prefer to schedule pods to nodes that satisfy 2746 // the anti-affinity expressions specified by this field, but it may choose 2747 // a node that violates one or more of the expressions. The node that is 2748 // most preferred is the one with the greatest sum of weights, i.e. 2749 // for each node that meets all of the scheduling requirements (resource 2750 // request, requiredDuringScheduling anti-affinity expressions, etc.), 2751 // compute a sum by iterating through the elements of this field and adding 2752 // "weight" to the sum if the node has pods which matches the corresponding podAffinityTerm; the 2753 // node(s) with the highest sum are the most preferred. 2754 // +optional 2755 PreferredDuringSchedulingIgnoredDuringExecution []WeightedPodAffinityTerm `json:"preferredDuringSchedulingIgnoredDuringExecution,omitempty" protobuf:"bytes,2,rep,name=preferredDuringSchedulingIgnoredDuringExecution"` 2756} 2757 2758// The weights of all of the matched WeightedPodAffinityTerm fields are added per-node to find the most preferred node(s) 2759type WeightedPodAffinityTerm struct { 2760 // weight associated with matching the corresponding podAffinityTerm, 2761 // in the range 1-100. 2762 Weight int32 `json:"weight" protobuf:"varint,1,opt,name=weight"` 2763 // Required. A pod affinity term, associated with the corresponding weight. 2764 PodAffinityTerm PodAffinityTerm `json:"podAffinityTerm" protobuf:"bytes,2,opt,name=podAffinityTerm"` 2765} 2766 2767// Defines a set of pods (namely those matching the labelSelector 2768// relative to the given namespace(s)) that this pod should be 2769// co-located (affinity) or not co-located (anti-affinity) with, 2770// where co-located is defined as running on a node whose value of 2771// the label with key <topologyKey> matches that of any node on which 2772// a pod of the set of pods is running 2773type PodAffinityTerm struct { 2774 // A label query over a set of resources, in this case pods. 2775 // +optional 2776 LabelSelector *metav1.LabelSelector `json:"labelSelector,omitempty" protobuf:"bytes,1,opt,name=labelSelector"` 2777 // namespaces specifies which namespaces the labelSelector applies to (matches against); 2778 // null or empty list means "this pod's namespace" 2779 // +optional 2780 Namespaces []string `json:"namespaces,omitempty" protobuf:"bytes,2,rep,name=namespaces"` 2781 // This pod should be co-located (affinity) or not co-located (anti-affinity) with the pods matching 2782 // the labelSelector in the specified namespaces, where co-located is defined as running on a node 2783 // whose value of the label with key topologyKey matches that of any node on which any of the 2784 // selected pods is running. 2785 // Empty topologyKey is not allowed. 2786 TopologyKey string `json:"topologyKey" protobuf:"bytes,3,opt,name=topologyKey"` 2787} 2788 2789// Node affinity is a group of node affinity scheduling rules. 2790type NodeAffinity struct { 2791 // NOT YET IMPLEMENTED. TODO: Uncomment field once it is implemented. 2792 // If the affinity requirements specified by this field are not met at 2793 // scheduling time, the pod will not be scheduled onto the node. 2794 // If the affinity requirements specified by this field cease to be met 2795 // at some point during pod execution (e.g. due to an update), the system 2796 // will try to eventually evict the pod from its node. 2797 // +optional 2798 // RequiredDuringSchedulingRequiredDuringExecution *NodeSelector `json:"requiredDuringSchedulingRequiredDuringExecution,omitempty"` 2799 2800 // If the affinity requirements specified by this field are not met at 2801 // scheduling time, the pod will not be scheduled onto the node. 2802 // If the affinity requirements specified by this field cease to be met 2803 // at some point during pod execution (e.g. due to an update), the system 2804 // may or may not try to eventually evict the pod from its node. 2805 // +optional 2806 RequiredDuringSchedulingIgnoredDuringExecution *NodeSelector `json:"requiredDuringSchedulingIgnoredDuringExecution,omitempty" protobuf:"bytes,1,opt,name=requiredDuringSchedulingIgnoredDuringExecution"` 2807 // The scheduler will prefer to schedule pods to nodes that satisfy 2808 // the affinity expressions specified by this field, but it may choose 2809 // a node that violates one or more of the expressions. The node that is 2810 // most preferred is the one with the greatest sum of weights, i.e. 2811 // for each node that meets all of the scheduling requirements (resource 2812 // request, requiredDuringScheduling affinity expressions, etc.), 2813 // compute a sum by iterating through the elements of this field and adding 2814 // "weight" to the sum if the node matches the corresponding matchExpressions; the 2815 // node(s) with the highest sum are the most preferred. 2816 // +optional 2817 PreferredDuringSchedulingIgnoredDuringExecution []PreferredSchedulingTerm `json:"preferredDuringSchedulingIgnoredDuringExecution,omitempty" protobuf:"bytes,2,rep,name=preferredDuringSchedulingIgnoredDuringExecution"` 2818} 2819 2820// An empty preferred scheduling term matches all objects with implicit weight 0 2821// (i.e. it's a no-op). A null preferred scheduling term matches no objects (i.e. is also a no-op). 2822type PreferredSchedulingTerm struct { 2823 // Weight associated with matching the corresponding nodeSelectorTerm, in the range 1-100. 2824 Weight int32 `json:"weight" protobuf:"varint,1,opt,name=weight"` 2825 // A node selector term, associated with the corresponding weight. 2826 Preference NodeSelectorTerm `json:"preference" protobuf:"bytes,2,opt,name=preference"` 2827} 2828 2829// The node this Taint is attached to has the "effect" on 2830// any pod that does not tolerate the Taint. 2831type Taint struct { 2832 // Required. The taint key to be applied to a node. 2833 Key string `json:"key" protobuf:"bytes,1,opt,name=key"` 2834 // The taint value corresponding to the taint key. 2835 // +optional 2836 Value string `json:"value,omitempty" protobuf:"bytes,2,opt,name=value"` 2837 // Required. The effect of the taint on pods 2838 // that do not tolerate the taint. 2839 // Valid effects are NoSchedule, PreferNoSchedule and NoExecute. 2840 Effect TaintEffect `json:"effect" protobuf:"bytes,3,opt,name=effect,casttype=TaintEffect"` 2841 // TimeAdded represents the time at which the taint was added. 2842 // It is only written for NoExecute taints. 2843 // +optional 2844 TimeAdded *metav1.Time `json:"timeAdded,omitempty" protobuf:"bytes,4,opt,name=timeAdded"` 2845} 2846 2847type TaintEffect string 2848 2849const ( 2850 // Do not allow new pods to schedule onto the node unless they tolerate the taint, 2851 // but allow all pods submitted to Kubelet without going through the scheduler 2852 // to start, and allow all already-running pods to continue running. 2853 // Enforced by the scheduler. 2854 TaintEffectNoSchedule TaintEffect = "NoSchedule" 2855 // Like TaintEffectNoSchedule, but the scheduler tries not to schedule 2856 // new pods onto the node, rather than prohibiting new pods from scheduling 2857 // onto the node entirely. Enforced by the scheduler. 2858 TaintEffectPreferNoSchedule TaintEffect = "PreferNoSchedule" 2859 // NOT YET IMPLEMENTED. TODO: Uncomment field once it is implemented. 2860 // Like TaintEffectNoSchedule, but additionally do not allow pods submitted to 2861 // Kubelet without going through the scheduler to start. 2862 // Enforced by Kubelet and the scheduler. 2863 // TaintEffectNoScheduleNoAdmit TaintEffect = "NoScheduleNoAdmit" 2864 2865 // Evict any already-running pods that do not tolerate the taint. 2866 // Currently enforced by NodeController. 2867 TaintEffectNoExecute TaintEffect = "NoExecute" 2868) 2869 2870// The pod this Toleration is attached to tolerates any taint that matches 2871// the triple <key,value,effect> using the matching operator <operator>. 2872type Toleration struct { 2873 // Key is the taint key that the toleration applies to. Empty means match all taint keys. 2874 // If the key is empty, operator must be Exists; this combination means to match all values and all keys. 2875 // +optional 2876 Key string `json:"key,omitempty" protobuf:"bytes,1,opt,name=key"` 2877 // Operator represents a key's relationship to the value. 2878 // Valid operators are Exists and Equal. Defaults to Equal. 2879 // Exists is equivalent to wildcard for value, so that a pod can 2880 // tolerate all taints of a particular category. 2881 // +optional 2882 Operator TolerationOperator `json:"operator,omitempty" protobuf:"bytes,2,opt,name=operator,casttype=TolerationOperator"` 2883 // Value is the taint value the toleration matches to. 2884 // If the operator is Exists, the value should be empty, otherwise just a regular string. 2885 // +optional 2886 Value string `json:"value,omitempty" protobuf:"bytes,3,opt,name=value"` 2887 // Effect indicates the taint effect to match. Empty means match all taint effects. 2888 // When specified, allowed values are NoSchedule, PreferNoSchedule and NoExecute. 2889 // +optional 2890 Effect TaintEffect `json:"effect,omitempty" protobuf:"bytes,4,opt,name=effect,casttype=TaintEffect"` 2891 // TolerationSeconds represents the period of time the toleration (which must be 2892 // of effect NoExecute, otherwise this field is ignored) tolerates the taint. By default, 2893 // it is not set, which means tolerate the taint forever (do not evict). Zero and 2894 // negative values will be treated as 0 (evict immediately) by the system. 2895 // +optional 2896 TolerationSeconds *int64 `json:"tolerationSeconds,omitempty" protobuf:"varint,5,opt,name=tolerationSeconds"` 2897} 2898 2899// A toleration operator is the set of operators that can be used in a toleration. 2900type TolerationOperator string 2901 2902const ( 2903 TolerationOpExists TolerationOperator = "Exists" 2904 TolerationOpEqual TolerationOperator = "Equal" 2905) 2906 2907// PodReadinessGate contains the reference to a pod condition 2908type PodReadinessGate struct { 2909 // ConditionType refers to a condition in the pod's condition list with matching type. 2910 ConditionType PodConditionType `json:"conditionType" protobuf:"bytes,1,opt,name=conditionType,casttype=PodConditionType"` 2911} 2912 2913// PodSpec is a description of a pod. 2914type PodSpec struct { 2915 // List of volumes that can be mounted by containers belonging to the pod. 2916 // More info: https://kubernetes.io/docs/concepts/storage/volumes 2917 // +optional 2918 // +patchMergeKey=name 2919 // +patchStrategy=merge,retainKeys 2920 Volumes []Volume `json:"volumes,omitempty" patchStrategy:"merge,retainKeys" patchMergeKey:"name" protobuf:"bytes,1,rep,name=volumes"` 2921 // List of initialization containers belonging to the pod. 2922 // Init containers are executed in order prior to containers being started. If any 2923 // init container fails, the pod is considered to have failed and is handled according 2924 // to its restartPolicy. The name for an init container or normal container must be 2925 // unique among all containers. 2926 // Init containers may not have Lifecycle actions, Readiness probes, Liveness probes, or Startup probes. 2927 // The resourceRequirements of an init container are taken into account during scheduling 2928 // by finding the highest request/limit for each resource type, and then using the max of 2929 // of that value or the sum of the normal containers. Limits are applied to init containers 2930 // in a similar fashion. 2931 // Init containers cannot currently be added or removed. 2932 // Cannot be updated. 2933 // More info: https://kubernetes.io/docs/concepts/workloads/pods/init-containers/ 2934 // +patchMergeKey=name 2935 // +patchStrategy=merge 2936 InitContainers []Container `json:"initContainers,omitempty" patchStrategy:"merge" patchMergeKey:"name" protobuf:"bytes,20,rep,name=initContainers"` 2937 // List of containers belonging to the pod. 2938 // Containers cannot currently be added or removed. 2939 // There must be at least one container in a Pod. 2940 // Cannot be updated. 2941 // +patchMergeKey=name 2942 // +patchStrategy=merge 2943 Containers []Container `json:"containers" patchStrategy:"merge" patchMergeKey:"name" protobuf:"bytes,2,rep,name=containers"` 2944 // List of ephemeral containers run in this pod. Ephemeral containers may be run in an existing 2945 // pod to perform user-initiated actions such as debugging. This list cannot be specified when 2946 // creating a pod, and it cannot be modified by updating the pod spec. In order to add an 2947 // ephemeral container to an existing pod, use the pod's ephemeralcontainers subresource. 2948 // This field is alpha-level and is only honored by servers that enable the EphemeralContainers feature. 2949 // +optional 2950 // +patchMergeKey=name 2951 // +patchStrategy=merge 2952 EphemeralContainers []EphemeralContainer `json:"ephemeralContainers,omitempty" patchStrategy:"merge" patchMergeKey:"name" protobuf:"bytes,34,rep,name=ephemeralContainers"` 2953 // Restart policy for all containers within the pod. 2954 // One of Always, OnFailure, Never. 2955 // Default to Always. 2956 // More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#restart-policy 2957 // +optional 2958 RestartPolicy RestartPolicy `json:"restartPolicy,omitempty" protobuf:"bytes,3,opt,name=restartPolicy,casttype=RestartPolicy"` 2959 // Optional duration in seconds the pod needs to terminate gracefully. May be decreased in delete request. 2960 // Value must be non-negative integer. The value zero indicates delete immediately. 2961 // If this value is nil, the default grace period will be used instead. 2962 // The grace period is the duration in seconds after the processes running in the pod are sent 2963 // a termination signal and the time when the processes are forcibly halted with a kill signal. 2964 // Set this value longer than the expected cleanup time for your process. 2965 // Defaults to 30 seconds. 2966 // +optional 2967 TerminationGracePeriodSeconds *int64 `json:"terminationGracePeriodSeconds,omitempty" protobuf:"varint,4,opt,name=terminationGracePeriodSeconds"` 2968 // Optional duration in seconds the pod may be active on the node relative to 2969 // StartTime before the system will actively try to mark it failed and kill associated containers. 2970 // Value must be a positive integer. 2971 // +optional 2972 ActiveDeadlineSeconds *int64 `json:"activeDeadlineSeconds,omitempty" protobuf:"varint,5,opt,name=activeDeadlineSeconds"` 2973 // Set DNS policy for the pod. 2974 // Defaults to "ClusterFirst". 2975 // Valid values are 'ClusterFirstWithHostNet', 'ClusterFirst', 'Default' or 'None'. 2976 // DNS parameters given in DNSConfig will be merged with the policy selected with DNSPolicy. 2977 // To have DNS options set along with hostNetwork, you have to specify DNS policy 2978 // explicitly to 'ClusterFirstWithHostNet'. 2979 // +optional 2980 DNSPolicy DNSPolicy `json:"dnsPolicy,omitempty" protobuf:"bytes,6,opt,name=dnsPolicy,casttype=DNSPolicy"` 2981 // NodeSelector is a selector which must be true for the pod to fit on a node. 2982 // Selector which must match a node's labels for the pod to be scheduled on that node. 2983 // More info: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/ 2984 // +optional 2985 NodeSelector map[string]string `json:"nodeSelector,omitempty" protobuf:"bytes,7,rep,name=nodeSelector"` 2986 2987 // ServiceAccountName is the name of the ServiceAccount to use to run this pod. 2988 // More info: https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/ 2989 // +optional 2990 ServiceAccountName string `json:"serviceAccountName,omitempty" protobuf:"bytes,8,opt,name=serviceAccountName"` 2991 // DeprecatedServiceAccount is a depreciated alias for ServiceAccountName. 2992 // Deprecated: Use serviceAccountName instead. 2993 // +k8s:conversion-gen=false 2994 // +optional 2995 DeprecatedServiceAccount string `json:"serviceAccount,omitempty" protobuf:"bytes,9,opt,name=serviceAccount"` 2996 // AutomountServiceAccountToken indicates whether a service account token should be automatically mounted. 2997 // +optional 2998 AutomountServiceAccountToken *bool `json:"automountServiceAccountToken,omitempty" protobuf:"varint,21,opt,name=automountServiceAccountToken"` 2999 3000 // NodeName is a request to schedule this pod onto a specific node. If it is non-empty, 3001 // the scheduler simply schedules this pod onto that node, assuming that it fits resource 3002 // requirements. 3003 // +optional 3004 NodeName string `json:"nodeName,omitempty" protobuf:"bytes,10,opt,name=nodeName"` 3005 // Host networking requested for this pod. Use the host's network namespace. 3006 // If this option is set, the ports that will be used must be specified. 3007 // Default to false. 3008 // +k8s:conversion-gen=false 3009 // +optional 3010 HostNetwork bool `json:"hostNetwork,omitempty" protobuf:"varint,11,opt,name=hostNetwork"` 3011 // Use the host's pid namespace. 3012 // Optional: Default to false. 3013 // +k8s:conversion-gen=false 3014 // +optional 3015 HostPID bool `json:"hostPID,omitempty" protobuf:"varint,12,opt,name=hostPID"` 3016 // Use the host's ipc namespace. 3017 // Optional: Default to false. 3018 // +k8s:conversion-gen=false 3019 // +optional 3020 HostIPC bool `json:"hostIPC,omitempty" protobuf:"varint,13,opt,name=hostIPC"` 3021 // Share a single process namespace between all of the containers in a pod. 3022 // When this is set containers will be able to view and signal processes from other containers 3023 // in the same pod, and the first process in each container will not be assigned PID 1. 3024 // HostPID and ShareProcessNamespace cannot both be set. 3025 // Optional: Default to false. 3026 // +k8s:conversion-gen=false 3027 // +optional 3028 ShareProcessNamespace *bool `json:"shareProcessNamespace,omitempty" protobuf:"varint,27,opt,name=shareProcessNamespace"` 3029 // SecurityContext holds pod-level security attributes and common container settings. 3030 // Optional: Defaults to empty. See type description for default values of each field. 3031 // +optional 3032 SecurityContext *PodSecurityContext `json:"securityContext,omitempty" protobuf:"bytes,14,opt,name=securityContext"` 3033 // ImagePullSecrets is an optional list of references to secrets in the same namespace to use for pulling any of the images used by this PodSpec. 3034 // If specified, these secrets will be passed to individual puller implementations for them to use. For example, 3035 // in the case of docker, only DockerConfig type secrets are honored. 3036 // More info: https://kubernetes.io/docs/concepts/containers/images#specifying-imagepullsecrets-on-a-pod 3037 // +optional 3038 // +patchMergeKey=name 3039 // +patchStrategy=merge 3040 ImagePullSecrets []LocalObjectReference `json:"imagePullSecrets,omitempty" patchStrategy:"merge" patchMergeKey:"name" protobuf:"bytes,15,rep,name=imagePullSecrets"` 3041 // Specifies the hostname of the Pod 3042 // If not specified, the pod's hostname will be set to a system-defined value. 3043 // +optional 3044 Hostname string `json:"hostname,omitempty" protobuf:"bytes,16,opt,name=hostname"` 3045 // If specified, the fully qualified Pod hostname will be "<hostname>.<subdomain>.<pod namespace>.svc.<cluster domain>". 3046 // If not specified, the pod will not have a domainname at all. 3047 // +optional 3048 Subdomain string `json:"subdomain,omitempty" protobuf:"bytes,17,opt,name=subdomain"` 3049 // If specified, the pod's scheduling constraints 3050 // +optional 3051 Affinity *Affinity `json:"affinity,omitempty" protobuf:"bytes,18,opt,name=affinity"` 3052 // If specified, the pod will be dispatched by specified scheduler. 3053 // If not specified, the pod will be dispatched by default scheduler. 3054 // +optional 3055 SchedulerName string `json:"schedulerName,omitempty" protobuf:"bytes,19,opt,name=schedulerName"` 3056 // If specified, the pod's tolerations. 3057 // +optional 3058 Tolerations []Toleration `json:"tolerations,omitempty" protobuf:"bytes,22,opt,name=tolerations"` 3059 // HostAliases is an optional list of hosts and IPs that will be injected into the pod's hosts 3060 // file if specified. This is only valid for non-hostNetwork pods. 3061 // +optional 3062 // +patchMergeKey=ip 3063 // +patchStrategy=merge 3064 HostAliases []HostAlias `json:"hostAliases,omitempty" patchStrategy:"merge" patchMergeKey:"ip" protobuf:"bytes,23,rep,name=hostAliases"` 3065 // If specified, indicates the pod's priority. "system-node-critical" and 3066 // "system-cluster-critical" are two special keywords which indicate the 3067 // highest priorities with the former being the highest priority. Any other 3068 // name must be defined by creating a PriorityClass object with that name. 3069 // If not specified, the pod priority will be default or zero if there is no 3070 // default. 3071 // +optional 3072 PriorityClassName string `json:"priorityClassName,omitempty" protobuf:"bytes,24,opt,name=priorityClassName"` 3073 // The priority value. Various system components use this field to find the 3074 // priority of the pod. When Priority Admission Controller is enabled, it 3075 // prevents users from setting this field. The admission controller populates 3076 // this field from PriorityClassName. 3077 // The higher the value, the higher the priority. 3078 // +optional 3079 Priority *int32 `json:"priority,omitempty" protobuf:"bytes,25,opt,name=priority"` 3080 // Specifies the DNS parameters of a pod. 3081 // Parameters specified here will be merged to the generated DNS 3082 // configuration based on DNSPolicy. 3083 // +optional 3084 DNSConfig *PodDNSConfig `json:"dnsConfig,omitempty" protobuf:"bytes,26,opt,name=dnsConfig"` 3085 // If specified, all readiness gates will be evaluated for pod readiness. 3086 // A pod is ready when all its containers are ready AND 3087 // all conditions specified in the readiness gates have status equal to "True" 3088 // More info: https://git.k8s.io/enhancements/keps/sig-network/0007-pod-ready%2B%2B.md 3089 // +optional 3090 ReadinessGates []PodReadinessGate `json:"readinessGates,omitempty" protobuf:"bytes,28,opt,name=readinessGates"` 3091 // RuntimeClassName refers to a RuntimeClass object in the node.k8s.io group, which should be used 3092 // to run this pod. If no RuntimeClass resource matches the named class, the pod will not be run. 3093 // If unset or empty, the "legacy" RuntimeClass will be used, which is an implicit class with an 3094 // empty definition that uses the default runtime handler. 3095 // More info: https://git.k8s.io/enhancements/keps/sig-node/runtime-class.md 3096 // This is a beta feature as of Kubernetes v1.14. 3097 // +optional 3098 RuntimeClassName *string `json:"runtimeClassName,omitempty" protobuf:"bytes,29,opt,name=runtimeClassName"` 3099 // EnableServiceLinks indicates whether information about services should be injected into pod's 3100 // environment variables, matching the syntax of Docker links. 3101 // Optional: Defaults to true. 3102 // +optional 3103 EnableServiceLinks *bool `json:"enableServiceLinks,omitempty" protobuf:"varint,30,opt,name=enableServiceLinks"` 3104 // PreemptionPolicy is the Policy for preempting pods with lower priority. 3105 // One of Never, PreemptLowerPriority. 3106 // Defaults to PreemptLowerPriority if unset. 3107 // This field is beta-level, gated by the NonPreemptingPriority feature-gate. 3108 // +optional 3109 PreemptionPolicy *PreemptionPolicy `json:"preemptionPolicy,omitempty" protobuf:"bytes,31,opt,name=preemptionPolicy"` 3110 // Overhead represents the resource overhead associated with running a pod for a given RuntimeClass. 3111 // This field will be autopopulated at admission time by the RuntimeClass admission controller. If 3112 // the RuntimeClass admission controller is enabled, overhead must not be set in Pod create requests. 3113 // The RuntimeClass admission controller will reject Pod create requests which have the overhead already 3114 // set. If RuntimeClass is configured and selected in the PodSpec, Overhead will be set to the value 3115 // defined in the corresponding RuntimeClass, otherwise it will remain unset and treated as zero. 3116 // More info: https://git.k8s.io/enhancements/keps/sig-node/20190226-pod-overhead.md 3117 // This field is alpha-level as of Kubernetes v1.16, and is only honored by servers that enable the PodOverhead feature. 3118 // +optional 3119 Overhead ResourceList `json:"overhead,omitempty" protobuf:"bytes,32,opt,name=overhead"` 3120 // TopologySpreadConstraints describes how a group of pods ought to spread across topology 3121 // domains. Scheduler will schedule pods in a way which abides by the constraints. 3122 // All topologySpreadConstraints are ANDed. 3123 // +optional 3124 // +patchMergeKey=topologyKey 3125 // +patchStrategy=merge 3126 // +listType=map 3127 // +listMapKey=topologyKey 3128 // +listMapKey=whenUnsatisfiable 3129 TopologySpreadConstraints []TopologySpreadConstraint `json:"topologySpreadConstraints,omitempty" patchStrategy:"merge" patchMergeKey:"topologyKey" protobuf:"bytes,33,opt,name=topologySpreadConstraints"` 3130 // If true the pod's hostname will be configured as the pod's FQDN, rather than the leaf name (the default). 3131 // In Linux containers, this means setting the FQDN in the hostname field of the kernel (the nodename field of struct utsname). 3132 // In Windows containers, this means setting the registry value of hostname for the registry key HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters to FQDN. 3133 // If a pod does not have FQDN, this has no effect. 3134 // Default to false. 3135 // +optional 3136 SetHostnameAsFQDN *bool `json:"setHostnameAsFQDN,omitempty" protobuf:"varint,35,opt,name=setHostnameAsFQDN"` 3137} 3138 3139type UnsatisfiableConstraintAction string 3140 3141const ( 3142 // DoNotSchedule instructs the scheduler not to schedule the pod 3143 // when constraints are not satisfied. 3144 DoNotSchedule UnsatisfiableConstraintAction = "DoNotSchedule" 3145 // ScheduleAnyway instructs the scheduler to schedule the pod 3146 // even if constraints are not satisfied. 3147 ScheduleAnyway UnsatisfiableConstraintAction = "ScheduleAnyway" 3148) 3149 3150// TopologySpreadConstraint specifies how to spread matching pods among the given topology. 3151type TopologySpreadConstraint struct { 3152 // MaxSkew describes the degree to which pods may be unevenly distributed. 3153 // When `whenUnsatisfiable=DoNotSchedule`, it is the maximum permitted difference 3154 // between the number of matching pods in the target topology and the global minimum. 3155 // For example, in a 3-zone cluster, MaxSkew is set to 1, and pods with the same 3156 // labelSelector spread as 1/1/0: 3157 // +-------+-------+-------+ 3158 // | zone1 | zone2 | zone3 | 3159 // +-------+-------+-------+ 3160 // | P | P | | 3161 // +-------+-------+-------+ 3162 // - if MaxSkew is 1, incoming pod can only be scheduled to zone3 to become 1/1/1; 3163 // scheduling it onto zone1(zone2) would make the ActualSkew(2-0) on zone1(zone2) 3164 // violate MaxSkew(1). 3165 // - if MaxSkew is 2, incoming pod can be scheduled onto any zone. 3166 // When `whenUnsatisfiable=ScheduleAnyway`, it is used to give higher precedence 3167 // to topologies that satisfy it. 3168 // It's a required field. Default value is 1 and 0 is not allowed. 3169 MaxSkew int32 `json:"maxSkew" protobuf:"varint,1,opt,name=maxSkew"` 3170 // TopologyKey is the key of node labels. Nodes that have a label with this key 3171 // and identical values are considered to be in the same topology. 3172 // We consider each <key, value> as a "bucket", and try to put balanced number 3173 // of pods into each bucket. 3174 // It's a required field. 3175 TopologyKey string `json:"topologyKey" protobuf:"bytes,2,opt,name=topologyKey"` 3176 // WhenUnsatisfiable indicates how to deal with a pod if it doesn't satisfy 3177 // the spread constraint. 3178 // - DoNotSchedule (default) tells the scheduler not to schedule it. 3179 // - ScheduleAnyway tells the scheduler to schedule the pod in any location, 3180 // but giving higher precedence to topologies that would help reduce the 3181 // skew. 3182 // A constraint is considered "Unsatisfiable" for an incoming pod 3183 // if and only if every possible node assigment for that pod would violate 3184 // "MaxSkew" on some topology. 3185 // For example, in a 3-zone cluster, MaxSkew is set to 1, and pods with the same 3186 // labelSelector spread as 3/1/1: 3187 // +-------+-------+-------+ 3188 // | zone1 | zone2 | zone3 | 3189 // +-------+-------+-------+ 3190 // | P P P | P | P | 3191 // +-------+-------+-------+ 3192 // If WhenUnsatisfiable is set to DoNotSchedule, incoming pod can only be scheduled 3193 // to zone2(zone3) to become 3/2/1(3/1/2) as ActualSkew(2-1) on zone2(zone3) satisfies 3194 // MaxSkew(1). In other words, the cluster can still be imbalanced, but scheduler 3195 // won't make it *more* imbalanced. 3196 // It's a required field. 3197 WhenUnsatisfiable UnsatisfiableConstraintAction `json:"whenUnsatisfiable" protobuf:"bytes,3,opt,name=whenUnsatisfiable,casttype=UnsatisfiableConstraintAction"` 3198 // LabelSelector is used to find matching pods. 3199 // Pods that match this label selector are counted to determine the number of pods 3200 // in their corresponding topology domain. 3201 // +optional 3202 LabelSelector *metav1.LabelSelector `json:"labelSelector,omitempty" protobuf:"bytes,4,opt,name=labelSelector"` 3203} 3204 3205const ( 3206 // The default value for enableServiceLinks attribute. 3207 DefaultEnableServiceLinks = true 3208) 3209 3210// HostAlias holds the mapping between IP and hostnames that will be injected as an entry in the 3211// pod's hosts file. 3212type HostAlias struct { 3213 // IP address of the host file entry. 3214 IP string `json:"ip,omitempty" protobuf:"bytes,1,opt,name=ip"` 3215 // Hostnames for the above IP address. 3216 Hostnames []string `json:"hostnames,omitempty" protobuf:"bytes,2,rep,name=hostnames"` 3217} 3218 3219// PodFSGroupChangePolicy holds policies that will be used for applying fsGroup to a volume 3220// when volume is mounted. 3221type PodFSGroupChangePolicy string 3222 3223const ( 3224 // FSGroupChangeOnRootMismatch indicates that volume's ownership and permissions will be changed 3225 // only when permission and ownership of root directory does not match with expected 3226 // permissions on the volume. This can help shorten the time it takes to change 3227 // ownership and permissions of a volume. 3228 FSGroupChangeOnRootMismatch PodFSGroupChangePolicy = "OnRootMismatch" 3229 // FSGroupChangeAlways indicates that volume's ownership and permissions 3230 // should always be changed whenever volume is mounted inside a Pod. This the default 3231 // behavior. 3232 FSGroupChangeAlways PodFSGroupChangePolicy = "Always" 3233) 3234 3235// PodSecurityContext holds pod-level security attributes and common container settings. 3236// Some fields are also present in container.securityContext. Field values of 3237// container.securityContext take precedence over field values of PodSecurityContext. 3238type PodSecurityContext struct { 3239 // The SELinux context to be applied to all containers. 3240 // If unspecified, the container runtime will allocate a random SELinux context for each 3241 // container. May also be set in SecurityContext. If set in 3242 // both SecurityContext and PodSecurityContext, the value specified in SecurityContext 3243 // takes precedence for that container. 3244 // +optional 3245 SELinuxOptions *SELinuxOptions `json:"seLinuxOptions,omitempty" protobuf:"bytes,1,opt,name=seLinuxOptions"` 3246 // The Windows specific settings applied to all containers. 3247 // If unspecified, the options within a container's SecurityContext will be used. 3248 // If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. 3249 // +optional 3250 WindowsOptions *WindowsSecurityContextOptions `json:"windowsOptions,omitempty" protobuf:"bytes,8,opt,name=windowsOptions"` 3251 // The UID to run the entrypoint of the container process. 3252 // Defaults to user specified in image metadata if unspecified. 3253 // May also be set in SecurityContext. If set in both SecurityContext and 3254 // PodSecurityContext, the value specified in SecurityContext takes precedence 3255 // for that container. 3256 // +optional 3257 RunAsUser *int64 `json:"runAsUser,omitempty" protobuf:"varint,2,opt,name=runAsUser"` 3258 // The GID to run the entrypoint of the container process. 3259 // Uses runtime default if unset. 3260 // May also be set in SecurityContext. If set in both SecurityContext and 3261 // PodSecurityContext, the value specified in SecurityContext takes precedence 3262 // for that container. 3263 // +optional 3264 RunAsGroup *int64 `json:"runAsGroup,omitempty" protobuf:"varint,6,opt,name=runAsGroup"` 3265 // Indicates that the container must run as a non-root user. 3266 // If true, the Kubelet will validate the image at runtime to ensure that it 3267 // does not run as UID 0 (root) and fail to start the container if it does. 3268 // If unset or false, no such validation will be performed. 3269 // May also be set in SecurityContext. If set in both SecurityContext and 3270 // PodSecurityContext, the value specified in SecurityContext takes precedence. 3271 // +optional 3272 RunAsNonRoot *bool `json:"runAsNonRoot,omitempty" protobuf:"varint,3,opt,name=runAsNonRoot"` 3273 // A list of groups applied to the first process run in each container, in addition 3274 // to the container's primary GID. If unspecified, no groups will be added to 3275 // any container. 3276 // +optional 3277 SupplementalGroups []int64 `json:"supplementalGroups,omitempty" protobuf:"varint,4,rep,name=supplementalGroups"` 3278 // A special supplemental group that applies to all containers in a pod. 3279 // Some volume types allow the Kubelet to change the ownership of that volume 3280 // to be owned by the pod: 3281 // 3282 // 1. The owning GID will be the FSGroup 3283 // 2. The setgid bit is set (new files created in the volume will be owned by FSGroup) 3284 // 3. The permission bits are OR'd with rw-rw---- 3285 // 3286 // If unset, the Kubelet will not modify the ownership and permissions of any volume. 3287 // +optional 3288 FSGroup *int64 `json:"fsGroup,omitempty" protobuf:"varint,5,opt,name=fsGroup"` 3289 // Sysctls hold a list of namespaced sysctls used for the pod. Pods with unsupported 3290 // sysctls (by the container runtime) might fail to launch. 3291 // +optional 3292 Sysctls []Sysctl `json:"sysctls,omitempty" protobuf:"bytes,7,rep,name=sysctls"` 3293 // fsGroupChangePolicy defines behavior of changing ownership and permission of the volume 3294 // before being exposed inside Pod. This field will only apply to 3295 // volume types which support fsGroup based ownership(and permissions). 3296 // It will have no effect on ephemeral volume types such as: secret, configmaps 3297 // and emptydir. 3298 // Valid values are "OnRootMismatch" and "Always". If not specified, "Always" is used. 3299 // +optional 3300 FSGroupChangePolicy *PodFSGroupChangePolicy `json:"fsGroupChangePolicy,omitempty" protobuf:"bytes,9,opt,name=fsGroupChangePolicy"` 3301 // The seccomp options to use by the containers in this pod. 3302 // +optional 3303 SeccompProfile *SeccompProfile `json:"seccompProfile,omitempty" protobuf:"bytes,10,opt,name=seccompProfile"` 3304} 3305 3306// SeccompProfile defines a pod/container's seccomp profile settings. 3307// Only one profile source may be set. 3308// +union 3309type SeccompProfile struct { 3310 // type indicates which kind of seccomp profile will be applied. 3311 // Valid options are: 3312 // 3313 // Localhost - a profile defined in a file on the node should be used. 3314 // RuntimeDefault - the container runtime default profile should be used. 3315 // Unconfined - no profile should be applied. 3316 // +unionDiscriminator 3317 Type SeccompProfileType `json:"type" protobuf:"bytes,1,opt,name=type,casttype=SeccompProfileType"` 3318 // localhostProfile indicates a profile defined in a file on the node should be used. 3319 // The profile must be preconfigured on the node to work. 3320 // Must be a descending path, relative to the kubelet's configured seccomp profile location. 3321 // Must only be set if type is "Localhost". 3322 // +optional 3323 LocalhostProfile *string `json:"localhostProfile,omitempty" protobuf:"bytes,2,opt,name=localhostProfile"` 3324} 3325 3326// SeccompProfileType defines the supported seccomp profile types. 3327type SeccompProfileType string 3328 3329const ( 3330 // SeccompProfileTypeUnconfined indicates no seccomp profile is applied (A.K.A. unconfined). 3331 SeccompProfileTypeUnconfined SeccompProfileType = "Unconfined" 3332 // SeccompProfileTypeRuntimeDefault represents the default container runtime seccomp profile. 3333 SeccompProfileTypeRuntimeDefault SeccompProfileType = "RuntimeDefault" 3334 // SeccompProfileTypeLocalhost indicates a profile defined in a file on the node should be used. 3335 // The file's location is based off the kubelet's deprecated flag --seccomp-profile-root. 3336 // Once the flag support is removed the location will be <kubelet-root-dir>/seccomp. 3337 SeccompProfileTypeLocalhost SeccompProfileType = "Localhost" 3338) 3339 3340// PodQOSClass defines the supported qos classes of Pods. 3341type PodQOSClass string 3342 3343const ( 3344 // PodQOSGuaranteed is the Guaranteed qos class. 3345 PodQOSGuaranteed PodQOSClass = "Guaranteed" 3346 // PodQOSBurstable is the Burstable qos class. 3347 PodQOSBurstable PodQOSClass = "Burstable" 3348 // PodQOSBestEffort is the BestEffort qos class. 3349 PodQOSBestEffort PodQOSClass = "BestEffort" 3350) 3351 3352// PodDNSConfig defines the DNS parameters of a pod in addition to 3353// those generated from DNSPolicy. 3354type PodDNSConfig struct { 3355 // A list of DNS name server IP addresses. 3356 // This will be appended to the base nameservers generated from DNSPolicy. 3357 // Duplicated nameservers will be removed. 3358 // +optional 3359 Nameservers []string `json:"nameservers,omitempty" protobuf:"bytes,1,rep,name=nameservers"` 3360 // A list of DNS search domains for host-name lookup. 3361 // This will be appended to the base search paths generated from DNSPolicy. 3362 // Duplicated search paths will be removed. 3363 // +optional 3364 Searches []string `json:"searches,omitempty" protobuf:"bytes,2,rep,name=searches"` 3365 // A list of DNS resolver options. 3366 // This will be merged with the base options generated from DNSPolicy. 3367 // Duplicated entries will be removed. Resolution options given in Options 3368 // will override those that appear in the base DNSPolicy. 3369 // +optional 3370 Options []PodDNSConfigOption `json:"options,omitempty" protobuf:"bytes,3,rep,name=options"` 3371} 3372 3373// PodDNSConfigOption defines DNS resolver options of a pod. 3374type PodDNSConfigOption struct { 3375 // Required. 3376 Name string `json:"name,omitempty" protobuf:"bytes,1,opt,name=name"` 3377 // +optional 3378 Value *string `json:"value,omitempty" protobuf:"bytes,2,opt,name=value"` 3379} 3380 3381// IP address information for entries in the (plural) PodIPs field. 3382// Each entry includes: 3383// IP: An IP address allocated to the pod. Routable at least within the cluster. 3384type PodIP struct { 3385 // ip is an IP address (IPv4 or IPv6) assigned to the pod 3386 IP string `json:"ip,omitempty" protobuf:"bytes,1,opt,name=ip"` 3387} 3388 3389// EphemeralContainerCommon is a copy of all fields in Container to be inlined in 3390// EphemeralContainer. This separate type allows easy conversion from EphemeralContainer 3391// to Container and allows separate documentation for the fields of EphemeralContainer. 3392// When a new field is added to Container it must be added here as well. 3393type EphemeralContainerCommon struct { 3394 // Name of the ephemeral container specified as a DNS_LABEL. 3395 // This name must be unique among all containers, init containers and ephemeral containers. 3396 Name string `json:"name" protobuf:"bytes,1,opt,name=name"` 3397 // Docker image name. 3398 // More info: https://kubernetes.io/docs/concepts/containers/images 3399 Image string `json:"image,omitempty" protobuf:"bytes,2,opt,name=image"` 3400 // Entrypoint array. Not executed within a shell. 3401 // The docker image's ENTRYPOINT is used if this is not provided. 3402 // Variable references $(VAR_NAME) are expanded using the container's environment. If a variable 3403 // cannot be resolved, the reference in the input string will be unchanged. The $(VAR_NAME) syntax 3404 // can be escaped with a double $$, ie: $$(VAR_NAME). Escaped references will never be expanded, 3405 // regardless of whether the variable exists or not. 3406 // Cannot be updated. 3407 // More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell 3408 // +optional 3409 Command []string `json:"command,omitempty" protobuf:"bytes,3,rep,name=command"` 3410 // Arguments to the entrypoint. 3411 // The docker image's CMD is used if this is not provided. 3412 // Variable references $(VAR_NAME) are expanded using the container's environment. If a variable 3413 // cannot be resolved, the reference in the input string will be unchanged. The $(VAR_NAME) syntax 3414 // can be escaped with a double $$, ie: $$(VAR_NAME). Escaped references will never be expanded, 3415 // regardless of whether the variable exists or not. 3416 // Cannot be updated. 3417 // More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell 3418 // +optional 3419 Args []string `json:"args,omitempty" protobuf:"bytes,4,rep,name=args"` 3420 // Container's working directory. 3421 // If not specified, the container runtime's default will be used, which 3422 // might be configured in the container image. 3423 // Cannot be updated. 3424 // +optional 3425 WorkingDir string `json:"workingDir,omitempty" protobuf:"bytes,5,opt,name=workingDir"` 3426 // Ports are not allowed for ephemeral containers. 3427 Ports []ContainerPort `json:"ports,omitempty" protobuf:"bytes,6,rep,name=ports"` 3428 // List of sources to populate environment variables in the container. 3429 // The keys defined within a source must be a C_IDENTIFIER. All invalid keys 3430 // will be reported as an event when the container is starting. When a key exists in multiple 3431 // sources, the value associated with the last source will take precedence. 3432 // Values defined by an Env with a duplicate key will take precedence. 3433 // Cannot be updated. 3434 // +optional 3435 EnvFrom []EnvFromSource `json:"envFrom,omitempty" protobuf:"bytes,19,rep,name=envFrom"` 3436 // List of environment variables to set in the container. 3437 // Cannot be updated. 3438 // +optional 3439 // +patchMergeKey=name 3440 // +patchStrategy=merge 3441 Env []EnvVar `json:"env,omitempty" patchStrategy:"merge" patchMergeKey:"name" protobuf:"bytes,7,rep,name=env"` 3442 // Resources are not allowed for ephemeral containers. Ephemeral containers use spare resources 3443 // already allocated to the pod. 3444 // +optional 3445 Resources ResourceRequirements `json:"resources,omitempty" protobuf:"bytes,8,opt,name=resources"` 3446 // Pod volumes to mount into the container's filesystem. 3447 // Cannot be updated. 3448 // +optional 3449 // +patchMergeKey=mountPath 3450 // +patchStrategy=merge 3451 VolumeMounts []VolumeMount `json:"volumeMounts,omitempty" patchStrategy:"merge" patchMergeKey:"mountPath" protobuf:"bytes,9,rep,name=volumeMounts"` 3452 // volumeDevices is the list of block devices to be used by the container. 3453 // +patchMergeKey=devicePath 3454 // +patchStrategy=merge 3455 // +optional 3456 VolumeDevices []VolumeDevice `json:"volumeDevices,omitempty" patchStrategy:"merge" patchMergeKey:"devicePath" protobuf:"bytes,21,rep,name=volumeDevices"` 3457 // Probes are not allowed for ephemeral containers. 3458 // +optional 3459 LivenessProbe *Probe `json:"livenessProbe,omitempty" protobuf:"bytes,10,opt,name=livenessProbe"` 3460 // Probes are not allowed for ephemeral containers. 3461 // +optional 3462 ReadinessProbe *Probe `json:"readinessProbe,omitempty" protobuf:"bytes,11,opt,name=readinessProbe"` 3463 // Probes are not allowed for ephemeral containers. 3464 // +optional 3465 StartupProbe *Probe `json:"startupProbe,omitempty" protobuf:"bytes,22,opt,name=startupProbe"` 3466 // Lifecycle is not allowed for ephemeral containers. 3467 // +optional 3468 Lifecycle *Lifecycle `json:"lifecycle,omitempty" protobuf:"bytes,12,opt,name=lifecycle"` 3469 // Optional: Path at which the file to which the container's termination message 3470 // will be written is mounted into the container's filesystem. 3471 // Message written is intended to be brief final status, such as an assertion failure message. 3472 // Will be truncated by the node if greater than 4096 bytes. The total message length across 3473 // all containers will be limited to 12kb. 3474 // Defaults to /dev/termination-log. 3475 // Cannot be updated. 3476 // +optional 3477 TerminationMessagePath string `json:"terminationMessagePath,omitempty" protobuf:"bytes,13,opt,name=terminationMessagePath"` 3478 // Indicate how the termination message should be populated. File will use the contents of 3479 // terminationMessagePath to populate the container status message on both success and failure. 3480 // FallbackToLogsOnError will use the last chunk of container log output if the termination 3481 // message file is empty and the container exited with an error. 3482 // The log output is limited to 2048 bytes or 80 lines, whichever is smaller. 3483 // Defaults to File. 3484 // Cannot be updated. 3485 // +optional 3486 TerminationMessagePolicy TerminationMessagePolicy `json:"terminationMessagePolicy,omitempty" protobuf:"bytes,20,opt,name=terminationMessagePolicy,casttype=TerminationMessagePolicy"` 3487 // Image pull policy. 3488 // One of Always, Never, IfNotPresent. 3489 // Defaults to Always if :latest tag is specified, or IfNotPresent otherwise. 3490 // Cannot be updated. 3491 // More info: https://kubernetes.io/docs/concepts/containers/images#updating-images 3492 // +optional 3493 ImagePullPolicy PullPolicy `json:"imagePullPolicy,omitempty" protobuf:"bytes,14,opt,name=imagePullPolicy,casttype=PullPolicy"` 3494 // SecurityContext is not allowed for ephemeral containers. 3495 // +optional 3496 SecurityContext *SecurityContext `json:"securityContext,omitempty" protobuf:"bytes,15,opt,name=securityContext"` 3497 3498 // Variables for interactive containers, these have very specialized use-cases (e.g. debugging) 3499 // and shouldn't be used for general purpose containers. 3500 3501 // Whether this container should allocate a buffer for stdin in the container runtime. If this 3502 // is not set, reads from stdin in the container will always result in EOF. 3503 // Default is false. 3504 // +optional 3505 Stdin bool `json:"stdin,omitempty" protobuf:"varint,16,opt,name=stdin"` 3506 // Whether the container runtime should close the stdin channel after it has been opened by 3507 // a single attach. When stdin is true the stdin stream will remain open across multiple attach 3508 // sessions. If stdinOnce is set to true, stdin is opened on container start, is empty until the 3509 // first client attaches to stdin, and then remains open and accepts data until the client disconnects, 3510 // at which time stdin is closed and remains closed until the container is restarted. If this 3511 // flag is false, a container processes that reads from stdin will never receive an EOF. 3512 // Default is false 3513 // +optional 3514 StdinOnce bool `json:"stdinOnce,omitempty" protobuf:"varint,17,opt,name=stdinOnce"` 3515 // Whether this container should allocate a TTY for itself, also requires 'stdin' to be true. 3516 // Default is false. 3517 // +optional 3518 TTY bool `json:"tty,omitempty" protobuf:"varint,18,opt,name=tty"` 3519} 3520 3521// EphemeralContainerCommon converts to Container. All fields must be kept in sync between 3522// these two types. 3523var _ = Container(EphemeralContainerCommon{}) 3524 3525// An EphemeralContainer is a container that may be added temporarily to an existing pod for 3526// user-initiated activities such as debugging. Ephemeral containers have no resource or 3527// scheduling guarantees, and they will not be restarted when they exit or when a pod is 3528// removed or restarted. If an ephemeral container causes a pod to exceed its resource 3529// allocation, the pod may be evicted. 3530// Ephemeral containers may not be added by directly updating the pod spec. They must be added 3531// via the pod's ephemeralcontainers subresource, and they will appear in the pod spec 3532// once added. 3533// This is an alpha feature enabled by the EphemeralContainers feature flag. 3534type EphemeralContainer struct { 3535 // Ephemeral containers have all of the fields of Container, plus additional fields 3536 // specific to ephemeral containers. Fields in common with Container are in the 3537 // following inlined struct so than an EphemeralContainer may easily be converted 3538 // to a Container. 3539 EphemeralContainerCommon `json:",inline" protobuf:"bytes,1,req"` 3540 3541 // If set, the name of the container from PodSpec that this ephemeral container targets. 3542 // The ephemeral container will be run in the namespaces (IPC, PID, etc) of this container. 3543 // If not set then the ephemeral container is run in whatever namespaces are shared 3544 // for the pod. Note that the container runtime must support this feature. 3545 // +optional 3546 TargetContainerName string `json:"targetContainerName,omitempty" protobuf:"bytes,2,opt,name=targetContainerName"` 3547} 3548 3549// PodStatus represents information about the status of a pod. Status may trail the actual 3550// state of a system, especially if the node that hosts the pod cannot contact the control 3551// plane. 3552type PodStatus struct { 3553 // The phase of a Pod is a simple, high-level summary of where the Pod is in its lifecycle. 3554 // The conditions array, the reason and message fields, and the individual container status 3555 // arrays contain more detail about the pod's status. 3556 // There are five possible phase values: 3557 // 3558 // Pending: The pod has been accepted by the Kubernetes system, but one or more of the 3559 // container images has not been created. This includes time before being scheduled as 3560 // well as time spent downloading images over the network, which could take a while. 3561 // Running: The pod has been bound to a node, and all of the containers have been created. 3562 // At least one container is still running, or is in the process of starting or restarting. 3563 // Succeeded: All containers in the pod have terminated in success, and will not be restarted. 3564 // Failed: All containers in the pod have terminated, and at least one container has 3565 // terminated in failure. The container either exited with non-zero status or was terminated 3566 // by the system. 3567 // Unknown: For some reason the state of the pod could not be obtained, typically due to an 3568 // error in communicating with the host of the pod. 3569 // 3570 // More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#pod-phase 3571 // +optional 3572 Phase PodPhase `json:"phase,omitempty" protobuf:"bytes,1,opt,name=phase,casttype=PodPhase"` 3573 // Current service state of pod. 3574 // More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#pod-conditions 3575 // +optional 3576 // +patchMergeKey=type 3577 // +patchStrategy=merge 3578 Conditions []PodCondition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type" protobuf:"bytes,2,rep,name=conditions"` 3579 // A human readable message indicating details about why the pod is in this condition. 3580 // +optional 3581 Message string `json:"message,omitempty" protobuf:"bytes,3,opt,name=message"` 3582 // A brief CamelCase message indicating details about why the pod is in this state. 3583 // e.g. 'Evicted' 3584 // +optional 3585 Reason string `json:"reason,omitempty" protobuf:"bytes,4,opt,name=reason"` 3586 // nominatedNodeName is set only when this pod preempts other pods on the node, but it cannot be 3587 // scheduled right away as preemption victims receive their graceful termination periods. 3588 // This field does not guarantee that the pod will be scheduled on this node. Scheduler may decide 3589 // to place the pod elsewhere if other nodes become available sooner. Scheduler may also decide to 3590 // give the resources on this node to a higher priority pod that is created after preemption. 3591 // As a result, this field may be different than PodSpec.nodeName when the pod is 3592 // scheduled. 3593 // +optional 3594 NominatedNodeName string `json:"nominatedNodeName,omitempty" protobuf:"bytes,11,opt,name=nominatedNodeName"` 3595 3596 // IP address of the host to which the pod is assigned. Empty if not yet scheduled. 3597 // +optional 3598 HostIP string `json:"hostIP,omitempty" protobuf:"bytes,5,opt,name=hostIP"` 3599 // IP address allocated to the pod. Routable at least within the cluster. 3600 // Empty if not yet allocated. 3601 // +optional 3602 PodIP string `json:"podIP,omitempty" protobuf:"bytes,6,opt,name=podIP"` 3603 3604 // podIPs holds the IP addresses allocated to the pod. If this field is specified, the 0th entry must 3605 // match the podIP field. Pods may be allocated at most 1 value for each of IPv4 and IPv6. This list 3606 // is empty if no IPs have been allocated yet. 3607 // +optional 3608 // +patchStrategy=merge 3609 // +patchMergeKey=ip 3610 PodIPs []PodIP `json:"podIPs,omitempty" protobuf:"bytes,12,rep,name=podIPs" patchStrategy:"merge" patchMergeKey:"ip"` 3611 3612 // RFC 3339 date and time at which the object was acknowledged by the Kubelet. 3613 // This is before the Kubelet pulled the container image(s) for the pod. 3614 // +optional 3615 StartTime *metav1.Time `json:"startTime,omitempty" protobuf:"bytes,7,opt,name=startTime"` 3616 3617 // The list has one entry per init container in the manifest. The most recent successful 3618 // init container will have ready = true, the most recently started container will have 3619 // startTime set. 3620 // More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#pod-and-container-status 3621 InitContainerStatuses []ContainerStatus `json:"initContainerStatuses,omitempty" protobuf:"bytes,10,rep,name=initContainerStatuses"` 3622 3623 // The list has one entry per container in the manifest. Each entry is currently the output 3624 // of `docker inspect`. 3625 // More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#pod-and-container-status 3626 // +optional 3627 ContainerStatuses []ContainerStatus `json:"containerStatuses,omitempty" protobuf:"bytes,8,rep,name=containerStatuses"` 3628 // The Quality of Service (QOS) classification assigned to the pod based on resource requirements 3629 // See PodQOSClass type for available QOS classes 3630 // More info: https://git.k8s.io/community/contributors/design-proposals/node/resource-qos.md 3631 // +optional 3632 QOSClass PodQOSClass `json:"qosClass,omitempty" protobuf:"bytes,9,rep,name=qosClass"` 3633 // Status for any ephemeral containers that have run in this pod. 3634 // This field is alpha-level and is only populated by servers that enable the EphemeralContainers feature. 3635 // +optional 3636 EphemeralContainerStatuses []ContainerStatus `json:"ephemeralContainerStatuses,omitempty" protobuf:"bytes,13,rep,name=ephemeralContainerStatuses"` 3637} 3638 3639// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object 3640 3641// PodStatusResult is a wrapper for PodStatus returned by kubelet that can be encode/decoded 3642type PodStatusResult struct { 3643 metav1.TypeMeta `json:",inline"` 3644 // Standard object's metadata. 3645 // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata 3646 // +optional 3647 metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` 3648 // Most recently observed status of the pod. 3649 // This data may not be up to date. 3650 // Populated by the system. 3651 // Read-only. 3652 // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status 3653 // +optional 3654 Status PodStatus `json:"status,omitempty" protobuf:"bytes,2,opt,name=status"` 3655} 3656 3657// +genclient 3658// +genclient:method=GetEphemeralContainers,verb=get,subresource=ephemeralcontainers,result=EphemeralContainers 3659// +genclient:method=UpdateEphemeralContainers,verb=update,subresource=ephemeralcontainers,input=EphemeralContainers,result=EphemeralContainers 3660// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object 3661 3662// Pod is a collection of containers that can run on a host. This resource is created 3663// by clients and scheduled onto hosts. 3664type Pod struct { 3665 metav1.TypeMeta `json:",inline"` 3666 // Standard object's metadata. 3667 // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata 3668 // +optional 3669 metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` 3670 3671 // Specification of the desired behavior of the pod. 3672 // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status 3673 // +optional 3674 Spec PodSpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"` 3675 3676 // Most recently observed status of the pod. 3677 // This data may not be up to date. 3678 // Populated by the system. 3679 // Read-only. 3680 // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status 3681 // +optional 3682 Status PodStatus `json:"status,omitempty" protobuf:"bytes,3,opt,name=status"` 3683} 3684 3685// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object 3686 3687// PodList is a list of Pods. 3688type PodList struct { 3689 metav1.TypeMeta `json:",inline"` 3690 // Standard list metadata. 3691 // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds 3692 // +optional 3693 metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` 3694 3695 // List of pods. 3696 // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md 3697 Items []Pod `json:"items" protobuf:"bytes,2,rep,name=items"` 3698} 3699 3700// PodTemplateSpec describes the data a pod should have when created from a template 3701type PodTemplateSpec struct { 3702 // Standard object's metadata. 3703 // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata 3704 // +optional 3705 metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` 3706 3707 // Specification of the desired behavior of the pod. 3708 // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status 3709 // +optional 3710 Spec PodSpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"` 3711} 3712 3713// +genclient 3714// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object 3715 3716// PodTemplate describes a template for creating copies of a predefined pod. 3717type PodTemplate struct { 3718 metav1.TypeMeta `json:",inline"` 3719 // Standard object's metadata. 3720 // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata 3721 // +optional 3722 metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` 3723 3724 // Template defines the pods that will be created from this pod template. 3725 // https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status 3726 // +optional 3727 Template PodTemplateSpec `json:"template,omitempty" protobuf:"bytes,2,opt,name=template"` 3728} 3729 3730// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object 3731 3732// PodTemplateList is a list of PodTemplates. 3733type PodTemplateList struct { 3734 metav1.TypeMeta `json:",inline"` 3735 // Standard list metadata. 3736 // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds 3737 // +optional 3738 metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` 3739 3740 // List of pod templates 3741 Items []PodTemplate `json:"items" protobuf:"bytes,2,rep,name=items"` 3742} 3743 3744// ReplicationControllerSpec is the specification of a replication controller. 3745type ReplicationControllerSpec struct { 3746 // Replicas is the number of desired replicas. 3747 // This is a pointer to distinguish between explicit zero and unspecified. 3748 // Defaults to 1. 3749 // More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller#what-is-a-replicationcontroller 3750 // +optional 3751 Replicas *int32 `json:"replicas,omitempty" protobuf:"varint,1,opt,name=replicas"` 3752 3753 // Minimum number of seconds for which a newly created pod should be ready 3754 // without any of its container crashing, for it to be considered available. 3755 // Defaults to 0 (pod will be considered available as soon as it is ready) 3756 // +optional 3757 MinReadySeconds int32 `json:"minReadySeconds,omitempty" protobuf:"varint,4,opt,name=minReadySeconds"` 3758 3759 // Selector is a label query over pods that should match the Replicas count. 3760 // If Selector is empty, it is defaulted to the labels present on the Pod template. 3761 // Label keys and values that must match in order to be controlled by this replication 3762 // controller, if empty defaulted to labels on Pod template. 3763 // More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors 3764 // +optional 3765 Selector map[string]string `json:"selector,omitempty" protobuf:"bytes,2,rep,name=selector"` 3766 3767 // TemplateRef is a reference to an object that describes the pod that will be created if 3768 // insufficient replicas are detected. 3769 // Reference to an object that describes the pod that will be created if insufficient replicas are detected. 3770 // +optional 3771 // TemplateRef *ObjectReference `json:"templateRef,omitempty"` 3772 3773 // Template is the object that describes the pod that will be created if 3774 // insufficient replicas are detected. This takes precedence over a TemplateRef. 3775 // More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller#pod-template 3776 // +optional 3777 Template *PodTemplateSpec `json:"template,omitempty" protobuf:"bytes,3,opt,name=template"` 3778} 3779 3780// ReplicationControllerStatus represents the current status of a replication 3781// controller. 3782type ReplicationControllerStatus struct { 3783 // Replicas is the most recently oberved number of replicas. 3784 // More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller#what-is-a-replicationcontroller 3785 Replicas int32 `json:"replicas" protobuf:"varint,1,opt,name=replicas"` 3786 3787 // The number of pods that have labels matching the labels of the pod template of the replication controller. 3788 // +optional 3789 FullyLabeledReplicas int32 `json:"fullyLabeledReplicas,omitempty" protobuf:"varint,2,opt,name=fullyLabeledReplicas"` 3790 3791 // The number of ready replicas for this replication controller. 3792 // +optional 3793 ReadyReplicas int32 `json:"readyReplicas,omitempty" protobuf:"varint,4,opt,name=readyReplicas"` 3794 3795 // The number of available replicas (ready for at least minReadySeconds) for this replication controller. 3796 // +optional 3797 AvailableReplicas int32 `json:"availableReplicas,omitempty" protobuf:"varint,5,opt,name=availableReplicas"` 3798 3799 // ObservedGeneration reflects the generation of the most recently observed replication controller. 3800 // +optional 3801 ObservedGeneration int64 `json:"observedGeneration,omitempty" protobuf:"varint,3,opt,name=observedGeneration"` 3802 3803 // Represents the latest available observations of a replication controller's current state. 3804 // +optional 3805 // +patchMergeKey=type 3806 // +patchStrategy=merge 3807 Conditions []ReplicationControllerCondition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type" protobuf:"bytes,6,rep,name=conditions"` 3808} 3809 3810type ReplicationControllerConditionType string 3811 3812// These are valid conditions of a replication controller. 3813const ( 3814 // ReplicationControllerReplicaFailure is added in a replication controller when one of its pods 3815 // fails to be created due to insufficient quota, limit ranges, pod security policy, node selectors, 3816 // etc. or deleted due to kubelet being down or finalizers are failing. 3817 ReplicationControllerReplicaFailure ReplicationControllerConditionType = "ReplicaFailure" 3818) 3819 3820// ReplicationControllerCondition describes the state of a replication controller at a certain point. 3821type ReplicationControllerCondition struct { 3822 // Type of replication controller condition. 3823 Type ReplicationControllerConditionType `json:"type" protobuf:"bytes,1,opt,name=type,casttype=ReplicationControllerConditionType"` 3824 // Status of the condition, one of True, False, Unknown. 3825 Status ConditionStatus `json:"status" protobuf:"bytes,2,opt,name=status,casttype=ConditionStatus"` 3826 // The last time the condition transitioned from one status to another. 3827 // +optional 3828 LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty" protobuf:"bytes,3,opt,name=lastTransitionTime"` 3829 // The reason for the condition's last transition. 3830 // +optional 3831 Reason string `json:"reason,omitempty" protobuf:"bytes,4,opt,name=reason"` 3832 // A human readable message indicating details about the transition. 3833 // +optional 3834 Message string `json:"message,omitempty" protobuf:"bytes,5,opt,name=message"` 3835} 3836 3837// +genclient 3838// +genclient:method=GetScale,verb=get,subresource=scale,result=k8s.io/api/autoscaling/v1.Scale 3839// +genclient:method=UpdateScale,verb=update,subresource=scale,input=k8s.io/api/autoscaling/v1.Scale,result=k8s.io/api/autoscaling/v1.Scale 3840// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object 3841 3842// ReplicationController represents the configuration of a replication controller. 3843type ReplicationController struct { 3844 metav1.TypeMeta `json:",inline"` 3845 3846 // If the Labels of a ReplicationController are empty, they are defaulted to 3847 // be the same as the Pod(s) that the replication controller manages. 3848 // Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata 3849 // +optional 3850 metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` 3851 3852 // Spec defines the specification of the desired behavior of the replication controller. 3853 // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status 3854 // +optional 3855 Spec ReplicationControllerSpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"` 3856 3857 // Status is the most recently observed status of the replication controller. 3858 // This data may be out of date by some window of time. 3859 // Populated by the system. 3860 // Read-only. 3861 // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status 3862 // +optional 3863 Status ReplicationControllerStatus `json:"status,omitempty" protobuf:"bytes,3,opt,name=status"` 3864} 3865 3866// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object 3867 3868// ReplicationControllerList is a collection of replication controllers. 3869type ReplicationControllerList struct { 3870 metav1.TypeMeta `json:",inline"` 3871 // Standard list metadata. 3872 // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds 3873 // +optional 3874 metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` 3875 3876 // List of replication controllers. 3877 // More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller 3878 Items []ReplicationController `json:"items" protobuf:"bytes,2,rep,name=items"` 3879} 3880 3881// Session Affinity Type string 3882type ServiceAffinity string 3883 3884const ( 3885 // ServiceAffinityClientIP is the Client IP based. 3886 ServiceAffinityClientIP ServiceAffinity = "ClientIP" 3887 3888 // ServiceAffinityNone - no session affinity. 3889 ServiceAffinityNone ServiceAffinity = "None" 3890) 3891 3892const DefaultClientIPServiceAffinitySeconds int32 = 10800 3893 3894// SessionAffinityConfig represents the configurations of session affinity. 3895type SessionAffinityConfig struct { 3896 // clientIP contains the configurations of Client IP based session affinity. 3897 // +optional 3898 ClientIP *ClientIPConfig `json:"clientIP,omitempty" protobuf:"bytes,1,opt,name=clientIP"` 3899} 3900 3901// ClientIPConfig represents the configurations of Client IP based session affinity. 3902type ClientIPConfig struct { 3903 // timeoutSeconds specifies the seconds of ClientIP type session sticky time. 3904 // The value must be >0 && <=86400(for 1 day) if ServiceAffinity == "ClientIP". 3905 // Default value is 10800(for 3 hours). 3906 // +optional 3907 TimeoutSeconds *int32 `json:"timeoutSeconds,omitempty" protobuf:"varint,1,opt,name=timeoutSeconds"` 3908} 3909 3910// Service Type string describes ingress methods for a service 3911type ServiceType string 3912 3913const ( 3914 // ServiceTypeClusterIP means a service will only be accessible inside the 3915 // cluster, via the cluster IP. 3916 ServiceTypeClusterIP ServiceType = "ClusterIP" 3917 3918 // ServiceTypeNodePort means a service will be exposed on one port of 3919 // every node, in addition to 'ClusterIP' type. 3920 ServiceTypeNodePort ServiceType = "NodePort" 3921 3922 // ServiceTypeLoadBalancer means a service will be exposed via an 3923 // external load balancer (if the cloud provider supports it), in addition 3924 // to 'NodePort' type. 3925 ServiceTypeLoadBalancer ServiceType = "LoadBalancer" 3926 3927 // ServiceTypeExternalName means a service consists of only a reference to 3928 // an external name that kubedns or equivalent will return as a CNAME 3929 // record, with no exposing or proxying of any pods involved. 3930 ServiceTypeExternalName ServiceType = "ExternalName" 3931) 3932 3933// Service External Traffic Policy Type string 3934type ServiceExternalTrafficPolicyType string 3935 3936const ( 3937 // ServiceExternalTrafficPolicyTypeLocal specifies node-local endpoints behavior. 3938 ServiceExternalTrafficPolicyTypeLocal ServiceExternalTrafficPolicyType = "Local" 3939 // ServiceExternalTrafficPolicyTypeCluster specifies node-global (legacy) behavior. 3940 ServiceExternalTrafficPolicyTypeCluster ServiceExternalTrafficPolicyType = "Cluster" 3941) 3942 3943// These are the valid conditions of a service. 3944const ( 3945 // LoadBalancerPortsError represents the condition of the requested ports 3946 // on the cloud load balancer instance. 3947 LoadBalancerPortsError = "LoadBalancerPortsError" 3948) 3949 3950// ServiceStatus represents the current status of a service. 3951type ServiceStatus struct { 3952 // LoadBalancer contains the current status of the load-balancer, 3953 // if one is present. 3954 // +optional 3955 LoadBalancer LoadBalancerStatus `json:"loadBalancer,omitempty" protobuf:"bytes,1,opt,name=loadBalancer"` 3956 // Current service state 3957 // +optional 3958 // +patchMergeKey=type 3959 // +patchStrategy=merge 3960 // +listType=map 3961 // +listMapKey=type 3962 Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type" protobuf:"bytes,2,rep,name=conditions"` 3963} 3964 3965// LoadBalancerStatus represents the status of a load-balancer. 3966type LoadBalancerStatus struct { 3967 // Ingress is a list containing ingress points for the load-balancer. 3968 // Traffic intended for the service should be sent to these ingress points. 3969 // +optional 3970 Ingress []LoadBalancerIngress `json:"ingress,omitempty" protobuf:"bytes,1,rep,name=ingress"` 3971} 3972 3973// LoadBalancerIngress represents the status of a load-balancer ingress point: 3974// traffic intended for the service should be sent to an ingress point. 3975type LoadBalancerIngress struct { 3976 // IP is set for load-balancer ingress points that are IP based 3977 // (typically GCE or OpenStack load-balancers) 3978 // +optional 3979 IP string `json:"ip,omitempty" protobuf:"bytes,1,opt,name=ip"` 3980 3981 // Hostname is set for load-balancer ingress points that are DNS based 3982 // (typically AWS load-balancers) 3983 // +optional 3984 Hostname string `json:"hostname,omitempty" protobuf:"bytes,2,opt,name=hostname"` 3985 3986 // Ports is a list of records of service ports 3987 // If used, every port defined in the service should have an entry in it 3988 // +listType=atomic 3989 // +optional 3990 Ports []PortStatus `json:"ports,omitempty" protobuf:"bytes,4,rep,name=ports"` 3991} 3992 3993const ( 3994 // MaxServiceTopologyKeys is the largest number of topology keys allowed on a service 3995 MaxServiceTopologyKeys = 16 3996) 3997 3998// IPFamily represents the IP Family (IPv4 or IPv6). This type is used 3999// to express the family of an IP expressed by a type (e.g. service.spec.ipFamilies). 4000type IPFamily string 4001 4002const ( 4003 // IPv4Protocol indicates that this IP is IPv4 protocol 4004 IPv4Protocol IPFamily = "IPv4" 4005 // IPv6Protocol indicates that this IP is IPv6 protocol 4006 IPv6Protocol IPFamily = "IPv6" 4007) 4008 4009// IPFamilyPolicyType represents the dual-stack-ness requested or required by a Service 4010type IPFamilyPolicyType string 4011 4012const ( 4013 // IPFamilyPolicySingleStack indicates that this service is required to have a single IPFamily. 4014 // The IPFamily assigned is based on the default IPFamily used by the cluster 4015 // or as identified by service.spec.ipFamilies field 4016 IPFamilyPolicySingleStack IPFamilyPolicyType = "SingleStack" 4017 // IPFamilyPolicyPreferDualStack indicates that this service prefers dual-stack when 4018 // the cluster is configured for dual-stack. If the cluster is not configured 4019 // for dual-stack the service will be assigned a single IPFamily. If the IPFamily is not 4020 // set in service.spec.ipFamilies then the service will be assigned the default IPFamily 4021 // configured on the cluster 4022 IPFamilyPolicyPreferDualStack IPFamilyPolicyType = "PreferDualStack" 4023 // IPFamilyPolicyRequireDualStack indicates that this service requires dual-stack. Using 4024 // IPFamilyPolicyRequireDualStack on a single stack cluster will result in validation errors. The 4025 // IPFamilies (and their order) assigned to this service is based on service.spec.ipFamilies. If 4026 // service.spec.ipFamilies was not provided then it will be assigned according to how they are 4027 // configured on the cluster. If service.spec.ipFamilies has only one entry then the alternative 4028 // IPFamily will be added by apiserver 4029 IPFamilyPolicyRequireDualStack IPFamilyPolicyType = "RequireDualStack" 4030) 4031 4032// ServiceSpec describes the attributes that a user creates on a service. 4033type ServiceSpec struct { 4034 // The list of ports that are exposed by this service. 4035 // More info: https://kubernetes.io/docs/concepts/services-networking/service/#virtual-ips-and-service-proxies 4036 // +patchMergeKey=port 4037 // +patchStrategy=merge 4038 // +listType=map 4039 // +listMapKey=port 4040 // +listMapKey=protocol 4041 Ports []ServicePort `json:"ports,omitempty" patchStrategy:"merge" patchMergeKey:"port" protobuf:"bytes,1,rep,name=ports"` 4042 4043 // Route service traffic to pods with label keys and values matching this 4044 // selector. If empty or not present, the service is assumed to have an 4045 // external process managing its endpoints, which Kubernetes will not 4046 // modify. Only applies to types ClusterIP, NodePort, and LoadBalancer. 4047 // Ignored if type is ExternalName. 4048 // More info: https://kubernetes.io/docs/concepts/services-networking/service/ 4049 // +optional 4050 Selector map[string]string `json:"selector,omitempty" protobuf:"bytes,2,rep,name=selector"` 4051 4052 // clusterIP is the IP address of the service and is usually assigned 4053 // randomly. If an address is specified manually, is in-range (as per 4054 // system configuration), and is not in use, it will be allocated to the 4055 // service; otherwise creation of the service will fail. This field may not 4056 // be changed through updates unless the type field is also being changed 4057 // to ExternalName (which requires this field to be blank) or the type 4058 // field is being changed from ExternalName (in which case this field may 4059 // optionally be specified, as describe above). Valid values are "None", 4060 // empty string (""), or a valid IP address. Setting this to "None" makes a 4061 // "headless service" (no virtual IP), which is useful when direct endpoint 4062 // connections are preferred and proxying is not required. Only applies to 4063 // types ClusterIP, NodePort, and LoadBalancer. If this field is specified 4064 // when creating a Service of type ExternalName, creation will fail. This 4065 // field will be wiped when updating a Service to type ExternalName. 4066 // More info: https://kubernetes.io/docs/concepts/services-networking/service/#virtual-ips-and-service-proxies 4067 // +optional 4068 ClusterIP string `json:"clusterIP,omitempty" protobuf:"bytes,3,opt,name=clusterIP"` 4069 4070 // ClusterIPs is a list of IP addresses assigned to this service, and are 4071 // usually assigned randomly. If an address is specified manually, is 4072 // in-range (as per system configuration), and is not in use, it will be 4073 // allocated to the service; otherwise creation of the service will fail. 4074 // This field may not be changed through updates unless the type field is 4075 // also being changed to ExternalName (which requires this field to be 4076 // empty) or the type field is being changed from ExternalName (in which 4077 // case this field may optionally be specified, as describe above). Valid 4078 // values are "None", empty string (""), or a valid IP address. Setting 4079 // this to "None" makes a "headless service" (no virtual IP), which is 4080 // useful when direct endpoint connections are preferred and proxying is 4081 // not required. Only applies to types ClusterIP, NodePort, and 4082 // LoadBalancer. If this field is specified when creating a Service of type 4083 // ExternalName, creation will fail. This field will be wiped when updating 4084 // a Service to type ExternalName. If this field is not specified, it will 4085 // be initialized from the clusterIP field. If this field is specified, 4086 // clients must ensure that clusterIPs[0] and clusterIP have the same 4087 // value. 4088 // 4089 // Unless the "IPv6DualStack" feature gate is enabled, this field is 4090 // limited to one value, which must be the same as the clusterIP field. If 4091 // the feature gate is enabled, this field may hold a maximum of two 4092 // entries (dual-stack IPs, in either order). These IPs must correspond to 4093 // the values of the ipFamilies field. Both clusterIPs and ipFamilies are 4094 // governed by the ipFamilyPolicy field. 4095 // More info: https://kubernetes.io/docs/concepts/services-networking/service/#virtual-ips-and-service-proxies 4096 // +listType=atomic 4097 // +optional 4098 ClusterIPs []string `json:"clusterIPs,omitempty" protobuf:"bytes,18,opt,name=clusterIPs"` 4099 4100 // type determines how the Service is exposed. Defaults to ClusterIP. Valid 4101 // options are ExternalName, ClusterIP, NodePort, and LoadBalancer. 4102 // "ClusterIP" allocates a cluster-internal IP address for load-balancing 4103 // to endpoints. Endpoints are determined by the selector or if that is not 4104 // specified, by manual construction of an Endpoints object or 4105 // EndpointSlice objects. If clusterIP is "None", no virtual IP is 4106 // allocated and the endpoints are published as a set of endpoints rather 4107 // than a virtual IP. 4108 // "NodePort" builds on ClusterIP and allocates a port on every node which 4109 // routes to the same endpoints as the clusterIP. 4110 // "LoadBalancer" builds on NodePort and creates an external load-balancer 4111 // (if supported in the current cloud) which routes to the same endpoints 4112 // as the clusterIP. 4113 // "ExternalName" aliases this service to the specified externalName. 4114 // Several other fields do not apply to ExternalName services. 4115 // More info: https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services-service-types 4116 // +optional 4117 Type ServiceType `json:"type,omitempty" protobuf:"bytes,4,opt,name=type,casttype=ServiceType"` 4118 4119 // externalIPs is a list of IP addresses for which nodes in the cluster 4120 // will also accept traffic for this service. These IPs are not managed by 4121 // Kubernetes. The user is responsible for ensuring that traffic arrives 4122 // at a node with this IP. A common example is external load-balancers 4123 // that are not part of the Kubernetes system. 4124 // +optional 4125 ExternalIPs []string `json:"externalIPs,omitempty" protobuf:"bytes,5,rep,name=externalIPs"` 4126 4127 // Supports "ClientIP" and "None". Used to maintain session affinity. 4128 // Enable client IP based session affinity. 4129 // Must be ClientIP or None. 4130 // Defaults to None. 4131 // More info: https://kubernetes.io/docs/concepts/services-networking/service/#virtual-ips-and-service-proxies 4132 // +optional 4133 SessionAffinity ServiceAffinity `json:"sessionAffinity,omitempty" protobuf:"bytes,7,opt,name=sessionAffinity,casttype=ServiceAffinity"` 4134 4135 // Only applies to Service Type: LoadBalancer 4136 // LoadBalancer will get created with the IP specified in this field. 4137 // This feature depends on whether the underlying cloud-provider supports specifying 4138 // the loadBalancerIP when a load balancer is created. 4139 // This field will be ignored if the cloud-provider does not support the feature. 4140 // +optional 4141 LoadBalancerIP string `json:"loadBalancerIP,omitempty" protobuf:"bytes,8,opt,name=loadBalancerIP"` 4142 4143 // If specified and supported by the platform, this will restrict traffic through the cloud-provider 4144 // load-balancer will be restricted to the specified client IPs. This field will be ignored if the 4145 // cloud-provider does not support the feature." 4146 // More info: https://kubernetes.io/docs/tasks/access-application-cluster/configure-cloud-provider-firewall/ 4147 // +optional 4148 LoadBalancerSourceRanges []string `json:"loadBalancerSourceRanges,omitempty" protobuf:"bytes,9,opt,name=loadBalancerSourceRanges"` 4149 4150 // externalName is the external reference that discovery mechanisms will 4151 // return as an alias for this service (e.g. a DNS CNAME record). No 4152 // proxying will be involved. Must be a lowercase RFC-1123 hostname 4153 // (https://tools.ietf.org/html/rfc1123) and requires Type to be 4154 // +optional 4155 ExternalName string `json:"externalName,omitempty" protobuf:"bytes,10,opt,name=externalName"` 4156 4157 // externalTrafficPolicy denotes if this Service desires to route external 4158 // traffic to node-local or cluster-wide endpoints. "Local" preserves the 4159 // client source IP and avoids a second hop for LoadBalancer and Nodeport 4160 // type services, but risks potentially imbalanced traffic spreading. 4161 // "Cluster" obscures the client source IP and may cause a second hop to 4162 // another node, but should have good overall load-spreading. 4163 // +optional 4164 ExternalTrafficPolicy ServiceExternalTrafficPolicyType `json:"externalTrafficPolicy,omitempty" protobuf:"bytes,11,opt,name=externalTrafficPolicy"` 4165 4166 // healthCheckNodePort specifies the healthcheck nodePort for the service. 4167 // This only applies when type is set to LoadBalancer and 4168 // externalTrafficPolicy is set to Local. If a value is specified, is 4169 // in-range, and is not in use, it will be used. If not specified, a value 4170 // will be automatically allocated. External systems (e.g. load-balancers) 4171 // can use this port to determine if a given node holds endpoints for this 4172 // service or not. If this field is specified when creating a Service 4173 // which does not need it, creation will fail. This field will be wiped 4174 // when updating a Service to no longer need it (e.g. changing type). 4175 // +optional 4176 HealthCheckNodePort int32 `json:"healthCheckNodePort,omitempty" protobuf:"bytes,12,opt,name=healthCheckNodePort"` 4177 4178 // publishNotReadyAddresses indicates that any agent which deals with endpoints for this 4179 // Service should disregard any indications of ready/not-ready. 4180 // The primary use case for setting this field is for a StatefulSet's Headless Service to 4181 // propagate SRV DNS records for its Pods for the purpose of peer discovery. 4182 // The Kubernetes controllers that generate Endpoints and EndpointSlice resources for 4183 // Services interpret this to mean that all endpoints are considered "ready" even if the 4184 // Pods themselves are not. Agents which consume only Kubernetes generated endpoints 4185 // through the Endpoints or EndpointSlice resources can safely assume this behavior. 4186 // +optional 4187 PublishNotReadyAddresses bool `json:"publishNotReadyAddresses,omitempty" protobuf:"varint,13,opt,name=publishNotReadyAddresses"` 4188 4189 // sessionAffinityConfig contains the configurations of session affinity. 4190 // +optional 4191 SessionAffinityConfig *SessionAffinityConfig `json:"sessionAffinityConfig,omitempty" protobuf:"bytes,14,opt,name=sessionAffinityConfig"` 4192 4193 // topologyKeys is a preference-order list of topology keys which 4194 // implementations of services should use to preferentially sort endpoints 4195 // when accessing this Service, it can not be used at the same time as 4196 // externalTrafficPolicy=Local. 4197 // Topology keys must be valid label keys and at most 16 keys may be specified. 4198 // Endpoints are chosen based on the first topology key with available backends. 4199 // If this field is specified and all entries have no backends that match 4200 // the topology of the client, the service has no backends for that client 4201 // and connections should fail. 4202 // The special value "*" may be used to mean "any topology". This catch-all 4203 // value, if used, only makes sense as the last value in the list. 4204 // If this is not specified or empty, no topology constraints will be applied. 4205 // This field is alpha-level and is only honored by servers that enable the ServiceTopology feature. 4206 // +optional 4207 TopologyKeys []string `json:"topologyKeys,omitempty" protobuf:"bytes,16,opt,name=topologyKeys"` 4208 4209 // IPFamily is tombstoned to show why 15 is a reserved protobuf tag. 4210 // IPFamily *IPFamily `json:"ipFamily,omitempty" protobuf:"bytes,15,opt,name=ipFamily,Configcasttype=IPFamily"` 4211 4212 // IPFamilies is a list of IP families (e.g. IPv4, IPv6) assigned to this 4213 // service, and is gated by the "IPv6DualStack" feature gate. This field 4214 // is usually assigned automatically based on cluster configuration and the 4215 // ipFamilyPolicy field. If this field is specified manually, the requested 4216 // family is available in the cluster, and ipFamilyPolicy allows it, it 4217 // will be used; otherwise creation of the service will fail. This field 4218 // is conditionally mutable: it allows for adding or removing a secondary 4219 // IP family, but it does not allow changing the primary IP family of the 4220 // Service. Valid values are "IPv4" and "IPv6". This field only applies 4221 // to Services of types ClusterIP, NodePort, and LoadBalancer, and does 4222 // apply to "headless" services. This field will be wiped when updating a 4223 // Service to type ExternalName. 4224 // 4225 // This field may hold a maximum of two entries (dual-stack families, in 4226 // either order). These families must correspond to the values of the 4227 // clusterIPs field, if specified. Both clusterIPs and ipFamilies are 4228 // governed by the ipFamilyPolicy field. 4229 // +listType=atomic 4230 // +optional 4231 IPFamilies []IPFamily `json:"ipFamilies,omitempty" protobuf:"bytes,19,opt,name=ipFamilies,casttype=IPFamily"` 4232 4233 // IPFamilyPolicy represents the dual-stack-ness requested or required by 4234 // this Service, and is gated by the "IPv6DualStack" feature gate. If 4235 // there is no value provided, then this field will be set to SingleStack. 4236 // Services can be "SingleStack" (a single IP family), "PreferDualStack" 4237 // (two IP families on dual-stack configured clusters or a single IP family 4238 // on single-stack clusters), or "RequireDualStack" (two IP families on 4239 // dual-stack configured clusters, otherwise fail). The ipFamilies and 4240 // clusterIPs fields depend on the value of this field. This field will be 4241 // wiped when updating a service to type ExternalName. 4242 // +optional 4243 IPFamilyPolicy *IPFamilyPolicyType `json:"ipFamilyPolicy,omitempty" protobuf:"bytes,17,opt,name=ipFamilyPolicy,casttype=IPFamilyPolicyType"` 4244 4245 // allocateLoadBalancerNodePorts defines if NodePorts will be automatically 4246 // allocated for services with type LoadBalancer. Default is "true". It may be 4247 // set to "false" if the cluster load-balancer does not rely on NodePorts. 4248 // allocateLoadBalancerNodePorts may only be set for services with type LoadBalancer 4249 // and will be cleared if the type is changed to any other type. 4250 // This field is alpha-level and is only honored by servers that enable the ServiceLBNodePortControl feature. 4251 // +optional 4252 AllocateLoadBalancerNodePorts *bool `json:"allocateLoadBalancerNodePorts,omitempty" protobuf:"bytes,20,opt,name=allocateLoadBalancerNodePorts"` 4253} 4254 4255// ServicePort contains information on service's port. 4256type ServicePort struct { 4257 // The name of this port within the service. This must be a DNS_LABEL. 4258 // All ports within a ServiceSpec must have unique names. When considering 4259 // the endpoints for a Service, this must match the 'name' field in the 4260 // EndpointPort. 4261 // Optional if only one ServicePort is defined on this service. 4262 // +optional 4263 Name string `json:"name,omitempty" protobuf:"bytes,1,opt,name=name"` 4264 4265 // The IP protocol for this port. Supports "TCP", "UDP", and "SCTP". 4266 // Default is TCP. 4267 // +default="TCP" 4268 // +optional 4269 Protocol Protocol `json:"protocol,omitempty" protobuf:"bytes,2,opt,name=protocol,casttype=Protocol"` 4270 4271 // The application protocol for this port. 4272 // This field follows standard Kubernetes label syntax. 4273 // Un-prefixed names are reserved for IANA standard service names (as per 4274 // RFC-6335 and http://www.iana.org/assignments/service-names). 4275 // Non-standard protocols should use prefixed names such as 4276 // mycompany.com/my-custom-protocol. 4277 // This is a beta field that is guarded by the ServiceAppProtocol feature 4278 // gate and enabled by default. 4279 // +optional 4280 AppProtocol *string `json:"appProtocol,omitempty" protobuf:"bytes,6,opt,name=appProtocol"` 4281 4282 // The port that will be exposed by this service. 4283 Port int32 `json:"port" protobuf:"varint,3,opt,name=port"` 4284 4285 // Number or name of the port to access on the pods targeted by the service. 4286 // Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. 4287 // If this is a string, it will be looked up as a named port in the 4288 // target Pod's container ports. If this is not specified, the value 4289 // of the 'port' field is used (an identity map). 4290 // This field is ignored for services with clusterIP=None, and should be 4291 // omitted or set equal to the 'port' field. 4292 // More info: https://kubernetes.io/docs/concepts/services-networking/service/#defining-a-service 4293 // +optional 4294 TargetPort intstr.IntOrString `json:"targetPort,omitempty" protobuf:"bytes,4,opt,name=targetPort"` 4295 4296 // The port on each node on which this service is exposed when type is 4297 // NodePort or LoadBalancer. Usually assigned by the system. If a value is 4298 // specified, in-range, and not in use it will be used, otherwise the 4299 // operation will fail. If not specified, a port will be allocated if this 4300 // Service requires one. If this field is specified when creating a 4301 // Service which does not need it, creation will fail. This field will be 4302 // wiped when updating a Service to no longer need it (e.g. changing type 4303 // from NodePort to ClusterIP). 4304 // More info: https://kubernetes.io/docs/concepts/services-networking/service/#type-nodeport 4305 // +optional 4306 NodePort int32 `json:"nodePort,omitempty" protobuf:"varint,5,opt,name=nodePort"` 4307} 4308 4309// +genclient 4310// +genclient:skipVerbs=deleteCollection 4311// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object 4312 4313// Service is a named abstraction of software service (for example, mysql) consisting of local port 4314// (for example 3306) that the proxy listens on, and the selector that determines which pods 4315// will answer requests sent through the proxy. 4316type Service struct { 4317 metav1.TypeMeta `json:",inline"` 4318 // Standard object's metadata. 4319 // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata 4320 // +optional 4321 metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` 4322 4323 // Spec defines the behavior of a service. 4324 // https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status 4325 // +optional 4326 Spec ServiceSpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"` 4327 4328 // Most recently observed status of the service. 4329 // Populated by the system. 4330 // Read-only. 4331 // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status 4332 // +optional 4333 Status ServiceStatus `json:"status,omitempty" protobuf:"bytes,3,opt,name=status"` 4334} 4335 4336const ( 4337 // ClusterIPNone - do not assign a cluster IP 4338 // no proxying required and no environment variables should be created for pods 4339 ClusterIPNone = "None" 4340) 4341 4342// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object 4343 4344// ServiceList holds a list of services. 4345type ServiceList struct { 4346 metav1.TypeMeta `json:",inline"` 4347 // Standard list metadata. 4348 // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds 4349 // +optional 4350 metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` 4351 4352 // List of services 4353 Items []Service `json:"items" protobuf:"bytes,2,rep,name=items"` 4354} 4355 4356// +genclient 4357// +genclient:method=CreateToken,verb=create,subresource=token,input=k8s.io/api/authentication/v1.TokenRequest,result=k8s.io/api/authentication/v1.TokenRequest 4358// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object 4359 4360// ServiceAccount binds together: 4361// * a name, understood by users, and perhaps by peripheral systems, for an identity 4362// * a principal that can be authenticated and authorized 4363// * a set of secrets 4364type ServiceAccount struct { 4365 metav1.TypeMeta `json:",inline"` 4366 // Standard object's metadata. 4367 // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata 4368 // +optional 4369 metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` 4370 4371 // Secrets is the list of secrets allowed to be used by pods running using this ServiceAccount. 4372 // More info: https://kubernetes.io/docs/concepts/configuration/secret 4373 // +optional 4374 // +patchMergeKey=name 4375 // +patchStrategy=merge 4376 Secrets []ObjectReference `json:"secrets,omitempty" patchStrategy:"merge" patchMergeKey:"name" protobuf:"bytes,2,rep,name=secrets"` 4377 4378 // ImagePullSecrets is a list of references to secrets in the same namespace to use for pulling any images 4379 // in pods that reference this ServiceAccount. ImagePullSecrets are distinct from Secrets because Secrets 4380 // can be mounted in the pod, but ImagePullSecrets are only accessed by the kubelet. 4381 // More info: https://kubernetes.io/docs/concepts/containers/images/#specifying-imagepullsecrets-on-a-pod 4382 // +optional 4383 ImagePullSecrets []LocalObjectReference `json:"imagePullSecrets,omitempty" protobuf:"bytes,3,rep,name=imagePullSecrets"` 4384 4385 // AutomountServiceAccountToken indicates whether pods running as this service account should have an API token automatically mounted. 4386 // Can be overridden at the pod level. 4387 // +optional 4388 AutomountServiceAccountToken *bool `json:"automountServiceAccountToken,omitempty" protobuf:"varint,4,opt,name=automountServiceAccountToken"` 4389} 4390 4391// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object 4392 4393// ServiceAccountList is a list of ServiceAccount objects 4394type ServiceAccountList struct { 4395 metav1.TypeMeta `json:",inline"` 4396 // Standard list metadata. 4397 // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds 4398 // +optional 4399 metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` 4400 4401 // List of ServiceAccounts. 4402 // More info: https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/ 4403 Items []ServiceAccount `json:"items" protobuf:"bytes,2,rep,name=items"` 4404} 4405 4406// +genclient 4407// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object 4408 4409// Endpoints is a collection of endpoints that implement the actual service. Example: 4410// Name: "mysvc", 4411// Subsets: [ 4412// { 4413// Addresses: [{"ip": "10.10.1.1"}, {"ip": "10.10.2.2"}], 4414// Ports: [{"name": "a", "port": 8675}, {"name": "b", "port": 309}] 4415// }, 4416// { 4417// Addresses: [{"ip": "10.10.3.3"}], 4418// Ports: [{"name": "a", "port": 93}, {"name": "b", "port": 76}] 4419// }, 4420// ] 4421type Endpoints struct { 4422 metav1.TypeMeta `json:",inline"` 4423 // Standard object's metadata. 4424 // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata 4425 // +optional 4426 metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` 4427 4428 // The set of all endpoints is the union of all subsets. Addresses are placed into 4429 // subsets according to the IPs they share. A single address with multiple ports, 4430 // some of which are ready and some of which are not (because they come from 4431 // different containers) will result in the address being displayed in different 4432 // subsets for the different ports. No address will appear in both Addresses and 4433 // NotReadyAddresses in the same subset. 4434 // Sets of addresses and ports that comprise a service. 4435 // +optional 4436 Subsets []EndpointSubset `json:"subsets,omitempty" protobuf:"bytes,2,rep,name=subsets"` 4437} 4438 4439// EndpointSubset is a group of addresses with a common set of ports. The 4440// expanded set of endpoints is the Cartesian product of Addresses x Ports. 4441// For example, given: 4442// { 4443// Addresses: [{"ip": "10.10.1.1"}, {"ip": "10.10.2.2"}], 4444// Ports: [{"name": "a", "port": 8675}, {"name": "b", "port": 309}] 4445// } 4446// The resulting set of endpoints can be viewed as: 4447// a: [ 10.10.1.1:8675, 10.10.2.2:8675 ], 4448// b: [ 10.10.1.1:309, 10.10.2.2:309 ] 4449type EndpointSubset struct { 4450 // IP addresses which offer the related ports that are marked as ready. These endpoints 4451 // should be considered safe for load balancers and clients to utilize. 4452 // +optional 4453 Addresses []EndpointAddress `json:"addresses,omitempty" protobuf:"bytes,1,rep,name=addresses"` 4454 // IP addresses which offer the related ports but are not currently marked as ready 4455 // because they have not yet finished starting, have recently failed a readiness check, 4456 // or have recently failed a liveness check. 4457 // +optional 4458 NotReadyAddresses []EndpointAddress `json:"notReadyAddresses,omitempty" protobuf:"bytes,2,rep,name=notReadyAddresses"` 4459 // Port numbers available on the related IP addresses. 4460 // +optional 4461 Ports []EndpointPort `json:"ports,omitempty" protobuf:"bytes,3,rep,name=ports"` 4462} 4463 4464// EndpointAddress is a tuple that describes single IP address. 4465type EndpointAddress struct { 4466 // The IP of this endpoint. 4467 // May not be loopback (127.0.0.0/8), link-local (169.254.0.0/16), 4468 // or link-local multicast ((224.0.0.0/24). 4469 // IPv6 is also accepted but not fully supported on all platforms. Also, certain 4470 // kubernetes components, like kube-proxy, are not IPv6 ready. 4471 // TODO: This should allow hostname or IP, See #4447. 4472 IP string `json:"ip" protobuf:"bytes,1,opt,name=ip"` 4473 // The Hostname of this endpoint 4474 // +optional 4475 Hostname string `json:"hostname,omitempty" protobuf:"bytes,3,opt,name=hostname"` 4476 // Optional: Node hosting this endpoint. This can be used to determine endpoints local to a node. 4477 // +optional 4478 NodeName *string `json:"nodeName,omitempty" protobuf:"bytes,4,opt,name=nodeName"` 4479 // Reference to object providing the endpoint. 4480 // +optional 4481 TargetRef *ObjectReference `json:"targetRef,omitempty" protobuf:"bytes,2,opt,name=targetRef"` 4482} 4483 4484// EndpointPort is a tuple that describes a single port. 4485type EndpointPort struct { 4486 // The name of this port. This must match the 'name' field in the 4487 // corresponding ServicePort. 4488 // Must be a DNS_LABEL. 4489 // Optional only if one port is defined. 4490 // +optional 4491 Name string `json:"name,omitempty" protobuf:"bytes,1,opt,name=name"` 4492 4493 // The port number of the endpoint. 4494 Port int32 `json:"port" protobuf:"varint,2,opt,name=port"` 4495 4496 // The IP protocol for this port. 4497 // Must be UDP, TCP, or SCTP. 4498 // Default is TCP. 4499 // +optional 4500 Protocol Protocol `json:"protocol,omitempty" protobuf:"bytes,3,opt,name=protocol,casttype=Protocol"` 4501 4502 // The application protocol for this port. 4503 // This field follows standard Kubernetes label syntax. 4504 // Un-prefixed names are reserved for IANA standard service names (as per 4505 // RFC-6335 and http://www.iana.org/assignments/service-names). 4506 // Non-standard protocols should use prefixed names such as 4507 // mycompany.com/my-custom-protocol. 4508 // This is a beta field that is guarded by the ServiceAppProtocol feature 4509 // gate and enabled by default. 4510 // +optional 4511 AppProtocol *string `json:"appProtocol,omitempty" protobuf:"bytes,4,opt,name=appProtocol"` 4512} 4513 4514// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object 4515 4516// EndpointsList is a list of endpoints. 4517type EndpointsList struct { 4518 metav1.TypeMeta `json:",inline"` 4519 // Standard list metadata. 4520 // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds 4521 // +optional 4522 metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` 4523 4524 // List of endpoints. 4525 Items []Endpoints `json:"items" protobuf:"bytes,2,rep,name=items"` 4526} 4527 4528// NodeSpec describes the attributes that a node is created with. 4529type NodeSpec struct { 4530 // PodCIDR represents the pod IP range assigned to the node. 4531 // +optional 4532 PodCIDR string `json:"podCIDR,omitempty" protobuf:"bytes,1,opt,name=podCIDR"` 4533 4534 // podCIDRs represents the IP ranges assigned to the node for usage by Pods on that node. If this 4535 // field is specified, the 0th entry must match the podCIDR field. It may contain at most 1 value for 4536 // each of IPv4 and IPv6. 4537 // +optional 4538 // +patchStrategy=merge 4539 PodCIDRs []string `json:"podCIDRs,omitempty" protobuf:"bytes,7,opt,name=podCIDRs" patchStrategy:"merge"` 4540 4541 // ID of the node assigned by the cloud provider in the format: <ProviderName>://<ProviderSpecificNodeID> 4542 // +optional 4543 ProviderID string `json:"providerID,omitempty" protobuf:"bytes,3,opt,name=providerID"` 4544 // Unschedulable controls node schedulability of new pods. By default, node is schedulable. 4545 // More info: https://kubernetes.io/docs/concepts/nodes/node/#manual-node-administration 4546 // +optional 4547 Unschedulable bool `json:"unschedulable,omitempty" protobuf:"varint,4,opt,name=unschedulable"` 4548 // If specified, the node's taints. 4549 // +optional 4550 Taints []Taint `json:"taints,omitempty" protobuf:"bytes,5,opt,name=taints"` 4551 // If specified, the source to get node configuration from 4552 // The DynamicKubeletConfig feature gate must be enabled for the Kubelet to use this field 4553 // +optional 4554 ConfigSource *NodeConfigSource `json:"configSource,omitempty" protobuf:"bytes,6,opt,name=configSource"` 4555 4556 // Deprecated. Not all kubelets will set this field. Remove field after 1.13. 4557 // see: https://issues.k8s.io/61966 4558 // +optional 4559 DoNotUseExternalID string `json:"externalID,omitempty" protobuf:"bytes,2,opt,name=externalID"` 4560} 4561 4562// NodeConfigSource specifies a source of node configuration. Exactly one subfield (excluding metadata) must be non-nil. 4563type NodeConfigSource struct { 4564 // For historical context, regarding the below kind, apiVersion, and configMapRef deprecation tags: 4565 // 1. kind/apiVersion were used by the kubelet to persist this struct to disk (they had no protobuf tags) 4566 // 2. configMapRef and proto tag 1 were used by the API to refer to a configmap, 4567 // but used a generic ObjectReference type that didn't really have the fields we needed 4568 // All uses/persistence of the NodeConfigSource struct prior to 1.11 were gated by alpha feature flags, 4569 // so there was no persisted data for these fields that needed to be migrated/handled. 4570 4571 // +k8s:deprecated=kind 4572 // +k8s:deprecated=apiVersion 4573 // +k8s:deprecated=configMapRef,protobuf=1 4574 4575 // ConfigMap is a reference to a Node's ConfigMap 4576 ConfigMap *ConfigMapNodeConfigSource `json:"configMap,omitempty" protobuf:"bytes,2,opt,name=configMap"` 4577} 4578 4579// ConfigMapNodeConfigSource contains the information to reference a ConfigMap as a config source for the Node. 4580type ConfigMapNodeConfigSource struct { 4581 // Namespace is the metadata.namespace of the referenced ConfigMap. 4582 // This field is required in all cases. 4583 Namespace string `json:"namespace" protobuf:"bytes,1,opt,name=namespace"` 4584 4585 // Name is the metadata.name of the referenced ConfigMap. 4586 // This field is required in all cases. 4587 Name string `json:"name" protobuf:"bytes,2,opt,name=name"` 4588 4589 // UID is the metadata.UID of the referenced ConfigMap. 4590 // This field is forbidden in Node.Spec, and required in Node.Status. 4591 // +optional 4592 UID types.UID `json:"uid,omitempty" protobuf:"bytes,3,opt,name=uid"` 4593 4594 // ResourceVersion is the metadata.ResourceVersion of the referenced ConfigMap. 4595 // This field is forbidden in Node.Spec, and required in Node.Status. 4596 // +optional 4597 ResourceVersion string `json:"resourceVersion,omitempty" protobuf:"bytes,4,opt,name=resourceVersion"` 4598 4599 // KubeletConfigKey declares which key of the referenced ConfigMap corresponds to the KubeletConfiguration structure 4600 // This field is required in all cases. 4601 KubeletConfigKey string `json:"kubeletConfigKey" protobuf:"bytes,5,opt,name=kubeletConfigKey"` 4602} 4603 4604// DaemonEndpoint contains information about a single Daemon endpoint. 4605type DaemonEndpoint struct { 4606 /* 4607 The port tag was not properly in quotes in earlier releases, so it must be 4608 uppercased for backwards compat (since it was falling back to var name of 4609 'Port'). 4610 */ 4611 4612 // Port number of the given endpoint. 4613 Port int32 `json:"Port" protobuf:"varint,1,opt,name=Port"` 4614} 4615 4616// NodeDaemonEndpoints lists ports opened by daemons running on the Node. 4617type NodeDaemonEndpoints struct { 4618 // Endpoint on which Kubelet is listening. 4619 // +optional 4620 KubeletEndpoint DaemonEndpoint `json:"kubeletEndpoint,omitempty" protobuf:"bytes,1,opt,name=kubeletEndpoint"` 4621} 4622 4623// NodeSystemInfo is a set of ids/uuids to uniquely identify the node. 4624type NodeSystemInfo struct { 4625 // MachineID reported by the node. For unique machine identification 4626 // in the cluster this field is preferred. Learn more from man(5) 4627 // machine-id: http://man7.org/linux/man-pages/man5/machine-id.5.html 4628 MachineID string `json:"machineID" protobuf:"bytes,1,opt,name=machineID"` 4629 // SystemUUID reported by the node. For unique machine identification 4630 // MachineID is preferred. This field is specific to Red Hat hosts 4631 // https://access.redhat.com/documentation/en-us/red_hat_subscription_management/1/html/rhsm/uuid 4632 SystemUUID string `json:"systemUUID" protobuf:"bytes,2,opt,name=systemUUID"` 4633 // Boot ID reported by the node. 4634 BootID string `json:"bootID" protobuf:"bytes,3,opt,name=bootID"` 4635 // Kernel Version reported by the node from 'uname -r' (e.g. 3.16.0-0.bpo.4-amd64). 4636 KernelVersion string `json:"kernelVersion" protobuf:"bytes,4,opt,name=kernelVersion"` 4637 // OS Image reported by the node from /etc/os-release (e.g. Debian GNU/Linux 7 (wheezy)). 4638 OSImage string `json:"osImage" protobuf:"bytes,5,opt,name=osImage"` 4639 // ContainerRuntime Version reported by the node through runtime remote API (e.g. docker://1.5.0). 4640 ContainerRuntimeVersion string `json:"containerRuntimeVersion" protobuf:"bytes,6,opt,name=containerRuntimeVersion"` 4641 // Kubelet Version reported by the node. 4642 KubeletVersion string `json:"kubeletVersion" protobuf:"bytes,7,opt,name=kubeletVersion"` 4643 // KubeProxy Version reported by the node. 4644 KubeProxyVersion string `json:"kubeProxyVersion" protobuf:"bytes,8,opt,name=kubeProxyVersion"` 4645 // The Operating System reported by the node 4646 OperatingSystem string `json:"operatingSystem" protobuf:"bytes,9,opt,name=operatingSystem"` 4647 // The Architecture reported by the node 4648 Architecture string `json:"architecture" protobuf:"bytes,10,opt,name=architecture"` 4649} 4650 4651// NodeConfigStatus describes the status of the config assigned by Node.Spec.ConfigSource. 4652type NodeConfigStatus struct { 4653 // Assigned reports the checkpointed config the node will try to use. 4654 // When Node.Spec.ConfigSource is updated, the node checkpoints the associated 4655 // config payload to local disk, along with a record indicating intended 4656 // config. The node refers to this record to choose its config checkpoint, and 4657 // reports this record in Assigned. Assigned only updates in the status after 4658 // the record has been checkpointed to disk. When the Kubelet is restarted, 4659 // it tries to make the Assigned config the Active config by loading and 4660 // validating the checkpointed payload identified by Assigned. 4661 // +optional 4662 Assigned *NodeConfigSource `json:"assigned,omitempty" protobuf:"bytes,1,opt,name=assigned"` 4663 // Active reports the checkpointed config the node is actively using. 4664 // Active will represent either the current version of the Assigned config, 4665 // or the current LastKnownGood config, depending on whether attempting to use the 4666 // Assigned config results in an error. 4667 // +optional 4668 Active *NodeConfigSource `json:"active,omitempty" protobuf:"bytes,2,opt,name=active"` 4669 // LastKnownGood reports the checkpointed config the node will fall back to 4670 // when it encounters an error attempting to use the Assigned config. 4671 // The Assigned config becomes the LastKnownGood config when the node determines 4672 // that the Assigned config is stable and correct. 4673 // This is currently implemented as a 10-minute soak period starting when the local 4674 // record of Assigned config is updated. If the Assigned config is Active at the end 4675 // of this period, it becomes the LastKnownGood. Note that if Spec.ConfigSource is 4676 // reset to nil (use local defaults), the LastKnownGood is also immediately reset to nil, 4677 // because the local default config is always assumed good. 4678 // You should not make assumptions about the node's method of determining config stability 4679 // and correctness, as this may change or become configurable in the future. 4680 // +optional 4681 LastKnownGood *NodeConfigSource `json:"lastKnownGood,omitempty" protobuf:"bytes,3,opt,name=lastKnownGood"` 4682 // Error describes any problems reconciling the Spec.ConfigSource to the Active config. 4683 // Errors may occur, for example, attempting to checkpoint Spec.ConfigSource to the local Assigned 4684 // record, attempting to checkpoint the payload associated with Spec.ConfigSource, attempting 4685 // to load or validate the Assigned config, etc. 4686 // Errors may occur at different points while syncing config. Earlier errors (e.g. download or 4687 // checkpointing errors) will not result in a rollback to LastKnownGood, and may resolve across 4688 // Kubelet retries. Later errors (e.g. loading or validating a checkpointed config) will result in 4689 // a rollback to LastKnownGood. In the latter case, it is usually possible to resolve the error 4690 // by fixing the config assigned in Spec.ConfigSource. 4691 // You can find additional information for debugging by searching the error message in the Kubelet log. 4692 // Error is a human-readable description of the error state; machines can check whether or not Error 4693 // is empty, but should not rely on the stability of the Error text across Kubelet versions. 4694 // +optional 4695 Error string `json:"error,omitempty" protobuf:"bytes,4,opt,name=error"` 4696} 4697 4698// NodeStatus is information about the current status of a node. 4699type NodeStatus struct { 4700 // Capacity represents the total resources of a node. 4701 // More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#capacity 4702 // +optional 4703 Capacity ResourceList `json:"capacity,omitempty" protobuf:"bytes,1,rep,name=capacity,casttype=ResourceList,castkey=ResourceName"` 4704 // Allocatable represents the resources of a node that are available for scheduling. 4705 // Defaults to Capacity. 4706 // +optional 4707 Allocatable ResourceList `json:"allocatable,omitempty" protobuf:"bytes,2,rep,name=allocatable,casttype=ResourceList,castkey=ResourceName"` 4708 // NodePhase is the recently observed lifecycle phase of the node. 4709 // More info: https://kubernetes.io/docs/concepts/nodes/node/#phase 4710 // The field is never populated, and now is deprecated. 4711 // +optional 4712 Phase NodePhase `json:"phase,omitempty" protobuf:"bytes,3,opt,name=phase,casttype=NodePhase"` 4713 // Conditions is an array of current observed node conditions. 4714 // More info: https://kubernetes.io/docs/concepts/nodes/node/#condition 4715 // +optional 4716 // +patchMergeKey=type 4717 // +patchStrategy=merge 4718 Conditions []NodeCondition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type" protobuf:"bytes,4,rep,name=conditions"` 4719 // List of addresses reachable to the node. 4720 // Queried from cloud provider, if available. 4721 // More info: https://kubernetes.io/docs/concepts/nodes/node/#addresses 4722 // Note: This field is declared as mergeable, but the merge key is not sufficiently 4723 // unique, which can cause data corruption when it is merged. Callers should instead 4724 // use a full-replacement patch. See http://pr.k8s.io/79391 for an example. 4725 // +optional 4726 // +patchMergeKey=type 4727 // +patchStrategy=merge 4728 Addresses []NodeAddress `json:"addresses,omitempty" patchStrategy:"merge" patchMergeKey:"type" protobuf:"bytes,5,rep,name=addresses"` 4729 // Endpoints of daemons running on the Node. 4730 // +optional 4731 DaemonEndpoints NodeDaemonEndpoints `json:"daemonEndpoints,omitempty" protobuf:"bytes,6,opt,name=daemonEndpoints"` 4732 // Set of ids/uuids to uniquely identify the node. 4733 // More info: https://kubernetes.io/docs/concepts/nodes/node/#info 4734 // +optional 4735 NodeInfo NodeSystemInfo `json:"nodeInfo,omitempty" protobuf:"bytes,7,opt,name=nodeInfo"` 4736 // List of container images on this node 4737 // +optional 4738 Images []ContainerImage `json:"images,omitempty" protobuf:"bytes,8,rep,name=images"` 4739 // List of attachable volumes in use (mounted) by the node. 4740 // +optional 4741 VolumesInUse []UniqueVolumeName `json:"volumesInUse,omitempty" protobuf:"bytes,9,rep,name=volumesInUse"` 4742 // List of volumes that are attached to the node. 4743 // +optional 4744 VolumesAttached []AttachedVolume `json:"volumesAttached,omitempty" protobuf:"bytes,10,rep,name=volumesAttached"` 4745 // Status of the config assigned to the node via the dynamic Kubelet config feature. 4746 // +optional 4747 Config *NodeConfigStatus `json:"config,omitempty" protobuf:"bytes,11,opt,name=config"` 4748} 4749 4750type UniqueVolumeName string 4751 4752// AttachedVolume describes a volume attached to a node 4753type AttachedVolume struct { 4754 // Name of the attached volume 4755 Name UniqueVolumeName `json:"name" protobuf:"bytes,1,rep,name=name"` 4756 4757 // DevicePath represents the device path where the volume should be available 4758 DevicePath string `json:"devicePath" protobuf:"bytes,2,rep,name=devicePath"` 4759} 4760 4761// AvoidPods describes pods that should avoid this node. This is the value for a 4762// Node annotation with key scheduler.alpha.kubernetes.io/preferAvoidPods and 4763// will eventually become a field of NodeStatus. 4764type AvoidPods struct { 4765 // Bounded-sized list of signatures of pods that should avoid this node, sorted 4766 // in timestamp order from oldest to newest. Size of the slice is unspecified. 4767 // +optional 4768 PreferAvoidPods []PreferAvoidPodsEntry `json:"preferAvoidPods,omitempty" protobuf:"bytes,1,rep,name=preferAvoidPods"` 4769} 4770 4771// Describes a class of pods that should avoid this node. 4772type PreferAvoidPodsEntry struct { 4773 // The class of pods. 4774 PodSignature PodSignature `json:"podSignature" protobuf:"bytes,1,opt,name=podSignature"` 4775 // Time at which this entry was added to the list. 4776 // +optional 4777 EvictionTime metav1.Time `json:"evictionTime,omitempty" protobuf:"bytes,2,opt,name=evictionTime"` 4778 // (brief) reason why this entry was added to the list. 4779 // +optional 4780 Reason string `json:"reason,omitempty" protobuf:"bytes,3,opt,name=reason"` 4781 // Human readable message indicating why this entry was added to the list. 4782 // +optional 4783 Message string `json:"message,omitempty" protobuf:"bytes,4,opt,name=message"` 4784} 4785 4786// Describes the class of pods that should avoid this node. 4787// Exactly one field should be set. 4788type PodSignature struct { 4789 // Reference to controller whose pods should avoid this node. 4790 // +optional 4791 PodController *metav1.OwnerReference `json:"podController,omitempty" protobuf:"bytes,1,opt,name=podController"` 4792} 4793 4794// Describe a container image 4795type ContainerImage struct { 4796 // Names by which this image is known. 4797 // e.g. ["k8s.gcr.io/hyperkube:v1.0.7", "dockerhub.io/google_containers/hyperkube:v1.0.7"] 4798 Names []string `json:"names" protobuf:"bytes,1,rep,name=names"` 4799 // The size of the image in bytes. 4800 // +optional 4801 SizeBytes int64 `json:"sizeBytes,omitempty" protobuf:"varint,2,opt,name=sizeBytes"` 4802} 4803 4804type NodePhase string 4805 4806// These are the valid phases of node. 4807const ( 4808 // NodePending means the node has been created/added by the system, but not configured. 4809 NodePending NodePhase = "Pending" 4810 // NodeRunning means the node has been configured and has Kubernetes components running. 4811 NodeRunning NodePhase = "Running" 4812 // NodeTerminated means the node has been removed from the cluster. 4813 NodeTerminated NodePhase = "Terminated" 4814) 4815 4816type NodeConditionType string 4817 4818// These are valid conditions of node. Currently, we don't have enough information to decide 4819// node condition. In the future, we will add more. The proposed set of conditions are: 4820// NodeReachable, NodeLive, NodeReady, NodeSchedulable, NodeRunnable. 4821const ( 4822 // NodeReady means kubelet is healthy and ready to accept pods. 4823 NodeReady NodeConditionType = "Ready" 4824 // NodeMemoryPressure means the kubelet is under pressure due to insufficient available memory. 4825 NodeMemoryPressure NodeConditionType = "MemoryPressure" 4826 // NodeDiskPressure means the kubelet is under pressure due to insufficient available disk. 4827 NodeDiskPressure NodeConditionType = "DiskPressure" 4828 // NodePIDPressure means the kubelet is under pressure due to insufficient available PID. 4829 NodePIDPressure NodeConditionType = "PIDPressure" 4830 // NodeNetworkUnavailable means that network for the node is not correctly configured. 4831 NodeNetworkUnavailable NodeConditionType = "NetworkUnavailable" 4832) 4833 4834// NodeCondition contains condition information for a node. 4835type NodeCondition struct { 4836 // Type of node condition. 4837 Type NodeConditionType `json:"type" protobuf:"bytes,1,opt,name=type,casttype=NodeConditionType"` 4838 // Status of the condition, one of True, False, Unknown. 4839 Status ConditionStatus `json:"status" protobuf:"bytes,2,opt,name=status,casttype=ConditionStatus"` 4840 // Last time we got an update on a given condition. 4841 // +optional 4842 LastHeartbeatTime metav1.Time `json:"lastHeartbeatTime,omitempty" protobuf:"bytes,3,opt,name=lastHeartbeatTime"` 4843 // Last time the condition transit from one status to another. 4844 // +optional 4845 LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty" protobuf:"bytes,4,opt,name=lastTransitionTime"` 4846 // (brief) reason for the condition's last transition. 4847 // +optional 4848 Reason string `json:"reason,omitempty" protobuf:"bytes,5,opt,name=reason"` 4849 // Human readable message indicating details about last transition. 4850 // +optional 4851 Message string `json:"message,omitempty" protobuf:"bytes,6,opt,name=message"` 4852} 4853 4854type NodeAddressType string 4855 4856// These are valid address type of node. 4857const ( 4858 NodeHostName NodeAddressType = "Hostname" 4859 NodeExternalIP NodeAddressType = "ExternalIP" 4860 NodeInternalIP NodeAddressType = "InternalIP" 4861 NodeExternalDNS NodeAddressType = "ExternalDNS" 4862 NodeInternalDNS NodeAddressType = "InternalDNS" 4863) 4864 4865// NodeAddress contains information for the node's address. 4866type NodeAddress struct { 4867 // Node address type, one of Hostname, ExternalIP or InternalIP. 4868 Type NodeAddressType `json:"type" protobuf:"bytes,1,opt,name=type,casttype=NodeAddressType"` 4869 // The node address. 4870 Address string `json:"address" protobuf:"bytes,2,opt,name=address"` 4871} 4872 4873// ResourceName is the name identifying various resources in a ResourceList. 4874type ResourceName string 4875 4876// Resource names must be not more than 63 characters, consisting of upper- or lower-case alphanumeric characters, 4877// with the -, _, and . characters allowed anywhere, except the first or last character. 4878// The default convention, matching that for annotations, is to use lower-case names, with dashes, rather than 4879// camel case, separating compound words. 4880// Fully-qualified resource typenames are constructed from a DNS-style subdomain, followed by a slash `/` and a name. 4881const ( 4882 // CPU, in cores. (500m = .5 cores) 4883 ResourceCPU ResourceName = "cpu" 4884 // Memory, in bytes. (500Gi = 500GiB = 500 * 1024 * 1024 * 1024) 4885 ResourceMemory ResourceName = "memory" 4886 // Volume size, in bytes (e,g. 5Gi = 5GiB = 5 * 1024 * 1024 * 1024) 4887 ResourceStorage ResourceName = "storage" 4888 // Local ephemeral storage, in bytes. (500Gi = 500GiB = 500 * 1024 * 1024 * 1024) 4889 // The resource name for ResourceEphemeralStorage is alpha and it can change across releases. 4890 ResourceEphemeralStorage ResourceName = "ephemeral-storage" 4891) 4892 4893const ( 4894 // Default namespace prefix. 4895 ResourceDefaultNamespacePrefix = "kubernetes.io/" 4896 // Name prefix for huge page resources (alpha). 4897 ResourceHugePagesPrefix = "hugepages-" 4898 // Name prefix for storage resource limits 4899 ResourceAttachableVolumesPrefix = "attachable-volumes-" 4900) 4901 4902// ResourceList is a set of (resource name, quantity) pairs. 4903type ResourceList map[ResourceName]resource.Quantity 4904 4905// +genclient 4906// +genclient:nonNamespaced 4907// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object 4908 4909// Node is a worker node in Kubernetes. 4910// Each node will have a unique identifier in the cache (i.e. in etcd). 4911type Node struct { 4912 metav1.TypeMeta `json:",inline"` 4913 // Standard object's metadata. 4914 // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata 4915 // +optional 4916 metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` 4917 4918 // Spec defines the behavior of a node. 4919 // https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status 4920 // +optional 4921 Spec NodeSpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"` 4922 4923 // Most recently observed status of the node. 4924 // Populated by the system. 4925 // Read-only. 4926 // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status 4927 // +optional 4928 Status NodeStatus `json:"status,omitempty" protobuf:"bytes,3,opt,name=status"` 4929} 4930 4931// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object 4932 4933// NodeList is the whole list of all Nodes which have been registered with master. 4934type NodeList struct { 4935 metav1.TypeMeta `json:",inline"` 4936 // Standard list metadata. 4937 // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds 4938 // +optional 4939 metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` 4940 4941 // List of nodes 4942 Items []Node `json:"items" protobuf:"bytes,2,rep,name=items"` 4943} 4944 4945// FinalizerName is the name identifying a finalizer during namespace lifecycle. 4946type FinalizerName string 4947 4948// These are internal finalizer values to Kubernetes, must be qualified name unless defined here or 4949// in metav1. 4950const ( 4951 FinalizerKubernetes FinalizerName = "kubernetes" 4952) 4953 4954// NamespaceSpec describes the attributes on a Namespace. 4955type NamespaceSpec struct { 4956 // Finalizers is an opaque list of values that must be empty to permanently remove object from storage. 4957 // More info: https://kubernetes.io/docs/tasks/administer-cluster/namespaces/ 4958 // +optional 4959 Finalizers []FinalizerName `json:"finalizers,omitempty" protobuf:"bytes,1,rep,name=finalizers,casttype=FinalizerName"` 4960} 4961 4962// NamespaceStatus is information about the current status of a Namespace. 4963type NamespaceStatus struct { 4964 // Phase is the current lifecycle phase of the namespace. 4965 // More info: https://kubernetes.io/docs/tasks/administer-cluster/namespaces/ 4966 // +optional 4967 Phase NamespacePhase `json:"phase,omitempty" protobuf:"bytes,1,opt,name=phase,casttype=NamespacePhase"` 4968 4969 // Represents the latest available observations of a namespace's current state. 4970 // +optional 4971 // +patchMergeKey=type 4972 // +patchStrategy=merge 4973 Conditions []NamespaceCondition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type" protobuf:"bytes,2,rep,name=conditions"` 4974} 4975 4976type NamespacePhase string 4977 4978// These are the valid phases of a namespace. 4979const ( 4980 // NamespaceActive means the namespace is available for use in the system 4981 NamespaceActive NamespacePhase = "Active" 4982 // NamespaceTerminating means the namespace is undergoing graceful termination 4983 NamespaceTerminating NamespacePhase = "Terminating" 4984) 4985 4986const ( 4987 // NamespaceTerminatingCause is returned as a defaults.cause item when a change is 4988 // forbidden due to the namespace being terminated. 4989 NamespaceTerminatingCause metav1.CauseType = "NamespaceTerminating" 4990) 4991 4992type NamespaceConditionType string 4993 4994// These are valid conditions of a namespace. 4995const ( 4996 // NamespaceDeletionDiscoveryFailure contains information about namespace deleter errors during resource discovery. 4997 NamespaceDeletionDiscoveryFailure NamespaceConditionType = "NamespaceDeletionDiscoveryFailure" 4998 // NamespaceDeletionContentFailure contains information about namespace deleter errors during deletion of resources. 4999 NamespaceDeletionContentFailure NamespaceConditionType = "NamespaceDeletionContentFailure" 5000 // NamespaceDeletionGVParsingFailure contains information about namespace deleter errors parsing GV for legacy types. 5001 NamespaceDeletionGVParsingFailure NamespaceConditionType = "NamespaceDeletionGroupVersionParsingFailure" 5002 // NamespaceContentRemaining contains information about resources remaining in a namespace. 5003 NamespaceContentRemaining NamespaceConditionType = "NamespaceContentRemaining" 5004 // NamespaceFinalizersRemaining contains information about which finalizers are on resources remaining in a namespace. 5005 NamespaceFinalizersRemaining NamespaceConditionType = "NamespaceFinalizersRemaining" 5006) 5007 5008// NamespaceCondition contains details about state of namespace. 5009type NamespaceCondition struct { 5010 // Type of namespace controller condition. 5011 Type NamespaceConditionType `json:"type" protobuf:"bytes,1,opt,name=type,casttype=NamespaceConditionType"` 5012 // Status of the condition, one of True, False, Unknown. 5013 Status ConditionStatus `json:"status" protobuf:"bytes,2,opt,name=status,casttype=ConditionStatus"` 5014 // +optional 5015 LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty" protobuf:"bytes,4,opt,name=lastTransitionTime"` 5016 // +optional 5017 Reason string `json:"reason,omitempty" protobuf:"bytes,5,opt,name=reason"` 5018 // +optional 5019 Message string `json:"message,omitempty" protobuf:"bytes,6,opt,name=message"` 5020} 5021 5022// +genclient 5023// +genclient:nonNamespaced 5024// +genclient:skipVerbs=deleteCollection 5025// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object 5026 5027// Namespace provides a scope for Names. 5028// Use of multiple namespaces is optional. 5029type Namespace struct { 5030 metav1.TypeMeta `json:",inline"` 5031 // Standard object's metadata. 5032 // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata 5033 // +optional 5034 metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` 5035 5036 // Spec defines the behavior of the Namespace. 5037 // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status 5038 // +optional 5039 Spec NamespaceSpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"` 5040 5041 // Status describes the current status of a Namespace. 5042 // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status 5043 // +optional 5044 Status NamespaceStatus `json:"status,omitempty" protobuf:"bytes,3,opt,name=status"` 5045} 5046 5047// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object 5048 5049// NamespaceList is a list of Namespaces. 5050type NamespaceList struct { 5051 metav1.TypeMeta `json:",inline"` 5052 // Standard list metadata. 5053 // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds 5054 // +optional 5055 metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` 5056 5057 // Items is the list of Namespace objects in the list. 5058 // More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/ 5059 Items []Namespace `json:"items" protobuf:"bytes,2,rep,name=items"` 5060} 5061 5062// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object 5063 5064// Binding ties one object to another; for example, a pod is bound to a node by a scheduler. 5065// Deprecated in 1.7, please use the bindings subresource of pods instead. 5066type Binding struct { 5067 metav1.TypeMeta `json:",inline"` 5068 // Standard object's metadata. 5069 // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata 5070 // +optional 5071 metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` 5072 5073 // The target object that you want to bind to the standard object. 5074 Target ObjectReference `json:"target" protobuf:"bytes,2,opt,name=target"` 5075} 5076 5077// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object 5078 5079// A list of ephemeral containers used with the Pod ephemeralcontainers subresource. 5080type EphemeralContainers struct { 5081 metav1.TypeMeta `json:",inline"` 5082 // +optional 5083 metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` 5084 5085 // A list of ephemeral containers associated with this pod. New ephemeral containers 5086 // may be appended to this list, but existing ephemeral containers may not be removed 5087 // or modified. 5088 // +patchMergeKey=name 5089 // +patchStrategy=merge 5090 EphemeralContainers []EphemeralContainer `json:"ephemeralContainers" patchStrategy:"merge" patchMergeKey:"name" protobuf:"bytes,2,rep,name=ephemeralContainers"` 5091} 5092 5093// Preconditions must be fulfilled before an operation (update, delete, etc.) is carried out. 5094// +k8s:openapi-gen=false 5095type Preconditions struct { 5096 // Specifies the target UID. 5097 // +optional 5098 UID *types.UID `json:"uid,omitempty" protobuf:"bytes,1,opt,name=uid,casttype=k8s.io/apimachinery/pkg/types.UID"` 5099} 5100 5101// +k8s:conversion-gen:explicit-from=net/url.Values 5102// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object 5103 5104// PodLogOptions is the query options for a Pod's logs REST call. 5105type PodLogOptions struct { 5106 metav1.TypeMeta `json:",inline"` 5107 5108 // The container for which to stream logs. Defaults to only container if there is one container in the pod. 5109 // +optional 5110 Container string `json:"container,omitempty" protobuf:"bytes,1,opt,name=container"` 5111 // Follow the log stream of the pod. Defaults to false. 5112 // +optional 5113 Follow bool `json:"follow,omitempty" protobuf:"varint,2,opt,name=follow"` 5114 // Return previous terminated container logs. Defaults to false. 5115 // +optional 5116 Previous bool `json:"previous,omitempty" protobuf:"varint,3,opt,name=previous"` 5117 // A relative time in seconds before the current time from which to show logs. If this value 5118 // precedes the time a pod was started, only logs since the pod start will be returned. 5119 // If this value is in the future, no logs will be returned. 5120 // Only one of sinceSeconds or sinceTime may be specified. 5121 // +optional 5122 SinceSeconds *int64 `json:"sinceSeconds,omitempty" protobuf:"varint,4,opt,name=sinceSeconds"` 5123 // An RFC3339 timestamp from which to show logs. If this value 5124 // precedes the time a pod was started, only logs since the pod start will be returned. 5125 // If this value is in the future, no logs will be returned. 5126 // Only one of sinceSeconds or sinceTime may be specified. 5127 // +optional 5128 SinceTime *metav1.Time `json:"sinceTime,omitempty" protobuf:"bytes,5,opt,name=sinceTime"` 5129 // If true, add an RFC3339 or RFC3339Nano timestamp at the beginning of every line 5130 // of log output. Defaults to false. 5131 // +optional 5132 Timestamps bool `json:"timestamps,omitempty" protobuf:"varint,6,opt,name=timestamps"` 5133 // If set, the number of lines from the end of the logs to show. If not specified, 5134 // logs are shown from the creation of the container or sinceSeconds or sinceTime 5135 // +optional 5136 TailLines *int64 `json:"tailLines,omitempty" protobuf:"varint,7,opt,name=tailLines"` 5137 // If set, the number of bytes to read from the server before terminating the 5138 // log output. This may not display a complete final line of logging, and may return 5139 // slightly more or slightly less than the specified limit. 5140 // +optional 5141 LimitBytes *int64 `json:"limitBytes,omitempty" protobuf:"varint,8,opt,name=limitBytes"` 5142 5143 // insecureSkipTLSVerifyBackend indicates that the apiserver should not confirm the validity of the 5144 // serving certificate of the backend it is connecting to. This will make the HTTPS connection between the apiserver 5145 // and the backend insecure. This means the apiserver cannot verify the log data it is receiving came from the real 5146 // kubelet. If the kubelet is configured to verify the apiserver's TLS credentials, it does not mean the 5147 // connection to the real kubelet is vulnerable to a man in the middle attack (e.g. an attacker could not intercept 5148 // the actual log data coming from the real kubelet). 5149 // +optional 5150 InsecureSkipTLSVerifyBackend bool `json:"insecureSkipTLSVerifyBackend,omitempty" protobuf:"varint,9,opt,name=insecureSkipTLSVerifyBackend"` 5151} 5152 5153// +k8s:conversion-gen:explicit-from=net/url.Values 5154// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object 5155 5156// PodAttachOptions is the query options to a Pod's remote attach call. 5157// --- 5158// TODO: merge w/ PodExecOptions below for stdin, stdout, etc 5159// and also when we cut V2, we should export a "StreamOptions" or somesuch that contains Stdin, Stdout, Stder and TTY 5160type PodAttachOptions struct { 5161 metav1.TypeMeta `json:",inline"` 5162 5163 // Stdin if true, redirects the standard input stream of the pod for this call. 5164 // Defaults to false. 5165 // +optional 5166 Stdin bool `json:"stdin,omitempty" protobuf:"varint,1,opt,name=stdin"` 5167 5168 // Stdout if true indicates that stdout is to be redirected for the attach call. 5169 // Defaults to true. 5170 // +optional 5171 Stdout bool `json:"stdout,omitempty" protobuf:"varint,2,opt,name=stdout"` 5172 5173 // Stderr if true indicates that stderr is to be redirected for the attach call. 5174 // Defaults to true. 5175 // +optional 5176 Stderr bool `json:"stderr,omitempty" protobuf:"varint,3,opt,name=stderr"` 5177 5178 // TTY if true indicates that a tty will be allocated for the attach call. 5179 // This is passed through the container runtime so the tty 5180 // is allocated on the worker node by the container runtime. 5181 // Defaults to false. 5182 // +optional 5183 TTY bool `json:"tty,omitempty" protobuf:"varint,4,opt,name=tty"` 5184 5185 // The container in which to execute the command. 5186 // Defaults to only container if there is only one container in the pod. 5187 // +optional 5188 Container string `json:"container,omitempty" protobuf:"bytes,5,opt,name=container"` 5189} 5190 5191// +k8s:conversion-gen:explicit-from=net/url.Values 5192// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object 5193 5194// PodExecOptions is the query options to a Pod's remote exec call. 5195// --- 5196// TODO: This is largely identical to PodAttachOptions above, make sure they stay in sync and see about merging 5197// and also when we cut V2, we should export a "StreamOptions" or somesuch that contains Stdin, Stdout, Stder and TTY 5198type PodExecOptions struct { 5199 metav1.TypeMeta `json:",inline"` 5200 5201 // Redirect the standard input stream of the pod for this call. 5202 // Defaults to false. 5203 // +optional 5204 Stdin bool `json:"stdin,omitempty" protobuf:"varint,1,opt,name=stdin"` 5205 5206 // Redirect the standard output stream of the pod for this call. 5207 // Defaults to true. 5208 // +optional 5209 Stdout bool `json:"stdout,omitempty" protobuf:"varint,2,opt,name=stdout"` 5210 5211 // Redirect the standard error stream of the pod for this call. 5212 // Defaults to true. 5213 // +optional 5214 Stderr bool `json:"stderr,omitempty" protobuf:"varint,3,opt,name=stderr"` 5215 5216 // TTY if true indicates that a tty will be allocated for the exec call. 5217 // Defaults to false. 5218 // +optional 5219 TTY bool `json:"tty,omitempty" protobuf:"varint,4,opt,name=tty"` 5220 5221 // Container in which to execute the command. 5222 // Defaults to only container if there is only one container in the pod. 5223 // +optional 5224 Container string `json:"container,omitempty" protobuf:"bytes,5,opt,name=container"` 5225 5226 // Command is the remote command to execute. argv array. Not executed within a shell. 5227 Command []string `json:"command" protobuf:"bytes,6,rep,name=command"` 5228} 5229 5230// +k8s:conversion-gen:explicit-from=net/url.Values 5231// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object 5232 5233// PodPortForwardOptions is the query options to a Pod's port forward call 5234// when using WebSockets. 5235// The `port` query parameter must specify the port or 5236// ports (comma separated) to forward over. 5237// Port forwarding over SPDY does not use these options. It requires the port 5238// to be passed in the `port` header as part of request. 5239type PodPortForwardOptions struct { 5240 metav1.TypeMeta `json:",inline"` 5241 5242 // List of ports to forward 5243 // Required when using WebSockets 5244 // +optional 5245 Ports []int32 `json:"ports,omitempty" protobuf:"varint,1,rep,name=ports"` 5246} 5247 5248// +k8s:conversion-gen:explicit-from=net/url.Values 5249// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object 5250 5251// PodProxyOptions is the query options to a Pod's proxy call. 5252type PodProxyOptions struct { 5253 metav1.TypeMeta `json:",inline"` 5254 5255 // Path is the URL path to use for the current proxy request to pod. 5256 // +optional 5257 Path string `json:"path,omitempty" protobuf:"bytes,1,opt,name=path"` 5258} 5259 5260// +k8s:conversion-gen:explicit-from=net/url.Values 5261// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object 5262 5263// NodeProxyOptions is the query options to a Node's proxy call. 5264type NodeProxyOptions struct { 5265 metav1.TypeMeta `json:",inline"` 5266 5267 // Path is the URL path to use for the current proxy request to node. 5268 // +optional 5269 Path string `json:"path,omitempty" protobuf:"bytes,1,opt,name=path"` 5270} 5271 5272// +k8s:conversion-gen:explicit-from=net/url.Values 5273// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object 5274 5275// ServiceProxyOptions is the query options to a Service's proxy call. 5276type ServiceProxyOptions struct { 5277 metav1.TypeMeta `json:",inline"` 5278 5279 // Path is the part of URLs that include service endpoints, suffixes, 5280 // and parameters to use for the current proxy request to service. 5281 // For example, the whole request URL is 5282 // http://localhost/api/v1/namespaces/kube-system/services/elasticsearch-logging/_search?q=user:kimchy. 5283 // Path is _search?q=user:kimchy. 5284 // +optional 5285 Path string `json:"path,omitempty" protobuf:"bytes,1,opt,name=path"` 5286} 5287 5288// ObjectReference contains enough information to let you inspect or modify the referred object. 5289// --- 5290// New uses of this type are discouraged because of difficulty describing its usage when embedded in APIs. 5291// 1. Ignored fields. It includes many fields which are not generally honored. For instance, ResourceVersion and FieldPath are both very rarely valid in actual usage. 5292// 2. Invalid usage help. It is impossible to add specific help for individual usage. In most embedded usages, there are particular 5293// restrictions like, "must refer only to types A and B" or "UID not honored" or "name must be restricted". 5294// Those cannot be well described when embedded. 5295// 3. Inconsistent validation. Because the usages are different, the validation rules are different by usage, which makes it hard for users to predict what will happen. 5296// 4. The fields are both imprecise and overly precise. Kind is not a precise mapping to a URL. This can produce ambiguity 5297// during interpretation and require a REST mapping. In most cases, the dependency is on the group,resource tuple 5298// and the version of the actual struct is irrelevant. 5299// 5. We cannot easily change it. Because this type is embedded in many locations, updates to this type 5300// will affect numerous schemas. Don't make new APIs embed an underspecified API type they do not control. 5301// Instead of using this type, create a locally provided and used type that is well-focused on your reference. 5302// For example, ServiceReferences for admission registration: https://github.com/kubernetes/api/blob/release-1.17/admissionregistration/v1/types.go#L533 . 5303// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object 5304type ObjectReference struct { 5305 // Kind of the referent. 5306 // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds 5307 // +optional 5308 Kind string `json:"kind,omitempty" protobuf:"bytes,1,opt,name=kind"` 5309 // Namespace of the referent. 5310 // More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/ 5311 // +optional 5312 Namespace string `json:"namespace,omitempty" protobuf:"bytes,2,opt,name=namespace"` 5313 // Name of the referent. 5314 // More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names 5315 // +optional 5316 Name string `json:"name,omitempty" protobuf:"bytes,3,opt,name=name"` 5317 // UID of the referent. 5318 // More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids 5319 // +optional 5320 UID types.UID `json:"uid,omitempty" protobuf:"bytes,4,opt,name=uid,casttype=k8s.io/apimachinery/pkg/types.UID"` 5321 // API version of the referent. 5322 // +optional 5323 APIVersion string `json:"apiVersion,omitempty" protobuf:"bytes,5,opt,name=apiVersion"` 5324 // Specific resourceVersion to which this reference is made, if any. 5325 // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency 5326 // +optional 5327 ResourceVersion string `json:"resourceVersion,omitempty" protobuf:"bytes,6,opt,name=resourceVersion"` 5328 5329 // If referring to a piece of an object instead of an entire object, this string 5330 // should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. 5331 // For example, if the object reference is to a container within a pod, this would take on a value like: 5332 // "spec.containers{name}" (where "name" refers to the name of the container that triggered 5333 // the event) or if no container name is specified "spec.containers[2]" (container with 5334 // index 2 in this pod). This syntax is chosen only to have some well-defined way of 5335 // referencing a part of an object. 5336 // TODO: this design is not final and this field is subject to change in the future. 5337 // +optional 5338 FieldPath string `json:"fieldPath,omitempty" protobuf:"bytes,7,opt,name=fieldPath"` 5339} 5340 5341// LocalObjectReference contains enough information to let you locate the 5342// referenced object inside the same namespace. 5343type LocalObjectReference struct { 5344 // Name of the referent. 5345 // More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names 5346 // TODO: Add other useful fields. apiVersion, kind, uid? 5347 // +optional 5348 Name string `json:"name,omitempty" protobuf:"bytes,1,opt,name=name"` 5349} 5350 5351// TypedLocalObjectReference contains enough information to let you locate the 5352// typed referenced object inside the same namespace. 5353type TypedLocalObjectReference struct { 5354 // APIGroup is the group for the resource being referenced. 5355 // If APIGroup is not specified, the specified Kind must be in the core API group. 5356 // For any other third-party types, APIGroup is required. 5357 // +optional 5358 APIGroup *string `json:"apiGroup" protobuf:"bytes,1,opt,name=apiGroup"` 5359 // Kind is the type of resource being referenced 5360 Kind string `json:"kind" protobuf:"bytes,2,opt,name=kind"` 5361 // Name is the name of resource being referenced 5362 Name string `json:"name" protobuf:"bytes,3,opt,name=name"` 5363} 5364 5365// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object 5366 5367// SerializedReference is a reference to serialized object. 5368type SerializedReference struct { 5369 metav1.TypeMeta `json:",inline"` 5370 // The reference to an object in the system. 5371 // +optional 5372 Reference ObjectReference `json:"reference,omitempty" protobuf:"bytes,1,opt,name=reference"` 5373} 5374 5375// EventSource contains information for an event. 5376type EventSource struct { 5377 // Component from which the event is generated. 5378 // +optional 5379 Component string `json:"component,omitempty" protobuf:"bytes,1,opt,name=component"` 5380 // Node name on which the event is generated. 5381 // +optional 5382 Host string `json:"host,omitempty" protobuf:"bytes,2,opt,name=host"` 5383} 5384 5385// Valid values for event types (new types could be added in future) 5386const ( 5387 // Information only and will not cause any problems 5388 EventTypeNormal string = "Normal" 5389 // These events are to warn that something might go wrong 5390 EventTypeWarning string = "Warning" 5391) 5392 5393// +genclient 5394// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object 5395 5396// Event is a report of an event somewhere in the cluster. Events 5397// have a limited retention time and triggers and messages may evolve 5398// with time. Event consumers should not rely on the timing of an event 5399// with a given Reason reflecting a consistent underlying trigger, or the 5400// continued existence of events with that Reason. Events should be 5401// treated as informative, best-effort, supplemental data. 5402type Event struct { 5403 metav1.TypeMeta `json:",inline"` 5404 // Standard object's metadata. 5405 // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata 5406 metav1.ObjectMeta `json:"metadata" protobuf:"bytes,1,opt,name=metadata"` 5407 5408 // The object that this event is about. 5409 InvolvedObject ObjectReference `json:"involvedObject" protobuf:"bytes,2,opt,name=involvedObject"` 5410 5411 // This should be a short, machine understandable string that gives the reason 5412 // for the transition into the object's current status. 5413 // TODO: provide exact specification for format. 5414 // +optional 5415 Reason string `json:"reason,omitempty" protobuf:"bytes,3,opt,name=reason"` 5416 5417 // A human-readable description of the status of this operation. 5418 // TODO: decide on maximum length. 5419 // +optional 5420 Message string `json:"message,omitempty" protobuf:"bytes,4,opt,name=message"` 5421 5422 // The component reporting this event. Should be a short machine understandable string. 5423 // +optional 5424 Source EventSource `json:"source,omitempty" protobuf:"bytes,5,opt,name=source"` 5425 5426 // The time at which the event was first recorded. (Time of server receipt is in TypeMeta.) 5427 // +optional 5428 FirstTimestamp metav1.Time `json:"firstTimestamp,omitempty" protobuf:"bytes,6,opt,name=firstTimestamp"` 5429 5430 // The time at which the most recent occurrence of this event was recorded. 5431 // +optional 5432 LastTimestamp metav1.Time `json:"lastTimestamp,omitempty" protobuf:"bytes,7,opt,name=lastTimestamp"` 5433 5434 // The number of times this event has occurred. 5435 // +optional 5436 Count int32 `json:"count,omitempty" protobuf:"varint,8,opt,name=count"` 5437 5438 // Type of this event (Normal, Warning), new types could be added in the future 5439 // +optional 5440 Type string `json:"type,omitempty" protobuf:"bytes,9,opt,name=type"` 5441 5442 // Time when this Event was first observed. 5443 // +optional 5444 EventTime metav1.MicroTime `json:"eventTime,omitempty" protobuf:"bytes,10,opt,name=eventTime"` 5445 5446 // Data about the Event series this event represents or nil if it's a singleton Event. 5447 // +optional 5448 Series *EventSeries `json:"series,omitempty" protobuf:"bytes,11,opt,name=series"` 5449 5450 // What action was taken/failed regarding to the Regarding object. 5451 // +optional 5452 Action string `json:"action,omitempty" protobuf:"bytes,12,opt,name=action"` 5453 5454 // Optional secondary object for more complex actions. 5455 // +optional 5456 Related *ObjectReference `json:"related,omitempty" protobuf:"bytes,13,opt,name=related"` 5457 5458 // Name of the controller that emitted this Event, e.g. `kubernetes.io/kubelet`. 5459 // +optional 5460 ReportingController string `json:"reportingComponent" protobuf:"bytes,14,opt,name=reportingComponent"` 5461 5462 // ID of the controller instance, e.g. `kubelet-xyzf`. 5463 // +optional 5464 ReportingInstance string `json:"reportingInstance" protobuf:"bytes,15,opt,name=reportingInstance"` 5465} 5466 5467// EventSeries contain information on series of events, i.e. thing that was/is happening 5468// continuously for some time. 5469type EventSeries struct { 5470 // Number of occurrences in this series up to the last heartbeat time 5471 Count int32 `json:"count,omitempty" protobuf:"varint,1,name=count"` 5472 // Time of the last occurrence observed 5473 LastObservedTime metav1.MicroTime `json:"lastObservedTime,omitempty" protobuf:"bytes,2,name=lastObservedTime"` 5474 5475 // +k8s:deprecated=state,protobuf=3 5476} 5477 5478// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object 5479 5480// EventList is a list of events. 5481type EventList struct { 5482 metav1.TypeMeta `json:",inline"` 5483 // Standard list metadata. 5484 // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds 5485 // +optional 5486 metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` 5487 5488 // List of events 5489 Items []Event `json:"items" protobuf:"bytes,2,rep,name=items"` 5490} 5491 5492// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object 5493 5494// List holds a list of objects, which may not be known by the server. 5495type List metav1.List 5496 5497// LimitType is a type of object that is limited 5498type LimitType string 5499 5500const ( 5501 // Limit that applies to all pods in a namespace 5502 LimitTypePod LimitType = "Pod" 5503 // Limit that applies to all containers in a namespace 5504 LimitTypeContainer LimitType = "Container" 5505 // Limit that applies to all persistent volume claims in a namespace 5506 LimitTypePersistentVolumeClaim LimitType = "PersistentVolumeClaim" 5507) 5508 5509// LimitRangeItem defines a min/max usage limit for any resource that matches on kind. 5510type LimitRangeItem struct { 5511 // Type of resource that this limit applies to. 5512 Type LimitType `json:"type" protobuf:"bytes,1,opt,name=type,casttype=LimitType"` 5513 // Max usage constraints on this kind by resource name. 5514 // +optional 5515 Max ResourceList `json:"max,omitempty" protobuf:"bytes,2,rep,name=max,casttype=ResourceList,castkey=ResourceName"` 5516 // Min usage constraints on this kind by resource name. 5517 // +optional 5518 Min ResourceList `json:"min,omitempty" protobuf:"bytes,3,rep,name=min,casttype=ResourceList,castkey=ResourceName"` 5519 // Default resource requirement limit value by resource name if resource limit is omitted. 5520 // +optional 5521 Default ResourceList `json:"default,omitempty" protobuf:"bytes,4,rep,name=default,casttype=ResourceList,castkey=ResourceName"` 5522 // DefaultRequest is the default resource requirement request value by resource name if resource request is omitted. 5523 // +optional 5524 DefaultRequest ResourceList `json:"defaultRequest,omitempty" protobuf:"bytes,5,rep,name=defaultRequest,casttype=ResourceList,castkey=ResourceName"` 5525 // MaxLimitRequestRatio if specified, the named resource must have a request and limit that are both non-zero where limit divided by request is less than or equal to the enumerated value; this represents the max burst for the named resource. 5526 // +optional 5527 MaxLimitRequestRatio ResourceList `json:"maxLimitRequestRatio,omitempty" protobuf:"bytes,6,rep,name=maxLimitRequestRatio,casttype=ResourceList,castkey=ResourceName"` 5528} 5529 5530// LimitRangeSpec defines a min/max usage limit for resources that match on kind. 5531type LimitRangeSpec struct { 5532 // Limits is the list of LimitRangeItem objects that are enforced. 5533 Limits []LimitRangeItem `json:"limits" protobuf:"bytes,1,rep,name=limits"` 5534} 5535 5536// +genclient 5537// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object 5538 5539// LimitRange sets resource usage limits for each kind of resource in a Namespace. 5540type LimitRange struct { 5541 metav1.TypeMeta `json:",inline"` 5542 // Standard object's metadata. 5543 // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata 5544 // +optional 5545 metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` 5546 5547 // Spec defines the limits enforced. 5548 // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status 5549 // +optional 5550 Spec LimitRangeSpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"` 5551} 5552 5553// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object 5554 5555// LimitRangeList is a list of LimitRange items. 5556type LimitRangeList struct { 5557 metav1.TypeMeta `json:",inline"` 5558 // Standard list metadata. 5559 // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds 5560 // +optional 5561 metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` 5562 5563 // Items is a list of LimitRange objects. 5564 // More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/ 5565 Items []LimitRange `json:"items" protobuf:"bytes,2,rep,name=items"` 5566} 5567 5568// The following identify resource constants for Kubernetes object types 5569const ( 5570 // Pods, number 5571 ResourcePods ResourceName = "pods" 5572 // Services, number 5573 ResourceServices ResourceName = "services" 5574 // ReplicationControllers, number 5575 ResourceReplicationControllers ResourceName = "replicationcontrollers" 5576 // ResourceQuotas, number 5577 ResourceQuotas ResourceName = "resourcequotas" 5578 // ResourceSecrets, number 5579 ResourceSecrets ResourceName = "secrets" 5580 // ResourceConfigMaps, number 5581 ResourceConfigMaps ResourceName = "configmaps" 5582 // ResourcePersistentVolumeClaims, number 5583 ResourcePersistentVolumeClaims ResourceName = "persistentvolumeclaims" 5584 // ResourceServicesNodePorts, number 5585 ResourceServicesNodePorts ResourceName = "services.nodeports" 5586 // ResourceServicesLoadBalancers, number 5587 ResourceServicesLoadBalancers ResourceName = "services.loadbalancers" 5588 // CPU request, in cores. (500m = .5 cores) 5589 ResourceRequestsCPU ResourceName = "requests.cpu" 5590 // Memory request, in bytes. (500Gi = 500GiB = 500 * 1024 * 1024 * 1024) 5591 ResourceRequestsMemory ResourceName = "requests.memory" 5592 // Storage request, in bytes 5593 ResourceRequestsStorage ResourceName = "requests.storage" 5594 // Local ephemeral storage request, in bytes. (500Gi = 500GiB = 500 * 1024 * 1024 * 1024) 5595 ResourceRequestsEphemeralStorage ResourceName = "requests.ephemeral-storage" 5596 // CPU limit, in cores. (500m = .5 cores) 5597 ResourceLimitsCPU ResourceName = "limits.cpu" 5598 // Memory limit, in bytes. (500Gi = 500GiB = 500 * 1024 * 1024 * 1024) 5599 ResourceLimitsMemory ResourceName = "limits.memory" 5600 // Local ephemeral storage limit, in bytes. (500Gi = 500GiB = 500 * 1024 * 1024 * 1024) 5601 ResourceLimitsEphemeralStorage ResourceName = "limits.ephemeral-storage" 5602) 5603 5604// The following identify resource prefix for Kubernetes object types 5605const ( 5606 // HugePages request, in bytes. (500Gi = 500GiB = 500 * 1024 * 1024 * 1024) 5607 // As burst is not supported for HugePages, we would only quota its request, and ignore the limit. 5608 ResourceRequestsHugePagesPrefix = "requests.hugepages-" 5609 // Default resource requests prefix 5610 DefaultResourceRequestsPrefix = "requests." 5611) 5612 5613// A ResourceQuotaScope defines a filter that must match each object tracked by a quota 5614type ResourceQuotaScope string 5615 5616const ( 5617 // Match all pod objects where spec.activeDeadlineSeconds 5618 ResourceQuotaScopeTerminating ResourceQuotaScope = "Terminating" 5619 // Match all pod objects where !spec.activeDeadlineSeconds 5620 ResourceQuotaScopeNotTerminating ResourceQuotaScope = "NotTerminating" 5621 // Match all pod objects that have best effort quality of service 5622 ResourceQuotaScopeBestEffort ResourceQuotaScope = "BestEffort" 5623 // Match all pod objects that do not have best effort quality of service 5624 ResourceQuotaScopeNotBestEffort ResourceQuotaScope = "NotBestEffort" 5625 // Match all pod objects that have priority class mentioned 5626 ResourceQuotaScopePriorityClass ResourceQuotaScope = "PriorityClass" 5627) 5628 5629// ResourceQuotaSpec defines the desired hard limits to enforce for Quota. 5630type ResourceQuotaSpec struct { 5631 // hard is the set of desired hard limits for each named resource. 5632 // More info: https://kubernetes.io/docs/concepts/policy/resource-quotas/ 5633 // +optional 5634 Hard ResourceList `json:"hard,omitempty" protobuf:"bytes,1,rep,name=hard,casttype=ResourceList,castkey=ResourceName"` 5635 // A collection of filters that must match each object tracked by a quota. 5636 // If not specified, the quota matches all objects. 5637 // +optional 5638 Scopes []ResourceQuotaScope `json:"scopes,omitempty" protobuf:"bytes,2,rep,name=scopes,casttype=ResourceQuotaScope"` 5639 // scopeSelector is also a collection of filters like scopes that must match each object tracked by a quota 5640 // but expressed using ScopeSelectorOperator in combination with possible values. 5641 // For a resource to match, both scopes AND scopeSelector (if specified in spec), must be matched. 5642 // +optional 5643 ScopeSelector *ScopeSelector `json:"scopeSelector,omitempty" protobuf:"bytes,3,opt,name=scopeSelector"` 5644} 5645 5646// A scope selector represents the AND of the selectors represented 5647// by the scoped-resource selector requirements. 5648type ScopeSelector struct { 5649 // A list of scope selector requirements by scope of the resources. 5650 // +optional 5651 MatchExpressions []ScopedResourceSelectorRequirement `json:"matchExpressions,omitempty" protobuf:"bytes,1,rep,name=matchExpressions"` 5652} 5653 5654// A scoped-resource selector requirement is a selector that contains values, a scope name, and an operator 5655// that relates the scope name and values. 5656type ScopedResourceSelectorRequirement struct { 5657 // The name of the scope that the selector applies to. 5658 ScopeName ResourceQuotaScope `json:"scopeName" protobuf:"bytes,1,opt,name=scopeName"` 5659 // Represents a scope's relationship to a set of values. 5660 // Valid operators are In, NotIn, Exists, DoesNotExist. 5661 Operator ScopeSelectorOperator `json:"operator" protobuf:"bytes,2,opt,name=operator,casttype=ScopedResourceSelectorOperator"` 5662 // An array of string values. If the operator is In or NotIn, 5663 // the values array must be non-empty. If the operator is Exists or DoesNotExist, 5664 // the values array must be empty. 5665 // This array is replaced during a strategic merge patch. 5666 // +optional 5667 Values []string `json:"values,omitempty" protobuf:"bytes,3,rep,name=values"` 5668} 5669 5670// A scope selector operator is the set of operators that can be used in 5671// a scope selector requirement. 5672type ScopeSelectorOperator string 5673 5674const ( 5675 ScopeSelectorOpIn ScopeSelectorOperator = "In" 5676 ScopeSelectorOpNotIn ScopeSelectorOperator = "NotIn" 5677 ScopeSelectorOpExists ScopeSelectorOperator = "Exists" 5678 ScopeSelectorOpDoesNotExist ScopeSelectorOperator = "DoesNotExist" 5679) 5680 5681// ResourceQuotaStatus defines the enforced hard limits and observed use. 5682type ResourceQuotaStatus struct { 5683 // Hard is the set of enforced hard limits for each named resource. 5684 // More info: https://kubernetes.io/docs/concepts/policy/resource-quotas/ 5685 // +optional 5686 Hard ResourceList `json:"hard,omitempty" protobuf:"bytes,1,rep,name=hard,casttype=ResourceList,castkey=ResourceName"` 5687 // Used is the current observed total usage of the resource in the namespace. 5688 // +optional 5689 Used ResourceList `json:"used,omitempty" protobuf:"bytes,2,rep,name=used,casttype=ResourceList,castkey=ResourceName"` 5690} 5691 5692// +genclient 5693// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object 5694 5695// ResourceQuota sets aggregate quota restrictions enforced per namespace 5696type ResourceQuota struct { 5697 metav1.TypeMeta `json:",inline"` 5698 // Standard object's metadata. 5699 // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata 5700 // +optional 5701 metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` 5702 5703 // Spec defines the desired quota. 5704 // https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status 5705 // +optional 5706 Spec ResourceQuotaSpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"` 5707 5708 // Status defines the actual enforced quota and its current usage. 5709 // https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status 5710 // +optional 5711 Status ResourceQuotaStatus `json:"status,omitempty" protobuf:"bytes,3,opt,name=status"` 5712} 5713 5714// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object 5715 5716// ResourceQuotaList is a list of ResourceQuota items. 5717type ResourceQuotaList struct { 5718 metav1.TypeMeta `json:",inline"` 5719 // Standard list metadata. 5720 // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds 5721 // +optional 5722 metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` 5723 5724 // Items is a list of ResourceQuota objects. 5725 // More info: https://kubernetes.io/docs/concepts/policy/resource-quotas/ 5726 Items []ResourceQuota `json:"items" protobuf:"bytes,2,rep,name=items"` 5727} 5728 5729// +genclient 5730// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object 5731 5732// Secret holds secret data of a certain type. The total bytes of the values in 5733// the Data field must be less than MaxSecretSize bytes. 5734type Secret struct { 5735 metav1.TypeMeta `json:",inline"` 5736 // Standard object's metadata. 5737 // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata 5738 // +optional 5739 metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` 5740 5741 // Immutable, if set to true, ensures that data stored in the Secret cannot 5742 // be updated (only object metadata can be modified). 5743 // If not set to true, the field can be modified at any time. 5744 // Defaulted to nil. 5745 // This is a beta field enabled by ImmutableEphemeralVolumes feature gate. 5746 // +optional 5747 Immutable *bool `json:"immutable,omitempty" protobuf:"varint,5,opt,name=immutable"` 5748 5749 // Data contains the secret data. Each key must consist of alphanumeric 5750 // characters, '-', '_' or '.'. The serialized form of the secret data is a 5751 // base64 encoded string, representing the arbitrary (possibly non-string) 5752 // data value here. Described in https://tools.ietf.org/html/rfc4648#section-4 5753 // +optional 5754 Data map[string][]byte `json:"data,omitempty" protobuf:"bytes,2,rep,name=data"` 5755 5756 // stringData allows specifying non-binary secret data in string form. 5757 // It is provided as a write-only convenience method. 5758 // All keys and values are merged into the data field on write, overwriting any existing values. 5759 // It is never output when reading from the API. 5760 // +k8s:conversion-gen=false 5761 // +optional 5762 StringData map[string]string `json:"stringData,omitempty" protobuf:"bytes,4,rep,name=stringData"` 5763 5764 // Used to facilitate programmatic handling of secret data. 5765 // +optional 5766 Type SecretType `json:"type,omitempty" protobuf:"bytes,3,opt,name=type,casttype=SecretType"` 5767} 5768 5769const MaxSecretSize = 1 * 1024 * 1024 5770 5771type SecretType string 5772 5773const ( 5774 // SecretTypeOpaque is the default. Arbitrary user-defined data 5775 SecretTypeOpaque SecretType = "Opaque" 5776 5777 // SecretTypeServiceAccountToken contains a token that identifies a service account to the API 5778 // 5779 // Required fields: 5780 // - Secret.Annotations["kubernetes.io/service-account.name"] - the name of the ServiceAccount the token identifies 5781 // - Secret.Annotations["kubernetes.io/service-account.uid"] - the UID of the ServiceAccount the token identifies 5782 // - Secret.Data["token"] - a token that identifies the service account to the API 5783 SecretTypeServiceAccountToken SecretType = "kubernetes.io/service-account-token" 5784 5785 // ServiceAccountNameKey is the key of the required annotation for SecretTypeServiceAccountToken secrets 5786 ServiceAccountNameKey = "kubernetes.io/service-account.name" 5787 // ServiceAccountUIDKey is the key of the required annotation for SecretTypeServiceAccountToken secrets 5788 ServiceAccountUIDKey = "kubernetes.io/service-account.uid" 5789 // ServiceAccountTokenKey is the key of the required data for SecretTypeServiceAccountToken secrets 5790 ServiceAccountTokenKey = "token" 5791 // ServiceAccountKubeconfigKey is the key of the optional kubeconfig data for SecretTypeServiceAccountToken secrets 5792 ServiceAccountKubeconfigKey = "kubernetes.kubeconfig" 5793 // ServiceAccountRootCAKey is the key of the optional root certificate authority for SecretTypeServiceAccountToken secrets 5794 ServiceAccountRootCAKey = "ca.crt" 5795 // ServiceAccountNamespaceKey is the key of the optional namespace to use as the default for namespaced API calls 5796 ServiceAccountNamespaceKey = "namespace" 5797 5798 // SecretTypeDockercfg contains a dockercfg file that follows the same format rules as ~/.dockercfg 5799 // 5800 // Required fields: 5801 // - Secret.Data[".dockercfg"] - a serialized ~/.dockercfg file 5802 SecretTypeDockercfg SecretType = "kubernetes.io/dockercfg" 5803 5804 // DockerConfigKey is the key of the required data for SecretTypeDockercfg secrets 5805 DockerConfigKey = ".dockercfg" 5806 5807 // SecretTypeDockerConfigJson contains a dockercfg file that follows the same format rules as ~/.docker/config.json 5808 // 5809 // Required fields: 5810 // - Secret.Data[".dockerconfigjson"] - a serialized ~/.docker/config.json file 5811 SecretTypeDockerConfigJson SecretType = "kubernetes.io/dockerconfigjson" 5812 5813 // DockerConfigJsonKey is the key of the required data for SecretTypeDockerConfigJson secrets 5814 DockerConfigJsonKey = ".dockerconfigjson" 5815 5816 // SecretTypeBasicAuth contains data needed for basic authentication. 5817 // 5818 // Required at least one of fields: 5819 // - Secret.Data["username"] - username used for authentication 5820 // - Secret.Data["password"] - password or token needed for authentication 5821 SecretTypeBasicAuth SecretType = "kubernetes.io/basic-auth" 5822 5823 // BasicAuthUsernameKey is the key of the username for SecretTypeBasicAuth secrets 5824 BasicAuthUsernameKey = "username" 5825 // BasicAuthPasswordKey is the key of the password or token for SecretTypeBasicAuth secrets 5826 BasicAuthPasswordKey = "password" 5827 5828 // SecretTypeSSHAuth contains data needed for SSH authetication. 5829 // 5830 // Required field: 5831 // - Secret.Data["ssh-privatekey"] - private SSH key needed for authentication 5832 SecretTypeSSHAuth SecretType = "kubernetes.io/ssh-auth" 5833 5834 // SSHAuthPrivateKey is the key of the required SSH private key for SecretTypeSSHAuth secrets 5835 SSHAuthPrivateKey = "ssh-privatekey" 5836 // SecretTypeTLS contains information about a TLS client or server secret. It 5837 // is primarily used with TLS termination of the Ingress resource, but may be 5838 // used in other types. 5839 // 5840 // Required fields: 5841 // - Secret.Data["tls.key"] - TLS private key. 5842 // Secret.Data["tls.crt"] - TLS certificate. 5843 // TODO: Consider supporting different formats, specifying CA/destinationCA. 5844 SecretTypeTLS SecretType = "kubernetes.io/tls" 5845 5846 // TLSCertKey is the key for tls certificates in a TLS secert. 5847 TLSCertKey = "tls.crt" 5848 // TLSPrivateKeyKey is the key for the private key field in a TLS secret. 5849 TLSPrivateKeyKey = "tls.key" 5850 // SecretTypeBootstrapToken is used during the automated bootstrap process (first 5851 // implemented by kubeadm). It stores tokens that are used to sign well known 5852 // ConfigMaps. They are used for authn. 5853 SecretTypeBootstrapToken SecretType = "bootstrap.kubernetes.io/token" 5854) 5855 5856// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object 5857 5858// SecretList is a list of Secret. 5859type SecretList struct { 5860 metav1.TypeMeta `json:",inline"` 5861 // Standard list metadata. 5862 // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds 5863 // +optional 5864 metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` 5865 5866 // Items is a list of secret objects. 5867 // More info: https://kubernetes.io/docs/concepts/configuration/secret 5868 Items []Secret `json:"items" protobuf:"bytes,2,rep,name=items"` 5869} 5870 5871// +genclient 5872// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object 5873 5874// ConfigMap holds configuration data for pods to consume. 5875type ConfigMap struct { 5876 metav1.TypeMeta `json:",inline"` 5877 // Standard object's metadata. 5878 // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata 5879 // +optional 5880 metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` 5881 5882 // Immutable, if set to true, ensures that data stored in the ConfigMap cannot 5883 // be updated (only object metadata can be modified). 5884 // If not set to true, the field can be modified at any time. 5885 // Defaulted to nil. 5886 // This is a beta field enabled by ImmutableEphemeralVolumes feature gate. 5887 // +optional 5888 Immutable *bool `json:"immutable,omitempty" protobuf:"varint,4,opt,name=immutable"` 5889 5890 // Data contains the configuration data. 5891 // Each key must consist of alphanumeric characters, '-', '_' or '.'. 5892 // Values with non-UTF-8 byte sequences must use the BinaryData field. 5893 // The keys stored in Data must not overlap with the keys in 5894 // the BinaryData field, this is enforced during validation process. 5895 // +optional 5896 Data map[string]string `json:"data,omitempty" protobuf:"bytes,2,rep,name=data"` 5897 5898 // BinaryData contains the binary data. 5899 // Each key must consist of alphanumeric characters, '-', '_' or '.'. 5900 // BinaryData can contain byte sequences that are not in the UTF-8 range. 5901 // The keys stored in BinaryData must not overlap with the ones in 5902 // the Data field, this is enforced during validation process. 5903 // Using this field will require 1.10+ apiserver and 5904 // kubelet. 5905 // +optional 5906 BinaryData map[string][]byte `json:"binaryData,omitempty" protobuf:"bytes,3,rep,name=binaryData"` 5907} 5908 5909// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object 5910 5911// ConfigMapList is a resource containing a list of ConfigMap objects. 5912type ConfigMapList struct { 5913 metav1.TypeMeta `json:",inline"` 5914 5915 // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata 5916 // +optional 5917 metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` 5918 5919 // Items is the list of ConfigMaps. 5920 Items []ConfigMap `json:"items" protobuf:"bytes,2,rep,name=items"` 5921} 5922 5923// Type and constants for component health validation. 5924type ComponentConditionType string 5925 5926// These are the valid conditions for the component. 5927const ( 5928 ComponentHealthy ComponentConditionType = "Healthy" 5929) 5930 5931// Information about the condition of a component. 5932type ComponentCondition struct { 5933 // Type of condition for a component. 5934 // Valid value: "Healthy" 5935 Type ComponentConditionType `json:"type" protobuf:"bytes,1,opt,name=type,casttype=ComponentConditionType"` 5936 // Status of the condition for a component. 5937 // Valid values for "Healthy": "True", "False", or "Unknown". 5938 Status ConditionStatus `json:"status" protobuf:"bytes,2,opt,name=status,casttype=ConditionStatus"` 5939 // Message about the condition for a component. 5940 // For example, information about a health check. 5941 // +optional 5942 Message string `json:"message,omitempty" protobuf:"bytes,3,opt,name=message"` 5943 // Condition error code for a component. 5944 // For example, a health check error code. 5945 // +optional 5946 Error string `json:"error,omitempty" protobuf:"bytes,4,opt,name=error"` 5947} 5948 5949// +genclient 5950// +genclient:nonNamespaced 5951// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object 5952 5953// ComponentStatus (and ComponentStatusList) holds the cluster validation info. 5954// Deprecated: This API is deprecated in v1.19+ 5955type ComponentStatus struct { 5956 metav1.TypeMeta `json:",inline"` 5957 // Standard object's metadata. 5958 // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata 5959 // +optional 5960 metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` 5961 5962 // List of component conditions observed 5963 // +optional 5964 // +patchMergeKey=type 5965 // +patchStrategy=merge 5966 Conditions []ComponentCondition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type" protobuf:"bytes,2,rep,name=conditions"` 5967} 5968 5969// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object 5970 5971// Status of all the conditions for the component as a list of ComponentStatus objects. 5972// Deprecated: This API is deprecated in v1.19+ 5973type ComponentStatusList struct { 5974 metav1.TypeMeta `json:",inline"` 5975 // Standard list metadata. 5976 // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds 5977 // +optional 5978 metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` 5979 5980 // List of ComponentStatus objects. 5981 Items []ComponentStatus `json:"items" protobuf:"bytes,2,rep,name=items"` 5982} 5983 5984// DownwardAPIVolumeSource represents a volume containing downward API info. 5985// Downward API volumes support ownership management and SELinux relabeling. 5986type DownwardAPIVolumeSource struct { 5987 // Items is a list of downward API volume file 5988 // +optional 5989 Items []DownwardAPIVolumeFile `json:"items,omitempty" protobuf:"bytes,1,rep,name=items"` 5990 // Optional: mode bits to use on created files by default. Must be a 5991 // Optional: mode bits used to set permissions on created files by default. 5992 // Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. 5993 // YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. 5994 // Defaults to 0644. 5995 // Directories within the path are not affected by this setting. 5996 // This might be in conflict with other options that affect the file 5997 // mode, like fsGroup, and the result can be other mode bits set. 5998 // +optional 5999 DefaultMode *int32 `json:"defaultMode,omitempty" protobuf:"varint,2,opt,name=defaultMode"` 6000} 6001 6002const ( 6003 DownwardAPIVolumeSourceDefaultMode int32 = 0644 6004) 6005 6006// DownwardAPIVolumeFile represents information to create the file containing the pod field 6007type DownwardAPIVolumeFile struct { 6008 // Required: Path is the relative path name of the file to be created. Must not be absolute or contain the '..' path. Must be utf-8 encoded. The first item of the relative path must not start with '..' 6009 Path string `json:"path" protobuf:"bytes,1,opt,name=path"` 6010 // Required: Selects a field of the pod: only annotations, labels, name and namespace are supported. 6011 // +optional 6012 FieldRef *ObjectFieldSelector `json:"fieldRef,omitempty" protobuf:"bytes,2,opt,name=fieldRef"` 6013 // Selects a resource of the container: only resources limits and requests 6014 // (limits.cpu, limits.memory, requests.cpu and requests.memory) are currently supported. 6015 // +optional 6016 ResourceFieldRef *ResourceFieldSelector `json:"resourceFieldRef,omitempty" protobuf:"bytes,3,opt,name=resourceFieldRef"` 6017 // Optional: mode bits used to set permissions on this file, must be an octal value 6018 // between 0000 and 0777 or a decimal value between 0 and 511. 6019 // YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. 6020 // If not specified, the volume defaultMode will be used. 6021 // This might be in conflict with other options that affect the file 6022 // mode, like fsGroup, and the result can be other mode bits set. 6023 // +optional 6024 Mode *int32 `json:"mode,omitempty" protobuf:"varint,4,opt,name=mode"` 6025} 6026 6027// Represents downward API info for projecting into a projected volume. 6028// Note that this is identical to a downwardAPI volume source without the default 6029// mode. 6030type DownwardAPIProjection struct { 6031 // Items is a list of DownwardAPIVolume file 6032 // +optional 6033 Items []DownwardAPIVolumeFile `json:"items,omitempty" protobuf:"bytes,1,rep,name=items"` 6034} 6035 6036// SecurityContext holds security configuration that will be applied to a container. 6037// Some fields are present in both SecurityContext and PodSecurityContext. When both 6038// are set, the values in SecurityContext take precedence. 6039type SecurityContext struct { 6040 // The capabilities to add/drop when running containers. 6041 // Defaults to the default set of capabilities granted by the container runtime. 6042 // +optional 6043 Capabilities *Capabilities `json:"capabilities,omitempty" protobuf:"bytes,1,opt,name=capabilities"` 6044 // Run container in privileged mode. 6045 // Processes in privileged containers are essentially equivalent to root on the host. 6046 // Defaults to false. 6047 // +optional 6048 Privileged *bool `json:"privileged,omitempty" protobuf:"varint,2,opt,name=privileged"` 6049 // The SELinux context to be applied to the container. 6050 // If unspecified, the container runtime will allocate a random SELinux context for each 6051 // container. May also be set in PodSecurityContext. If set in both SecurityContext and 6052 // PodSecurityContext, the value specified in SecurityContext takes precedence. 6053 // +optional 6054 SELinuxOptions *SELinuxOptions `json:"seLinuxOptions,omitempty" protobuf:"bytes,3,opt,name=seLinuxOptions"` 6055 // The Windows specific settings applied to all containers. 6056 // If unspecified, the options from the PodSecurityContext will be used. 6057 // If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. 6058 // +optional 6059 WindowsOptions *WindowsSecurityContextOptions `json:"windowsOptions,omitempty" protobuf:"bytes,10,opt,name=windowsOptions"` 6060 // The UID to run the entrypoint of the container process. 6061 // Defaults to user specified in image metadata if unspecified. 6062 // May also be set in PodSecurityContext. If set in both SecurityContext and 6063 // PodSecurityContext, the value specified in SecurityContext takes precedence. 6064 // +optional 6065 RunAsUser *int64 `json:"runAsUser,omitempty" protobuf:"varint,4,opt,name=runAsUser"` 6066 // The GID to run the entrypoint of the container process. 6067 // Uses runtime default if unset. 6068 // May also be set in PodSecurityContext. If set in both SecurityContext and 6069 // PodSecurityContext, the value specified in SecurityContext takes precedence. 6070 // +optional 6071 RunAsGroup *int64 `json:"runAsGroup,omitempty" protobuf:"varint,8,opt,name=runAsGroup"` 6072 // Indicates that the container must run as a non-root user. 6073 // If true, the Kubelet will validate the image at runtime to ensure that it 6074 // does not run as UID 0 (root) and fail to start the container if it does. 6075 // If unset or false, no such validation will be performed. 6076 // May also be set in PodSecurityContext. If set in both SecurityContext and 6077 // PodSecurityContext, the value specified in SecurityContext takes precedence. 6078 // +optional 6079 RunAsNonRoot *bool `json:"runAsNonRoot,omitempty" protobuf:"varint,5,opt,name=runAsNonRoot"` 6080 // Whether this container has a read-only root filesystem. 6081 // Default is false. 6082 // +optional 6083 ReadOnlyRootFilesystem *bool `json:"readOnlyRootFilesystem,omitempty" protobuf:"varint,6,opt,name=readOnlyRootFilesystem"` 6084 // AllowPrivilegeEscalation controls whether a process can gain more 6085 // privileges than its parent process. This bool directly controls if 6086 // the no_new_privs flag will be set on the container process. 6087 // AllowPrivilegeEscalation is true always when the container is: 6088 // 1) run as Privileged 6089 // 2) has CAP_SYS_ADMIN 6090 // +optional 6091 AllowPrivilegeEscalation *bool `json:"allowPrivilegeEscalation,omitempty" protobuf:"varint,7,opt,name=allowPrivilegeEscalation"` 6092 // procMount denotes the type of proc mount to use for the containers. 6093 // The default is DefaultProcMount which uses the container runtime defaults for 6094 // readonly paths and masked paths. 6095 // This requires the ProcMountType feature flag to be enabled. 6096 // +optional 6097 ProcMount *ProcMountType `json:"procMount,omitempty" protobuf:"bytes,9,opt,name=procMount"` 6098 // The seccomp options to use by this container. If seccomp options are 6099 // provided at both the pod & container level, the container options 6100 // override the pod options. 6101 // +optional 6102 SeccompProfile *SeccompProfile `json:"seccompProfile,omitempty" protobuf:"bytes,11,opt,name=seccompProfile"` 6103} 6104 6105type ProcMountType string 6106 6107const ( 6108 // DefaultProcMount uses the container runtime defaults for readonly and masked 6109 // paths for /proc. Most container runtimes mask certain paths in /proc to avoid 6110 // accidental security exposure of special devices or information. 6111 DefaultProcMount ProcMountType = "Default" 6112 6113 // UnmaskedProcMount bypasses the default masking behavior of the container 6114 // runtime and ensures the newly created /proc the container stays in tact with 6115 // no modifications. 6116 UnmaskedProcMount ProcMountType = "Unmasked" 6117) 6118 6119// SELinuxOptions are the labels to be applied to the container 6120type SELinuxOptions struct { 6121 // User is a SELinux user label that applies to the container. 6122 // +optional 6123 User string `json:"user,omitempty" protobuf:"bytes,1,opt,name=user"` 6124 // Role is a SELinux role label that applies to the container. 6125 // +optional 6126 Role string `json:"role,omitempty" protobuf:"bytes,2,opt,name=role"` 6127 // Type is a SELinux type label that applies to the container. 6128 // +optional 6129 Type string `json:"type,omitempty" protobuf:"bytes,3,opt,name=type"` 6130 // Level is SELinux level label that applies to the container. 6131 // +optional 6132 Level string `json:"level,omitempty" protobuf:"bytes,4,opt,name=level"` 6133} 6134 6135// WindowsSecurityContextOptions contain Windows-specific options and credentials. 6136type WindowsSecurityContextOptions struct { 6137 // GMSACredentialSpecName is the name of the GMSA credential spec to use. 6138 // +optional 6139 GMSACredentialSpecName *string `json:"gmsaCredentialSpecName,omitempty" protobuf:"bytes,1,opt,name=gmsaCredentialSpecName"` 6140 6141 // GMSACredentialSpec is where the GMSA admission webhook 6142 // (https://github.com/kubernetes-sigs/windows-gmsa) inlines the contents of the 6143 // GMSA credential spec named by the GMSACredentialSpecName field. 6144 // +optional 6145 GMSACredentialSpec *string `json:"gmsaCredentialSpec,omitempty" protobuf:"bytes,2,opt,name=gmsaCredentialSpec"` 6146 6147 // The UserName in Windows to run the entrypoint of the container process. 6148 // Defaults to the user specified in image metadata if unspecified. 6149 // May also be set in PodSecurityContext. If set in both SecurityContext and 6150 // PodSecurityContext, the value specified in SecurityContext takes precedence. 6151 // +optional 6152 RunAsUserName *string `json:"runAsUserName,omitempty" protobuf:"bytes,3,opt,name=runAsUserName"` 6153} 6154 6155// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object 6156 6157// RangeAllocation is not a public type. 6158type RangeAllocation struct { 6159 metav1.TypeMeta `json:",inline"` 6160 // Standard object's metadata. 6161 // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata 6162 // +optional 6163 metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` 6164 6165 // Range is string that identifies the range represented by 'data'. 6166 Range string `json:"range" protobuf:"bytes,2,opt,name=range"` 6167 // Data is a bit array containing all allocated addresses in the previous segment. 6168 Data []byte `json:"data" protobuf:"bytes,3,opt,name=data"` 6169} 6170 6171const ( 6172 // "default-scheduler" is the name of default scheduler. 6173 DefaultSchedulerName = "default-scheduler" 6174 6175 // RequiredDuringScheduling affinity is not symmetric, but there is an implicit PreferredDuringScheduling affinity rule 6176 // corresponding to every RequiredDuringScheduling affinity rule. 6177 // When the --hard-pod-affinity-weight scheduler flag is not specified, 6178 // DefaultHardPodAffinityWeight defines the weight of the implicit PreferredDuringScheduling affinity rule. 6179 DefaultHardPodAffinitySymmetricWeight int32 = 1 6180) 6181 6182// Sysctl defines a kernel parameter to be set 6183type Sysctl struct { 6184 // Name of a property to set 6185 Name string `json:"name" protobuf:"bytes,1,opt,name=name"` 6186 // Value of a property to set 6187 Value string `json:"value" protobuf:"bytes,2,opt,name=value"` 6188} 6189 6190// NodeResources is an object for conveying resource information about a node. 6191// see https://kubernetes.io/docs/concepts/architecture/nodes/#capacity for more details. 6192type NodeResources struct { 6193 // Capacity represents the available resources of a node 6194 Capacity ResourceList `protobuf:"bytes,1,rep,name=capacity,casttype=ResourceList,castkey=ResourceName"` 6195} 6196 6197const ( 6198 // Enable stdin for remote command execution 6199 ExecStdinParam = "input" 6200 // Enable stdout for remote command execution 6201 ExecStdoutParam = "output" 6202 // Enable stderr for remote command execution 6203 ExecStderrParam = "error" 6204 // Enable TTY for remote command execution 6205 ExecTTYParam = "tty" 6206 // Command to run for remote command execution 6207 ExecCommandParam = "command" 6208 6209 // Name of header that specifies stream type 6210 StreamType = "streamType" 6211 // Value for streamType header for stdin stream 6212 StreamTypeStdin = "stdin" 6213 // Value for streamType header for stdout stream 6214 StreamTypeStdout = "stdout" 6215 // Value for streamType header for stderr stream 6216 StreamTypeStderr = "stderr" 6217 // Value for streamType header for data stream 6218 StreamTypeData = "data" 6219 // Value for streamType header for error stream 6220 StreamTypeError = "error" 6221 // Value for streamType header for terminal resize stream 6222 StreamTypeResize = "resize" 6223 6224 // Name of header that specifies the port being forwarded 6225 PortHeader = "port" 6226 // Name of header that specifies a request ID used to associate the error 6227 // and data streams for a single forwarded connection 6228 PortForwardRequestIDHeader = "requestID" 6229) 6230 6231// PortStatus represents the error condition of a service port 6232 6233type PortStatus struct { 6234 // Port is the port number of the service port of which status is recorded here 6235 Port int32 `json:"port" protobuf:"varint,1,opt,name=port"` 6236 // Protocol is the protocol of the service port of which status is recorded here 6237 // The supported values are: "TCP", "UDP", "SCTP" 6238 Protocol Protocol `json:"protocol" protobuf:"bytes,2,opt,name=protocol,casttype=Protocol"` 6239 // Error is to record the problem with the service port 6240 // The format of the error shall comply with the following rules: 6241 // - built-in error values shall be specified in this file and those shall use 6242 // CamelCase names 6243 // - cloud provider specific error values must have names that comply with the 6244 // format foo.example.com/CamelCase. 6245 // --- 6246 // The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt) 6247 // +optional 6248 // +kubebuilder:validation:Required 6249 // +kubebuilder:validation:Pattern=`^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$` 6250 // +kubebuilder:validation:MaxLength=316 6251 Error *string `json:"error,omitempty" protobuf:"bytes,3,opt,name=error"` 6252} 6253