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/runtime" 23 "k8s.io/apimachinery/pkg/types" 24 "k8s.io/apimachinery/pkg/util/intstr" 25) 26 27// The comments for the structs and fields can be used from go-restful to 28// generate Swagger API documentation for its models. Please read this PR for more 29// information on the implementation: https://github.com/emicklei/go-restful/pull/215 30// 31// TODOs are ignored from the parser (e.g. TODO(andronat):... || TODO:...) if and only if 32// they are on one line! For multiple line or blocks that you want to ignore use ---. 33// Any context after a --- is ignored and not exported to the SwaggerAPI. 34// 35// The aforementioned methods can be generated by hack/update-generated-swagger-docs.sh 36 37// Common string formats 38// --------------------- 39// Many fields in this API have formatting requirements. The commonly used 40// formats are defined here. 41// 42// C_IDENTIFIER: This is a string that conforms to the definition of an "identifier" 43// in the C language. This is captured by the following regex: 44// [A-Za-z_][A-Za-z0-9_]* 45// This defines the format, but not the length restriction, which should be 46// specified at the definition of any field of this type. 47// 48// DNS_LABEL: This is a string, no more than 63 characters long, that conforms 49// to the definition of a "label" in RFCs 1035 and 1123. This is captured 50// by the following regex: 51// [a-z0-9]([-a-z0-9]*[a-z0-9])? 52// 53// DNS_SUBDOMAIN: This is a string, no more than 253 characters long, that conforms 54// to the definition of a "subdomain" in RFCs 1035 and 1123. This is captured 55// by the following regex: 56// [a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)* 57// or more simply: 58// DNS_LABEL(\.DNS_LABEL)* 59// 60// IANA_SVC_NAME: This is a string, no more than 15 characters long, that 61// conforms to the definition of IANA service name in RFC 6335. 62// It must contains at least one letter [a-z] and it must contains only [a-z0-9-]. 63// Hypens ('-') cannot be leading or trailing character of the string 64// and cannot be adjacent to other hyphens. 65 66// ObjectMeta is metadata that all persisted resources must have, which includes all objects 67// users must create. 68// DEPRECATED: Use k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta instead - this type will be removed soon. 69// +k8s:openapi-gen=false 70type ObjectMeta struct { 71 // Name must be unique within a namespace. Is required when creating resources, although 72 // some resources may allow a client to request the generation of an appropriate name 73 // automatically. Name is primarily intended for creation idempotence and configuration 74 // definition. 75 // Cannot be updated. 76 // More info: http://kubernetes.io/docs/user-guide/identifiers#names 77 // +optional 78 Name string `json:"name,omitempty" protobuf:"bytes,1,opt,name=name"` 79 80 // GenerateName is an optional prefix, used by the server, to generate a unique 81 // name ONLY IF the Name field has not been provided. 82 // If this field is used, the name returned to the client will be different 83 // than the name passed. This value will also be combined with a unique suffix. 84 // The provided value has the same validation rules as the Name field, 85 // and may be truncated by the length of the suffix required to make the value 86 // unique on the server. 87 // 88 // If this field is specified and the generated name exists, the server will 89 // NOT return a 409 - instead, it will either return 201 Created or 500 with Reason 90 // ServerTimeout indicating a unique name could not be found in the time allotted, and the client 91 // should retry (optionally after the time indicated in the Retry-After header). 92 // 93 // Applied only if Name is not specified. 94 // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#idempotency 95 // +optional 96 GenerateName string `json:"generateName,omitempty" protobuf:"bytes,2,opt,name=generateName"` 97 98 // Namespace defines the space within each name must be unique. An empty namespace is 99 // equivalent to the "default" namespace, but "default" is the canonical representation. 100 // Not all objects are required to be scoped to a namespace - the value of this field for 101 // those objects will be empty. 102 // 103 // Must be a DNS_LABEL. 104 // Cannot be updated. 105 // More info: http://kubernetes.io/docs/user-guide/namespaces 106 // +optional 107 Namespace string `json:"namespace,omitempty" protobuf:"bytes,3,opt,name=namespace"` 108 109 // SelfLink is a URL representing this object. 110 // Populated by the system. 111 // Read-only. 112 // +optional 113 SelfLink string `json:"selfLink,omitempty" protobuf:"bytes,4,opt,name=selfLink"` 114 115 // UID is the unique in time and space value for this object. It is typically generated by 116 // the server on successful creation of a resource and is not allowed to change on PUT 117 // operations. 118 // 119 // Populated by the system. 120 // Read-only. 121 // More info: http://kubernetes.io/docs/user-guide/identifiers#uids 122 // +optional 123 UID types.UID `json:"uid,omitempty" protobuf:"bytes,5,opt,name=uid,casttype=k8s.io/apimachinery/pkg/types.UID"` 124 125 // An opaque value that represents the internal version of this object that can 126 // be used by clients to determine when objects have changed. May be used for optimistic 127 // concurrency, change detection, and the watch operation on a resource or set of resources. 128 // Clients must treat these values as opaque and passed unmodified back to the server. 129 // They may only be valid for a particular resource or set of resources. 130 // 131 // Populated by the system. 132 // Read-only. 133 // Value must be treated as opaque by clients and . 134 // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#concurrency-control-and-consistency 135 // +optional 136 ResourceVersion string `json:"resourceVersion,omitempty" protobuf:"bytes,6,opt,name=resourceVersion"` 137 138 // A sequence number representing a specific generation of the desired state. 139 // Populated by the system. Read-only. 140 // +optional 141 Generation int64 `json:"generation,omitempty" protobuf:"varint,7,opt,name=generation"` 142 143 // CreationTimestamp is a timestamp representing the server time when this object was 144 // created. It is not guaranteed to be set in happens-before order across separate operations. 145 // Clients may not set this value. It is represented in RFC3339 form and is in UTC. 146 // 147 // Populated by the system. 148 // Read-only. 149 // Null for lists. 150 // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata 151 // +optional 152 CreationTimestamp metav1.Time `json:"creationTimestamp,omitempty" protobuf:"bytes,8,opt,name=creationTimestamp"` 153 154 // DeletionTimestamp is RFC 3339 date and time at which this resource will be deleted. This 155 // field is set by the server when a graceful deletion is requested by the user, and is not 156 // directly settable by a client. The resource is expected to be deleted (no longer visible 157 // from resource lists, and not reachable by name) after the time in this field. Once set, 158 // this value may not be unset or be set further into the future, although it may be shortened 159 // or the resource may be deleted prior to this time. For example, a user may request that 160 // a pod is deleted in 30 seconds. The Kubelet will react by sending a graceful termination 161 // signal to the containers in the pod. After that 30 seconds, the Kubelet will send a hard 162 // termination signal (SIGKILL) to the container and after cleanup, remove the pod from the 163 // API. In the presence of network partitions, this object may still exist after this 164 // timestamp, until an administrator or automated process can determine the resource is 165 // fully terminated. 166 // If not set, graceful deletion of the object has not been requested. 167 // 168 // Populated by the system when a graceful deletion is requested. 169 // Read-only. 170 // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata 171 // +optional 172 DeletionTimestamp *metav1.Time `json:"deletionTimestamp,omitempty" protobuf:"bytes,9,opt,name=deletionTimestamp"` 173 174 // Number of seconds allowed for this object to gracefully terminate before 175 // it will be removed from the system. Only set when deletionTimestamp is also set. 176 // May only be shortened. 177 // Read-only. 178 // +optional 179 DeletionGracePeriodSeconds *int64 `json:"deletionGracePeriodSeconds,omitempty" protobuf:"varint,10,opt,name=deletionGracePeriodSeconds"` 180 181 // Map of string keys and values that can be used to organize and categorize 182 // (scope and select) objects. May match selectors of replication controllers 183 // and services. 184 // More info: http://kubernetes.io/docs/user-guide/labels 185 // +optional 186 Labels map[string]string `json:"labels,omitempty" protobuf:"bytes,11,rep,name=labels"` 187 188 // Annotations is an unstructured key value map stored with a resource that may be 189 // set by external tools to store and retrieve arbitrary metadata. They are not 190 // queryable and should be preserved when modifying objects. 191 // More info: http://kubernetes.io/docs/user-guide/annotations 192 // +optional 193 Annotations map[string]string `json:"annotations,omitempty" protobuf:"bytes,12,rep,name=annotations"` 194 195 // List of objects depended by this object. If ALL objects in the list have 196 // been deleted, this object will be garbage collected. If this object is managed by a controller, 197 // then an entry in this list will point to this controller, with the controller field set to true. 198 // There cannot be more than one managing controller. 199 // +optional 200 OwnerReferences []metav1.OwnerReference `json:"ownerReferences,omitempty" patchStrategy:"merge" patchMergeKey:"uid" protobuf:"bytes,13,rep,name=ownerReferences"` 201 202 // Must be empty before the object is deleted from the registry. Each entry 203 // is an identifier for the responsible component that will remove the entry 204 // from the list. If the deletionTimestamp of the object is non-nil, entries 205 // in this list can only be removed. 206 // +optional 207 Finalizers []string `json:"finalizers,omitempty" patchStrategy:"merge" protobuf:"bytes,14,rep,name=finalizers"` 208 209 // The name of the cluster which the object belongs to. 210 // This is used to distinguish resources with same name and namespace in different clusters. 211 // This field is not set anywhere right now and apiserver is going to ignore it if set in create or update request. 212 // +optional 213 ClusterName string `json:"clusterName,omitempty" protobuf:"bytes,15,opt,name=clusterName"` 214} 215 216const ( 217 // NamespaceDefault means the object is in the default namespace which is applied when not specified by clients 218 NamespaceDefault string = "default" 219 // NamespaceAll is the default argument to specify on a context when you want to list or filter resources across all namespaces 220 NamespaceAll string = "" 221) 222 223// Volume represents a named volume in a pod that may be accessed by any container in the pod. 224type Volume struct { 225 // Volume's name. 226 // Must be a DNS_LABEL and unique within the pod. 227 // More info: http://kubernetes.io/docs/user-guide/identifiers#names 228 Name string `json:"name" protobuf:"bytes,1,opt,name=name"` 229 // VolumeSource represents the location and type of the mounted volume. 230 // If not specified, the Volume is implied to be an EmptyDir. 231 // This implied behavior is deprecated and will be removed in a future version. 232 VolumeSource `json:",inline" protobuf:"bytes,2,opt,name=volumeSource"` 233} 234 235// Represents the source of a volume to mount. 236// Only one of its members may be specified. 237type VolumeSource struct { 238 // HostPath represents a pre-existing file or directory on the host 239 // machine that is directly exposed to the container. This is generally 240 // used for system agents or other privileged things that are allowed 241 // to see the host machine. Most containers will NOT need this. 242 // More info: http://kubernetes.io/docs/user-guide/volumes#hostpath 243 // --- 244 // TODO(jonesdl) We need to restrict who can use host directory mounts and who can/can not 245 // mount host directories as read/write. 246 // +optional 247 HostPath *HostPathVolumeSource `json:"hostPath,omitempty" protobuf:"bytes,1,opt,name=hostPath"` 248 // EmptyDir represents a temporary directory that shares a pod's lifetime. 249 // More info: http://kubernetes.io/docs/user-guide/volumes#emptydir 250 // +optional 251 EmptyDir *EmptyDirVolumeSource `json:"emptyDir,omitempty" protobuf:"bytes,2,opt,name=emptyDir"` 252 // GCEPersistentDisk represents a GCE Disk resource that is attached to a 253 // kubelet's host machine and then exposed to the pod. 254 // More info: http://kubernetes.io/docs/user-guide/volumes#gcepersistentdisk 255 // +optional 256 GCEPersistentDisk *GCEPersistentDiskVolumeSource `json:"gcePersistentDisk,omitempty" protobuf:"bytes,3,opt,name=gcePersistentDisk"` 257 // AWSElasticBlockStore represents an AWS Disk resource that is attached to a 258 // kubelet's host machine and then exposed to the pod. 259 // More info: http://kubernetes.io/docs/user-guide/volumes#awselasticblockstore 260 // +optional 261 AWSElasticBlockStore *AWSElasticBlockStoreVolumeSource `json:"awsElasticBlockStore,omitempty" protobuf:"bytes,4,opt,name=awsElasticBlockStore"` 262 // GitRepo represents a git repository at a particular revision. 263 // +optional 264 GitRepo *GitRepoVolumeSource `json:"gitRepo,omitempty" protobuf:"bytes,5,opt,name=gitRepo"` 265 // Secret represents a secret that should populate this volume. 266 // More info: http://kubernetes.io/docs/user-guide/volumes#secrets 267 // +optional 268 Secret *SecretVolumeSource `json:"secret,omitempty" protobuf:"bytes,6,opt,name=secret"` 269 // NFS represents an NFS mount on the host that shares a pod's lifetime 270 // More info: http://kubernetes.io/docs/user-guide/volumes#nfs 271 // +optional 272 NFS *NFSVolumeSource `json:"nfs,omitempty" protobuf:"bytes,7,opt,name=nfs"` 273 // ISCSI represents an ISCSI Disk resource that is attached to a 274 // kubelet's host machine and then exposed to the pod. 275 // More info: http://releases.k8s.io/HEAD/examples/volumes/iscsi/README.md 276 // +optional 277 ISCSI *ISCSIVolumeSource `json:"iscsi,omitempty" protobuf:"bytes,8,opt,name=iscsi"` 278 // Glusterfs represents a Glusterfs mount on the host that shares a pod's lifetime. 279 // More info: http://releases.k8s.io/HEAD/examples/volumes/glusterfs/README.md 280 // +optional 281 Glusterfs *GlusterfsVolumeSource `json:"glusterfs,omitempty" protobuf:"bytes,9,opt,name=glusterfs"` 282 // PersistentVolumeClaimVolumeSource represents a reference to a 283 // PersistentVolumeClaim in the same namespace. 284 // More info: http://kubernetes.io/docs/user-guide/persistent-volumes#persistentvolumeclaims 285 // +optional 286 PersistentVolumeClaim *PersistentVolumeClaimVolumeSource `json:"persistentVolumeClaim,omitempty" protobuf:"bytes,10,opt,name=persistentVolumeClaim"` 287 // RBD represents a Rados Block Device mount on the host that shares a pod's lifetime. 288 // More info: http://releases.k8s.io/HEAD/examples/volumes/rbd/README.md 289 // +optional 290 RBD *RBDVolumeSource `json:"rbd,omitempty" protobuf:"bytes,11,opt,name=rbd"` 291 // FlexVolume represents a generic volume resource that is 292 // provisioned/attached using an exec based plugin. This is an 293 // alpha feature and may change in future. 294 // +optional 295 FlexVolume *FlexVolumeSource `json:"flexVolume,omitempty" protobuf:"bytes,12,opt,name=flexVolume"` 296 // Cinder represents a cinder volume attached and mounted on kubelets host machine 297 // More info: http://releases.k8s.io/HEAD/examples/mysql-cinder-pd/README.md 298 // +optional 299 Cinder *CinderVolumeSource `json:"cinder,omitempty" protobuf:"bytes,13,opt,name=cinder"` 300 // CephFS represents a Ceph FS mount on the host that shares a pod's lifetime 301 // +optional 302 CephFS *CephFSVolumeSource `json:"cephfs,omitempty" protobuf:"bytes,14,opt,name=cephfs"` 303 // Flocker represents a Flocker volume attached to a kubelet's host machine. This depends on the Flocker control service being running 304 // +optional 305 Flocker *FlockerVolumeSource `json:"flocker,omitempty" protobuf:"bytes,15,opt,name=flocker"` 306 // DownwardAPI represents downward API about the pod that should populate this volume 307 // +optional 308 DownwardAPI *DownwardAPIVolumeSource `json:"downwardAPI,omitempty" protobuf:"bytes,16,opt,name=downwardAPI"` 309 // FC represents a Fibre Channel resource that is attached to a kubelet's host machine and then exposed to the pod. 310 // +optional 311 FC *FCVolumeSource `json:"fc,omitempty" protobuf:"bytes,17,opt,name=fc"` 312 // AzureFile represents an Azure File Service mount on the host and bind mount to the pod. 313 // +optional 314 AzureFile *AzureFileVolumeSource `json:"azureFile,omitempty" protobuf:"bytes,18,opt,name=azureFile"` 315 // ConfigMap represents a configMap that should populate this volume 316 // +optional 317 ConfigMap *ConfigMapVolumeSource `json:"configMap,omitempty" protobuf:"bytes,19,opt,name=configMap"` 318 // VsphereVolume represents a vSphere volume attached and mounted on kubelets host machine 319 // +optional 320 VsphereVolume *VsphereVirtualDiskVolumeSource `json:"vsphereVolume,omitempty" protobuf:"bytes,20,opt,name=vsphereVolume"` 321 // Quobyte represents a Quobyte mount on the host that shares a pod's lifetime 322 // +optional 323 Quobyte *QuobyteVolumeSource `json:"quobyte,omitempty" protobuf:"bytes,21,opt,name=quobyte"` 324 // AzureDisk represents an Azure Data Disk mount on the host and bind mount to the pod. 325 // +optional 326 AzureDisk *AzureDiskVolumeSource `json:"azureDisk,omitempty" protobuf:"bytes,22,opt,name=azureDisk"` 327 // PhotonPersistentDisk represents a PhotonController persistent disk attached and mounted on kubelets host machine 328 PhotonPersistentDisk *PhotonPersistentDiskVolumeSource `json:"photonPersistentDisk,omitempty" protobuf:"bytes,23,opt,name=photonPersistentDisk"` 329 // Items for all in one resources secrets, configmaps, and downward API 330 Projected *ProjectedVolumeSource `json:"projected,omitempty" protobuf:"bytes,26,opt,name=projected"` 331 // PortworxVolume represents a portworx volume attached and mounted on kubelets host machine 332 // +optional 333 PortworxVolume *PortworxVolumeSource `json:"portworxVolume,omitempty" protobuf:"bytes,24,opt,name=portworxVolume"` 334 // ScaleIO represents a ScaleIO persistent volume attached and mounted on Kubernetes nodes. 335 // +optional 336 ScaleIO *ScaleIOVolumeSource `json:"scaleIO,omitempty" protobuf:"bytes,25,opt,name=scaleIO"` 337} 338 339// PersistentVolumeClaimVolumeSource references the user's PVC in the same namespace. 340// This volume finds the bound PV and mounts that volume for the pod. A 341// PersistentVolumeClaimVolumeSource is, essentially, a wrapper around another 342// type of volume that is owned by someone else (the system). 343type PersistentVolumeClaimVolumeSource struct { 344 // ClaimName is the name of a PersistentVolumeClaim in the same namespace as the pod using this volume. 345 // More info: http://kubernetes.io/docs/user-guide/persistent-volumes#persistentvolumeclaims 346 ClaimName string `json:"claimName" protobuf:"bytes,1,opt,name=claimName"` 347 // Will force the ReadOnly setting in VolumeMounts. 348 // Default false. 349 // +optional 350 ReadOnly bool `json:"readOnly,omitempty" protobuf:"varint,2,opt,name=readOnly"` 351} 352 353// PersistentVolumeSource is similar to VolumeSource but meant for the 354// administrator who creates PVs. Exactly one of its members must be set. 355type PersistentVolumeSource struct { 356 // GCEPersistentDisk represents a GCE Disk resource that is attached to a 357 // kubelet's host machine and then exposed to the pod. Provisioned by an admin. 358 // More info: http://kubernetes.io/docs/user-guide/volumes#gcepersistentdisk 359 // +optional 360 GCEPersistentDisk *GCEPersistentDiskVolumeSource `json:"gcePersistentDisk,omitempty" protobuf:"bytes,1,opt,name=gcePersistentDisk"` 361 // AWSElasticBlockStore represents an AWS Disk resource that is attached to a 362 // kubelet's host machine and then exposed to the pod. 363 // More info: http://kubernetes.io/docs/user-guide/volumes#awselasticblockstore 364 // +optional 365 AWSElasticBlockStore *AWSElasticBlockStoreVolumeSource `json:"awsElasticBlockStore,omitempty" protobuf:"bytes,2,opt,name=awsElasticBlockStore"` 366 // HostPath represents a directory on the host. 367 // Provisioned by a developer or tester. 368 // This is useful for single-node development and testing only! 369 // On-host storage is not supported in any way and WILL NOT WORK in a multi-node cluster. 370 // More info: http://kubernetes.io/docs/user-guide/volumes#hostpath 371 // +optional 372 HostPath *HostPathVolumeSource `json:"hostPath,omitempty" protobuf:"bytes,3,opt,name=hostPath"` 373 // Glusterfs represents a Glusterfs volume that is attached to a host and 374 // exposed to the pod. Provisioned by an admin. 375 // More info: http://releases.k8s.io/HEAD/examples/volumes/glusterfs/README.md 376 // +optional 377 Glusterfs *GlusterfsVolumeSource `json:"glusterfs,omitempty" protobuf:"bytes,4,opt,name=glusterfs"` 378 // NFS represents an NFS mount on the host. Provisioned by an admin. 379 // More info: http://kubernetes.io/docs/user-guide/volumes#nfs 380 // +optional 381 NFS *NFSVolumeSource `json:"nfs,omitempty" protobuf:"bytes,5,opt,name=nfs"` 382 // RBD represents a Rados Block Device mount on the host that shares a pod's lifetime. 383 // More info: http://releases.k8s.io/HEAD/examples/volumes/rbd/README.md 384 // +optional 385 RBD *RBDVolumeSource `json:"rbd,omitempty" protobuf:"bytes,6,opt,name=rbd"` 386 // ISCSI represents an ISCSI Disk resource that is attached to a 387 // kubelet's host machine and then exposed to the pod. Provisioned by an admin. 388 // +optional 389 ISCSI *ISCSIVolumeSource `json:"iscsi,omitempty" protobuf:"bytes,7,opt,name=iscsi"` 390 // Cinder represents a cinder volume attached and mounted on kubelets host machine 391 // More info: http://releases.k8s.io/HEAD/examples/mysql-cinder-pd/README.md 392 // +optional 393 Cinder *CinderVolumeSource `json:"cinder,omitempty" protobuf:"bytes,8,opt,name=cinder"` 394 // CephFS represents a Ceph FS mount on the host that shares a pod's lifetime 395 // +optional 396 CephFS *CephFSVolumeSource `json:"cephfs,omitempty" protobuf:"bytes,9,opt,name=cephfs"` 397 // FC represents a Fibre Channel resource that is attached to a kubelet's host machine and then exposed to the pod. 398 // +optional 399 FC *FCVolumeSource `json:"fc,omitempty" protobuf:"bytes,10,opt,name=fc"` 400 // 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 401 // +optional 402 Flocker *FlockerVolumeSource `json:"flocker,omitempty" protobuf:"bytes,11,opt,name=flocker"` 403 // FlexVolume represents a generic volume resource that is 404 // provisioned/attached using an exec based plugin. This is an 405 // alpha feature and may change in future. 406 // +optional 407 FlexVolume *FlexVolumeSource `json:"flexVolume,omitempty" protobuf:"bytes,12,opt,name=flexVolume"` 408 // AzureFile represents an Azure File Service mount on the host and bind mount to the pod. 409 // +optional 410 AzureFile *AzureFileVolumeSource `json:"azureFile,omitempty" protobuf:"bytes,13,opt,name=azureFile"` 411 // VsphereVolume represents a vSphere volume attached and mounted on kubelets host machine 412 // +optional 413 VsphereVolume *VsphereVirtualDiskVolumeSource `json:"vsphereVolume,omitempty" protobuf:"bytes,14,opt,name=vsphereVolume"` 414 // Quobyte represents a Quobyte mount on the host that shares a pod's lifetime 415 // +optional 416 Quobyte *QuobyteVolumeSource `json:"quobyte,omitempty" protobuf:"bytes,15,opt,name=quobyte"` 417 // AzureDisk represents an Azure Data Disk mount on the host and bind mount to the pod. 418 // +optional 419 AzureDisk *AzureDiskVolumeSource `json:"azureDisk,omitempty" protobuf:"bytes,16,opt,name=azureDisk"` 420 // PhotonPersistentDisk represents a PhotonController persistent disk attached and mounted on kubelets host machine 421 PhotonPersistentDisk *PhotonPersistentDiskVolumeSource `json:"photonPersistentDisk,omitempty" protobuf:"bytes,17,opt,name=photonPersistentDisk"` 422 // PortworxVolume represents a portworx volume attached and mounted on kubelets host machine 423 // +optional 424 PortworxVolume *PortworxVolumeSource `json:"portworxVolume,omitempty" protobuf:"bytes,18,opt,name=portworxVolume"` 425 // ScaleIO represents a ScaleIO persistent volume attached and mounted on Kubernetes nodes. 426 // +optional 427 ScaleIO *ScaleIOVolumeSource `json:"scaleIO,omitempty" protobuf:"bytes,19,opt,name=scaleIO"` 428} 429 430const ( 431 // AlphaStorageClassAnnotation represents the previous alpha storage class 432 // annotation. It's currently still used and will be held for backwards 433 // compatibility 434 AlphaStorageClassAnnotation = "volume.alpha.kubernetes.io/storage-class" 435 436 // BetaStorageClassAnnotation represents the beta/previous StorageClass annotation. 437 // It's currently still used and will be held for backwards compatibility 438 BetaStorageClassAnnotation = "volume.beta.kubernetes.io/storage-class" 439) 440 441// +genclient=true 442// +nonNamespaced=true 443 444// PersistentVolume (PV) is a storage resource provisioned by an administrator. 445// It is analogous to a node. 446// More info: http://kubernetes.io/docs/user-guide/persistent-volumes 447type PersistentVolume struct { 448 metav1.TypeMeta `json:",inline"` 449 // Standard object's metadata. 450 // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata 451 // +optional 452 metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` 453 454 // Spec defines a specification of a persistent volume owned by the cluster. 455 // Provisioned by an administrator. 456 // More info: http://kubernetes.io/docs/user-guide/persistent-volumes#persistent-volumes 457 // +optional 458 Spec PersistentVolumeSpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"` 459 460 // Status represents the current information/status for the persistent volume. 461 // Populated by the system. 462 // Read-only. 463 // More info: http://kubernetes.io/docs/user-guide/persistent-volumes#persistent-volumes 464 // +optional 465 Status PersistentVolumeStatus `json:"status,omitempty" protobuf:"bytes,3,opt,name=status"` 466} 467 468// PersistentVolumeSpec is the specification of a persistent volume. 469type PersistentVolumeSpec struct { 470 // A description of the persistent volume's resources and capacity. 471 // More info: http://kubernetes.io/docs/user-guide/persistent-volumes#capacity 472 // +optional 473 Capacity ResourceList `json:"capacity,omitempty" protobuf:"bytes,1,rep,name=capacity,casttype=ResourceList,castkey=ResourceName"` 474 // The actual volume backing the persistent volume. 475 PersistentVolumeSource `json:",inline" protobuf:"bytes,2,opt,name=persistentVolumeSource"` 476 // AccessModes contains all ways the volume can be mounted. 477 // More info: http://kubernetes.io/docs/user-guide/persistent-volumes#access-modes 478 // +optional 479 AccessModes []PersistentVolumeAccessMode `json:"accessModes,omitempty" protobuf:"bytes,3,rep,name=accessModes,casttype=PersistentVolumeAccessMode"` 480 // ClaimRef is part of a bi-directional binding between PersistentVolume and PersistentVolumeClaim. 481 // Expected to be non-nil when bound. 482 // claim.VolumeName is the authoritative bind between PV and PVC. 483 // More info: http://kubernetes.io/docs/user-guide/persistent-volumes#binding 484 // +optional 485 ClaimRef *ObjectReference `json:"claimRef,omitempty" protobuf:"bytes,4,opt,name=claimRef"` 486 // What happens to a persistent volume when released from its claim. 487 // Valid options are Retain (default) and Recycle. 488 // Recycling must be supported by the volume plugin underlying this persistent volume. 489 // More info: http://kubernetes.io/docs/user-guide/persistent-volumes#recycling-policy 490 // +optional 491 PersistentVolumeReclaimPolicy PersistentVolumeReclaimPolicy `json:"persistentVolumeReclaimPolicy,omitempty" protobuf:"bytes,5,opt,name=persistentVolumeReclaimPolicy,casttype=PersistentVolumeReclaimPolicy"` 492 // Name of StorageClass to which this persistent volume belongs. Empty value 493 // means that this volume does not belong to any StorageClass. 494 // +optional 495 StorageClassName string `json:"storageClassName,omitempty" protobuf:"bytes,6,opt,name=storageClassName"` 496} 497 498// PersistentVolumeReclaimPolicy describes a policy for end-of-life maintenance of persistent volumes. 499type PersistentVolumeReclaimPolicy string 500 501const ( 502 // PersistentVolumeReclaimRecycle means the volume will be recycled back into the pool of unbound persistent volumes on release from its claim. 503 // The volume plugin must support Recycling. 504 PersistentVolumeReclaimRecycle PersistentVolumeReclaimPolicy = "Recycle" 505 // PersistentVolumeReclaimDelete means the volume will be deleted from Kubernetes on release from its claim. 506 // The volume plugin must support Deletion. 507 PersistentVolumeReclaimDelete PersistentVolumeReclaimPolicy = "Delete" 508 // PersistentVolumeReclaimRetain means the volume will be left in its current phase (Released) for manual reclamation by the administrator. 509 // The default policy is Retain. 510 PersistentVolumeReclaimRetain PersistentVolumeReclaimPolicy = "Retain" 511) 512 513// PersistentVolumeStatus is the current status of a persistent volume. 514type PersistentVolumeStatus struct { 515 // Phase indicates if a volume is available, bound to a claim, or released by a claim. 516 // More info: http://kubernetes.io/docs/user-guide/persistent-volumes#phase 517 // +optional 518 Phase PersistentVolumePhase `json:"phase,omitempty" protobuf:"bytes,1,opt,name=phase,casttype=PersistentVolumePhase"` 519 // A human-readable message indicating details about why the volume is in this state. 520 // +optional 521 Message string `json:"message,omitempty" protobuf:"bytes,2,opt,name=message"` 522 // Reason is a brief CamelCase string that describes any failure and is meant 523 // for machine parsing and tidy display in the CLI. 524 // +optional 525 Reason string `json:"reason,omitempty" protobuf:"bytes,3,opt,name=reason"` 526} 527 528// PersistentVolumeList is a list of PersistentVolume items. 529type PersistentVolumeList struct { 530 metav1.TypeMeta `json:",inline"` 531 // Standard list metadata. 532 // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#types-kinds 533 // +optional 534 metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` 535 // List of persistent volumes. 536 // More info: http://kubernetes.io/docs/user-guide/persistent-volumes 537 Items []PersistentVolume `json:"items" protobuf:"bytes,2,rep,name=items"` 538} 539 540// +genclient=true 541 542// PersistentVolumeClaim is a user's request for and claim to a persistent volume 543type PersistentVolumeClaim struct { 544 metav1.TypeMeta `json:",inline"` 545 // Standard object's metadata. 546 // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata 547 // +optional 548 metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` 549 550 // Spec defines the desired characteristics of a volume requested by a pod author. 551 // More info: http://kubernetes.io/docs/user-guide/persistent-volumes#persistentvolumeclaims 552 // +optional 553 Spec PersistentVolumeClaimSpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"` 554 555 // Status represents the current information/status of a persistent volume claim. 556 // Read-only. 557 // More info: http://kubernetes.io/docs/user-guide/persistent-volumes#persistentvolumeclaims 558 // +optional 559 Status PersistentVolumeClaimStatus `json:"status,omitempty" protobuf:"bytes,3,opt,name=status"` 560} 561 562// PersistentVolumeClaimList is a list of PersistentVolumeClaim items. 563type PersistentVolumeClaimList struct { 564 metav1.TypeMeta `json:",inline"` 565 // Standard list metadata. 566 // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#types-kinds 567 // +optional 568 metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` 569 // A list of persistent volume claims. 570 // More info: http://kubernetes.io/docs/user-guide/persistent-volumes#persistentvolumeclaims 571 Items []PersistentVolumeClaim `json:"items" protobuf:"bytes,2,rep,name=items"` 572} 573 574// PersistentVolumeClaimSpec describes the common attributes of storage devices 575// and allows a Source for provider-specific attributes 576type PersistentVolumeClaimSpec struct { 577 // AccessModes contains the desired access modes the volume should have. 578 // More info: http://kubernetes.io/docs/user-guide/persistent-volumes#access-modes-1 579 // +optional 580 AccessModes []PersistentVolumeAccessMode `json:"accessModes,omitempty" protobuf:"bytes,1,rep,name=accessModes,casttype=PersistentVolumeAccessMode"` 581 // A label query over volumes to consider for binding. 582 // +optional 583 Selector *metav1.LabelSelector `json:"selector,omitempty" protobuf:"bytes,4,opt,name=selector"` 584 // Resources represents the minimum resources the volume should have. 585 // More info: http://kubernetes.io/docs/user-guide/persistent-volumes#resources 586 // +optional 587 Resources ResourceRequirements `json:"resources,omitempty" protobuf:"bytes,2,opt,name=resources"` 588 // VolumeName is the binding reference to the PersistentVolume backing this claim. 589 // +optional 590 VolumeName string `json:"volumeName,omitempty" protobuf:"bytes,3,opt,name=volumeName"` 591 // Name of the StorageClass required by the claim. 592 // More info: http://kubernetes.io/docs/user-guide/persistent-volumes#class-1 593 // +optional 594 StorageClassName *string `json:"storageClassName,omitempty" protobuf:"bytes,5,opt,name=storageClassName"` 595} 596 597// PersistentVolumeClaimStatus is the current status of a persistent volume claim. 598type PersistentVolumeClaimStatus struct { 599 // Phase represents the current phase of PersistentVolumeClaim. 600 // +optional 601 Phase PersistentVolumeClaimPhase `json:"phase,omitempty" protobuf:"bytes,1,opt,name=phase,casttype=PersistentVolumeClaimPhase"` 602 // AccessModes contains the actual access modes the volume backing the PVC has. 603 // More info: http://kubernetes.io/docs/user-guide/persistent-volumes#access-modes-1 604 // +optional 605 AccessModes []PersistentVolumeAccessMode `json:"accessModes,omitempty" protobuf:"bytes,2,rep,name=accessModes,casttype=PersistentVolumeAccessMode"` 606 // Represents the actual resources of the underlying volume. 607 // +optional 608 Capacity ResourceList `json:"capacity,omitempty" protobuf:"bytes,3,rep,name=capacity,casttype=ResourceList,castkey=ResourceName"` 609} 610 611type PersistentVolumeAccessMode string 612 613const ( 614 // can be mounted read/write mode to exactly 1 host 615 ReadWriteOnce PersistentVolumeAccessMode = "ReadWriteOnce" 616 // can be mounted in read-only mode to many hosts 617 ReadOnlyMany PersistentVolumeAccessMode = "ReadOnlyMany" 618 // can be mounted in read/write mode to many hosts 619 ReadWriteMany PersistentVolumeAccessMode = "ReadWriteMany" 620) 621 622type PersistentVolumePhase string 623 624const ( 625 // used for PersistentVolumes that are not available 626 VolumePending PersistentVolumePhase = "Pending" 627 // used for PersistentVolumes that are not yet bound 628 // Available volumes are held by the binder and matched to PersistentVolumeClaims 629 VolumeAvailable PersistentVolumePhase = "Available" 630 // used for PersistentVolumes that are bound 631 VolumeBound PersistentVolumePhase = "Bound" 632 // used for PersistentVolumes where the bound PersistentVolumeClaim was deleted 633 // released volumes must be recycled before becoming available again 634 // this phase is used by the persistent volume claim binder to signal to another process to reclaim the resource 635 VolumeReleased PersistentVolumePhase = "Released" 636 // used for PersistentVolumes that failed to be correctly recycled or deleted after being released from a claim 637 VolumeFailed PersistentVolumePhase = "Failed" 638) 639 640type PersistentVolumeClaimPhase string 641 642const ( 643 // used for PersistentVolumeClaims that are not yet bound 644 ClaimPending PersistentVolumeClaimPhase = "Pending" 645 // used for PersistentVolumeClaims that are bound 646 ClaimBound PersistentVolumeClaimPhase = "Bound" 647 // used for PersistentVolumeClaims that lost their underlying 648 // PersistentVolume. The claim was bound to a PersistentVolume and this 649 // volume does not exist any longer and all data on it was lost. 650 ClaimLost PersistentVolumeClaimPhase = "Lost" 651) 652 653// Represents a host path mapped into a pod. 654// Host path volumes do not support ownership management or SELinux relabeling. 655type HostPathVolumeSource struct { 656 // Path of the directory on the host. 657 // More info: http://kubernetes.io/docs/user-guide/volumes#hostpath 658 Path string `json:"path" protobuf:"bytes,1,opt,name=path"` 659} 660 661// Represents an empty directory for a pod. 662// Empty directory volumes support ownership management and SELinux relabeling. 663type EmptyDirVolumeSource struct { 664 // What type of storage medium should back this directory. 665 // The default is "" which means to use the node's default medium. 666 // Must be an empty string (default) or Memory. 667 // More info: http://kubernetes.io/docs/user-guide/volumes#emptydir 668 // +optional 669 Medium StorageMedium `json:"medium,omitempty" protobuf:"bytes,1,opt,name=medium,casttype=StorageMedium"` 670} 671 672// Represents a Glusterfs mount that lasts the lifetime of a pod. 673// Glusterfs volumes do not support ownership management or SELinux relabeling. 674type GlusterfsVolumeSource struct { 675 // EndpointsName is the endpoint name that details Glusterfs topology. 676 // More info: http://releases.k8s.io/HEAD/examples/volumes/glusterfs/README.md#create-a-pod 677 EndpointsName string `json:"endpoints" protobuf:"bytes,1,opt,name=endpoints"` 678 679 // Path is the Glusterfs volume path. 680 // More info: http://releases.k8s.io/HEAD/examples/volumes/glusterfs/README.md#create-a-pod 681 Path string `json:"path" protobuf:"bytes,2,opt,name=path"` 682 683 // ReadOnly here will force the Glusterfs volume to be mounted with read-only permissions. 684 // Defaults to false. 685 // More info: http://releases.k8s.io/HEAD/examples/volumes/glusterfs/README.md#create-a-pod 686 // +optional 687 ReadOnly bool `json:"readOnly,omitempty" protobuf:"varint,3,opt,name=readOnly"` 688} 689 690// Represents a Rados Block Device mount that lasts the lifetime of a pod. 691// RBD volumes support ownership management and SELinux relabeling. 692type RBDVolumeSource struct { 693 // A collection of Ceph monitors. 694 // More info: http://releases.k8s.io/HEAD/examples/volumes/rbd/README.md#how-to-use-it 695 CephMonitors []string `json:"monitors" protobuf:"bytes,1,rep,name=monitors"` 696 // The rados image name. 697 // More info: http://releases.k8s.io/HEAD/examples/volumes/rbd/README.md#how-to-use-it 698 RBDImage string `json:"image" protobuf:"bytes,2,opt,name=image"` 699 // Filesystem type of the volume that you want to mount. 700 // Tip: Ensure that the filesystem type is supported by the host operating system. 701 // Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. 702 // More info: http://kubernetes.io/docs/user-guide/volumes#rbd 703 // TODO: how do we prevent errors in the filesystem from compromising the machine 704 // +optional 705 FSType string `json:"fsType,omitempty" protobuf:"bytes,3,opt,name=fsType"` 706 // The rados pool name. 707 // Default is rbd. 708 // More info: http://releases.k8s.io/HEAD/examples/volumes/rbd/README.md#how-to-use-it. 709 // +optional 710 RBDPool string `json:"pool,omitempty" protobuf:"bytes,4,opt,name=pool"` 711 // The rados user name. 712 // Default is admin. 713 // More info: http://releases.k8s.io/HEAD/examples/volumes/rbd/README.md#how-to-use-it 714 // +optional 715 RadosUser string `json:"user,omitempty" protobuf:"bytes,5,opt,name=user"` 716 // Keyring is the path to key ring for RBDUser. 717 // Default is /etc/ceph/keyring. 718 // More info: http://releases.k8s.io/HEAD/examples/volumes/rbd/README.md#how-to-use-it 719 // +optional 720 Keyring string `json:"keyring,omitempty" protobuf:"bytes,6,opt,name=keyring"` 721 // SecretRef is name of the authentication secret for RBDUser. If provided 722 // overrides keyring. 723 // Default is nil. 724 // More info: http://releases.k8s.io/HEAD/examples/volumes/rbd/README.md#how-to-use-it 725 // +optional 726 SecretRef *LocalObjectReference `json:"secretRef,omitempty" protobuf:"bytes,7,opt,name=secretRef"` 727 // ReadOnly here will force the ReadOnly setting in VolumeMounts. 728 // Defaults to false. 729 // More info: http://releases.k8s.io/HEAD/examples/volumes/rbd/README.md#how-to-use-it 730 // +optional 731 ReadOnly bool `json:"readOnly,omitempty" protobuf:"varint,8,opt,name=readOnly"` 732} 733 734// Represents a cinder volume resource in Openstack. 735// A Cinder volume must exist before mounting to a container. 736// The volume must also be in the same region as the kubelet. 737// Cinder volumes support ownership management and SELinux relabeling. 738type CinderVolumeSource struct { 739 // volume id used to identify the volume in cinder 740 // More info: http://releases.k8s.io/HEAD/examples/mysql-cinder-pd/README.md 741 VolumeID string `json:"volumeID" protobuf:"bytes,1,opt,name=volumeID"` 742 // Filesystem type to mount. 743 // Must be a filesystem type supported by the host operating system. 744 // Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. 745 // More info: http://releases.k8s.io/HEAD/examples/mysql-cinder-pd/README.md 746 // +optional 747 FSType string `json:"fsType,omitempty" protobuf:"bytes,2,opt,name=fsType"` 748 // Optional: Defaults to false (read/write). ReadOnly here will force 749 // the ReadOnly setting in VolumeMounts. 750 // More info: http://releases.k8s.io/HEAD/examples/mysql-cinder-pd/README.md 751 // +optional 752 ReadOnly bool `json:"readOnly,omitempty" protobuf:"varint,3,opt,name=readOnly"` 753} 754 755// Represents a Ceph Filesystem mount that lasts the lifetime of a pod 756// Cephfs volumes do not support ownership management or SELinux relabeling. 757type CephFSVolumeSource struct { 758 // Required: Monitors is a collection of Ceph monitors 759 // More info: http://releases.k8s.io/HEAD/examples/volumes/cephfs/README.md#how-to-use-it 760 Monitors []string `json:"monitors" protobuf:"bytes,1,rep,name=monitors"` 761 // Optional: Used as the mounted root, rather than the full Ceph tree, default is / 762 // +optional 763 Path string `json:"path,omitempty" protobuf:"bytes,2,opt,name=path"` 764 // Optional: User is the rados user name, default is admin 765 // More info: http://releases.k8s.io/HEAD/examples/volumes/cephfs/README.md#how-to-use-it 766 // +optional 767 User string `json:"user,omitempty" protobuf:"bytes,3,opt,name=user"` 768 // Optional: SecretFile is the path to key ring for User, default is /etc/ceph/user.secret 769 // More info: http://releases.k8s.io/HEAD/examples/volumes/cephfs/README.md#how-to-use-it 770 // +optional 771 SecretFile string `json:"secretFile,omitempty" protobuf:"bytes,4,opt,name=secretFile"` 772 // Optional: SecretRef is reference to the authentication secret for User, default is empty. 773 // More info: http://releases.k8s.io/HEAD/examples/volumes/cephfs/README.md#how-to-use-it 774 // +optional 775 SecretRef *LocalObjectReference `json:"secretRef,omitempty" protobuf:"bytes,5,opt,name=secretRef"` 776 // Optional: Defaults to false (read/write). ReadOnly here will force 777 // the ReadOnly setting in VolumeMounts. 778 // More info: http://releases.k8s.io/HEAD/examples/volumes/cephfs/README.md#how-to-use-it 779 // +optional 780 ReadOnly bool `json:"readOnly,omitempty" protobuf:"varint,6,opt,name=readOnly"` 781} 782 783// Represents a Flocker volume mounted by the Flocker agent. 784// One and only one of datasetName and datasetUUID should be set. 785// Flocker volumes do not support ownership management or SELinux relabeling. 786type FlockerVolumeSource struct { 787 // Name of the dataset stored as metadata -> name on the dataset for Flocker 788 // should be considered as deprecated 789 // +optional 790 DatasetName string `json:"datasetName,omitempty" protobuf:"bytes,1,opt,name=datasetName"` 791 // UUID of the dataset. This is unique identifier of a Flocker dataset 792 // +optional 793 DatasetUUID string `json:"datasetUUID,omitempty" protobuf:"bytes,2,opt,name=datasetUUID"` 794} 795 796// StorageMedium defines ways that storage can be allocated to a volume. 797type StorageMedium string 798 799const ( 800 StorageMediumDefault StorageMedium = "" // use whatever the default is for the node 801 StorageMediumMemory StorageMedium = "Memory" // use memory (tmpfs) 802) 803 804// Protocol defines network protocols supported for things like container ports. 805type Protocol string 806 807const ( 808 // ProtocolTCP is the TCP protocol. 809 ProtocolTCP Protocol = "TCP" 810 // ProtocolUDP is the UDP protocol. 811 ProtocolUDP Protocol = "UDP" 812) 813 814// Represents a Persistent Disk resource in Google Compute Engine. 815// 816// A GCE PD must exist before mounting to a container. The disk must 817// also be in the same GCE project and zone as the kubelet. A GCE PD 818// can only be mounted as read/write once or read-only many times. GCE 819// PDs support ownership management and SELinux relabeling. 820type GCEPersistentDiskVolumeSource struct { 821 // Unique name of the PD resource in GCE. Used to identify the disk in GCE. 822 // More info: http://kubernetes.io/docs/user-guide/volumes#gcepersistentdisk 823 PDName string `json:"pdName" protobuf:"bytes,1,opt,name=pdName"` 824 // Filesystem type of the volume that you want to mount. 825 // Tip: Ensure that the filesystem type is supported by the host operating system. 826 // Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. 827 // More info: http://kubernetes.io/docs/user-guide/volumes#gcepersistentdisk 828 // TODO: how do we prevent errors in the filesystem from compromising the machine 829 // +optional 830 FSType string `json:"fsType,omitempty" protobuf:"bytes,2,opt,name=fsType"` 831 // The partition in the volume that you want to mount. 832 // If omitted, the default is to mount by volume name. 833 // Examples: For volume /dev/sda1, you specify the partition as "1". 834 // Similarly, the volume partition for /dev/sda is "0" (or you can leave the property empty). 835 // More info: http://kubernetes.io/docs/user-guide/volumes#gcepersistentdisk 836 // +optional 837 Partition int32 `json:"partition,omitempty" protobuf:"varint,3,opt,name=partition"` 838 // ReadOnly here will force the ReadOnly setting in VolumeMounts. 839 // Defaults to false. 840 // More info: http://kubernetes.io/docs/user-guide/volumes#gcepersistentdisk 841 // +optional 842 ReadOnly bool `json:"readOnly,omitempty" protobuf:"varint,4,opt,name=readOnly"` 843} 844 845// Represents a Quobyte mount that lasts the lifetime of a pod. 846// Quobyte volumes do not support ownership management or SELinux relabeling. 847type QuobyteVolumeSource struct { 848 // Registry represents a single or multiple Quobyte Registry services 849 // specified as a string as host:port pair (multiple entries are separated with commas) 850 // which acts as the central registry for volumes 851 Registry string `json:"registry" protobuf:"bytes,1,opt,name=registry"` 852 853 // Volume is a string that references an already created Quobyte volume by name. 854 Volume string `json:"volume" protobuf:"bytes,2,opt,name=volume"` 855 856 // ReadOnly here will force the Quobyte volume to be mounted with read-only permissions. 857 // Defaults to false. 858 // +optional 859 ReadOnly bool `json:"readOnly,omitempty" protobuf:"varint,3,opt,name=readOnly"` 860 861 // User to map volume access to 862 // Defaults to serivceaccount user 863 // +optional 864 User string `json:"user,omitempty" protobuf:"bytes,4,opt,name=user"` 865 866 // Group to map volume access to 867 // Default is no group 868 // +optional 869 Group string `json:"group,omitempty" protobuf:"bytes,5,opt,name=group"` 870} 871 872// FlexVolume represents a generic volume resource that is 873// provisioned/attached using an exec based plugin. This is an alpha feature and may change in future. 874type FlexVolumeSource struct { 875 // Driver is the name of the driver to use for this volume. 876 Driver string `json:"driver" protobuf:"bytes,1,opt,name=driver"` 877 // Filesystem type to mount. 878 // Must be a filesystem type supported by the host operating system. 879 // Ex. "ext4", "xfs", "ntfs". The default filesystem depends on FlexVolume script. 880 // +optional 881 FSType string `json:"fsType,omitempty" protobuf:"bytes,2,opt,name=fsType"` 882 // Optional: SecretRef is reference to the secret object containing 883 // sensitive information to pass to the plugin scripts. This may be 884 // empty if no secret object is specified. If the secret object 885 // contains more than one secret, all secrets are passed to the plugin 886 // scripts. 887 // +optional 888 SecretRef *LocalObjectReference `json:"secretRef,omitempty" protobuf:"bytes,3,opt,name=secretRef"` 889 // Optional: Defaults to false (read/write). ReadOnly here will force 890 // the ReadOnly setting in VolumeMounts. 891 // +optional 892 ReadOnly bool `json:"readOnly,omitempty" protobuf:"varint,4,opt,name=readOnly"` 893 // Optional: Extra command options if any. 894 // +optional 895 Options map[string]string `json:"options,omitempty" protobuf:"bytes,5,rep,name=options"` 896} 897 898// Represents a Persistent Disk resource in AWS. 899// 900// An AWS EBS disk must exist before mounting to a container. The disk 901// must also be in the same AWS zone as the kubelet. An AWS EBS disk 902// can only be mounted as read/write once. AWS EBS volumes support 903// ownership management and SELinux relabeling. 904type AWSElasticBlockStoreVolumeSource struct { 905 // Unique ID of the persistent disk resource in AWS (Amazon EBS volume). 906 // More info: http://kubernetes.io/docs/user-guide/volumes#awselasticblockstore 907 VolumeID string `json:"volumeID" protobuf:"bytes,1,opt,name=volumeID"` 908 // Filesystem type of the volume that you want to mount. 909 // Tip: Ensure that the filesystem type is supported by the host operating system. 910 // Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. 911 // More info: http://kubernetes.io/docs/user-guide/volumes#awselasticblockstore 912 // TODO: how do we prevent errors in the filesystem from compromising the machine 913 // +optional 914 FSType string `json:"fsType,omitempty" protobuf:"bytes,2,opt,name=fsType"` 915 // The partition in the volume that you want to mount. 916 // If omitted, the default is to mount by volume name. 917 // Examples: For volume /dev/sda1, you specify the partition as "1". 918 // Similarly, the volume partition for /dev/sda is "0" (or you can leave the property empty). 919 // +optional 920 Partition int32 `json:"partition,omitempty" protobuf:"varint,3,opt,name=partition"` 921 // Specify "true" to force and set the ReadOnly property in VolumeMounts to "true". 922 // If omitted, the default is "false". 923 // More info: http://kubernetes.io/docs/user-guide/volumes#awselasticblockstore 924 // +optional 925 ReadOnly bool `json:"readOnly,omitempty" protobuf:"varint,4,opt,name=readOnly"` 926} 927 928// Represents a volume that is populated with the contents of a git repository. 929// Git repo volumes do not support ownership management. 930// Git repo volumes support SELinux relabeling. 931type GitRepoVolumeSource struct { 932 // Repository URL 933 Repository string `json:"repository" protobuf:"bytes,1,opt,name=repository"` 934 // Commit hash for the specified revision. 935 // +optional 936 Revision string `json:"revision,omitempty" protobuf:"bytes,2,opt,name=revision"` 937 // Target directory name. 938 // Must not contain or start with '..'. If '.' is supplied, the volume directory will be the 939 // git repository. Otherwise, if specified, the volume will contain the git repository in 940 // the subdirectory with the given name. 941 // +optional 942 Directory string `json:"directory,omitempty" protobuf:"bytes,3,opt,name=directory"` 943} 944 945// Adapts a Secret into a volume. 946// 947// The contents of the target Secret's Data field will be presented in a volume 948// as files using the keys in the Data field as the file names. 949// Secret volumes support ownership management and SELinux relabeling. 950type SecretVolumeSource struct { 951 // Name of the secret in the pod's namespace to use. 952 // More info: http://kubernetes.io/docs/user-guide/volumes#secrets 953 // +optional 954 SecretName string `json:"secretName,omitempty" protobuf:"bytes,1,opt,name=secretName"` 955 // If unspecified, each key-value pair in the Data field of the referenced 956 // Secret will be projected into the volume as a file whose name is the 957 // key and content is the value. If specified, the listed keys will be 958 // projected into the specified paths, and unlisted keys will not be 959 // present. If a key is specified which is not present in the Secret, 960 // the volume setup will error unless it is marked optional. Paths must be 961 // relative and may not contain the '..' path or start with '..'. 962 // +optional 963 Items []KeyToPath `json:"items,omitempty" protobuf:"bytes,2,rep,name=items"` 964 // Optional: mode bits to use on created files by default. Must be a 965 // value between 0 and 0777. Defaults to 0644. 966 // Directories within the path are not affected by this setting. 967 // This might be in conflict with other options that affect the file 968 // mode, like fsGroup, and the result can be other mode bits set. 969 // +optional 970 DefaultMode *int32 `json:"defaultMode,omitempty" protobuf:"bytes,3,opt,name=defaultMode"` 971 // Specify whether the Secret or it's keys must be defined 972 // +optional 973 Optional *bool `json:"optional,omitempty" protobuf:"varint,4,opt,name=optional"` 974} 975 976const ( 977 SecretVolumeSourceDefaultMode int32 = 0644 978) 979 980// Adapts a secret into a projected volume. 981// 982// The contents of the target Secret's Data field will be presented in a 983// projected volume as files using the keys in the Data field as the file names. 984// Note that this is identical to a secret volume source without the default 985// mode. 986type SecretProjection struct { 987 LocalObjectReference `json:",inline" protobuf:"bytes,1,opt,name=localObjectReference"` 988 // If unspecified, each key-value pair in the Data field of the referenced 989 // Secret will be projected into the volume as a file whose name is the 990 // key and content is the value. If specified, the listed keys will be 991 // projected into the specified paths, and unlisted keys will not be 992 // present. If a key is specified which is not present in the Secret, 993 // the volume setup will error unless it is marked optional. Paths must be 994 // relative and may not contain the '..' path or start with '..'. 995 // +optional 996 Items []KeyToPath `json:"items,omitempty" protobuf:"bytes,2,rep,name=items"` 997 // Specify whether the Secret or its key must be defined 998 // +optional 999 Optional *bool `json:"optional,omitempty" protobuf:"varint,4,opt,name=optional"` 1000} 1001 1002// Represents an NFS mount that lasts the lifetime of a pod. 1003// NFS volumes do not support ownership management or SELinux relabeling. 1004type NFSVolumeSource struct { 1005 // Server is the hostname or IP address of the NFS server. 1006 // More info: http://kubernetes.io/docs/user-guide/volumes#nfs 1007 Server string `json:"server" protobuf:"bytes,1,opt,name=server"` 1008 1009 // Path that is exported by the NFS server. 1010 // More info: http://kubernetes.io/docs/user-guide/volumes#nfs 1011 Path string `json:"path" protobuf:"bytes,2,opt,name=path"` 1012 1013 // ReadOnly here will force 1014 // the NFS export to be mounted with read-only permissions. 1015 // Defaults to false. 1016 // More info: http://kubernetes.io/docs/user-guide/volumes#nfs 1017 // +optional 1018 ReadOnly bool `json:"readOnly,omitempty" protobuf:"varint,3,opt,name=readOnly"` 1019} 1020 1021// Represents an ISCSI disk. 1022// ISCSI volumes can only be mounted as read/write once. 1023// ISCSI volumes support ownership management and SELinux relabeling. 1024type ISCSIVolumeSource struct { 1025 // iSCSI target portal. The portal is either an IP or ip_addr:port if the port 1026 // is other than default (typically TCP ports 860 and 3260). 1027 TargetPortal string `json:"targetPortal" protobuf:"bytes,1,opt,name=targetPortal"` 1028 // Target iSCSI Qualified Name. 1029 IQN string `json:"iqn" protobuf:"bytes,2,opt,name=iqn"` 1030 // iSCSI target lun number. 1031 Lun int32 `json:"lun" protobuf:"varint,3,opt,name=lun"` 1032 // Optional: Defaults to 'default' (tcp). iSCSI interface name that uses an iSCSI transport. 1033 // +optional 1034 ISCSIInterface string `json:"iscsiInterface,omitempty" protobuf:"bytes,4,opt,name=iscsiInterface"` 1035 // Filesystem type of the volume that you want to mount. 1036 // Tip: Ensure that the filesystem type is supported by the host operating system. 1037 // Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. 1038 // More info: http://kubernetes.io/docs/user-guide/volumes#iscsi 1039 // TODO: how do we prevent errors in the filesystem from compromising the machine 1040 // +optional 1041 FSType string `json:"fsType,omitempty" protobuf:"bytes,5,opt,name=fsType"` 1042 // ReadOnly here will force the ReadOnly setting in VolumeMounts. 1043 // Defaults to false. 1044 // +optional 1045 ReadOnly bool `json:"readOnly,omitempty" protobuf:"varint,6,opt,name=readOnly"` 1046 // iSCSI target portal List. The portal is either an IP or ip_addr:port if the port 1047 // is other than default (typically TCP ports 860 and 3260). 1048 // +optional 1049 Portals []string `json:"portals,omitempty" protobuf:"bytes,7,opt,name=portals"` 1050} 1051 1052// Represents a Fibre Channel volume. 1053// Fibre Channel volumes can only be mounted as read/write once. 1054// Fibre Channel volumes support ownership management and SELinux relabeling. 1055type FCVolumeSource struct { 1056 // Required: FC target worldwide names (WWNs) 1057 TargetWWNs []string `json:"targetWWNs" protobuf:"bytes,1,rep,name=targetWWNs"` 1058 // Required: FC target lun number 1059 Lun *int32 `json:"lun" protobuf:"varint,2,opt,name=lun"` 1060 // Filesystem type to mount. 1061 // Must be a filesystem type supported by the host operating system. 1062 // Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. 1063 // TODO: how do we prevent errors in the filesystem from compromising the machine 1064 // +optional 1065 FSType string `json:"fsType,omitempty" protobuf:"bytes,3,opt,name=fsType"` 1066 // Optional: Defaults to false (read/write). ReadOnly here will force 1067 // the ReadOnly setting in VolumeMounts. 1068 // +optional 1069 ReadOnly bool `json:"readOnly,omitempty" protobuf:"varint,4,opt,name=readOnly"` 1070} 1071 1072// AzureFile represents an Azure File Service mount on the host and bind mount to the pod. 1073type AzureFileVolumeSource struct { 1074 // the name of secret that contains Azure Storage Account Name and Key 1075 SecretName string `json:"secretName" protobuf:"bytes,1,opt,name=secretName"` 1076 // Share Name 1077 ShareName string `json:"shareName" protobuf:"bytes,2,opt,name=shareName"` 1078 // Defaults to false (read/write). ReadOnly here will force 1079 // the ReadOnly setting in VolumeMounts. 1080 // +optional 1081 ReadOnly bool `json:"readOnly,omitempty" protobuf:"varint,3,opt,name=readOnly"` 1082} 1083 1084// Represents a vSphere volume resource. 1085type VsphereVirtualDiskVolumeSource struct { 1086 // Path that identifies vSphere volume vmdk 1087 VolumePath string `json:"volumePath" protobuf:"bytes,1,opt,name=volumePath"` 1088 // Filesystem type to mount. 1089 // Must be a filesystem type supported by the host operating system. 1090 // Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. 1091 // +optional 1092 FSType string `json:"fsType,omitempty" protobuf:"bytes,2,opt,name=fsType"` 1093} 1094 1095// Represents a Photon Controller persistent disk resource. 1096type PhotonPersistentDiskVolumeSource struct { 1097 // ID that identifies Photon Controller persistent disk 1098 PdID string `json:"pdID" protobuf:"bytes,1,opt,name=pdID"` 1099 // Filesystem type to mount. 1100 // Must be a filesystem type supported by the host operating system. 1101 // Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. 1102 FSType string `json:"fsType,omitempty" protobuf:"bytes,2,opt,name=fsType"` 1103} 1104 1105type AzureDataDiskCachingMode string 1106 1107const ( 1108 AzureDataDiskCachingNone AzureDataDiskCachingMode = "None" 1109 AzureDataDiskCachingReadOnly AzureDataDiskCachingMode = "ReadOnly" 1110 AzureDataDiskCachingReadWrite AzureDataDiskCachingMode = "ReadWrite" 1111) 1112 1113// AzureDisk represents an Azure Data Disk mount on the host and bind mount to the pod. 1114type AzureDiskVolumeSource struct { 1115 // The Name of the data disk in the blob storage 1116 DiskName string `json:"diskName" protobuf:"bytes,1,opt,name=diskName"` 1117 // The URI the data disk in the blob storage 1118 DataDiskURI string `json:"diskURI" protobuf:"bytes,2,opt,name=diskURI"` 1119 // Host Caching mode: None, Read Only, Read Write. 1120 // +optional 1121 CachingMode *AzureDataDiskCachingMode `json:"cachingMode,omitempty" protobuf:"bytes,3,opt,name=cachingMode,casttype=AzureDataDiskCachingMode"` 1122 // Filesystem type to mount. 1123 // Must be a filesystem type supported by the host operating system. 1124 // Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. 1125 // +optional 1126 FSType *string `json:"fsType,omitempty" protobuf:"bytes,4,opt,name=fsType"` 1127 // Defaults to false (read/write). ReadOnly here will force 1128 // the ReadOnly setting in VolumeMounts. 1129 // +optional 1130 ReadOnly *bool `json:"readOnly,omitempty" protobuf:"varint,5,opt,name=readOnly"` 1131} 1132 1133// PortworxVolumeSource represents a Portworx volume resource. 1134type PortworxVolumeSource struct { 1135 // VolumeID uniquely identifies a Portworx volume 1136 VolumeID string `json:"volumeID" protobuf:"bytes,1,opt,name=volumeID"` 1137 // FSType represents the filesystem type to mount 1138 // Must be a filesystem type supported by the host operating system. 1139 // Ex. "ext4", "xfs". Implicitly inferred to be "ext4" if unspecified. 1140 FSType string `json:"fsType,omitempty" protobuf:"bytes,2,opt,name=fsType"` 1141 // Defaults to false (read/write). ReadOnly here will force 1142 // the ReadOnly setting in VolumeMounts. 1143 // +optional 1144 ReadOnly bool `json:"readOnly,omitempty" protobuf:"varint,3,opt,name=readOnly"` 1145} 1146 1147// ScaleIOVolumeSource represents a persistent ScaleIO volume 1148type ScaleIOVolumeSource struct { 1149 // The host address of the ScaleIO API Gateway. 1150 Gateway string `json:"gateway" protobuf:"bytes,1,opt,name=gateway"` 1151 // The name of the storage system as configured in ScaleIO. 1152 System string `json:"system" protobuf:"bytes,2,opt,name=system"` 1153 // SecretRef references to the secret for ScaleIO user and other 1154 // sensitive information. If this is not provided, Login operation will fail. 1155 SecretRef *LocalObjectReference `json:"secretRef" protobuf:"bytes,3,opt,name=secretRef"` 1156 // Flag to enable/disable SSL communication with Gateway, default false 1157 // +optional 1158 SSLEnabled bool `json:"sslEnabled,omitempty" protobuf:"varint,4,opt,name=sslEnabled"` 1159 // The name of the Protection Domain for the configured storage (defaults to "default"). 1160 // +optional 1161 ProtectionDomain string `json:"protectionDomain,omitempty" protobuf:"bytes,5,opt,name=protectionDomain"` 1162 // The Storage Pool associated with the protection domain (defaults to "default"). 1163 // +optional 1164 StoragePool string `json:"storagePool,omitempty" protobuf:"bytes,6,opt,name=storagePool"` 1165 // Indicates whether the storage for a volume should be thick or thin (defaults to "thin"). 1166 // +optional 1167 StorageMode string `json:"storageMode,omitempty" protobuf:"bytes,7,opt,name=storageMode"` 1168 // The name of a volume already created in the ScaleIO system 1169 // that is associated with this volume source. 1170 VolumeName string `json:"volumeName,omitempty" protobuf:"bytes,8,opt,name=volumeName"` 1171 // Filesystem type to mount. 1172 // Must be a filesystem type supported by the host operating system. 1173 // Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. 1174 // +optional 1175 FSType string `json:"fsType,omitempty" protobuf:"bytes,9,opt,name=fsType"` 1176 // Defaults to false (read/write). ReadOnly here will force 1177 // the ReadOnly setting in VolumeMounts. 1178 // +optional 1179 ReadOnly bool `json:"readOnly,omitempty" protobuf:"varint,10,opt,name=readOnly"` 1180} 1181 1182// Adapts a ConfigMap into a volume. 1183// 1184// The contents of the target ConfigMap's Data field will be presented in a 1185// volume as files using the keys in the Data field as the file names, unless 1186// the items element is populated with specific mappings of keys to paths. 1187// ConfigMap volumes support ownership management and SELinux relabeling. 1188type ConfigMapVolumeSource struct { 1189 LocalObjectReference `json:",inline" protobuf:"bytes,1,opt,name=localObjectReference"` 1190 // If unspecified, each key-value pair in the Data field of the referenced 1191 // ConfigMap will be projected into the volume as a file whose name is the 1192 // key and content is the value. If specified, the listed keys will be 1193 // projected into the specified paths, and unlisted keys will not be 1194 // present. If a key is specified which is not present in the ConfigMap, 1195 // the volume setup will error unless it is marked optional. Paths must be 1196 // relative and may not contain the '..' path or start with '..'. 1197 // +optional 1198 Items []KeyToPath `json:"items,omitempty" protobuf:"bytes,2,rep,name=items"` 1199 // Optional: mode bits to use on created files by default. Must be a 1200 // value between 0 and 0777. Defaults to 0644. 1201 // Directories within the path are not affected by this setting. 1202 // This might be in conflict with other options that affect the file 1203 // mode, like fsGroup, and the result can be other mode bits set. 1204 // +optional 1205 DefaultMode *int32 `json:"defaultMode,omitempty" protobuf:"varint,3,opt,name=defaultMode"` 1206 // Specify whether the ConfigMap or it's keys must be defined 1207 // +optional 1208 Optional *bool `json:"optional,omitempty" protobuf:"varint,4,opt,name=optional"` 1209} 1210 1211const ( 1212 ConfigMapVolumeSourceDefaultMode int32 = 0644 1213) 1214 1215// Adapts a ConfigMap into a projected volume. 1216// 1217// The contents of the target ConfigMap's Data field will be presented in a 1218// projected volume as files using the keys in the Data field as the file names, 1219// unless the items element is populated with specific mappings of keys to paths. 1220// Note that this is identical to a configmap volume source without the default 1221// mode. 1222type ConfigMapProjection struct { 1223 LocalObjectReference `json:",inline" protobuf:"bytes,1,opt,name=localObjectReference"` 1224 // If unspecified, each key-value pair in the Data field of the referenced 1225 // ConfigMap will be projected into the volume as a file whose name is the 1226 // key and content is the value. If specified, the listed keys will be 1227 // projected into the specified paths, and unlisted keys will not be 1228 // present. If a key is specified which is not present in the ConfigMap, 1229 // the volume setup will error unless it is marked optional. Paths must be 1230 // relative and may not contain the '..' path or start with '..'. 1231 // +optional 1232 Items []KeyToPath `json:"items,omitempty" protobuf:"bytes,2,rep,name=items"` 1233 // Specify whether the ConfigMap or it's keys must be defined 1234 // +optional 1235 Optional *bool `json:"optional,omitempty" protobuf:"varint,4,opt,name=optional"` 1236} 1237 1238// Represents a projected volume source 1239type ProjectedVolumeSource struct { 1240 // list of volume projections 1241 Sources []VolumeProjection `json:"sources" protobuf:"bytes,1,rep,name=sources"` 1242 // Mode bits to use on created files by default. Must be a value between 1243 // 0 and 0777. 1244 // Directories within the path are not affected by this setting. 1245 // This might be in conflict with other options that affect the file 1246 // mode, like fsGroup, and the result can be other mode bits set. 1247 // +optional 1248 DefaultMode *int32 `json:"defaultMode,omitempty" protobuf:"varint,2,opt,name=defaultMode"` 1249} 1250 1251// Projection that may be projected along with other supported volume types 1252type VolumeProjection struct { 1253 // all types below are the supported types for projection into the same volume 1254 1255 // information about the secret data to project 1256 Secret *SecretProjection `json:"secret,omitempty" protobuf:"bytes,1,opt,name=secret"` 1257 // information about the downwardAPI data to project 1258 DownwardAPI *DownwardAPIProjection `json:"downwardAPI,omitempty" protobuf:"bytes,2,opt,name=downwardAPI"` 1259 // information about the configMap data to project 1260 ConfigMap *ConfigMapProjection `json:"configMap,omitempty" protobuf:"bytes,3,opt,name=configMap"` 1261} 1262 1263const ( 1264 ProjectedVolumeSourceDefaultMode int32 = 0644 1265) 1266 1267// Maps a string key to a path within a volume. 1268type KeyToPath struct { 1269 // The key to project. 1270 Key string `json:"key" protobuf:"bytes,1,opt,name=key"` 1271 1272 // The relative path of the file to map the key to. 1273 // May not be an absolute path. 1274 // May not contain the path element '..'. 1275 // May not start with the string '..'. 1276 Path string `json:"path" protobuf:"bytes,2,opt,name=path"` 1277 // Optional: mode bits to use on this file, must be a value between 0 1278 // and 0777. If not specified, the volume defaultMode will be used. 1279 // This might be in conflict with other options that affect the file 1280 // mode, like fsGroup, and the result can be other mode bits set. 1281 // +optional 1282 Mode *int32 `json:"mode,omitempty" protobuf:"varint,3,opt,name=mode"` 1283} 1284 1285// ContainerPort represents a network port in a single container. 1286type ContainerPort struct { 1287 // If specified, this must be an IANA_SVC_NAME and unique within the pod. Each 1288 // named port in a pod must have a unique name. Name for the port that can be 1289 // referred to by services. 1290 // +optional 1291 Name string `json:"name,omitempty" protobuf:"bytes,1,opt,name=name"` 1292 // Number of port to expose on the host. 1293 // If specified, this must be a valid port number, 0 < x < 65536. 1294 // If HostNetwork is specified, this must match ContainerPort. 1295 // Most containers do not need this. 1296 // +optional 1297 HostPort int32 `json:"hostPort,omitempty" protobuf:"varint,2,opt,name=hostPort"` 1298 // Number of port to expose on the pod's IP address. 1299 // This must be a valid port number, 0 < x < 65536. 1300 ContainerPort int32 `json:"containerPort" protobuf:"varint,3,opt,name=containerPort"` 1301 // Protocol for port. Must be UDP or TCP. 1302 // Defaults to "TCP". 1303 // +optional 1304 Protocol Protocol `json:"protocol,omitempty" protobuf:"bytes,4,opt,name=protocol,casttype=Protocol"` 1305 // What host IP to bind the external port to. 1306 // +optional 1307 HostIP string `json:"hostIP,omitempty" protobuf:"bytes,5,opt,name=hostIP"` 1308} 1309 1310// VolumeMount describes a mounting of a Volume within a container. 1311type VolumeMount struct { 1312 // This must match the Name of a Volume. 1313 Name string `json:"name" protobuf:"bytes,1,opt,name=name"` 1314 // Mounted read-only if true, read-write otherwise (false or unspecified). 1315 // Defaults to false. 1316 // +optional 1317 ReadOnly bool `json:"readOnly,omitempty" protobuf:"varint,2,opt,name=readOnly"` 1318 // Path within the container at which the volume should be mounted. Must 1319 // not contain ':'. 1320 MountPath string `json:"mountPath" protobuf:"bytes,3,opt,name=mountPath"` 1321 // Path within the volume from which the container's volume should be mounted. 1322 // Defaults to "" (volume's root). 1323 // +optional 1324 SubPath string `json:"subPath,omitempty" protobuf:"bytes,4,opt,name=subPath"` 1325} 1326 1327// EnvVar represents an environment variable present in a Container. 1328type EnvVar struct { 1329 // Name of the environment variable. Must be a C_IDENTIFIER. 1330 Name string `json:"name" protobuf:"bytes,1,opt,name=name"` 1331 1332 // Optional: no more than one of the following may be specified. 1333 1334 // Variable references $(VAR_NAME) are expanded 1335 // using the previous defined environment variables in the container and 1336 // any service environment variables. If a variable cannot be resolved, 1337 // the reference in the input string will be unchanged. The $(VAR_NAME) 1338 // syntax can be escaped with a double $$, ie: $$(VAR_NAME). Escaped 1339 // references will never be expanded, regardless of whether the variable 1340 // exists or not. 1341 // Defaults to "". 1342 // +optional 1343 Value string `json:"value,omitempty" protobuf:"bytes,2,opt,name=value"` 1344 // Source for the environment variable's value. Cannot be used if value is not empty. 1345 // +optional 1346 ValueFrom *EnvVarSource `json:"valueFrom,omitempty" protobuf:"bytes,3,opt,name=valueFrom"` 1347} 1348 1349// EnvVarSource represents a source for the value of an EnvVar. 1350type EnvVarSource struct { 1351 // Selects a field of the pod: supports metadata.name, metadata.namespace, metadata.labels, metadata.annotations, 1352 // spec.nodeName, spec.serviceAccountName, status.podIP. 1353 // +optional 1354 FieldRef *ObjectFieldSelector `json:"fieldRef,omitempty" protobuf:"bytes,1,opt,name=fieldRef"` 1355 // Selects a resource of the container: only resources limits and requests 1356 // (limits.cpu, limits.memory, requests.cpu and requests.memory) are currently supported. 1357 // +optional 1358 ResourceFieldRef *ResourceFieldSelector `json:"resourceFieldRef,omitempty" protobuf:"bytes,2,opt,name=resourceFieldRef"` 1359 // Selects a key of a ConfigMap. 1360 // +optional 1361 ConfigMapKeyRef *ConfigMapKeySelector `json:"configMapKeyRef,omitempty" protobuf:"bytes,3,opt,name=configMapKeyRef"` 1362 // Selects a key of a secret in the pod's namespace 1363 // +optional 1364 SecretKeyRef *SecretKeySelector `json:"secretKeyRef,omitempty" protobuf:"bytes,4,opt,name=secretKeyRef"` 1365} 1366 1367// ObjectFieldSelector selects an APIVersioned field of an object. 1368type ObjectFieldSelector struct { 1369 // Version of the schema the FieldPath is written in terms of, defaults to "v1". 1370 // +optional 1371 APIVersion string `json:"apiVersion,omitempty" protobuf:"bytes,1,opt,name=apiVersion"` 1372 // Path of the field to select in the specified API version. 1373 FieldPath string `json:"fieldPath" protobuf:"bytes,2,opt,name=fieldPath"` 1374} 1375 1376// ResourceFieldSelector represents container resources (cpu, memory) and their output format 1377type ResourceFieldSelector struct { 1378 // Container name: required for volumes, optional for env vars 1379 // +optional 1380 ContainerName string `json:"containerName,omitempty" protobuf:"bytes,1,opt,name=containerName"` 1381 // Required: resource to select 1382 Resource string `json:"resource" protobuf:"bytes,2,opt,name=resource"` 1383 // Specifies the output format of the exposed resources, defaults to "1" 1384 // +optional 1385 Divisor resource.Quantity `json:"divisor,omitempty" protobuf:"bytes,3,opt,name=divisor"` 1386} 1387 1388// Selects a key from a ConfigMap. 1389type ConfigMapKeySelector struct { 1390 // The ConfigMap to select from. 1391 LocalObjectReference `json:",inline" protobuf:"bytes,1,opt,name=localObjectReference"` 1392 // The key to select. 1393 Key string `json:"key" protobuf:"bytes,2,opt,name=key"` 1394 // Specify whether the ConfigMap or it's key must be defined 1395 // +optional 1396 Optional *bool `json:"optional,omitempty" protobuf:"varint,3,opt,name=optional"` 1397} 1398 1399// SecretKeySelector selects a key of a Secret. 1400type SecretKeySelector struct { 1401 // The name of the secret in the pod's namespace to select from. 1402 LocalObjectReference `json:",inline" protobuf:"bytes,1,opt,name=localObjectReference"` 1403 // The key of the secret to select from. Must be a valid secret key. 1404 Key string `json:"key" protobuf:"bytes,2,opt,name=key"` 1405 // Specify whether the Secret or it's key must be defined 1406 // +optional 1407 Optional *bool `json:"optional,omitempty" protobuf:"varint,3,opt,name=optional"` 1408} 1409 1410// EnvFromSource represents the source of a set of ConfigMaps 1411type EnvFromSource struct { 1412 // An optional identifer to prepend to each key in the ConfigMap. Must be a C_IDENTIFIER. 1413 // +optional 1414 Prefix string `json:"prefix,omitempty" protobuf:"bytes,1,opt,name=prefix"` 1415 // The ConfigMap to select from 1416 // +optional 1417 ConfigMapRef *ConfigMapEnvSource `json:"configMapRef,omitempty" protobuf:"bytes,2,opt,name=configMapRef"` 1418 // The Secret to select from 1419 // +optional 1420 SecretRef *SecretEnvSource `json:"secretRef,omitempty" protobuf:"bytes,3,opt,name=secretRef"` 1421} 1422 1423// ConfigMapEnvSource selects a ConfigMap to populate the environment 1424// variables with. 1425// 1426// The contents of the target ConfigMap's Data field will represent the 1427// key-value pairs as environment variables. 1428type ConfigMapEnvSource struct { 1429 // The ConfigMap to select from. 1430 LocalObjectReference `json:",inline" protobuf:"bytes,1,opt,name=localObjectReference"` 1431 // Specify whether the ConfigMap must be defined 1432 // +optional 1433 Optional *bool `json:"optional,omitempty" protobuf:"varint,2,opt,name=optional"` 1434} 1435 1436// SecretEnvSource selects a Secret to populate the environment 1437// variables with. 1438// 1439// The contents of the target Secret's Data field will represent the 1440// key-value pairs as environment variables. 1441type SecretEnvSource struct { 1442 // The Secret to select from. 1443 LocalObjectReference `json:",inline" protobuf:"bytes,1,opt,name=localObjectReference"` 1444 // Specify whether the Secret must be defined 1445 // +optional 1446 Optional *bool `json:"optional,omitempty" protobuf:"varint,2,opt,name=optional"` 1447} 1448 1449// HTTPHeader describes a custom header to be used in HTTP probes 1450type HTTPHeader struct { 1451 // The header field name 1452 Name string `json:"name" protobuf:"bytes,1,opt,name=name"` 1453 // The header field value 1454 Value string `json:"value" protobuf:"bytes,2,opt,name=value"` 1455} 1456 1457// HTTPGetAction describes an action based on HTTP Get requests. 1458type HTTPGetAction struct { 1459 // Path to access on the HTTP server. 1460 // +optional 1461 Path string `json:"path,omitempty" protobuf:"bytes,1,opt,name=path"` 1462 // Name or number of the port to access on the container. 1463 // Number must be in the range 1 to 65535. 1464 // Name must be an IANA_SVC_NAME. 1465 Port intstr.IntOrString `json:"port" protobuf:"bytes,2,opt,name=port"` 1466 // Host name to connect to, defaults to the pod IP. You probably want to set 1467 // "Host" in httpHeaders instead. 1468 // +optional 1469 Host string `json:"host,omitempty" protobuf:"bytes,3,opt,name=host"` 1470 // Scheme to use for connecting to the host. 1471 // Defaults to HTTP. 1472 // +optional 1473 Scheme URIScheme `json:"scheme,omitempty" protobuf:"bytes,4,opt,name=scheme,casttype=URIScheme"` 1474 // Custom headers to set in the request. HTTP allows repeated headers. 1475 // +optional 1476 HTTPHeaders []HTTPHeader `json:"httpHeaders,omitempty" protobuf:"bytes,5,rep,name=httpHeaders"` 1477} 1478 1479// URIScheme identifies the scheme used for connection to a host for Get actions 1480type URIScheme string 1481 1482const ( 1483 // URISchemeHTTP means that the scheme used will be http:// 1484 URISchemeHTTP URIScheme = "HTTP" 1485 // URISchemeHTTPS means that the scheme used will be https:// 1486 URISchemeHTTPS URIScheme = "HTTPS" 1487) 1488 1489// TCPSocketAction describes an action based on opening a socket 1490type TCPSocketAction struct { 1491 // Number or name of the port to access on the container. 1492 // Number must be in the range 1 to 65535. 1493 // Name must be an IANA_SVC_NAME. 1494 Port intstr.IntOrString `json:"port" protobuf:"bytes,1,opt,name=port"` 1495} 1496 1497// ExecAction describes a "run in container" action. 1498type ExecAction struct { 1499 // Command is the command line to execute inside the container, the working directory for the 1500 // command is root ('/') in the container's filesystem. The command is simply exec'd, it is 1501 // not run inside a shell, so traditional shell instructions ('|', etc) won't work. To use 1502 // a shell, you need to explicitly call out to that shell. 1503 // Exit status of 0 is treated as live/healthy and non-zero is unhealthy. 1504 // +optional 1505 Command []string `json:"command,omitempty" protobuf:"bytes,1,rep,name=command"` 1506} 1507 1508// Probe describes a health check to be performed against a container to determine whether it is 1509// alive or ready to receive traffic. 1510type Probe struct { 1511 // The action taken to determine the health of a container 1512 Handler `json:",inline" protobuf:"bytes,1,opt,name=handler"` 1513 // Number of seconds after the container has started before liveness probes are initiated. 1514 // More info: http://kubernetes.io/docs/user-guide/pod-states#container-probes 1515 // +optional 1516 InitialDelaySeconds int32 `json:"initialDelaySeconds,omitempty" protobuf:"varint,2,opt,name=initialDelaySeconds"` 1517 // Number of seconds after which the probe times out. 1518 // Defaults to 1 second. Minimum value is 1. 1519 // More info: http://kubernetes.io/docs/user-guide/pod-states#container-probes 1520 // +optional 1521 TimeoutSeconds int32 `json:"timeoutSeconds,omitempty" protobuf:"varint,3,opt,name=timeoutSeconds"` 1522 // How often (in seconds) to perform the probe. 1523 // Default to 10 seconds. Minimum value is 1. 1524 // +optional 1525 PeriodSeconds int32 `json:"periodSeconds,omitempty" protobuf:"varint,4,opt,name=periodSeconds"` 1526 // Minimum consecutive successes for the probe to be considered successful after having failed. 1527 // Defaults to 1. Must be 1 for liveness. Minimum value is 1. 1528 // +optional 1529 SuccessThreshold int32 `json:"successThreshold,omitempty" protobuf:"varint,5,opt,name=successThreshold"` 1530 // Minimum consecutive failures for the probe to be considered failed after having succeeded. 1531 // Defaults to 3. Minimum value is 1. 1532 // +optional 1533 FailureThreshold int32 `json:"failureThreshold,omitempty" protobuf:"varint,6,opt,name=failureThreshold"` 1534} 1535 1536// PullPolicy describes a policy for if/when to pull a container image 1537type PullPolicy string 1538 1539const ( 1540 // PullAlways means that kubelet always attempts to pull the latest image. Container will fail If the pull fails. 1541 PullAlways PullPolicy = "Always" 1542 // PullNever means that kubelet never pulls an image, but only uses a local image. Container will fail if the image isn't present 1543 PullNever PullPolicy = "Never" 1544 // 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. 1545 PullIfNotPresent PullPolicy = "IfNotPresent" 1546) 1547 1548// TerminationMessagePolicy describes how termination messages are retrieved from a container. 1549type TerminationMessagePolicy string 1550 1551const ( 1552 // TerminationMessageReadFile is the default behavior and will set the container status message to 1553 // the contents of the container's terminationMessagePath when the container exits. 1554 TerminationMessageReadFile TerminationMessagePolicy = "File" 1555 // TerminationMessageFallbackToLogsOnError will read the most recent contents of the container logs 1556 // for the container status message when the container exits with an error and the 1557 // terminationMessagePath has no contents. 1558 TerminationMessageFallbackToLogsOnError TerminationMessagePolicy = "FallbackToLogsOnError" 1559) 1560 1561// Capability represent POSIX capabilities type 1562type Capability string 1563 1564// Adds and removes POSIX capabilities from running containers. 1565type Capabilities struct { 1566 // Added capabilities 1567 // +optional 1568 Add []Capability `json:"add,omitempty" protobuf:"bytes,1,rep,name=add,casttype=Capability"` 1569 // Removed capabilities 1570 // +optional 1571 Drop []Capability `json:"drop,omitempty" protobuf:"bytes,2,rep,name=drop,casttype=Capability"` 1572} 1573 1574// ResourceRequirements describes the compute resource requirements. 1575type ResourceRequirements struct { 1576 // Limits describes the maximum amount of compute resources allowed. 1577 // More info: http://kubernetes.io/docs/user-guide/compute-resources/ 1578 // +optional 1579 Limits ResourceList `json:"limits,omitempty" protobuf:"bytes,1,rep,name=limits,casttype=ResourceList,castkey=ResourceName"` 1580 // Requests describes the minimum amount of compute resources required. 1581 // If Requests is omitted for a container, it defaults to Limits if that is explicitly specified, 1582 // otherwise to an implementation-defined value. 1583 // More info: http://kubernetes.io/docs/user-guide/compute-resources/ 1584 // +optional 1585 Requests ResourceList `json:"requests,omitempty" protobuf:"bytes,2,rep,name=requests,casttype=ResourceList,castkey=ResourceName"` 1586} 1587 1588const ( 1589 // TerminationMessagePathDefault means the default path to capture the application termination message running in a container 1590 TerminationMessagePathDefault string = "/dev/termination-log" 1591) 1592 1593// A single application container that you want to run within a pod. 1594type Container struct { 1595 // Name of the container specified as a DNS_LABEL. 1596 // Each container in a pod must have a unique name (DNS_LABEL). 1597 // Cannot be updated. 1598 Name string `json:"name" protobuf:"bytes,1,opt,name=name"` 1599 // Docker image name. 1600 // More info: http://kubernetes.io/docs/user-guide/images 1601 // +optional 1602 Image string `json:"image,omitempty" protobuf:"bytes,2,opt,name=image"` 1603 // Entrypoint array. Not executed within a shell. 1604 // The docker image's ENTRYPOINT is used if this is not provided. 1605 // Variable references $(VAR_NAME) are expanded using the container's environment. If a variable 1606 // cannot be resolved, the reference in the input string will be unchanged. The $(VAR_NAME) syntax 1607 // can be escaped with a double $$, ie: $$(VAR_NAME). Escaped references will never be expanded, 1608 // regardless of whether the variable exists or not. 1609 // Cannot be updated. 1610 // More info: http://kubernetes.io/docs/user-guide/containers#containers-and-commands 1611 // +optional 1612 Command []string `json:"command,omitempty" protobuf:"bytes,3,rep,name=command"` 1613 // Arguments to the entrypoint. 1614 // The docker image's CMD is used if this is not provided. 1615 // Variable references $(VAR_NAME) are expanded using the container's environment. If a variable 1616 // cannot be resolved, the reference in the input string will be unchanged. The $(VAR_NAME) syntax 1617 // can be escaped with a double $$, ie: $$(VAR_NAME). Escaped references will never be expanded, 1618 // regardless of whether the variable exists or not. 1619 // Cannot be updated. 1620 // More info: http://kubernetes.io/docs/user-guide/containers#containers-and-commands 1621 // +optional 1622 Args []string `json:"args,omitempty" protobuf:"bytes,4,rep,name=args"` 1623 // Container's working directory. 1624 // If not specified, the container runtime's default will be used, which 1625 // might be configured in the container image. 1626 // Cannot be updated. 1627 // +optional 1628 WorkingDir string `json:"workingDir,omitempty" protobuf:"bytes,5,opt,name=workingDir"` 1629 // List of ports to expose from the container. Exposing a port here gives 1630 // the system additional information about the network connections a 1631 // container uses, but is primarily informational. Not specifying a port here 1632 // DOES NOT prevent that port from being exposed. Any port which is 1633 // listening on the default "0.0.0.0" address inside a container will be 1634 // accessible from the network. 1635 // Cannot be updated. 1636 // +optional 1637 Ports []ContainerPort `json:"ports,omitempty" patchStrategy:"merge" patchMergeKey:"containerPort" protobuf:"bytes,6,rep,name=ports"` 1638 // List of sources to populate environment variables in the container. 1639 // The keys defined within a source must be a C_IDENTIFIER. All invalid keys 1640 // will be reported as an event when the container is starting. When a key exists in multiple 1641 // sources, the value associated with the last source will take precedence. 1642 // Values defined by an Env with a duplicate key will take precedence. 1643 // Cannot be updated. 1644 // +optional 1645 EnvFrom []EnvFromSource `json:"envFrom,omitempty" protobuf:"bytes,19,rep,name=envFrom"` 1646 // List of environment variables to set in the container. 1647 // Cannot be updated. 1648 // +optional 1649 Env []EnvVar `json:"env,omitempty" patchStrategy:"merge" patchMergeKey:"name" protobuf:"bytes,7,rep,name=env"` 1650 // Compute Resources required by this container. 1651 // Cannot be updated. 1652 // More info: http://kubernetes.io/docs/user-guide/persistent-volumes#resources 1653 // +optional 1654 Resources ResourceRequirements `json:"resources,omitempty" protobuf:"bytes,8,opt,name=resources"` 1655 // Pod volumes to mount into the container's filesystem. 1656 // Cannot be updated. 1657 // +optional 1658 VolumeMounts []VolumeMount `json:"volumeMounts,omitempty" patchStrategy:"merge" patchMergeKey:"mountPath" protobuf:"bytes,9,rep,name=volumeMounts"` 1659 // Periodic probe of container liveness. 1660 // Container will be restarted if the probe fails. 1661 // Cannot be updated. 1662 // More info: http://kubernetes.io/docs/user-guide/pod-states#container-probes 1663 // +optional 1664 LivenessProbe *Probe `json:"livenessProbe,omitempty" protobuf:"bytes,10,opt,name=livenessProbe"` 1665 // Periodic probe of container service readiness. 1666 // Container will be removed from service endpoints if the probe fails. 1667 // Cannot be updated. 1668 // More info: http://kubernetes.io/docs/user-guide/pod-states#container-probes 1669 // +optional 1670 ReadinessProbe *Probe `json:"readinessProbe,omitempty" protobuf:"bytes,11,opt,name=readinessProbe"` 1671 // Actions that the management system should take in response to container lifecycle events. 1672 // Cannot be updated. 1673 // +optional 1674 Lifecycle *Lifecycle `json:"lifecycle,omitempty" protobuf:"bytes,12,opt,name=lifecycle"` 1675 // Optional: Path at which the file to which the container's termination message 1676 // will be written is mounted into the container's filesystem. 1677 // Message written is intended to be brief final status, such as an assertion failure message. 1678 // Will be truncated by the node if greater than 4096 bytes. The total message length across 1679 // all containers will be limited to 12kb. 1680 // Defaults to /dev/termination-log. 1681 // Cannot be updated. 1682 // +optional 1683 TerminationMessagePath string `json:"terminationMessagePath,omitempty" protobuf:"bytes,13,opt,name=terminationMessagePath"` 1684 // Indicate how the termination message should be populated. File will use the contents of 1685 // terminationMessagePath to populate the container status message on both success and failure. 1686 // FallbackToLogsOnError will use the last chunk of container log output if the termination 1687 // message file is empty and the container exited with an error. 1688 // The log output is limited to 2048 bytes or 80 lines, whichever is smaller. 1689 // Defaults to File. 1690 // Cannot be updated. 1691 // +optional 1692 TerminationMessagePolicy TerminationMessagePolicy `json:"terminationMessagePolicy,omitempty" protobuf:"bytes,20,opt,name=terminationMessagePolicy,casttype=TerminationMessagePolicy"` 1693 // Image pull policy. 1694 // One of Always, Never, IfNotPresent. 1695 // Defaults to Always if :latest tag is specified, or IfNotPresent otherwise. 1696 // Cannot be updated. 1697 // More info: http://kubernetes.io/docs/user-guide/images#updating-images 1698 // +optional 1699 ImagePullPolicy PullPolicy `json:"imagePullPolicy,omitempty" protobuf:"bytes,14,opt,name=imagePullPolicy,casttype=PullPolicy"` 1700 // Security options the pod should run with. 1701 // More info: http://releases.k8s.io/HEAD/docs/design/security_context.md 1702 // +optional 1703 SecurityContext *SecurityContext `json:"securityContext,omitempty" protobuf:"bytes,15,opt,name=securityContext"` 1704 1705 // Variables for interactive containers, these have very specialized use-cases (e.g. debugging) 1706 // and shouldn't be used for general purpose containers. 1707 1708 // Whether this container should allocate a buffer for stdin in the container runtime. If this 1709 // is not set, reads from stdin in the container will always result in EOF. 1710 // Default is false. 1711 // +optional 1712 Stdin bool `json:"stdin,omitempty" protobuf:"varint,16,opt,name=stdin"` 1713 // Whether the container runtime should close the stdin channel after it has been opened by 1714 // a single attach. When stdin is true the stdin stream will remain open across multiple attach 1715 // sessions. If stdinOnce is set to true, stdin is opened on container start, is empty until the 1716 // first client attaches to stdin, and then remains open and accepts data until the client disconnects, 1717 // at which time stdin is closed and remains closed until the container is restarted. If this 1718 // flag is false, a container processes that reads from stdin will never receive an EOF. 1719 // Default is false 1720 // +optional 1721 StdinOnce bool `json:"stdinOnce,omitempty" protobuf:"varint,17,opt,name=stdinOnce"` 1722 // Whether this container should allocate a TTY for itself, also requires 'stdin' to be true. 1723 // Default is false. 1724 // +optional 1725 TTY bool `json:"tty,omitempty" protobuf:"varint,18,opt,name=tty"` 1726} 1727 1728// Handler defines a specific action that should be taken 1729// TODO: pass structured data to these actions, and document that data here. 1730type Handler struct { 1731 // One and only one of the following should be specified. 1732 // Exec specifies the action to take. 1733 // +optional 1734 Exec *ExecAction `json:"exec,omitempty" protobuf:"bytes,1,opt,name=exec"` 1735 // HTTPGet specifies the http request to perform. 1736 // +optional 1737 HTTPGet *HTTPGetAction `json:"httpGet,omitempty" protobuf:"bytes,2,opt,name=httpGet"` 1738 // TCPSocket specifies an action involving a TCP port. 1739 // TCP hooks not yet supported 1740 // TODO: implement a realistic TCP lifecycle hook 1741 // +optional 1742 TCPSocket *TCPSocketAction `json:"tcpSocket,omitempty" protobuf:"bytes,3,opt,name=tcpSocket"` 1743} 1744 1745// Lifecycle describes actions that the management system should take in response to container lifecycle 1746// events. For the PostStart and PreStop lifecycle handlers, management of the container blocks 1747// until the action is complete, unless the container process fails, in which case the handler is aborted. 1748type Lifecycle struct { 1749 // PostStart is called immediately after a container is created. If the handler fails, 1750 // the container is terminated and restarted according to its restart policy. 1751 // Other management of the container blocks until the hook completes. 1752 // More info: http://kubernetes.io/docs/user-guide/container-environment#hook-details 1753 // +optional 1754 PostStart *Handler `json:"postStart,omitempty" protobuf:"bytes,1,opt,name=postStart"` 1755 // PreStop is called immediately before a container is terminated. 1756 // The container is terminated after the handler completes. 1757 // The reason for termination is passed to the handler. 1758 // Regardless of the outcome of the handler, the container is eventually terminated. 1759 // Other management of the container blocks until the hook completes. 1760 // More info: http://kubernetes.io/docs/user-guide/container-environment#hook-details 1761 // +optional 1762 PreStop *Handler `json:"preStop,omitempty" protobuf:"bytes,2,opt,name=preStop"` 1763} 1764 1765type ConditionStatus string 1766 1767// These are valid condition statuses. "ConditionTrue" means a resource is in the condition. 1768// "ConditionFalse" means a resource is not in the condition. "ConditionUnknown" means kubernetes 1769// can't decide if a resource is in the condition or not. In the future, we could add other 1770// intermediate conditions, e.g. ConditionDegraded. 1771const ( 1772 ConditionTrue ConditionStatus = "True" 1773 ConditionFalse ConditionStatus = "False" 1774 ConditionUnknown ConditionStatus = "Unknown" 1775) 1776 1777// ContainerStateWaiting is a waiting state of a container. 1778type ContainerStateWaiting struct { 1779 // (brief) reason the container is not yet running. 1780 // +optional 1781 Reason string `json:"reason,omitempty" protobuf:"bytes,1,opt,name=reason"` 1782 // Message regarding why the container is not yet running. 1783 // +optional 1784 Message string `json:"message,omitempty" protobuf:"bytes,2,opt,name=message"` 1785} 1786 1787// ContainerStateRunning is a running state of a container. 1788type ContainerStateRunning struct { 1789 // Time at which the container was last (re-)started 1790 // +optional 1791 StartedAt metav1.Time `json:"startedAt,omitempty" protobuf:"bytes,1,opt,name=startedAt"` 1792} 1793 1794// ContainerStateTerminated is a terminated state of a container. 1795type ContainerStateTerminated struct { 1796 // Exit status from the last termination of the container 1797 ExitCode int32 `json:"exitCode" protobuf:"varint,1,opt,name=exitCode"` 1798 // Signal from the last termination of the container 1799 // +optional 1800 Signal int32 `json:"signal,omitempty" protobuf:"varint,2,opt,name=signal"` 1801 // (brief) reason from the last termination of the container 1802 // +optional 1803 Reason string `json:"reason,omitempty" protobuf:"bytes,3,opt,name=reason"` 1804 // Message regarding the last termination of the container 1805 // +optional 1806 Message string `json:"message,omitempty" protobuf:"bytes,4,opt,name=message"` 1807 // Time at which previous execution of the container started 1808 // +optional 1809 StartedAt metav1.Time `json:"startedAt,omitempty" protobuf:"bytes,5,opt,name=startedAt"` 1810 // Time at which the container last terminated 1811 // +optional 1812 FinishedAt metav1.Time `json:"finishedAt,omitempty" protobuf:"bytes,6,opt,name=finishedAt"` 1813 // Container's ID in the format 'docker://<container_id>' 1814 // +optional 1815 ContainerID string `json:"containerID,omitempty" protobuf:"bytes,7,opt,name=containerID"` 1816} 1817 1818// ContainerState holds a possible state of container. 1819// Only one of its members may be specified. 1820// If none of them is specified, the default one is ContainerStateWaiting. 1821type ContainerState struct { 1822 // Details about a waiting container 1823 // +optional 1824 Waiting *ContainerStateWaiting `json:"waiting,omitempty" protobuf:"bytes,1,opt,name=waiting"` 1825 // Details about a running container 1826 // +optional 1827 Running *ContainerStateRunning `json:"running,omitempty" protobuf:"bytes,2,opt,name=running"` 1828 // Details about a terminated container 1829 // +optional 1830 Terminated *ContainerStateTerminated `json:"terminated,omitempty" protobuf:"bytes,3,opt,name=terminated"` 1831} 1832 1833// ContainerStatus contains details for the current status of this container. 1834type ContainerStatus struct { 1835 // This must be a DNS_LABEL. Each container in a pod must have a unique name. 1836 // Cannot be updated. 1837 Name string `json:"name" protobuf:"bytes,1,opt,name=name"` 1838 // Details about the container's current condition. 1839 // +optional 1840 State ContainerState `json:"state,omitempty" protobuf:"bytes,2,opt,name=state"` 1841 // Details about the container's last termination condition. 1842 // +optional 1843 LastTerminationState ContainerState `json:"lastState,omitempty" protobuf:"bytes,3,opt,name=lastState"` 1844 // Specifies whether the container has passed its readiness probe. 1845 Ready bool `json:"ready" protobuf:"varint,4,opt,name=ready"` 1846 // The number of times the container has been restarted, currently based on 1847 // the number of dead containers that have not yet been removed. 1848 // Note that this is calculated from dead containers. But those containers are subject to 1849 // garbage collection. This value will get capped at 5 by GC. 1850 RestartCount int32 `json:"restartCount" protobuf:"varint,5,opt,name=restartCount"` 1851 // The image the container is running. 1852 // More info: http://kubernetes.io/docs/user-guide/images 1853 // TODO(dchen1107): Which image the container is running with? 1854 Image string `json:"image" protobuf:"bytes,6,opt,name=image"` 1855 // ImageID of the container's image. 1856 ImageID string `json:"imageID" protobuf:"bytes,7,opt,name=imageID"` 1857 // Container's ID in the format 'docker://<container_id>'. 1858 // More info: http://kubernetes.io/docs/user-guide/container-environment#container-information 1859 // +optional 1860 ContainerID string `json:"containerID,omitempty" protobuf:"bytes,8,opt,name=containerID"` 1861} 1862 1863// PodPhase is a label for the condition of a pod at the current time. 1864type PodPhase string 1865 1866// These are the valid statuses of pods. 1867const ( 1868 // PodPending means the pod has been accepted by the system, but one or more of the containers 1869 // has not been started. This includes time before being bound to a node, as well as time spent 1870 // pulling images onto the host. 1871 PodPending PodPhase = "Pending" 1872 // PodRunning means the pod has been bound to a node and all of the containers have been started. 1873 // At least one container is still running or is in the process of being restarted. 1874 PodRunning PodPhase = "Running" 1875 // PodSucceeded means that all containers in the pod have voluntarily terminated 1876 // with a container exit code of 0, and the system is not going to restart any of these containers. 1877 PodSucceeded PodPhase = "Succeeded" 1878 // PodFailed means that all containers in the pod have terminated, and at least one container has 1879 // terminated in a failure (exited with a non-zero exit code or was stopped by the system). 1880 PodFailed PodPhase = "Failed" 1881 // PodUnknown means that for some reason the state of the pod could not be obtained, typically due 1882 // to an error in communicating with the host of the pod. 1883 PodUnknown PodPhase = "Unknown" 1884) 1885 1886// PodConditionType is a valid value for PodCondition.Type 1887type PodConditionType string 1888 1889// These are valid conditions of pod. 1890const ( 1891 // PodScheduled represents status of the scheduling process for this pod. 1892 PodScheduled PodConditionType = "PodScheduled" 1893 // PodReady means the pod is able to service requests and should be added to the 1894 // load balancing pools of all matching services. 1895 PodReady PodConditionType = "Ready" 1896 // PodInitialized means that all init containers in the pod have started successfully. 1897 PodInitialized PodConditionType = "Initialized" 1898 // PodReasonUnschedulable reason in PodScheduled PodCondition means that the scheduler 1899 // can't schedule the pod right now, for example due to insufficient resources in the cluster. 1900 PodReasonUnschedulable = "Unschedulable" 1901) 1902 1903// PodCondition contains details for the current condition of this pod. 1904type PodCondition struct { 1905 // Type is the type of the condition. 1906 // Currently only Ready. 1907 // More info: http://kubernetes.io/docs/user-guide/pod-states#pod-conditions 1908 Type PodConditionType `json:"type" protobuf:"bytes,1,opt,name=type,casttype=PodConditionType"` 1909 // Status is the status of the condition. 1910 // Can be True, False, Unknown. 1911 // More info: http://kubernetes.io/docs/user-guide/pod-states#pod-conditions 1912 Status ConditionStatus `json:"status" protobuf:"bytes,2,opt,name=status,casttype=ConditionStatus"` 1913 // Last time we probed the condition. 1914 // +optional 1915 LastProbeTime metav1.Time `json:"lastProbeTime,omitempty" protobuf:"bytes,3,opt,name=lastProbeTime"` 1916 // Last time the condition transitioned from one status to another. 1917 // +optional 1918 LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty" protobuf:"bytes,4,opt,name=lastTransitionTime"` 1919 // Unique, one-word, CamelCase reason for the condition's last transition. 1920 // +optional 1921 Reason string `json:"reason,omitempty" protobuf:"bytes,5,opt,name=reason"` 1922 // Human-readable message indicating details about last transition. 1923 // +optional 1924 Message string `json:"message,omitempty" protobuf:"bytes,6,opt,name=message"` 1925} 1926 1927// RestartPolicy describes how the container should be restarted. 1928// Only one of the following restart policies may be specified. 1929// If none of the following policies is specified, the default one 1930// is RestartPolicyAlways. 1931type RestartPolicy string 1932 1933const ( 1934 RestartPolicyAlways RestartPolicy = "Always" 1935 RestartPolicyOnFailure RestartPolicy = "OnFailure" 1936 RestartPolicyNever RestartPolicy = "Never" 1937) 1938 1939// DNSPolicy defines how a pod's DNS will be configured. 1940type DNSPolicy string 1941 1942const ( 1943 // DNSClusterFirstWithHostNet indicates that the pod should use cluster DNS 1944 // first, if it is available, then fall back on the default 1945 // (as determined by kubelet) DNS settings. 1946 DNSClusterFirstWithHostNet DNSPolicy = "ClusterFirstWithHostNet" 1947 1948 // DNSClusterFirst indicates that the pod should use cluster DNS 1949 // first unless hostNetwork is true, if it is available, then 1950 // fall back on the default (as determined by kubelet) DNS settings. 1951 DNSClusterFirst DNSPolicy = "ClusterFirst" 1952 1953 // DNSDefault indicates that the pod should use the default (as 1954 // determined by kubelet) DNS settings. 1955 DNSDefault DNSPolicy = "Default" 1956 1957 DefaultTerminationGracePeriodSeconds = 30 1958) 1959 1960// A node selector represents the union of the results of one or more label queries 1961// over a set of nodes; that is, it represents the OR of the selectors represented 1962// by the node selector terms. 1963type NodeSelector struct { 1964 //Required. A list of node selector terms. The terms are ORed. 1965 NodeSelectorTerms []NodeSelectorTerm `json:"nodeSelectorTerms" protobuf:"bytes,1,rep,name=nodeSelectorTerms"` 1966} 1967 1968// A null or empty node selector term matches no objects. 1969type NodeSelectorTerm struct { 1970 //Required. A list of node selector requirements. The requirements are ANDed. 1971 MatchExpressions []NodeSelectorRequirement `json:"matchExpressions" protobuf:"bytes,1,rep,name=matchExpressions"` 1972} 1973 1974// A node selector requirement is a selector that contains values, a key, and an operator 1975// that relates the key and values. 1976type NodeSelectorRequirement struct { 1977 // The label key that the selector applies to. 1978 Key string `json:"key" patchStrategy:"merge" patchMergeKey:"key" protobuf:"bytes,1,opt,name=key"` 1979 // Represents a key's relationship to a set of values. 1980 // Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt. 1981 Operator NodeSelectorOperator `json:"operator" protobuf:"bytes,2,opt,name=operator,casttype=NodeSelectorOperator"` 1982 // An array of string values. If the operator is In or NotIn, 1983 // the values array must be non-empty. If the operator is Exists or DoesNotExist, 1984 // the values array must be empty. If the operator is Gt or Lt, the values 1985 // array must have a single element, which will be interpreted as an integer. 1986 // This array is replaced during a strategic merge patch. 1987 // +optional 1988 Values []string `json:"values,omitempty" protobuf:"bytes,3,rep,name=values"` 1989} 1990 1991// A node selector operator is the set of operators that can be used in 1992// a node selector requirement. 1993type NodeSelectorOperator string 1994 1995const ( 1996 NodeSelectorOpIn NodeSelectorOperator = "In" 1997 NodeSelectorOpNotIn NodeSelectorOperator = "NotIn" 1998 NodeSelectorOpExists NodeSelectorOperator = "Exists" 1999 NodeSelectorOpDoesNotExist NodeSelectorOperator = "DoesNotExist" 2000 NodeSelectorOpGt NodeSelectorOperator = "Gt" 2001 NodeSelectorOpLt NodeSelectorOperator = "Lt" 2002) 2003 2004// Affinity is a group of affinity scheduling rules. 2005type Affinity struct { 2006 // Describes node affinity scheduling rules for the pod. 2007 // +optional 2008 NodeAffinity *NodeAffinity `json:"nodeAffinity,omitempty" protobuf:"bytes,1,opt,name=nodeAffinity"` 2009 // Describes pod affinity scheduling rules (e.g. co-locate this pod in the same node, zone, etc. as some other pod(s)). 2010 // +optional 2011 PodAffinity *PodAffinity `json:"podAffinity,omitempty" protobuf:"bytes,2,opt,name=podAffinity"` 2012 // Describes pod anti-affinity scheduling rules (e.g. avoid putting this pod in the same node, zone, etc. as some other pod(s)). 2013 // +optional 2014 PodAntiAffinity *PodAntiAffinity `json:"podAntiAffinity,omitempty" protobuf:"bytes,3,opt,name=podAntiAffinity"` 2015} 2016 2017// Pod affinity is a group of inter pod affinity scheduling rules. 2018type PodAffinity struct { 2019 // NOT YET IMPLEMENTED. TODO: Uncomment field once it is implemented. 2020 // If the affinity requirements specified by this field are not met at 2021 // scheduling time, the pod will not be scheduled onto the node. 2022 // If the affinity requirements specified by this field cease to be met 2023 // at some point during pod execution (e.g. due to a pod label update), the 2024 // system will try to eventually evict the pod from its node. 2025 // When there are multiple elements, the lists of nodes corresponding to each 2026 // podAffinityTerm are intersected, i.e. all terms must be satisfied. 2027 // +optional 2028 // RequiredDuringSchedulingRequiredDuringExecution []PodAffinityTerm `json:"requiredDuringSchedulingRequiredDuringExecution,omitempty"` 2029 // If the affinity requirements specified by this field are not met at 2030 // scheduling time, the pod will not be scheduled onto the node. 2031 // If the affinity requirements specified by this field cease to be met 2032 // at some point during pod execution (e.g. due to a pod label update), the 2033 // system may or may not try to eventually evict the pod from its node. 2034 // When there are multiple elements, the lists of nodes corresponding to each 2035 // podAffinityTerm are intersected, i.e. all terms must be satisfied. 2036 // +optional 2037 RequiredDuringSchedulingIgnoredDuringExecution []PodAffinityTerm `json:"requiredDuringSchedulingIgnoredDuringExecution,omitempty" protobuf:"bytes,1,rep,name=requiredDuringSchedulingIgnoredDuringExecution"` 2038 // The scheduler will prefer to schedule pods to nodes that satisfy 2039 // the affinity expressions specified by this field, but it may choose 2040 // a node that violates one or more of the expressions. The node that is 2041 // most preferred is the one with the greatest sum of weights, i.e. 2042 // for each node that meets all of the scheduling requirements (resource 2043 // request, requiredDuringScheduling affinity expressions, etc.), 2044 // compute a sum by iterating through the elements of this field and adding 2045 // "weight" to the sum if the node has pods which matches the corresponding podAffinityTerm; the 2046 // node(s) with the highest sum are the most preferred. 2047 // +optional 2048 PreferredDuringSchedulingIgnoredDuringExecution []WeightedPodAffinityTerm `json:"preferredDuringSchedulingIgnoredDuringExecution,omitempty" protobuf:"bytes,2,rep,name=preferredDuringSchedulingIgnoredDuringExecution"` 2049} 2050 2051// Pod anti affinity is a group of inter pod anti affinity scheduling rules. 2052type PodAntiAffinity struct { 2053 // NOT YET IMPLEMENTED. TODO: Uncomment field once it is implemented. 2054 // If the anti-affinity requirements specified by this field are not met at 2055 // scheduling time, the pod will not be scheduled onto the node. 2056 // If the anti-affinity requirements specified by this field cease to be met 2057 // at some point during pod execution (e.g. due to a pod label update), the 2058 // system will try to eventually evict the pod from its node. 2059 // When there are multiple elements, the lists of nodes corresponding to each 2060 // podAffinityTerm are intersected, i.e. all terms must be satisfied. 2061 // +optional 2062 // RequiredDuringSchedulingRequiredDuringExecution []PodAffinityTerm `json:"requiredDuringSchedulingRequiredDuringExecution,omitempty"` 2063 // If the anti-affinity requirements specified by this field are not met at 2064 // scheduling time, the pod will not be scheduled onto the node. 2065 // If the anti-affinity requirements specified by this field cease to be met 2066 // at some point during pod execution (e.g. due to a pod label update), the 2067 // system may or may not try to eventually evict the pod from its node. 2068 // When there are multiple elements, the lists of nodes corresponding to each 2069 // podAffinityTerm are intersected, i.e. all terms must be satisfied. 2070 // +optional 2071 RequiredDuringSchedulingIgnoredDuringExecution []PodAffinityTerm `json:"requiredDuringSchedulingIgnoredDuringExecution,omitempty" protobuf:"bytes,1,rep,name=requiredDuringSchedulingIgnoredDuringExecution"` 2072 // The scheduler will prefer to schedule pods to nodes that satisfy 2073 // the anti-affinity expressions specified by this field, but it may choose 2074 // a node that violates one or more of the expressions. The node that is 2075 // most preferred is the one with the greatest sum of weights, i.e. 2076 // for each node that meets all of the scheduling requirements (resource 2077 // request, requiredDuringScheduling anti-affinity expressions, etc.), 2078 // compute a sum by iterating through the elements of this field and adding 2079 // "weight" to the sum if the node has pods which matches the corresponding podAffinityTerm; the 2080 // node(s) with the highest sum are the most preferred. 2081 // +optional 2082 PreferredDuringSchedulingIgnoredDuringExecution []WeightedPodAffinityTerm `json:"preferredDuringSchedulingIgnoredDuringExecution,omitempty" protobuf:"bytes,2,rep,name=preferredDuringSchedulingIgnoredDuringExecution"` 2083} 2084 2085// The weights of all of the matched WeightedPodAffinityTerm fields are added per-node to find the most preferred node(s) 2086type WeightedPodAffinityTerm struct { 2087 // weight associated with matching the corresponding podAffinityTerm, 2088 // in the range 1-100. 2089 Weight int32 `json:"weight" protobuf:"varint,1,opt,name=weight"` 2090 // Required. A pod affinity term, associated with the corresponding weight. 2091 PodAffinityTerm PodAffinityTerm `json:"podAffinityTerm" protobuf:"bytes,2,opt,name=podAffinityTerm"` 2092} 2093 2094// Defines a set of pods (namely those matching the labelSelector 2095// relative to the given namespace(s)) that this pod should be 2096// co-located (affinity) or not co-located (anti-affinity) with, 2097// where co-located is defined as running on a node whose value of 2098// the label with key <topologyKey> tches that of any node on which 2099// a pod of the set of pods is running 2100type PodAffinityTerm struct { 2101 // A label query over a set of resources, in this case pods. 2102 // +optional 2103 LabelSelector *metav1.LabelSelector `json:"labelSelector,omitempty" protobuf:"bytes,1,opt,name=labelSelector"` 2104 // namespaces specifies which namespaces the labelSelector applies to (matches against); 2105 // null or empty list means "this pod's namespace" 2106 Namespaces []string `json:"namespaces,omitempty" protobuf:"bytes,2,rep,name=namespaces"` 2107 // This pod should be co-located (affinity) or not co-located (anti-affinity) with the pods matching 2108 // the labelSelector in the specified namespaces, where co-located is defined as running on a node 2109 // whose value of the label with key topologyKey matches that of any node on which any of the 2110 // selected pods is running. 2111 // For PreferredDuringScheduling pod anti-affinity, empty topologyKey is interpreted as "all topologies" 2112 // ("all topologies" here means all the topologyKeys indicated by scheduler command-line argument --failure-domains); 2113 // for affinity and for RequiredDuringScheduling pod anti-affinity, empty topologyKey is not allowed. 2114 // +optional 2115 TopologyKey string `json:"topologyKey,omitempty" protobuf:"bytes,3,opt,name=topologyKey"` 2116} 2117 2118// Node affinity is a group of node affinity scheduling rules. 2119type NodeAffinity struct { 2120 // NOT YET IMPLEMENTED. TODO: Uncomment field once it is implemented. 2121 // If the affinity requirements specified by this field are not met at 2122 // scheduling time, the pod will not be scheduled onto the node. 2123 // If the affinity requirements specified by this field cease to be met 2124 // at some point during pod execution (e.g. due to an update), the system 2125 // will try to eventually evict the pod from its node. 2126 // +optional 2127 // RequiredDuringSchedulingRequiredDuringExecution *NodeSelector `json:"requiredDuringSchedulingRequiredDuringExecution,omitempty"` 2128 2129 // If the affinity requirements specified by this field are not met at 2130 // scheduling time, the pod will not be scheduled onto the node. 2131 // If the affinity requirements specified by this field cease to be met 2132 // at some point during pod execution (e.g. due to an update), the system 2133 // may or may not try to eventually evict the pod from its node. 2134 // +optional 2135 RequiredDuringSchedulingIgnoredDuringExecution *NodeSelector `json:"requiredDuringSchedulingIgnoredDuringExecution,omitempty" protobuf:"bytes,1,opt,name=requiredDuringSchedulingIgnoredDuringExecution"` 2136 // The scheduler will prefer to schedule pods to nodes that satisfy 2137 // the affinity expressions specified by this field, but it may choose 2138 // a node that violates one or more of the expressions. The node that is 2139 // most preferred is the one with the greatest sum of weights, i.e. 2140 // for each node that meets all of the scheduling requirements (resource 2141 // request, requiredDuringScheduling affinity expressions, etc.), 2142 // compute a sum by iterating through the elements of this field and adding 2143 // "weight" to the sum if the node matches the corresponding matchExpressions; the 2144 // node(s) with the highest sum are the most preferred. 2145 // +optional 2146 PreferredDuringSchedulingIgnoredDuringExecution []PreferredSchedulingTerm `json:"preferredDuringSchedulingIgnoredDuringExecution,omitempty" protobuf:"bytes,2,rep,name=preferredDuringSchedulingIgnoredDuringExecution"` 2147} 2148 2149// An empty preferred scheduling term matches all objects with implicit weight 0 2150// (i.e. it's a no-op). A null preferred scheduling term matches no objects (i.e. is also a no-op). 2151type PreferredSchedulingTerm struct { 2152 // Weight associated with matching the corresponding nodeSelectorTerm, in the range 1-100. 2153 Weight int32 `json:"weight" protobuf:"varint,1,opt,name=weight"` 2154 // A node selector term, associated with the corresponding weight. 2155 Preference NodeSelectorTerm `json:"preference" protobuf:"bytes,2,opt,name=preference"` 2156} 2157 2158// The node this Taint is attached to has the effect "effect" on 2159// any pod that that does not tolerate the Taint. 2160type Taint struct { 2161 // Required. The taint key to be applied to a node. 2162 Key string `json:"key" patchStrategy:"merge" patchMergeKey:"key" protobuf:"bytes,1,opt,name=key"` 2163 // Required. The taint value corresponding to the taint key. 2164 // +optional 2165 Value string `json:"value,omitempty" protobuf:"bytes,2,opt,name=value"` 2166 // Required. The effect of the taint on pods 2167 // that do not tolerate the taint. 2168 // Valid effects are NoSchedule, PreferNoSchedule and NoExecute. 2169 Effect TaintEffect `json:"effect" protobuf:"bytes,3,opt,name=effect,casttype=TaintEffect"` 2170 // TimeAdded represents the time at which the taint was added. 2171 // It is only written for NoExecute taints. 2172 // +optional 2173 TimeAdded metav1.Time `json:"timeAdded,omitempty" protobuf:"bytes,4,opt,name=timeAdded"` 2174} 2175 2176type TaintEffect string 2177 2178const ( 2179 // Do not allow new pods to schedule onto the node unless they tolerate the taint, 2180 // but allow all pods submitted to Kubelet without going through the scheduler 2181 // to start, and allow all already-running pods to continue running. 2182 // Enforced by the scheduler. 2183 TaintEffectNoSchedule TaintEffect = "NoSchedule" 2184 // Like TaintEffectNoSchedule, but the scheduler tries not to schedule 2185 // new pods onto the node, rather than prohibiting new pods from scheduling 2186 // onto the node entirely. Enforced by the scheduler. 2187 TaintEffectPreferNoSchedule TaintEffect = "PreferNoSchedule" 2188 // NOT YET IMPLEMENTED. TODO: Uncomment field once it is implemented. 2189 // Like TaintEffectNoSchedule, but additionally do not allow pods submitted to 2190 // Kubelet without going through the scheduler to start. 2191 // Enforced by Kubelet and the scheduler. 2192 // TaintEffectNoScheduleNoAdmit TaintEffect = "NoScheduleNoAdmit" 2193 // Evict any already-running pods that do not tolerate the taint. 2194 // Currently enforced by NodeController. 2195 TaintEffectNoExecute TaintEffect = "NoExecute" 2196) 2197 2198// The pod this Toleration is attached to tolerates any taint that matches 2199// the triple <key,value,effect> using the matching operator <operator>. 2200type Toleration struct { 2201 // Key is the taint key that the toleration applies to. Empty means match all taint keys. 2202 // If the key is empty, operator must be Exists; this combination means to match all values and all keys. 2203 // +optional 2204 Key string `json:"key,omitempty" patchStrategy:"merge" patchMergeKey:"key" protobuf:"bytes,1,opt,name=key"` 2205 // Operator represents a key's relationship to the value. 2206 // Valid operators are Exists and Equal. Defaults to Equal. 2207 // Exists is equivalent to wildcard for value, so that a pod can 2208 // tolerate all taints of a particular category. 2209 // +optional 2210 Operator TolerationOperator `json:"operator,omitempty" protobuf:"bytes,2,opt,name=operator,casttype=TolerationOperator"` 2211 // Value is the taint value the toleration matches to. 2212 // If the operator is Exists, the value should be empty, otherwise just a regular string. 2213 // +optional 2214 Value string `json:"value,omitempty" protobuf:"bytes,3,opt,name=value"` 2215 // Effect indicates the taint effect to match. Empty means match all taint effects. 2216 // When specified, allowed values are NoSchedule, PreferNoSchedule and NoExecute. 2217 // +optional 2218 Effect TaintEffect `json:"effect,omitempty" protobuf:"bytes,4,opt,name=effect,casttype=TaintEffect"` 2219 // TolerationSeconds represents the period of time the toleration (which must be 2220 // of effect NoExecute, otherwise this field is ignored) tolerates the taint. By default, 2221 // it is not set, which means tolerate the taint forever (do not evict). Zero and 2222 // negative values will be treated as 0 (evict immediately) by the system. 2223 // +optional 2224 TolerationSeconds *int64 `json:"tolerationSeconds,omitempty" protobuf:"varint,5,opt,name=tolerationSeconds"` 2225} 2226 2227// A toleration operator is the set of operators that can be used in a toleration. 2228type TolerationOperator string 2229 2230const ( 2231 TolerationOpExists TolerationOperator = "Exists" 2232 TolerationOpEqual TolerationOperator = "Equal" 2233) 2234 2235const ( 2236 // This annotation key will be used to contain an array of v1 JSON encoded Containers 2237 // for init containers. The annotation will be placed into the internal type and cleared. 2238 // This key is only recognized by version >= 1.4. 2239 PodInitContainersBetaAnnotationKey = "pod.beta.kubernetes.io/init-containers" 2240 // This annotation key will be used to contain an array of v1 JSON encoded Containers 2241 // for init containers. The annotation will be placed into the internal type and cleared. 2242 // This key is recognized by version >= 1.3. For version 1.4 code, this key 2243 // will have its value copied to the beta key. 2244 PodInitContainersAnnotationKey = "pod.alpha.kubernetes.io/init-containers" 2245 // This annotation key will be used to contain an array of v1 JSON encoded 2246 // ContainerStatuses for init containers. The annotation will be placed into the internal 2247 // type and cleared. This key is only recognized by version >= 1.4. 2248 PodInitContainerStatusesBetaAnnotationKey = "pod.beta.kubernetes.io/init-container-statuses" 2249 // This annotation key will be used to contain an array of v1 JSON encoded 2250 // ContainerStatuses for init containers. The annotation will be placed into the internal 2251 // type and cleared. This key is recognized by version >= 1.3. For version 1.4 code, 2252 // this key will have its value copied to the beta key. 2253 PodInitContainerStatusesAnnotationKey = "pod.alpha.kubernetes.io/init-container-statuses" 2254) 2255 2256// PodSpec is a description of a pod. 2257type PodSpec struct { 2258 // List of volumes that can be mounted by containers belonging to the pod. 2259 // More info: http://kubernetes.io/docs/user-guide/volumes 2260 // +optional 2261 Volumes []Volume `json:"volumes,omitempty" patchStrategy:"merge" patchMergeKey:"name" protobuf:"bytes,1,rep,name=volumes"` 2262 // List of initialization containers belonging to the pod. 2263 // Init containers are executed in order prior to containers being started. If any 2264 // init container fails, the pod is considered to have failed and is handled according 2265 // to its restartPolicy. The name for an init container or normal container must be 2266 // unique among all containers. 2267 // Init containers may not have Lifecycle actions, Readiness probes, or Liveness probes. 2268 // The resourceRequirements of an init container are taken into account during scheduling 2269 // by finding the highest request/limit for each resource type, and then using the max of 2270 // of that value or the sum of the normal containers. Limits are applied to init containers 2271 // in a similar fashion. 2272 // Init containers cannot currently be added or removed. 2273 // Cannot be updated. 2274 // More info: http://kubernetes.io/docs/user-guide/containers 2275 InitContainers []Container `json:"initContainers,omitempty" patchStrategy:"merge" patchMergeKey:"name" protobuf:"bytes,20,rep,name=initContainers"` 2276 // List of containers belonging to the pod. 2277 // Containers cannot currently be added or removed. 2278 // There must be at least one container in a Pod. 2279 // Cannot be updated. 2280 // More info: http://kubernetes.io/docs/user-guide/containers 2281 Containers []Container `json:"containers" patchStrategy:"merge" patchMergeKey:"name" protobuf:"bytes,2,rep,name=containers"` 2282 // Restart policy for all containers within the pod. 2283 // One of Always, OnFailure, Never. 2284 // Default to Always. 2285 // More info: http://kubernetes.io/docs/user-guide/pod-states#restartpolicy 2286 // +optional 2287 RestartPolicy RestartPolicy `json:"restartPolicy,omitempty" protobuf:"bytes,3,opt,name=restartPolicy,casttype=RestartPolicy"` 2288 // Optional duration in seconds the pod needs to terminate gracefully. May be decreased in delete request. 2289 // Value must be non-negative integer. The value zero indicates delete immediately. 2290 // If this value is nil, the default grace period will be used instead. 2291 // The grace period is the duration in seconds after the processes running in the pod are sent 2292 // a termination signal and the time when the processes are forcibly halted with a kill signal. 2293 // Set this value longer than the expected cleanup time for your process. 2294 // Defaults to 30 seconds. 2295 // +optional 2296 TerminationGracePeriodSeconds *int64 `json:"terminationGracePeriodSeconds,omitempty" protobuf:"varint,4,opt,name=terminationGracePeriodSeconds"` 2297 // Optional duration in seconds the pod may be active on the node relative to 2298 // StartTime before the system will actively try to mark it failed and kill associated containers. 2299 // Value must be a positive integer. 2300 // +optional 2301 ActiveDeadlineSeconds *int64 `json:"activeDeadlineSeconds,omitempty" protobuf:"varint,5,opt,name=activeDeadlineSeconds"` 2302 // Set DNS policy for containers within the pod. 2303 // One of 'ClusterFirstWithHostNet', 'ClusterFirst' or 'Default'. 2304 // Defaults to "ClusterFirst". 2305 // To have DNS options set along with hostNetwork, you have to specify DNS policy explicitly to 'ClusterFirstWithHostNet'. 2306 // +optional 2307 DNSPolicy DNSPolicy `json:"dnsPolicy,omitempty" protobuf:"bytes,6,opt,name=dnsPolicy,casttype=DNSPolicy"` 2308 // NodeSelector is a selector which must be true for the pod to fit on a node. 2309 // Selector which must match a node's labels for the pod to be scheduled on that node. 2310 // More info: http://kubernetes.io/docs/user-guide/node-selection/README 2311 // +optional 2312 NodeSelector map[string]string `json:"nodeSelector,omitempty" protobuf:"bytes,7,rep,name=nodeSelector"` 2313 2314 // ServiceAccountName is the name of the ServiceAccount to use to run this pod. 2315 // More info: http://releases.k8s.io/HEAD/docs/design/service_accounts.md 2316 // +optional 2317 ServiceAccountName string `json:"serviceAccountName,omitempty" protobuf:"bytes,8,opt,name=serviceAccountName"` 2318 // DeprecatedServiceAccount is a depreciated alias for ServiceAccountName. 2319 // Deprecated: Use serviceAccountName instead. 2320 // +k8s:conversion-gen=false 2321 // +optional 2322 DeprecatedServiceAccount string `json:"serviceAccount,omitempty" protobuf:"bytes,9,opt,name=serviceAccount"` 2323 // AutomountServiceAccountToken indicates whether a service account token should be automatically mounted. 2324 // +optional 2325 AutomountServiceAccountToken *bool `json:"automountServiceAccountToken,omitempty" protobuf:"varint,21,opt,name=automountServiceAccountToken"` 2326 2327 // NodeName is a request to schedule this pod onto a specific node. If it is non-empty, 2328 // the scheduler simply schedules this pod onto that node, assuming that it fits resource 2329 // requirements. 2330 // +optional 2331 NodeName string `json:"nodeName,omitempty" protobuf:"bytes,10,opt,name=nodeName"` 2332 // Host networking requested for this pod. Use the host's network namespace. 2333 // If this option is set, the ports that will be used must be specified. 2334 // Default to false. 2335 // +k8s:conversion-gen=false 2336 // +optional 2337 HostNetwork bool `json:"hostNetwork,omitempty" protobuf:"varint,11,opt,name=hostNetwork"` 2338 // Use the host's pid namespace. 2339 // Optional: Default to false. 2340 // +k8s:conversion-gen=false 2341 // +optional 2342 HostPID bool `json:"hostPID,omitempty" protobuf:"varint,12,opt,name=hostPID"` 2343 // Use the host's ipc namespace. 2344 // Optional: Default to false. 2345 // +k8s:conversion-gen=false 2346 // +optional 2347 HostIPC bool `json:"hostIPC,omitempty" protobuf:"varint,13,opt,name=hostIPC"` 2348 // SecurityContext holds pod-level security attributes and common container settings. 2349 // Optional: Defaults to empty. See type description for default values of each field. 2350 // +optional 2351 SecurityContext *PodSecurityContext `json:"securityContext,omitempty" protobuf:"bytes,14,opt,name=securityContext"` 2352 // 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. 2353 // If specified, these secrets will be passed to individual puller implementations for them to use. For example, 2354 // in the case of docker, only DockerConfig type secrets are honored. 2355 // More info: http://kubernetes.io/docs/user-guide/images#specifying-imagepullsecrets-on-a-pod 2356 // +optional 2357 ImagePullSecrets []LocalObjectReference `json:"imagePullSecrets,omitempty" patchStrategy:"merge" patchMergeKey:"name" protobuf:"bytes,15,rep,name=imagePullSecrets"` 2358 // Specifies the hostname of the Pod 2359 // If not specified, the pod's hostname will be set to a system-defined value. 2360 // +optional 2361 Hostname string `json:"hostname,omitempty" protobuf:"bytes,16,opt,name=hostname"` 2362 // If specified, the fully qualified Pod hostname will be "<hostname>.<subdomain>.<pod namespace>.svc.<cluster domain>". 2363 // If not specified, the pod will not have a domainname at all. 2364 // +optional 2365 Subdomain string `json:"subdomain,omitempty" protobuf:"bytes,17,opt,name=subdomain"` 2366 // If specified, the pod's scheduling constraints 2367 // +optional 2368 Affinity *Affinity `json:"affinity,omitempty" protobuf:"bytes,18,opt,name=affinity"` 2369 // If specified, the pod will be dispatched by specified scheduler. 2370 // If not specified, the pod will be dispatched by default scheduler. 2371 // +optional 2372 SchedulerName string `json:"schedulerName,omitempty" protobuf:"bytes,19,opt,name=schedulerName"` 2373 // If specified, the pod's tolerations. 2374 // +optional 2375 Tolerations []Toleration `json:"tolerations,omitempty" protobuf:"bytes,22,opt,name=tolerations"` 2376} 2377 2378// PodSecurityContext holds pod-level security attributes and common container settings. 2379// Some fields are also present in container.securityContext. Field values of 2380// container.securityContext take precedence over field values of PodSecurityContext. 2381type PodSecurityContext struct { 2382 // The SELinux context to be applied to all containers. 2383 // If unspecified, the container runtime will allocate a random SELinux context for each 2384 // container. May also be set in SecurityContext. If set in 2385 // both SecurityContext and PodSecurityContext, the value specified in SecurityContext 2386 // takes precedence for that container. 2387 // +optional 2388 SELinuxOptions *SELinuxOptions `json:"seLinuxOptions,omitempty" protobuf:"bytes,1,opt,name=seLinuxOptions"` 2389 // The UID to run the entrypoint of the container process. 2390 // Defaults to user specified in image metadata if unspecified. 2391 // May also be set in SecurityContext. If set in both SecurityContext and 2392 // PodSecurityContext, the value specified in SecurityContext takes precedence 2393 // for that container. 2394 // +optional 2395 RunAsUser *int64 `json:"runAsUser,omitempty" protobuf:"varint,2,opt,name=runAsUser"` 2396 // Indicates that the container must run as a non-root user. 2397 // If true, the Kubelet will validate the image at runtime to ensure that it 2398 // does not run as UID 0 (root) and fail to start the container if it does. 2399 // If unset or false, no such validation will be performed. 2400 // May also be set in SecurityContext. If set in both SecurityContext and 2401 // PodSecurityContext, the value specified in SecurityContext takes precedence. 2402 // +optional 2403 RunAsNonRoot *bool `json:"runAsNonRoot,omitempty" protobuf:"varint,3,opt,name=runAsNonRoot"` 2404 // A list of groups applied to the first process run in each container, in addition 2405 // to the container's primary GID. If unspecified, no groups will be added to 2406 // any container. 2407 // +optional 2408 SupplementalGroups []int64 `json:"supplementalGroups,omitempty" protobuf:"varint,4,rep,name=supplementalGroups"` 2409 // A special supplemental group that applies to all containers in a pod. 2410 // Some volume types allow the Kubelet to change the ownership of that volume 2411 // to be owned by the pod: 2412 // 2413 // 1. The owning GID will be the FSGroup 2414 // 2. The setgid bit is set (new files created in the volume will be owned by FSGroup) 2415 // 3. The permission bits are OR'd with rw-rw---- 2416 // 2417 // If unset, the Kubelet will not modify the ownership and permissions of any volume. 2418 // +optional 2419 FSGroup *int64 `json:"fsGroup,omitempty" protobuf:"varint,5,opt,name=fsGroup"` 2420} 2421 2422// PodQOSClass defines the supported qos classes of Pods. 2423type PodQOSClass string 2424 2425const ( 2426 // PodQOSGuaranteed is the Guaranteed qos class. 2427 PodQOSGuaranteed PodQOSClass = "Guaranteed" 2428 // PodQOSBurstable is the Burstable qos class. 2429 PodQOSBurstable PodQOSClass = "Burstable" 2430 // PodQOSBestEffort is the BestEffort qos class. 2431 PodQOSBestEffort PodQOSClass = "BestEffort" 2432) 2433 2434// PodStatus represents information about the status of a pod. Status may trail the actual 2435// state of a system. 2436type PodStatus struct { 2437 // Current condition of the pod. 2438 // More info: http://kubernetes.io/docs/user-guide/pod-states#pod-phase 2439 // +optional 2440 Phase PodPhase `json:"phase,omitempty" protobuf:"bytes,1,opt,name=phase,casttype=PodPhase"` 2441 // Current service state of pod. 2442 // More info: http://kubernetes.io/docs/user-guide/pod-states#pod-conditions 2443 // +optional 2444 Conditions []PodCondition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type" protobuf:"bytes,2,rep,name=conditions"` 2445 // A human readable message indicating details about why the pod is in this condition. 2446 // +optional 2447 Message string `json:"message,omitempty" protobuf:"bytes,3,opt,name=message"` 2448 // A brief CamelCase message indicating details about why the pod is in this state. 2449 // e.g. 'OutOfDisk' 2450 // +optional 2451 Reason string `json:"reason,omitempty" protobuf:"bytes,4,opt,name=reason"` 2452 2453 // IP address of the host to which the pod is assigned. Empty if not yet scheduled. 2454 // +optional 2455 HostIP string `json:"hostIP,omitempty" protobuf:"bytes,5,opt,name=hostIP"` 2456 // IP address allocated to the pod. Routable at least within the cluster. 2457 // Empty if not yet allocated. 2458 // +optional 2459 PodIP string `json:"podIP,omitempty" protobuf:"bytes,6,opt,name=podIP"` 2460 2461 // RFC 3339 date and time at which the object was acknowledged by the Kubelet. 2462 // This is before the Kubelet pulled the container image(s) for the pod. 2463 // +optional 2464 StartTime *metav1.Time `json:"startTime,omitempty" protobuf:"bytes,7,opt,name=startTime"` 2465 2466 // The list has one entry per init container in the manifest. The most recent successful 2467 // init container will have ready = true, the most recently started container will have 2468 // startTime set. 2469 // More info: http://kubernetes.io/docs/user-guide/pod-states#container-statuses 2470 InitContainerStatuses []ContainerStatus `json:"initContainerStatuses,omitempty" protobuf:"bytes,10,rep,name=initContainerStatuses"` 2471 2472 // The list has one entry per container in the manifest. Each entry is currently the output 2473 // of `docker inspect`. 2474 // More info: http://kubernetes.io/docs/user-guide/pod-states#container-statuses 2475 // +optional 2476 ContainerStatuses []ContainerStatus `json:"containerStatuses,omitempty" protobuf:"bytes,8,rep,name=containerStatuses"` 2477 // The Quality of Service (QOS) classification assigned to the pod based on resource requirements 2478 // See PodQOSClass type for available QOS classes 2479 // More info: https://github.com/kubernetes/kubernetes/blob/master/docs/design/resource-qos.md 2480 // +optional 2481 QOSClass PodQOSClass `json:"qosClass,omitempty" protobuf:"bytes,9,rep,name=qosClass"` 2482} 2483 2484// PodStatusResult is a wrapper for PodStatus returned by kubelet that can be encode/decoded 2485type PodStatusResult struct { 2486 metav1.TypeMeta `json:",inline"` 2487 // Standard object's metadata. 2488 // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata 2489 // +optional 2490 metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` 2491 // Most recently observed status of the pod. 2492 // This data may not be up to date. 2493 // Populated by the system. 2494 // Read-only. 2495 // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status 2496 // +optional 2497 Status PodStatus `json:"status,omitempty" protobuf:"bytes,2,opt,name=status"` 2498} 2499 2500// +genclient=true 2501 2502// Pod is a collection of containers that can run on a host. This resource is created 2503// by clients and scheduled onto hosts. 2504type Pod struct { 2505 metav1.TypeMeta `json:",inline"` 2506 // Standard object's metadata. 2507 // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata 2508 // +optional 2509 metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` 2510 2511 // Specification of the desired behavior of the pod. 2512 // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status 2513 // +optional 2514 Spec PodSpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"` 2515 2516 // Most recently observed status of the pod. 2517 // This data may not be up to date. 2518 // Populated by the system. 2519 // Read-only. 2520 // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status 2521 // +optional 2522 Status PodStatus `json:"status,omitempty" protobuf:"bytes,3,opt,name=status"` 2523} 2524 2525// PodList is a list of Pods. 2526type PodList struct { 2527 metav1.TypeMeta `json:",inline"` 2528 // Standard list metadata. 2529 // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#types-kinds 2530 // +optional 2531 metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` 2532 2533 // List of pods. 2534 // More info: http://kubernetes.io/docs/user-guide/pods 2535 Items []Pod `json:"items" protobuf:"bytes,2,rep,name=items"` 2536} 2537 2538// PodTemplateSpec describes the data a pod should have when created from a template 2539type PodTemplateSpec struct { 2540 // Standard object's metadata. 2541 // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata 2542 // +optional 2543 metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` 2544 2545 // Specification of the desired behavior of the pod. 2546 // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status 2547 // +optional 2548 Spec PodSpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"` 2549} 2550 2551// +genclient=true 2552 2553// PodTemplate describes a template for creating copies of a predefined pod. 2554type PodTemplate struct { 2555 metav1.TypeMeta `json:",inline"` 2556 // Standard object's metadata. 2557 // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata 2558 // +optional 2559 metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` 2560 2561 // Template defines the pods that will be created from this pod template. 2562 // http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status 2563 // +optional 2564 Template PodTemplateSpec `json:"template,omitempty" protobuf:"bytes,2,opt,name=template"` 2565} 2566 2567// PodTemplateList is a list of PodTemplates. 2568type PodTemplateList struct { 2569 metav1.TypeMeta `json:",inline"` 2570 // Standard list metadata. 2571 // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#types-kinds 2572 // +optional 2573 metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` 2574 2575 // List of pod templates 2576 Items []PodTemplate `json:"items" protobuf:"bytes,2,rep,name=items"` 2577} 2578 2579// ReplicationControllerSpec is the specification of a replication controller. 2580type ReplicationControllerSpec struct { 2581 // Replicas is the number of desired replicas. 2582 // This is a pointer to distinguish between explicit zero and unspecified. 2583 // Defaults to 1. 2584 // More info: http://kubernetes.io/docs/user-guide/replication-controller#what-is-a-replication-controller 2585 // +optional 2586 Replicas *int32 `json:"replicas,omitempty" protobuf:"varint,1,opt,name=replicas"` 2587 2588 // Minimum number of seconds for which a newly created pod should be ready 2589 // without any of its container crashing, for it to be considered available. 2590 // Defaults to 0 (pod will be considered available as soon as it is ready) 2591 // +optional 2592 MinReadySeconds int32 `json:"minReadySeconds,omitempty" protobuf:"varint,4,opt,name=minReadySeconds"` 2593 2594 // Selector is a label query over pods that should match the Replicas count. 2595 // If Selector is empty, it is defaulted to the labels present on the Pod template. 2596 // Label keys and values that must match in order to be controlled by this replication 2597 // controller, if empty defaulted to labels on Pod template. 2598 // More info: http://kubernetes.io/docs/user-guide/labels#label-selectors 2599 // +optional 2600 Selector map[string]string `json:"selector,omitempty" protobuf:"bytes,2,rep,name=selector"` 2601 2602 // TemplateRef is a reference to an object that describes the pod that will be created if 2603 // insufficient replicas are detected. 2604 // Reference to an object that describes the pod that will be created if insufficient replicas are detected. 2605 // +optional 2606 // TemplateRef *ObjectReference `json:"templateRef,omitempty"` 2607 2608 // Template is the object that describes the pod that will be created if 2609 // insufficient replicas are detected. This takes precedence over a TemplateRef. 2610 // More info: http://kubernetes.io/docs/user-guide/replication-controller#pod-template 2611 // +optional 2612 Template *PodTemplateSpec `json:"template,omitempty" protobuf:"bytes,3,opt,name=template"` 2613} 2614 2615// ReplicationControllerStatus represents the current status of a replication 2616// controller. 2617type ReplicationControllerStatus struct { 2618 // Replicas is the most recently oberved number of replicas. 2619 // More info: http://kubernetes.io/docs/user-guide/replication-controller#what-is-a-replication-controller 2620 Replicas int32 `json:"replicas" protobuf:"varint,1,opt,name=replicas"` 2621 2622 // The number of pods that have labels matching the labels of the pod template of the replication controller. 2623 // +optional 2624 FullyLabeledReplicas int32 `json:"fullyLabeledReplicas,omitempty" protobuf:"varint,2,opt,name=fullyLabeledReplicas"` 2625 2626 // The number of ready replicas for this replication controller. 2627 // +optional 2628 ReadyReplicas int32 `json:"readyReplicas,omitempty" protobuf:"varint,4,opt,name=readyReplicas"` 2629 2630 // The number of available replicas (ready for at least minReadySeconds) for this replication controller. 2631 // +optional 2632 AvailableReplicas int32 `json:"availableReplicas,omitempty" protobuf:"varint,5,opt,name=availableReplicas"` 2633 2634 // ObservedGeneration reflects the generation of the most recently observed replication controller. 2635 // +optional 2636 ObservedGeneration int64 `json:"observedGeneration,omitempty" protobuf:"varint,3,opt,name=observedGeneration"` 2637 2638 // Represents the latest available observations of a replication controller's current state. 2639 // +optional 2640 Conditions []ReplicationControllerCondition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type" protobuf:"bytes,6,rep,name=conditions"` 2641} 2642 2643type ReplicationControllerConditionType string 2644 2645// These are valid conditions of a replication controller. 2646const ( 2647 // ReplicationControllerReplicaFailure is added in a replication controller when one of its pods 2648 // fails to be created due to insufficient quota, limit ranges, pod security policy, node selectors, 2649 // etc. or deleted due to kubelet being down or finalizers are failing. 2650 ReplicationControllerReplicaFailure ReplicationControllerConditionType = "ReplicaFailure" 2651) 2652 2653// ReplicationControllerCondition describes the state of a replication controller at a certain point. 2654type ReplicationControllerCondition struct { 2655 // Type of replication controller condition. 2656 Type ReplicationControllerConditionType `json:"type" protobuf:"bytes,1,opt,name=type,casttype=ReplicationControllerConditionType"` 2657 // Status of the condition, one of True, False, Unknown. 2658 Status ConditionStatus `json:"status" protobuf:"bytes,2,opt,name=status,casttype=ConditionStatus"` 2659 // The last time the condition transitioned from one status to another. 2660 // +optional 2661 LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty" protobuf:"bytes,3,opt,name=lastTransitionTime"` 2662 // The reason for the condition's last transition. 2663 // +optional 2664 Reason string `json:"reason,omitempty" protobuf:"bytes,4,opt,name=reason"` 2665 // A human readable message indicating details about the transition. 2666 // +optional 2667 Message string `json:"message,omitempty" protobuf:"bytes,5,opt,name=message"` 2668} 2669 2670// +genclient=true 2671 2672// ReplicationController represents the configuration of a replication controller. 2673type ReplicationController struct { 2674 metav1.TypeMeta `json:",inline"` 2675 2676 // If the Labels of a ReplicationController are empty, they are defaulted to 2677 // be the same as the Pod(s) that the replication controller manages. 2678 // Standard object's metadata. More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata 2679 // +optional 2680 metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` 2681 2682 // Spec defines the specification of the desired behavior of the replication controller. 2683 // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status 2684 // +optional 2685 Spec ReplicationControllerSpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"` 2686 2687 // Status is the most recently observed status of the replication controller. 2688 // This data may be out of date by some window of time. 2689 // Populated by the system. 2690 // Read-only. 2691 // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status 2692 // +optional 2693 Status ReplicationControllerStatus `json:"status,omitempty" protobuf:"bytes,3,opt,name=status"` 2694} 2695 2696// ReplicationControllerList is a collection of replication controllers. 2697type ReplicationControllerList struct { 2698 metav1.TypeMeta `json:",inline"` 2699 // Standard list metadata. 2700 // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#types-kinds 2701 // +optional 2702 metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` 2703 2704 // List of replication controllers. 2705 // More info: http://kubernetes.io/docs/user-guide/replication-controller 2706 Items []ReplicationController `json:"items" protobuf:"bytes,2,rep,name=items"` 2707} 2708 2709// Session Affinity Type string 2710type ServiceAffinity string 2711 2712const ( 2713 // ServiceAffinityClientIP is the Client IP based. 2714 ServiceAffinityClientIP ServiceAffinity = "ClientIP" 2715 2716 // ServiceAffinityNone - no session affinity. 2717 ServiceAffinityNone ServiceAffinity = "None" 2718) 2719 2720// Service Type string describes ingress methods for a service 2721type ServiceType string 2722 2723const ( 2724 // ServiceTypeClusterIP means a service will only be accessible inside the 2725 // cluster, via the cluster IP. 2726 ServiceTypeClusterIP ServiceType = "ClusterIP" 2727 2728 // ServiceTypeNodePort means a service will be exposed on one port of 2729 // every node, in addition to 'ClusterIP' type. 2730 ServiceTypeNodePort ServiceType = "NodePort" 2731 2732 // ServiceTypeLoadBalancer means a service will be exposed via an 2733 // external load balancer (if the cloud provider supports it), in addition 2734 // to 'NodePort' type. 2735 ServiceTypeLoadBalancer ServiceType = "LoadBalancer" 2736 2737 // ServiceTypeExternalName means a service consists of only a reference to 2738 // an external name that kubedns or equivalent will return as a CNAME 2739 // record, with no exposing or proxying of any pods involved. 2740 ServiceTypeExternalName ServiceType = "ExternalName" 2741) 2742 2743// ServiceStatus represents the current status of a service. 2744type ServiceStatus struct { 2745 // LoadBalancer contains the current status of the load-balancer, 2746 // if one is present. 2747 // +optional 2748 LoadBalancer LoadBalancerStatus `json:"loadBalancer,omitempty" protobuf:"bytes,1,opt,name=loadBalancer"` 2749} 2750 2751// LoadBalancerStatus represents the status of a load-balancer. 2752type LoadBalancerStatus struct { 2753 // Ingress is a list containing ingress points for the load-balancer. 2754 // Traffic intended for the service should be sent to these ingress points. 2755 // +optional 2756 Ingress []LoadBalancerIngress `json:"ingress,omitempty" protobuf:"bytes,1,rep,name=ingress"` 2757} 2758 2759// LoadBalancerIngress represents the status of a load-balancer ingress point: 2760// traffic intended for the service should be sent to an ingress point. 2761type LoadBalancerIngress struct { 2762 // IP is set for load-balancer ingress points that are IP based 2763 // (typically GCE or OpenStack load-balancers) 2764 // +optional 2765 IP string `json:"ip,omitempty" protobuf:"bytes,1,opt,name=ip"` 2766 2767 // Hostname is set for load-balancer ingress points that are DNS based 2768 // (typically AWS load-balancers) 2769 // +optional 2770 Hostname string `json:"hostname,omitempty" protobuf:"bytes,2,opt,name=hostname"` 2771} 2772 2773// ServiceSpec describes the attributes that a user creates on a service. 2774type ServiceSpec struct { 2775 // The list of ports that are exposed by this service. 2776 // More info: http://kubernetes.io/docs/user-guide/services#virtual-ips-and-service-proxies 2777 Ports []ServicePort `json:"ports,omitempty" patchStrategy:"merge" patchMergeKey:"port" protobuf:"bytes,1,rep,name=ports"` 2778 2779 // Route service traffic to pods with label keys and values matching this 2780 // selector. If empty or not present, the service is assumed to have an 2781 // external process managing its endpoints, which Kubernetes will not 2782 // modify. Only applies to types ClusterIP, NodePort, and LoadBalancer. 2783 // Ignored if type is ExternalName. 2784 // More info: http://kubernetes.io/docs/user-guide/services#overview 2785 // +optional 2786 Selector map[string]string `json:"selector,omitempty" protobuf:"bytes,2,rep,name=selector"` 2787 2788 // clusterIP is the IP address of the service and is usually assigned 2789 // randomly by the master. If an address is specified manually and is not in 2790 // use by others, it will be allocated to the service; otherwise, creation 2791 // of the service will fail. This field can not be changed through updates. 2792 // Valid values are "None", empty string (""), or a valid IP address. "None" 2793 // can be specified for headless services when proxying is not required. 2794 // Only applies to types ClusterIP, NodePort, and LoadBalancer. Ignored if 2795 // type is ExternalName. 2796 // More info: http://kubernetes.io/docs/user-guide/services#virtual-ips-and-service-proxies 2797 // +optional 2798 ClusterIP string `json:"clusterIP,omitempty" protobuf:"bytes,3,opt,name=clusterIP"` 2799 2800 // type determines how the Service is exposed. Defaults to ClusterIP. Valid 2801 // options are ExternalName, ClusterIP, NodePort, and LoadBalancer. 2802 // "ExternalName" maps to the specified externalName. 2803 // "ClusterIP" allocates a cluster-internal IP address for load-balancing to 2804 // endpoints. Endpoints are determined by the selector or if that is not 2805 // specified, by manual construction of an Endpoints object. If clusterIP is 2806 // "None", no virtual IP is allocated and the endpoints are published as a 2807 // set of endpoints rather than a stable IP. 2808 // "NodePort" builds on ClusterIP and allocates a port on every node which 2809 // routes to the clusterIP. 2810 // "LoadBalancer" builds on NodePort and creates an 2811 // external load-balancer (if supported in the current cloud) which routes 2812 // to the clusterIP. 2813 // More info: http://kubernetes.io/docs/user-guide/services#overview 2814 // +optional 2815 Type ServiceType `json:"type,omitempty" protobuf:"bytes,4,opt,name=type,casttype=ServiceType"` 2816 2817 // externalIPs is a list of IP addresses for which nodes in the cluster 2818 // will also accept traffic for this service. These IPs are not managed by 2819 // Kubernetes. The user is responsible for ensuring that traffic arrives 2820 // at a node with this IP. A common example is external load-balancers 2821 // that are not part of the Kubernetes system. A previous form of this 2822 // functionality exists as the deprecatedPublicIPs field. When using this 2823 // field, callers should also clear the deprecatedPublicIPs field. 2824 // +optional 2825 ExternalIPs []string `json:"externalIPs,omitempty" protobuf:"bytes,5,rep,name=externalIPs"` 2826 2827 // deprecatedPublicIPs is deprecated and replaced by the externalIPs field 2828 // with almost the exact same semantics. This field is retained in the v1 2829 // API for compatibility until at least 8/20/2016. It will be removed from 2830 // any new API revisions. If both deprecatedPublicIPs *and* externalIPs are 2831 // set, deprecatedPublicIPs is used. 2832 // +k8s:conversion-gen=false 2833 // +optional 2834 DeprecatedPublicIPs []string `json:"deprecatedPublicIPs,omitempty" protobuf:"bytes,6,rep,name=deprecatedPublicIPs"` 2835 2836 // Supports "ClientIP" and "None". Used to maintain session affinity. 2837 // Enable client IP based session affinity. 2838 // Must be ClientIP or None. 2839 // Defaults to None. 2840 // More info: http://kubernetes.io/docs/user-guide/services#virtual-ips-and-service-proxies 2841 // +optional 2842 SessionAffinity ServiceAffinity `json:"sessionAffinity,omitempty" protobuf:"bytes,7,opt,name=sessionAffinity,casttype=ServiceAffinity"` 2843 2844 // Only applies to Service Type: LoadBalancer 2845 // LoadBalancer will get created with the IP specified in this field. 2846 // This feature depends on whether the underlying cloud-provider supports specifying 2847 // the loadBalancerIP when a load balancer is created. 2848 // This field will be ignored if the cloud-provider does not support the feature. 2849 // +optional 2850 LoadBalancerIP string `json:"loadBalancerIP,omitempty" protobuf:"bytes,8,opt,name=loadBalancerIP"` 2851 2852 // If specified and supported by the platform, this will restrict traffic through the cloud-provider 2853 // load-balancer will be restricted to the specified client IPs. This field will be ignored if the 2854 // cloud-provider does not support the feature." 2855 // More info: http://kubernetes.io/docs/user-guide/services-firewalls 2856 // +optional 2857 LoadBalancerSourceRanges []string `json:"loadBalancerSourceRanges,omitempty" protobuf:"bytes,9,opt,name=loadBalancerSourceRanges"` 2858 2859 // externalName is the external reference that kubedns or equivalent will 2860 // return as a CNAME record for this service. No proxying will be involved. 2861 // Must be a valid DNS name and requires Type to be ExternalName. 2862 // +optional 2863 ExternalName string `json:"externalName,omitempty" protobuf:"bytes,10,opt,name=externalName"` 2864} 2865 2866// ServicePort contains information on service's port. 2867type ServicePort struct { 2868 // The name of this port within the service. This must be a DNS_LABEL. 2869 // All ports within a ServiceSpec must have unique names. This maps to 2870 // the 'Name' field in EndpointPort objects. 2871 // Optional if only one ServicePort is defined on this service. 2872 // +optional 2873 Name string `json:"name,omitempty" protobuf:"bytes,1,opt,name=name"` 2874 2875 // The IP protocol for this port. Supports "TCP" and "UDP". 2876 // Default is TCP. 2877 // +optional 2878 Protocol Protocol `json:"protocol,omitempty" protobuf:"bytes,2,opt,name=protocol,casttype=Protocol"` 2879 2880 // The port that will be exposed by this service. 2881 Port int32 `json:"port" protobuf:"varint,3,opt,name=port"` 2882 2883 // Number or name of the port to access on the pods targeted by the service. 2884 // Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. 2885 // If this is a string, it will be looked up as a named port in the 2886 // target Pod's container ports. If this is not specified, the value 2887 // of the 'port' field is used (an identity map). 2888 // This field is ignored for services with clusterIP=None, and should be 2889 // omitted or set equal to the 'port' field. 2890 // More info: http://kubernetes.io/docs/user-guide/services#defining-a-service 2891 // +optional 2892 TargetPort intstr.IntOrString `json:"targetPort,omitempty" protobuf:"bytes,4,opt,name=targetPort"` 2893 2894 // The port on each node on which this service is exposed when type=NodePort or LoadBalancer. 2895 // Usually assigned by the system. If specified, it will be allocated to the service 2896 // if unused or else creation of the service will fail. 2897 // Default is to auto-allocate a port if the ServiceType of this Service requires one. 2898 // More info: http://kubernetes.io/docs/user-guide/services#type--nodeport 2899 // +optional 2900 NodePort int32 `json:"nodePort,omitempty" protobuf:"varint,5,opt,name=nodePort"` 2901} 2902 2903// +genclient=true 2904 2905// Service is a named abstraction of software service (for example, mysql) consisting of local port 2906// (for example 3306) that the proxy listens on, and the selector that determines which pods 2907// will answer requests sent through the proxy. 2908type Service struct { 2909 metav1.TypeMeta `json:",inline"` 2910 // Standard object's metadata. 2911 // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata 2912 // +optional 2913 metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` 2914 2915 // Spec defines the behavior of a service. 2916 // http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status 2917 // +optional 2918 Spec ServiceSpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"` 2919 2920 // Most recently observed status of the service. 2921 // Populated by the system. 2922 // Read-only. 2923 // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status 2924 // +optional 2925 Status ServiceStatus `json:"status,omitempty" protobuf:"bytes,3,opt,name=status"` 2926} 2927 2928const ( 2929 // ClusterIPNone - do not assign a cluster IP 2930 // no proxying required and no environment variables should be created for pods 2931 ClusterIPNone = "None" 2932) 2933 2934// ServiceList holds a list of services. 2935type ServiceList struct { 2936 metav1.TypeMeta `json:",inline"` 2937 // Standard list metadata. 2938 // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#types-kinds 2939 // +optional 2940 metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` 2941 2942 // List of services 2943 Items []Service `json:"items" protobuf:"bytes,2,rep,name=items"` 2944} 2945 2946// +genclient=true 2947 2948// ServiceAccount binds together: 2949// * a name, understood by users, and perhaps by peripheral systems, for an identity 2950// * a principal that can be authenticated and authorized 2951// * a set of secrets 2952type ServiceAccount struct { 2953 metav1.TypeMeta `json:",inline"` 2954 // Standard object's metadata. 2955 // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata 2956 // +optional 2957 metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` 2958 2959 // Secrets is the list of secrets allowed to be used by pods running using this ServiceAccount. 2960 // More info: http://kubernetes.io/docs/user-guide/secrets 2961 // +optional 2962 Secrets []ObjectReference `json:"secrets,omitempty" patchStrategy:"merge" patchMergeKey:"name" protobuf:"bytes,2,rep,name=secrets"` 2963 2964 // ImagePullSecrets is a list of references to secrets in the same namespace to use for pulling any images 2965 // in pods that reference this ServiceAccount. ImagePullSecrets are distinct from Secrets because Secrets 2966 // can be mounted in the pod, but ImagePullSecrets are only accessed by the kubelet. 2967 // More info: http://kubernetes.io/docs/user-guide/secrets#manually-specifying-an-imagepullsecret 2968 // +optional 2969 ImagePullSecrets []LocalObjectReference `json:"imagePullSecrets,omitempty" protobuf:"bytes,3,rep,name=imagePullSecrets"` 2970 2971 // AutomountServiceAccountToken indicates whether pods running as this service account should have an API token automatically mounted. 2972 // Can be overridden at the pod level. 2973 // +optional 2974 AutomountServiceAccountToken *bool `json:"automountServiceAccountToken,omitempty" protobuf:"varint,4,opt,name=automountServiceAccountToken"` 2975} 2976 2977// ServiceAccountList is a list of ServiceAccount objects 2978type ServiceAccountList struct { 2979 metav1.TypeMeta `json:",inline"` 2980 // Standard list metadata. 2981 // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#types-kinds 2982 // +optional 2983 metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` 2984 2985 // List of ServiceAccounts. 2986 // More info: http://releases.k8s.io/HEAD/docs/design/service_accounts.md#service-accounts 2987 Items []ServiceAccount `json:"items" protobuf:"bytes,2,rep,name=items"` 2988} 2989 2990// +genclient=true 2991 2992// Endpoints is a collection of endpoints that implement the actual service. Example: 2993// Name: "mysvc", 2994// Subsets: [ 2995// { 2996// Addresses: [{"ip": "10.10.1.1"}, {"ip": "10.10.2.2"}], 2997// Ports: [{"name": "a", "port": 8675}, {"name": "b", "port": 309}] 2998// }, 2999// { 3000// Addresses: [{"ip": "10.10.3.3"}], 3001// Ports: [{"name": "a", "port": 93}, {"name": "b", "port": 76}] 3002// }, 3003// ] 3004type Endpoints struct { 3005 metav1.TypeMeta `json:",inline"` 3006 // Standard object's metadata. 3007 // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata 3008 // +optional 3009 metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` 3010 3011 // The set of all endpoints is the union of all subsets. Addresses are placed into 3012 // subsets according to the IPs they share. A single address with multiple ports, 3013 // some of which are ready and some of which are not (because they come from 3014 // different containers) will result in the address being displayed in different 3015 // subsets for the different ports. No address will appear in both Addresses and 3016 // NotReadyAddresses in the same subset. 3017 // Sets of addresses and ports that comprise a service. 3018 Subsets []EndpointSubset `json:"subsets" protobuf:"bytes,2,rep,name=subsets"` 3019} 3020 3021// EndpointSubset is a group of addresses with a common set of ports. The 3022// expanded set of endpoints is the Cartesian product of Addresses x Ports. 3023// For example, given: 3024// { 3025// Addresses: [{"ip": "10.10.1.1"}, {"ip": "10.10.2.2"}], 3026// Ports: [{"name": "a", "port": 8675}, {"name": "b", "port": 309}] 3027// } 3028// The resulting set of endpoints can be viewed as: 3029// a: [ 10.10.1.1:8675, 10.10.2.2:8675 ], 3030// b: [ 10.10.1.1:309, 10.10.2.2:309 ] 3031type EndpointSubset struct { 3032 // IP addresses which offer the related ports that are marked as ready. These endpoints 3033 // should be considered safe for load balancers and clients to utilize. 3034 // +optional 3035 Addresses []EndpointAddress `json:"addresses,omitempty" protobuf:"bytes,1,rep,name=addresses"` 3036 // IP addresses which offer the related ports but are not currently marked as ready 3037 // because they have not yet finished starting, have recently failed a readiness check, 3038 // or have recently failed a liveness check. 3039 // +optional 3040 NotReadyAddresses []EndpointAddress `json:"notReadyAddresses,omitempty" protobuf:"bytes,2,rep,name=notReadyAddresses"` 3041 // Port numbers available on the related IP addresses. 3042 // +optional 3043 Ports []EndpointPort `json:"ports,omitempty" protobuf:"bytes,3,rep,name=ports"` 3044} 3045 3046// EndpointAddress is a tuple that describes single IP address. 3047type EndpointAddress struct { 3048 // The IP of this endpoint. 3049 // May not be loopback (127.0.0.0/8), link-local (169.254.0.0/16), 3050 // or link-local multicast ((224.0.0.0/24). 3051 // IPv6 is also accepted but not fully supported on all platforms. Also, certain 3052 // kubernetes components, like kube-proxy, are not IPv6 ready. 3053 // TODO: This should allow hostname or IP, See #4447. 3054 IP string `json:"ip" protobuf:"bytes,1,opt,name=ip"` 3055 // The Hostname of this endpoint 3056 // +optional 3057 Hostname string `json:"hostname,omitempty" protobuf:"bytes,3,opt,name=hostname"` 3058 // Optional: Node hosting this endpoint. This can be used to determine endpoints local to a node. 3059 // +optional 3060 NodeName *string `json:"nodeName,omitempty" protobuf:"bytes,4,opt,name=nodeName"` 3061 // Reference to object providing the endpoint. 3062 // +optional 3063 TargetRef *ObjectReference `json:"targetRef,omitempty" protobuf:"bytes,2,opt,name=targetRef"` 3064} 3065 3066// EndpointPort is a tuple that describes a single port. 3067type EndpointPort struct { 3068 // The name of this port (corresponds to ServicePort.Name). 3069 // Must be a DNS_LABEL. 3070 // Optional only if one port is defined. 3071 // +optional 3072 Name string `json:"name,omitempty" protobuf:"bytes,1,opt,name=name"` 3073 3074 // The port number of the endpoint. 3075 Port int32 `json:"port" protobuf:"varint,2,opt,name=port"` 3076 3077 // The IP protocol for this port. 3078 // Must be UDP or TCP. 3079 // Default is TCP. 3080 // +optional 3081 Protocol Protocol `json:"protocol,omitempty" protobuf:"bytes,3,opt,name=protocol,casttype=Protocol"` 3082} 3083 3084// EndpointsList is a list of endpoints. 3085type EndpointsList struct { 3086 metav1.TypeMeta `json:",inline"` 3087 // Standard list metadata. 3088 // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#types-kinds 3089 // +optional 3090 metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` 3091 3092 // List of endpoints. 3093 Items []Endpoints `json:"items" protobuf:"bytes,2,rep,name=items"` 3094} 3095 3096// NodeSpec describes the attributes that a node is created with. 3097type NodeSpec struct { 3098 // PodCIDR represents the pod IP range assigned to the node. 3099 // +optional 3100 PodCIDR string `json:"podCIDR,omitempty" protobuf:"bytes,1,opt,name=podCIDR"` 3101 // External ID of the node assigned by some machine database (e.g. a cloud provider). 3102 // Deprecated. 3103 // +optional 3104 ExternalID string `json:"externalID,omitempty" protobuf:"bytes,2,opt,name=externalID"` 3105 // ID of the node assigned by the cloud provider in the format: <ProviderName>://<ProviderSpecificNodeID> 3106 // +optional 3107 ProviderID string `json:"providerID,omitempty" protobuf:"bytes,3,opt,name=providerID"` 3108 // Unschedulable controls node schedulability of new pods. By default, node is schedulable. 3109 // More info: http://releases.k8s.io/HEAD/docs/admin/node.md#manual-node-administration 3110 // +optional 3111 Unschedulable bool `json:"unschedulable,omitempty" protobuf:"varint,4,opt,name=unschedulable"` 3112 // If specified, the node's taints. 3113 // +optional 3114 Taints []Taint `json:"taints,omitempty" protobuf:"bytes,5,opt,name=taints"` 3115} 3116 3117// DaemonEndpoint contains information about a single Daemon endpoint. 3118type DaemonEndpoint struct { 3119 /* 3120 The port tag was not properly in quotes in earlier releases, so it must be 3121 uppercased for backwards compat (since it was falling back to var name of 3122 'Port'). 3123 */ 3124 3125 // Port number of the given endpoint. 3126 Port int32 `json:"Port" protobuf:"varint,1,opt,name=Port"` 3127} 3128 3129// NodeDaemonEndpoints lists ports opened by daemons running on the Node. 3130type NodeDaemonEndpoints struct { 3131 // Endpoint on which Kubelet is listening. 3132 // +optional 3133 KubeletEndpoint DaemonEndpoint `json:"kubeletEndpoint,omitempty" protobuf:"bytes,1,opt,name=kubeletEndpoint"` 3134} 3135 3136// NodeSystemInfo is a set of ids/uuids to uniquely identify the node. 3137type NodeSystemInfo struct { 3138 // MachineID reported by the node. For unique machine identification 3139 // in the cluster this field is prefered. Learn more from man(5) 3140 // machine-id: http://man7.org/linux/man-pages/man5/machine-id.5.html 3141 MachineID string `json:"machineID" protobuf:"bytes,1,opt,name=machineID"` 3142 // SystemUUID reported by the node. For unique machine identification 3143 // MachineID is prefered. This field is specific to Red Hat hosts 3144 // https://access.redhat.com/documentation/en-US/Red_Hat_Subscription_Management/1/html/RHSM/getting-system-uuid.html 3145 SystemUUID string `json:"systemUUID" protobuf:"bytes,2,opt,name=systemUUID"` 3146 // Boot ID reported by the node. 3147 BootID string `json:"bootID" protobuf:"bytes,3,opt,name=bootID"` 3148 // Kernel Version reported by the node from 'uname -r' (e.g. 3.16.0-0.bpo.4-amd64). 3149 KernelVersion string `json:"kernelVersion" protobuf:"bytes,4,opt,name=kernelVersion"` 3150 // OS Image reported by the node from /etc/os-release (e.g. Debian GNU/Linux 7 (wheezy)). 3151 OSImage string `json:"osImage" protobuf:"bytes,5,opt,name=osImage"` 3152 // ContainerRuntime Version reported by the node through runtime remote API (e.g. docker://1.5.0). 3153 ContainerRuntimeVersion string `json:"containerRuntimeVersion" protobuf:"bytes,6,opt,name=containerRuntimeVersion"` 3154 // Kubelet Version reported by the node. 3155 KubeletVersion string `json:"kubeletVersion" protobuf:"bytes,7,opt,name=kubeletVersion"` 3156 // KubeProxy Version reported by the node. 3157 KubeProxyVersion string `json:"kubeProxyVersion" protobuf:"bytes,8,opt,name=kubeProxyVersion"` 3158 // The Operating System reported by the node 3159 OperatingSystem string `json:"operatingSystem" protobuf:"bytes,9,opt,name=operatingSystem"` 3160 // The Architecture reported by the node 3161 Architecture string `json:"architecture" protobuf:"bytes,10,opt,name=architecture"` 3162} 3163 3164// NodeStatus is information about the current status of a node. 3165type NodeStatus struct { 3166 // Capacity represents the total resources of a node. 3167 // More info: http://kubernetes.io/docs/user-guide/persistent-volumes#capacity for more details. 3168 // +optional 3169 Capacity ResourceList `json:"capacity,omitempty" protobuf:"bytes,1,rep,name=capacity,casttype=ResourceList,castkey=ResourceName"` 3170 // Allocatable represents the resources of a node that are available for scheduling. 3171 // Defaults to Capacity. 3172 // +optional 3173 Allocatable ResourceList `json:"allocatable,omitempty" protobuf:"bytes,2,rep,name=allocatable,casttype=ResourceList,castkey=ResourceName"` 3174 // NodePhase is the recently observed lifecycle phase of the node. 3175 // More info: http://releases.k8s.io/HEAD/docs/admin/node.md#node-phase 3176 // The field is never populated, and now is deprecated. 3177 // +optional 3178 Phase NodePhase `json:"phase,omitempty" protobuf:"bytes,3,opt,name=phase,casttype=NodePhase"` 3179 // Conditions is an array of current observed node conditions. 3180 // More info: http://releases.k8s.io/HEAD/docs/admin/node.md#node-condition 3181 // +optional 3182 Conditions []NodeCondition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type" protobuf:"bytes,4,rep,name=conditions"` 3183 // List of addresses reachable to the node. 3184 // Queried from cloud provider, if available. 3185 // More info: http://releases.k8s.io/HEAD/docs/admin/node.md#node-addresses 3186 // +optional 3187 Addresses []NodeAddress `json:"addresses,omitempty" patchStrategy:"merge" patchMergeKey:"type" protobuf:"bytes,5,rep,name=addresses"` 3188 // Endpoints of daemons running on the Node. 3189 // +optional 3190 DaemonEndpoints NodeDaemonEndpoints `json:"daemonEndpoints,omitempty" protobuf:"bytes,6,opt,name=daemonEndpoints"` 3191 // Set of ids/uuids to uniquely identify the node. 3192 // More info: http://releases.k8s.io/HEAD/docs/admin/node.md#node-info 3193 // +optional 3194 NodeInfo NodeSystemInfo `json:"nodeInfo,omitempty" protobuf:"bytes,7,opt,name=nodeInfo"` 3195 // List of container images on this node 3196 // +optional 3197 Images []ContainerImage `json:"images,omitempty" protobuf:"bytes,8,rep,name=images"` 3198 // List of attachable volumes in use (mounted) by the node. 3199 // +optional 3200 VolumesInUse []UniqueVolumeName `json:"volumesInUse,omitempty" protobuf:"bytes,9,rep,name=volumesInUse"` 3201 // List of volumes that are attached to the node. 3202 // +optional 3203 VolumesAttached []AttachedVolume `json:"volumesAttached,omitempty" protobuf:"bytes,10,rep,name=volumesAttached"` 3204} 3205 3206type UniqueVolumeName string 3207 3208// AttachedVolume describes a volume attached to a node 3209type AttachedVolume struct { 3210 // Name of the attached volume 3211 Name UniqueVolumeName `json:"name" protobuf:"bytes,1,rep,name=name"` 3212 3213 // DevicePath represents the device path where the volume should be available 3214 DevicePath string `json:"devicePath" protobuf:"bytes,2,rep,name=devicePath"` 3215} 3216 3217// AvoidPods describes pods that should avoid this node. This is the value for a 3218// Node annotation with key scheduler.alpha.kubernetes.io/preferAvoidPods and 3219// will eventually become a field of NodeStatus. 3220type AvoidPods struct { 3221 // Bounded-sized list of signatures of pods that should avoid this node, sorted 3222 // in timestamp order from oldest to newest. Size of the slice is unspecified. 3223 // +optional 3224 PreferAvoidPods []PreferAvoidPodsEntry `json:"preferAvoidPods,omitempty" protobuf:"bytes,1,rep,name=preferAvoidPods"` 3225} 3226 3227// Describes a class of pods that should avoid this node. 3228type PreferAvoidPodsEntry struct { 3229 // The class of pods. 3230 PodSignature PodSignature `json:"podSignature" protobuf:"bytes,1,opt,name=podSignature"` 3231 // Time at which this entry was added to the list. 3232 // +optional 3233 EvictionTime metav1.Time `json:"evictionTime,omitempty" protobuf:"bytes,2,opt,name=evictionTime"` 3234 // (brief) reason why this entry was added to the list. 3235 // +optional 3236 Reason string `json:"reason,omitempty" protobuf:"bytes,3,opt,name=reason"` 3237 // Human readable message indicating why this entry was added to the list. 3238 // +optional 3239 Message string `json:"message,omitempty" protobuf:"bytes,4,opt,name=message"` 3240} 3241 3242// Describes the class of pods that should avoid this node. 3243// Exactly one field should be set. 3244type PodSignature struct { 3245 // Reference to controller whose pods should avoid this node. 3246 // +optional 3247 PodController *metav1.OwnerReference `json:"podController,omitempty" protobuf:"bytes,1,opt,name=podController"` 3248} 3249 3250// Describe a container image 3251type ContainerImage struct { 3252 // Names by which this image is known. 3253 // e.g. ["gcr.io/google_containers/hyperkube:v1.0.7", "dockerhub.io/google_containers/hyperkube:v1.0.7"] 3254 Names []string `json:"names" protobuf:"bytes,1,rep,name=names"` 3255 // The size of the image in bytes. 3256 // +optional 3257 SizeBytes int64 `json:"sizeBytes,omitempty" protobuf:"varint,2,opt,name=sizeBytes"` 3258} 3259 3260type NodePhase string 3261 3262// These are the valid phases of node. 3263const ( 3264 // NodePending means the node has been created/added by the system, but not configured. 3265 NodePending NodePhase = "Pending" 3266 // NodeRunning means the node has been configured and has Kubernetes components running. 3267 NodeRunning NodePhase = "Running" 3268 // NodeTerminated means the node has been removed from the cluster. 3269 NodeTerminated NodePhase = "Terminated" 3270) 3271 3272type NodeConditionType string 3273 3274// These are valid conditions of node. Currently, we don't have enough information to decide 3275// node condition. In the future, we will add more. The proposed set of conditions are: 3276// NodeReachable, NodeLive, NodeReady, NodeSchedulable, NodeRunnable. 3277const ( 3278 // NodeReady means kubelet is healthy and ready to accept pods. 3279 NodeReady NodeConditionType = "Ready" 3280 // NodeOutOfDisk means the kubelet will not accept new pods due to insufficient free disk 3281 // space on the node. 3282 NodeOutOfDisk NodeConditionType = "OutOfDisk" 3283 // NodeMemoryPressure means the kubelet is under pressure due to insufficient available memory. 3284 NodeMemoryPressure NodeConditionType = "MemoryPressure" 3285 // NodeDiskPressure means the kubelet is under pressure due to insufficient available disk. 3286 NodeDiskPressure NodeConditionType = "DiskPressure" 3287 // NodeNetworkUnavailable means that network for the node is not correctly configured. 3288 NodeNetworkUnavailable NodeConditionType = "NetworkUnavailable" 3289 // NodeInodePressure means the kubelet is under pressure due to insufficient available inodes. 3290 NodeInodePressure NodeConditionType = "InodePressure" 3291) 3292 3293// NodeCondition contains condition information for a node. 3294type NodeCondition struct { 3295 // Type of node condition. 3296 Type NodeConditionType `json:"type" protobuf:"bytes,1,opt,name=type,casttype=NodeConditionType"` 3297 // Status of the condition, one of True, False, Unknown. 3298 Status ConditionStatus `json:"status" protobuf:"bytes,2,opt,name=status,casttype=ConditionStatus"` 3299 // Last time we got an update on a given condition. 3300 // +optional 3301 LastHeartbeatTime metav1.Time `json:"lastHeartbeatTime,omitempty" protobuf:"bytes,3,opt,name=lastHeartbeatTime"` 3302 // Last time the condition transit from one status to another. 3303 // +optional 3304 LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty" protobuf:"bytes,4,opt,name=lastTransitionTime"` 3305 // (brief) reason for the condition's last transition. 3306 // +optional 3307 Reason string `json:"reason,omitempty" protobuf:"bytes,5,opt,name=reason"` 3308 // Human readable message indicating details about last transition. 3309 // +optional 3310 Message string `json:"message,omitempty" protobuf:"bytes,6,opt,name=message"` 3311} 3312 3313type NodeAddressType string 3314 3315// These are valid address type of node. 3316const ( 3317 // Deprecated: NodeLegacyHostIP will be removed in 1.7. 3318 NodeLegacyHostIP NodeAddressType = "LegacyHostIP" 3319 NodeHostName NodeAddressType = "Hostname" 3320 NodeExternalIP NodeAddressType = "ExternalIP" 3321 NodeInternalIP NodeAddressType = "InternalIP" 3322 NodeExternalDNS NodeAddressType = "ExternalDNS" 3323 NodeInternalDNS NodeAddressType = "InternalDNS" 3324) 3325 3326// NodeAddress contains information for the node's address. 3327type NodeAddress struct { 3328 // Node address type, one of Hostname, ExternalIP or InternalIP. 3329 Type NodeAddressType `json:"type" protobuf:"bytes,1,opt,name=type,casttype=NodeAddressType"` 3330 // The node address. 3331 Address string `json:"address" protobuf:"bytes,2,opt,name=address"` 3332} 3333 3334// ResourceName is the name identifying various resources in a ResourceList. 3335type ResourceName string 3336 3337// Resource names must be not more than 63 characters, consisting of upper- or lower-case alphanumeric characters, 3338// with the -, _, and . characters allowed anywhere, except the first or last character. 3339// The default convention, matching that for annotations, is to use lower-case names, with dashes, rather than 3340// camel case, separating compound words. 3341// Fully-qualified resource typenames are constructed from a DNS-style subdomain, followed by a slash `/` and a name. 3342const ( 3343 // CPU, in cores. (500m = .5 cores) 3344 ResourceCPU ResourceName = "cpu" 3345 // Memory, in bytes. (500Gi = 500GiB = 500 * 1024 * 1024 * 1024) 3346 ResourceMemory ResourceName = "memory" 3347 // Volume size, in bytes (e,g. 5Gi = 5GiB = 5 * 1024 * 1024 * 1024) 3348 ResourceStorage ResourceName = "storage" 3349 // NVIDIA GPU, in devices. Alpha, might change: although fractional and allowing values >1, only one whole device per node is assigned. 3350 ResourceNvidiaGPU ResourceName = "alpha.kubernetes.io/nvidia-gpu" 3351 // Number of Pods that may be running on this Node: see ResourcePods 3352) 3353 3354const ( 3355 // Namespace prefix for opaque counted resources (alpha). 3356 ResourceOpaqueIntPrefix = "pod.alpha.kubernetes.io/opaque-int-resource-" 3357) 3358 3359// ResourceList is a set of (resource name, quantity) pairs. 3360type ResourceList map[ResourceName]resource.Quantity 3361 3362// +genclient=true 3363// +nonNamespaced=true 3364 3365// Node is a worker node in Kubernetes. 3366// Each node will have a unique identifier in the cache (i.e. in etcd). 3367type Node struct { 3368 metav1.TypeMeta `json:",inline"` 3369 // Standard object's metadata. 3370 // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata 3371 // +optional 3372 metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` 3373 3374 // Spec defines the behavior of a node. 3375 // http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status 3376 // +optional 3377 Spec NodeSpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"` 3378 3379 // Most recently observed status of the node. 3380 // Populated by the system. 3381 // Read-only. 3382 // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status 3383 // +optional 3384 Status NodeStatus `json:"status,omitempty" protobuf:"bytes,3,opt,name=status"` 3385} 3386 3387// NodeList is the whole list of all Nodes which have been registered with master. 3388type NodeList struct { 3389 metav1.TypeMeta `json:",inline"` 3390 // Standard list metadata. 3391 // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#types-kinds 3392 // +optional 3393 metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` 3394 3395 // List of nodes 3396 Items []Node `json:"items" protobuf:"bytes,2,rep,name=items"` 3397} 3398 3399// FinalizerName is the name identifying a finalizer during namespace lifecycle. 3400type FinalizerName string 3401 3402// These are internal finalizer values to Kubernetes, must be qualified name unless defined here or 3403// in metav1. 3404const ( 3405 FinalizerKubernetes FinalizerName = "kubernetes" 3406) 3407 3408// NamespaceSpec describes the attributes on a Namespace. 3409type NamespaceSpec struct { 3410 // Finalizers is an opaque list of values that must be empty to permanently remove object from storage. 3411 // More info: http://releases.k8s.io/HEAD/docs/design/namespaces.md#finalizers 3412 // +optional 3413 Finalizers []FinalizerName `json:"finalizers,omitempty" protobuf:"bytes,1,rep,name=finalizers,casttype=FinalizerName"` 3414} 3415 3416// NamespaceStatus is information about the current status of a Namespace. 3417type NamespaceStatus struct { 3418 // Phase is the current lifecycle phase of the namespace. 3419 // More info: http://releases.k8s.io/HEAD/docs/design/namespaces.md#phases 3420 // +optional 3421 Phase NamespacePhase `json:"phase,omitempty" protobuf:"bytes,1,opt,name=phase,casttype=NamespacePhase"` 3422} 3423 3424type NamespacePhase string 3425 3426// These are the valid phases of a namespace. 3427const ( 3428 // NamespaceActive means the namespace is available for use in the system 3429 NamespaceActive NamespacePhase = "Active" 3430 // NamespaceTerminating means the namespace is undergoing graceful termination 3431 NamespaceTerminating NamespacePhase = "Terminating" 3432) 3433 3434// +genclient=true 3435// +nonNamespaced=true 3436 3437// Namespace provides a scope for Names. 3438// Use of multiple namespaces is optional. 3439type Namespace struct { 3440 metav1.TypeMeta `json:",inline"` 3441 // Standard object's metadata. 3442 // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata 3443 // +optional 3444 metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` 3445 3446 // Spec defines the behavior of the Namespace. 3447 // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status 3448 // +optional 3449 Spec NamespaceSpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"` 3450 3451 // Status describes the current status of a Namespace. 3452 // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status 3453 // +optional 3454 Status NamespaceStatus `json:"status,omitempty" protobuf:"bytes,3,opt,name=status"` 3455} 3456 3457// NamespaceList is a list of Namespaces. 3458type NamespaceList struct { 3459 metav1.TypeMeta `json:",inline"` 3460 // Standard list metadata. 3461 // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#types-kinds 3462 // +optional 3463 metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` 3464 3465 // Items is the list of Namespace objects in the list. 3466 // More info: http://kubernetes.io/docs/user-guide/namespaces 3467 Items []Namespace `json:"items" protobuf:"bytes,2,rep,name=items"` 3468} 3469 3470// Binding ties one object to another. 3471// For example, a pod is bound to a node by a scheduler. 3472type Binding struct { 3473 metav1.TypeMeta `json:",inline"` 3474 // Standard object's metadata. 3475 // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata 3476 // +optional 3477 metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` 3478 3479 // The target object that you want to bind to the standard object. 3480 Target ObjectReference `json:"target" protobuf:"bytes,2,opt,name=target"` 3481} 3482 3483// Preconditions must be fulfilled before an operation (update, delete, etc.) is carried out. 3484// +k8s:openapi-gen=false 3485type Preconditions struct { 3486 // Specifies the target UID. 3487 // +optional 3488 UID *types.UID `json:"uid,omitempty" protobuf:"bytes,1,opt,name=uid,casttype=k8s.io/apimachinery/pkg/types.UID"` 3489} 3490 3491// DeletionPropagation decides if a deletion will propagate to the dependents of the object, and how the garbage collector will handle the propagation. 3492type DeletionPropagation string 3493 3494const ( 3495 // Orphans the dependents. 3496 DeletePropagationOrphan DeletionPropagation = "Orphan" 3497 // Deletes the object from the key-value store, the garbage collector will delete the dependents in the background. 3498 DeletePropagationBackground DeletionPropagation = "Background" 3499 // The object exists in the key-value store until the garbage collector deletes all the dependents whose ownerReference.blockOwnerDeletion=true from the key-value store. 3500 // API sever will put the "DeletingDependents" finalizer on the object, and sets its deletionTimestamp. 3501 // This policy is cascading, i.e., the dependents will be deleted with Foreground. 3502 DeletePropagationForeground DeletionPropagation = "Foreground" 3503) 3504 3505// DeleteOptions may be provided when deleting an API object 3506// DEPRECATED: This type has been moved to meta/v1 and will be removed soon. 3507// +k8s:openapi-gen=false 3508type DeleteOptions struct { 3509 metav1.TypeMeta `json:",inline"` 3510 3511 // The duration in seconds before the object should be deleted. Value must be non-negative integer. 3512 // The value zero indicates delete immediately. If this value is nil, the default grace period for the 3513 // specified type will be used. 3514 // Defaults to a per object value if not specified. zero means delete immediately. 3515 // +optional 3516 GracePeriodSeconds *int64 `json:"gracePeriodSeconds,omitempty" protobuf:"varint,1,opt,name=gracePeriodSeconds"` 3517 3518 // Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be 3519 // returned. 3520 // +optional 3521 Preconditions *Preconditions `json:"preconditions,omitempty" protobuf:"bytes,2,opt,name=preconditions"` 3522 3523 // Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. 3524 // Should the dependent objects be orphaned. If true/false, the "orphan" 3525 // finalizer will be added to/removed from the object's finalizers list. 3526 // Either this field or PropagationPolicy may be set, but not both. 3527 // +optional 3528 OrphanDependents *bool `json:"orphanDependents,omitempty" protobuf:"varint,3,opt,name=orphanDependents"` 3529 3530 // Whether and how garbage collection will be performed. 3531 // Either this field or OrphanDependents may be set, but not both. 3532 // The default policy is decided by the existing finalizer set in the 3533 // metadata.finalizers and the resource-specific default policy. 3534 // +optional 3535 PropagationPolicy *DeletionPropagation `protobuf:"bytes,4,opt,name=propagationPolicy,casttype=DeletionPropagation"` 3536} 3537 3538// ListOptions is the query options to a standard REST list call. 3539// DEPRECATED: This type has been moved to meta/v1 and will be removed soon. 3540// +k8s:openapi-gen=false 3541type ListOptions struct { 3542 metav1.TypeMeta `json:",inline"` 3543 3544 // A selector to restrict the list of returned objects by their labels. 3545 // Defaults to everything. 3546 // +optional 3547 LabelSelector string `json:"labelSelector,omitempty" protobuf:"bytes,1,opt,name=labelSelector"` 3548 // A selector to restrict the list of returned objects by their fields. 3549 // Defaults to everything. 3550 // +optional 3551 FieldSelector string `json:"fieldSelector,omitempty" protobuf:"bytes,2,opt,name=fieldSelector"` 3552 // Watch for changes to the described resources and return them as a stream of 3553 // add, update, and remove notifications. Specify resourceVersion. 3554 // +optional 3555 Watch bool `json:"watch,omitempty" protobuf:"varint,3,opt,name=watch"` 3556 // When specified with a watch call, shows changes that occur after that particular version of a resource. 3557 // Defaults to changes from the beginning of history. 3558 // When specified for list: 3559 // - if unset, then the result is returned from remote storage based on quorum-read flag; 3560 // - if it's 0, then we simply return what we currently have in cache, no guarantee; 3561 // - if set to non zero, then the result is at least as fresh as given rv. 3562 // +optional 3563 ResourceVersion string `json:"resourceVersion,omitempty" protobuf:"bytes,4,opt,name=resourceVersion"` 3564 // Timeout for the list/watch call. 3565 // +optional 3566 TimeoutSeconds *int64 `json:"timeoutSeconds,omitempty" protobuf:"varint,5,opt,name=timeoutSeconds"` 3567} 3568 3569// PodLogOptions is the query options for a Pod's logs REST call. 3570type PodLogOptions struct { 3571 metav1.TypeMeta `json:",inline"` 3572 3573 // The container for which to stream logs. Defaults to only container if there is one container in the pod. 3574 // +optional 3575 Container string `json:"container,omitempty" protobuf:"bytes,1,opt,name=container"` 3576 // Follow the log stream of the pod. Defaults to false. 3577 // +optional 3578 Follow bool `json:"follow,omitempty" protobuf:"varint,2,opt,name=follow"` 3579 // Return previous terminated container logs. Defaults to false. 3580 // +optional 3581 Previous bool `json:"previous,omitempty" protobuf:"varint,3,opt,name=previous"` 3582 // A relative time in seconds before the current time from which to show logs. If this value 3583 // precedes the time a pod was started, only logs since the pod start will be returned. 3584 // If this value is in the future, no logs will be returned. 3585 // Only one of sinceSeconds or sinceTime may be specified. 3586 // +optional 3587 SinceSeconds *int64 `json:"sinceSeconds,omitempty" protobuf:"varint,4,opt,name=sinceSeconds"` 3588 // An RFC3339 timestamp from which to show logs. If this value 3589 // precedes the time a pod was started, only logs since the pod start will be returned. 3590 // If this value is in the future, no logs will be returned. 3591 // Only one of sinceSeconds or sinceTime may be specified. 3592 // +optional 3593 SinceTime *metav1.Time `json:"sinceTime,omitempty" protobuf:"bytes,5,opt,name=sinceTime"` 3594 // If true, add an RFC3339 or RFC3339Nano timestamp at the beginning of every line 3595 // of log output. Defaults to false. 3596 // +optional 3597 Timestamps bool `json:"timestamps,omitempty" protobuf:"varint,6,opt,name=timestamps"` 3598 // If set, the number of lines from the end of the logs to show. If not specified, 3599 // logs are shown from the creation of the container or sinceSeconds or sinceTime 3600 // +optional 3601 TailLines *int64 `json:"tailLines,omitempty" protobuf:"varint,7,opt,name=tailLines"` 3602 // If set, the number of bytes to read from the server before terminating the 3603 // log output. This may not display a complete final line of logging, and may return 3604 // slightly more or slightly less than the specified limit. 3605 // +optional 3606 LimitBytes *int64 `json:"limitBytes,omitempty" protobuf:"varint,8,opt,name=limitBytes"` 3607} 3608 3609// PodAttachOptions is the query options to a Pod's remote attach call. 3610// --- 3611// TODO: merge w/ PodExecOptions below for stdin, stdout, etc 3612// and also when we cut V2, we should export a "StreamOptions" or somesuch that contains Stdin, Stdout, Stder and TTY 3613type PodAttachOptions struct { 3614 metav1.TypeMeta `json:",inline"` 3615 3616 // Stdin if true, redirects the standard input stream of the pod for this call. 3617 // Defaults to false. 3618 // +optional 3619 Stdin bool `json:"stdin,omitempty" protobuf:"varint,1,opt,name=stdin"` 3620 3621 // Stdout if true indicates that stdout is to be redirected for the attach call. 3622 // Defaults to true. 3623 // +optional 3624 Stdout bool `json:"stdout,omitempty" protobuf:"varint,2,opt,name=stdout"` 3625 3626 // Stderr if true indicates that stderr is to be redirected for the attach call. 3627 // Defaults to true. 3628 // +optional 3629 Stderr bool `json:"stderr,omitempty" protobuf:"varint,3,opt,name=stderr"` 3630 3631 // TTY if true indicates that a tty will be allocated for the attach call. 3632 // This is passed through the container runtime so the tty 3633 // is allocated on the worker node by the container runtime. 3634 // Defaults to false. 3635 // +optional 3636 TTY bool `json:"tty,omitempty" protobuf:"varint,4,opt,name=tty"` 3637 3638 // The container in which to execute the command. 3639 // Defaults to only container if there is only one container in the pod. 3640 // +optional 3641 Container string `json:"container,omitempty" protobuf:"bytes,5,opt,name=container"` 3642} 3643 3644// PodExecOptions is the query options to a Pod's remote exec call. 3645// --- 3646// TODO: This is largely identical to PodAttachOptions above, make sure they stay in sync and see about merging 3647// and also when we cut V2, we should export a "StreamOptions" or somesuch that contains Stdin, Stdout, Stder and TTY 3648type PodExecOptions struct { 3649 metav1.TypeMeta `json:",inline"` 3650 3651 // Redirect the standard input stream of the pod for this call. 3652 // Defaults to false. 3653 // +optional 3654 Stdin bool `json:"stdin,omitempty" protobuf:"varint,1,opt,name=stdin"` 3655 3656 // Redirect the standard output stream of the pod for this call. 3657 // Defaults to true. 3658 // +optional 3659 Stdout bool `json:"stdout,omitempty" protobuf:"varint,2,opt,name=stdout"` 3660 3661 // Redirect the standard error stream of the pod for this call. 3662 // Defaults to true. 3663 // +optional 3664 Stderr bool `json:"stderr,omitempty" protobuf:"varint,3,opt,name=stderr"` 3665 3666 // TTY if true indicates that a tty will be allocated for the exec call. 3667 // Defaults to false. 3668 // +optional 3669 TTY bool `json:"tty,omitempty" protobuf:"varint,4,opt,name=tty"` 3670 3671 // Container in which to execute the command. 3672 // Defaults to only container if there is only one container in the pod. 3673 // +optional 3674 Container string `json:"container,omitempty" protobuf:"bytes,5,opt,name=container"` 3675 3676 // Command is the remote command to execute. argv array. Not executed within a shell. 3677 Command []string `json:"command" protobuf:"bytes,6,rep,name=command"` 3678} 3679 3680// PodPortForwardOptions is the query options to a Pod's port forward call 3681// when using WebSockets. 3682// The `port` query parameter must specify the port or 3683// ports (comma separated) to forward over. 3684// Port forwarding over SPDY does not use these options. It requires the port 3685// to be passed in the `port` header as part of request. 3686type PodPortForwardOptions struct { 3687 metav1.TypeMeta `json:",inline"` 3688 3689 // List of ports to forward 3690 // Required when using WebSockets 3691 // +optional 3692 Ports []int32 `json:"ports,omitempty" protobuf:"varint,1,rep,name=ports"` 3693} 3694 3695// PodProxyOptions is the query options to a Pod's proxy call. 3696type PodProxyOptions struct { 3697 metav1.TypeMeta `json:",inline"` 3698 3699 // Path is the URL path to use for the current proxy request to pod. 3700 // +optional 3701 Path string `json:"path,omitempty" protobuf:"bytes,1,opt,name=path"` 3702} 3703 3704// NodeProxyOptions is the query options to a Node's proxy call. 3705type NodeProxyOptions struct { 3706 metav1.TypeMeta `json:",inline"` 3707 3708 // Path is the URL path to use for the current proxy request to node. 3709 // +optional 3710 Path string `json:"path,omitempty" protobuf:"bytes,1,opt,name=path"` 3711} 3712 3713// ServiceProxyOptions is the query options to a Service's proxy call. 3714type ServiceProxyOptions struct { 3715 metav1.TypeMeta `json:",inline"` 3716 3717 // Path is the part of URLs that include service endpoints, suffixes, 3718 // and parameters to use for the current proxy request to service. 3719 // For example, the whole request URL is 3720 // http://localhost/api/v1/namespaces/kube-system/services/elasticsearch-logging/_search?q=user:kimchy. 3721 // Path is _search?q=user:kimchy. 3722 // +optional 3723 Path string `json:"path,omitempty" protobuf:"bytes,1,opt,name=path"` 3724} 3725 3726// ObjectReference contains enough information to let you inspect or modify the referred object. 3727type ObjectReference struct { 3728 // Kind of the referent. 3729 // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#types-kinds 3730 // +optional 3731 Kind string `json:"kind,omitempty" protobuf:"bytes,1,opt,name=kind"` 3732 // Namespace of the referent. 3733 // More info: http://kubernetes.io/docs/user-guide/namespaces 3734 // +optional 3735 Namespace string `json:"namespace,omitempty" protobuf:"bytes,2,opt,name=namespace"` 3736 // Name of the referent. 3737 // More info: http://kubernetes.io/docs/user-guide/identifiers#names 3738 // +optional 3739 Name string `json:"name,omitempty" protobuf:"bytes,3,opt,name=name"` 3740 // UID of the referent. 3741 // More info: http://kubernetes.io/docs/user-guide/identifiers#uids 3742 // +optional 3743 UID types.UID `json:"uid,omitempty" protobuf:"bytes,4,opt,name=uid,casttype=k8s.io/apimachinery/pkg/types.UID"` 3744 // API version of the referent. 3745 // +optional 3746 APIVersion string `json:"apiVersion,omitempty" protobuf:"bytes,5,opt,name=apiVersion"` 3747 // Specific resourceVersion to which this reference is made, if any. 3748 // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#concurrency-control-and-consistency 3749 // +optional 3750 ResourceVersion string `json:"resourceVersion,omitempty" protobuf:"bytes,6,opt,name=resourceVersion"` 3751 3752 // If referring to a piece of an object instead of an entire object, this string 3753 // should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. 3754 // For example, if the object reference is to a container within a pod, this would take on a value like: 3755 // "spec.containers{name}" (where "name" refers to the name of the container that triggered 3756 // the event) or if no container name is specified "spec.containers[2]" (container with 3757 // index 2 in this pod). This syntax is chosen only to have some well-defined way of 3758 // referencing a part of an object. 3759 // TODO: this design is not final and this field is subject to change in the future. 3760 // +optional 3761 FieldPath string `json:"fieldPath,omitempty" protobuf:"bytes,7,opt,name=fieldPath"` 3762} 3763 3764// LocalObjectReference contains enough information to let you locate the 3765// referenced object inside the same namespace. 3766type LocalObjectReference struct { 3767 // Name of the referent. 3768 // More info: http://kubernetes.io/docs/user-guide/identifiers#names 3769 // TODO: Add other useful fields. apiVersion, kind, uid? 3770 // +optional 3771 Name string `json:"name,omitempty" protobuf:"bytes,1,opt,name=name"` 3772} 3773 3774// SerializedReference is a reference to serialized object. 3775type SerializedReference struct { 3776 metav1.TypeMeta `json:",inline"` 3777 // The reference to an object in the system. 3778 // +optional 3779 Reference ObjectReference `json:"reference,omitempty" protobuf:"bytes,1,opt,name=reference"` 3780} 3781 3782// EventSource contains information for an event. 3783type EventSource struct { 3784 // Component from which the event is generated. 3785 // +optional 3786 Component string `json:"component,omitempty" protobuf:"bytes,1,opt,name=component"` 3787 // Node name on which the event is generated. 3788 // +optional 3789 Host string `json:"host,omitempty" protobuf:"bytes,2,opt,name=host"` 3790} 3791 3792// Valid values for event types (new types could be added in future) 3793const ( 3794 // Information only and will not cause any problems 3795 EventTypeNormal string = "Normal" 3796 // These events are to warn that something might go wrong 3797 EventTypeWarning string = "Warning" 3798) 3799 3800// +genclient=true 3801 3802// Event is a report of an event somewhere in the cluster. 3803// TODO: Decide whether to store these separately or with the object they apply to. 3804type Event struct { 3805 metav1.TypeMeta `json:",inline"` 3806 // Standard object's metadata. 3807 // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata 3808 metav1.ObjectMeta `json:"metadata" protobuf:"bytes,1,opt,name=metadata"` 3809 3810 // The object that this event is about. 3811 InvolvedObject ObjectReference `json:"involvedObject" protobuf:"bytes,2,opt,name=involvedObject"` 3812 3813 // This should be a short, machine understandable string that gives the reason 3814 // for the transition into the object's current status. 3815 // TODO: provide exact specification for format. 3816 // +optional 3817 Reason string `json:"reason,omitempty" protobuf:"bytes,3,opt,name=reason"` 3818 3819 // A human-readable description of the status of this operation. 3820 // TODO: decide on maximum length. 3821 // +optional 3822 Message string `json:"message,omitempty" protobuf:"bytes,4,opt,name=message"` 3823 3824 // The component reporting this event. Should be a short machine understandable string. 3825 // +optional 3826 Source EventSource `json:"source,omitempty" protobuf:"bytes,5,opt,name=source"` 3827 3828 // The time at which the event was first recorded. (Time of server receipt is in TypeMeta.) 3829 // +optional 3830 FirstTimestamp metav1.Time `json:"firstTimestamp,omitempty" protobuf:"bytes,6,opt,name=firstTimestamp"` 3831 3832 // The time at which the most recent occurrence of this event was recorded. 3833 // +optional 3834 LastTimestamp metav1.Time `json:"lastTimestamp,omitempty" protobuf:"bytes,7,opt,name=lastTimestamp"` 3835 3836 // The number of times this event has occurred. 3837 // +optional 3838 Count int32 `json:"count,omitempty" protobuf:"varint,8,opt,name=count"` 3839 3840 // Type of this event (Normal, Warning), new types could be added in the future 3841 // +optional 3842 Type string `json:"type,omitempty" protobuf:"bytes,9,opt,name=type"` 3843} 3844 3845// EventList is a list of events. 3846type EventList struct { 3847 metav1.TypeMeta `json:",inline"` 3848 // Standard list metadata. 3849 // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#types-kinds 3850 // +optional 3851 metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` 3852 3853 // List of events 3854 Items []Event `json:"items" protobuf:"bytes,2,rep,name=items"` 3855} 3856 3857// List holds a list of objects, which may not be known by the server. 3858type List struct { 3859 metav1.TypeMeta `json:",inline"` 3860 // Standard list metadata. 3861 // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#types-kinds 3862 // +optional 3863 metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` 3864 3865 // List of objects 3866 Items []runtime.RawExtension `json:"items" protobuf:"bytes,2,rep,name=items"` 3867} 3868 3869// LimitType is a type of object that is limited 3870type LimitType string 3871 3872const ( 3873 // Limit that applies to all pods in a namespace 3874 LimitTypePod LimitType = "Pod" 3875 // Limit that applies to all containers in a namespace 3876 LimitTypeContainer LimitType = "Container" 3877 // Limit that applies to all persistent volume claims in a namespace 3878 LimitTypePersistentVolumeClaim LimitType = "PersistentVolumeClaim" 3879) 3880 3881// LimitRangeItem defines a min/max usage limit for any resource that matches on kind. 3882type LimitRangeItem struct { 3883 // Type of resource that this limit applies to. 3884 // +optional 3885 Type LimitType `json:"type,omitempty" protobuf:"bytes,1,opt,name=type,casttype=LimitType"` 3886 // Max usage constraints on this kind by resource name. 3887 // +optional 3888 Max ResourceList `json:"max,omitempty" protobuf:"bytes,2,rep,name=max,casttype=ResourceList,castkey=ResourceName"` 3889 // Min usage constraints on this kind by resource name. 3890 // +optional 3891 Min ResourceList `json:"min,omitempty" protobuf:"bytes,3,rep,name=min,casttype=ResourceList,castkey=ResourceName"` 3892 // Default resource requirement limit value by resource name if resource limit is omitted. 3893 // +optional 3894 Default ResourceList `json:"default,omitempty" protobuf:"bytes,4,rep,name=default,casttype=ResourceList,castkey=ResourceName"` 3895 // DefaultRequest is the default resource requirement request value by resource name if resource request is omitted. 3896 // +optional 3897 DefaultRequest ResourceList `json:"defaultRequest,omitempty" protobuf:"bytes,5,rep,name=defaultRequest,casttype=ResourceList,castkey=ResourceName"` 3898 // 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. 3899 // +optional 3900 MaxLimitRequestRatio ResourceList `json:"maxLimitRequestRatio,omitempty" protobuf:"bytes,6,rep,name=maxLimitRequestRatio,casttype=ResourceList,castkey=ResourceName"` 3901} 3902 3903// LimitRangeSpec defines a min/max usage limit for resources that match on kind. 3904type LimitRangeSpec struct { 3905 // Limits is the list of LimitRangeItem objects that are enforced. 3906 Limits []LimitRangeItem `json:"limits" protobuf:"bytes,1,rep,name=limits"` 3907} 3908 3909// +genclient=true 3910 3911// LimitRange sets resource usage limits for each kind of resource in a Namespace. 3912type LimitRange struct { 3913 metav1.TypeMeta `json:",inline"` 3914 // Standard object's metadata. 3915 // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata 3916 // +optional 3917 metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` 3918 3919 // Spec defines the limits enforced. 3920 // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status 3921 // +optional 3922 Spec LimitRangeSpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"` 3923} 3924 3925// LimitRangeList is a list of LimitRange items. 3926type LimitRangeList struct { 3927 metav1.TypeMeta `json:",inline"` 3928 // Standard list metadata. 3929 // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#types-kinds 3930 // +optional 3931 metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` 3932 3933 // Items is a list of LimitRange objects. 3934 // More info: http://releases.k8s.io/HEAD/docs/design/admission_control_limit_range.md 3935 Items []LimitRange `json:"items" protobuf:"bytes,2,rep,name=items"` 3936} 3937 3938// The following identify resource constants for Kubernetes object types 3939const ( 3940 // Pods, number 3941 ResourcePods ResourceName = "pods" 3942 // Services, number 3943 ResourceServices ResourceName = "services" 3944 // ReplicationControllers, number 3945 ResourceReplicationControllers ResourceName = "replicationcontrollers" 3946 // ResourceQuotas, number 3947 ResourceQuotas ResourceName = "resourcequotas" 3948 // ResourceSecrets, number 3949 ResourceSecrets ResourceName = "secrets" 3950 // ResourceConfigMaps, number 3951 ResourceConfigMaps ResourceName = "configmaps" 3952 // ResourcePersistentVolumeClaims, number 3953 ResourcePersistentVolumeClaims ResourceName = "persistentvolumeclaims" 3954 // ResourceServicesNodePorts, number 3955 ResourceServicesNodePorts ResourceName = "services.nodeports" 3956 // ResourceServicesLoadBalancers, number 3957 ResourceServicesLoadBalancers ResourceName = "services.loadbalancers" 3958 // CPU request, in cores. (500m = .5 cores) 3959 ResourceRequestsCPU ResourceName = "requests.cpu" 3960 // Memory request, in bytes. (500Gi = 500GiB = 500 * 1024 * 1024 * 1024) 3961 ResourceRequestsMemory ResourceName = "requests.memory" 3962 // Storage request, in bytes 3963 ResourceRequestsStorage ResourceName = "requests.storage" 3964 // CPU limit, in cores. (500m = .5 cores) 3965 ResourceLimitsCPU ResourceName = "limits.cpu" 3966 // Memory limit, in bytes. (500Gi = 500GiB = 500 * 1024 * 1024 * 1024) 3967 ResourceLimitsMemory ResourceName = "limits.memory" 3968) 3969 3970// A ResourceQuotaScope defines a filter that must match each object tracked by a quota 3971type ResourceQuotaScope string 3972 3973const ( 3974 // Match all pod objects where spec.activeDeadlineSeconds 3975 ResourceQuotaScopeTerminating ResourceQuotaScope = "Terminating" 3976 // Match all pod objects where !spec.activeDeadlineSeconds 3977 ResourceQuotaScopeNotTerminating ResourceQuotaScope = "NotTerminating" 3978 // Match all pod objects that have best effort quality of service 3979 ResourceQuotaScopeBestEffort ResourceQuotaScope = "BestEffort" 3980 // Match all pod objects that do not have best effort quality of service 3981 ResourceQuotaScopeNotBestEffort ResourceQuotaScope = "NotBestEffort" 3982) 3983 3984// ResourceQuotaSpec defines the desired hard limits to enforce for Quota. 3985type ResourceQuotaSpec struct { 3986 // Hard is the set of desired hard limits for each named resource. 3987 // More info: http://releases.k8s.io/HEAD/docs/design/admission_control_resource_quota.md#admissioncontrol-plugin-resourcequota 3988 // +optional 3989 Hard ResourceList `json:"hard,omitempty" protobuf:"bytes,1,rep,name=hard,casttype=ResourceList,castkey=ResourceName"` 3990 // A collection of filters that must match each object tracked by a quota. 3991 // If not specified, the quota matches all objects. 3992 // +optional 3993 Scopes []ResourceQuotaScope `json:"scopes,omitempty" protobuf:"bytes,2,rep,name=scopes,casttype=ResourceQuotaScope"` 3994} 3995 3996// ResourceQuotaStatus defines the enforced hard limits and observed use. 3997type ResourceQuotaStatus struct { 3998 // Hard is the set of enforced hard limits for each named resource. 3999 // More info: http://releases.k8s.io/HEAD/docs/design/admission_control_resource_quota.md#admissioncontrol-plugin-resourcequota 4000 // +optional 4001 Hard ResourceList `json:"hard,omitempty" protobuf:"bytes,1,rep,name=hard,casttype=ResourceList,castkey=ResourceName"` 4002 // Used is the current observed total usage of the resource in the namespace. 4003 // +optional 4004 Used ResourceList `json:"used,omitempty" protobuf:"bytes,2,rep,name=used,casttype=ResourceList,castkey=ResourceName"` 4005} 4006 4007// +genclient=true 4008 4009// ResourceQuota sets aggregate quota restrictions enforced per namespace 4010type ResourceQuota struct { 4011 metav1.TypeMeta `json:",inline"` 4012 // Standard object's metadata. 4013 // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata 4014 // +optional 4015 metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` 4016 4017 // Spec defines the desired quota. 4018 // http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status 4019 // +optional 4020 Spec ResourceQuotaSpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"` 4021 4022 // Status defines the actual enforced quota and its current usage. 4023 // http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status 4024 // +optional 4025 Status ResourceQuotaStatus `json:"status,omitempty" protobuf:"bytes,3,opt,name=status"` 4026} 4027 4028// ResourceQuotaList is a list of ResourceQuota items. 4029type ResourceQuotaList struct { 4030 metav1.TypeMeta `json:",inline"` 4031 // Standard list metadata. 4032 // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#types-kinds 4033 // +optional 4034 metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` 4035 4036 // Items is a list of ResourceQuota objects. 4037 // More info: http://releases.k8s.io/HEAD/docs/design/admission_control_resource_quota.md#admissioncontrol-plugin-resourcequota 4038 Items []ResourceQuota `json:"items" protobuf:"bytes,2,rep,name=items"` 4039} 4040 4041// +genclient=true 4042 4043// Secret holds secret data of a certain type. The total bytes of the values in 4044// the Data field must be less than MaxSecretSize bytes. 4045type Secret struct { 4046 metav1.TypeMeta `json:",inline"` 4047 // Standard object's metadata. 4048 // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata 4049 // +optional 4050 metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` 4051 4052 // Data contains the secret data. Each key must be a valid DNS_SUBDOMAIN 4053 // or leading dot followed by valid DNS_SUBDOMAIN. 4054 // The serialized form of the secret data is a base64 encoded string, 4055 // representing the arbitrary (possibly non-string) data value here. 4056 // Described in https://tools.ietf.org/html/rfc4648#section-4 4057 // +optional 4058 Data map[string][]byte `json:"data,omitempty" protobuf:"bytes,2,rep,name=data"` 4059 4060 // stringData allows specifying non-binary secret data in string form. 4061 // It is provided as a write-only convenience method. 4062 // All keys and values are merged into the data field on write, overwriting any existing values. 4063 // It is never output when reading from the API. 4064 // +k8s:conversion-gen=false 4065 // +optional 4066 StringData map[string]string `json:"stringData,omitempty" protobuf:"bytes,4,rep,name=stringData"` 4067 4068 // Used to facilitate programmatic handling of secret data. 4069 // +optional 4070 Type SecretType `json:"type,omitempty" protobuf:"bytes,3,opt,name=type,casttype=SecretType"` 4071} 4072 4073const MaxSecretSize = 1 * 1024 * 1024 4074 4075type SecretType string 4076 4077const ( 4078 // SecretTypeOpaque is the default. Arbitrary user-defined data 4079 SecretTypeOpaque SecretType = "Opaque" 4080 4081 // SecretTypeServiceAccountToken contains a token that identifies a service account to the API 4082 // 4083 // Required fields: 4084 // - Secret.Annotations["kubernetes.io/service-account.name"] - the name of the ServiceAccount the token identifies 4085 // - Secret.Annotations["kubernetes.io/service-account.uid"] - the UID of the ServiceAccount the token identifies 4086 // - Secret.Data["token"] - a token that identifies the service account to the API 4087 SecretTypeServiceAccountToken SecretType = "kubernetes.io/service-account-token" 4088 4089 // ServiceAccountNameKey is the key of the required annotation for SecretTypeServiceAccountToken secrets 4090 ServiceAccountNameKey = "kubernetes.io/service-account.name" 4091 // ServiceAccountUIDKey is the key of the required annotation for SecretTypeServiceAccountToken secrets 4092 ServiceAccountUIDKey = "kubernetes.io/service-account.uid" 4093 // ServiceAccountTokenKey is the key of the required data for SecretTypeServiceAccountToken secrets 4094 ServiceAccountTokenKey = "token" 4095 // ServiceAccountKubeconfigKey is the key of the optional kubeconfig data for SecretTypeServiceAccountToken secrets 4096 ServiceAccountKubeconfigKey = "kubernetes.kubeconfig" 4097 // ServiceAccountRootCAKey is the key of the optional root certificate authority for SecretTypeServiceAccountToken secrets 4098 ServiceAccountRootCAKey = "ca.crt" 4099 // ServiceAccountNamespaceKey is the key of the optional namespace to use as the default for namespaced API calls 4100 ServiceAccountNamespaceKey = "namespace" 4101 4102 // SecretTypeDockercfg contains a dockercfg file that follows the same format rules as ~/.dockercfg 4103 // 4104 // Required fields: 4105 // - Secret.Data[".dockercfg"] - a serialized ~/.dockercfg file 4106 SecretTypeDockercfg SecretType = "kubernetes.io/dockercfg" 4107 4108 // DockerConfigKey is the key of the required data for SecretTypeDockercfg secrets 4109 DockerConfigKey = ".dockercfg" 4110 4111 // SecretTypeDockerConfigJson contains a dockercfg file that follows the same format rules as ~/.docker/config.json 4112 // 4113 // Required fields: 4114 // - Secret.Data[".dockerconfigjson"] - a serialized ~/.docker/config.json file 4115 SecretTypeDockerConfigJson SecretType = "kubernetes.io/dockerconfigjson" 4116 4117 // DockerConfigJsonKey is the key of the required data for SecretTypeDockerConfigJson secrets 4118 DockerConfigJsonKey = ".dockerconfigjson" 4119 4120 // SecretTypeBasicAuth contains data needed for basic authentication. 4121 // 4122 // Required at least one of fields: 4123 // - Secret.Data["username"] - username used for authentication 4124 // - Secret.Data["password"] - password or token needed for authentication 4125 SecretTypeBasicAuth SecretType = "kubernetes.io/basic-auth" 4126 4127 // BasicAuthUsernameKey is the key of the username for SecretTypeBasicAuth secrets 4128 BasicAuthUsernameKey = "username" 4129 // BasicAuthPasswordKey is the key of the password or token for SecretTypeBasicAuth secrets 4130 BasicAuthPasswordKey = "password" 4131 4132 // SecretTypeSSHAuth contains data needed for SSH authetication. 4133 // 4134 // Required field: 4135 // - Secret.Data["ssh-privatekey"] - private SSH key needed for authentication 4136 SecretTypeSSHAuth SecretType = "kubernetes.io/ssh-auth" 4137 4138 // SSHAuthPrivateKey is the key of the required SSH private key for SecretTypeSSHAuth secrets 4139 SSHAuthPrivateKey = "ssh-privatekey" 4140 // SecretTypeTLS contains information about a TLS client or server secret. It 4141 // is primarily used with TLS termination of the Ingress resource, but may be 4142 // used in other types. 4143 // 4144 // Required fields: 4145 // - Secret.Data["tls.key"] - TLS private key. 4146 // Secret.Data["tls.crt"] - TLS certificate. 4147 // TODO: Consider supporting different formats, specifying CA/destinationCA. 4148 SecretTypeTLS SecretType = "kubernetes.io/tls" 4149 4150 // TLSCertKey is the key for tls certificates in a TLS secert. 4151 TLSCertKey = "tls.crt" 4152 // TLSPrivateKeyKey is the key for the private key field in a TLS secret. 4153 TLSPrivateKeyKey = "tls.key" 4154) 4155 4156// SecretList is a list of Secret. 4157type SecretList struct { 4158 metav1.TypeMeta `json:",inline"` 4159 // Standard list metadata. 4160 // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#types-kinds 4161 // +optional 4162 metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` 4163 4164 // Items is a list of secret objects. 4165 // More info: http://kubernetes.io/docs/user-guide/secrets 4166 Items []Secret `json:"items" protobuf:"bytes,2,rep,name=items"` 4167} 4168 4169// +genclient=true 4170 4171// ConfigMap holds configuration data for pods to consume. 4172type ConfigMap struct { 4173 metav1.TypeMeta `json:",inline"` 4174 // Standard object's metadata. 4175 // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata 4176 // +optional 4177 metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` 4178 4179 // Data contains the configuration data. 4180 // Each key must be a valid DNS_SUBDOMAIN with an optional leading dot. 4181 // +optional 4182 Data map[string]string `json:"data,omitempty" protobuf:"bytes,2,rep,name=data"` 4183} 4184 4185// ConfigMapList is a resource containing a list of ConfigMap objects. 4186type ConfigMapList struct { 4187 metav1.TypeMeta `json:",inline"` 4188 4189 // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata 4190 // +optional 4191 metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` 4192 4193 // Items is the list of ConfigMaps. 4194 Items []ConfigMap `json:"items" protobuf:"bytes,2,rep,name=items"` 4195} 4196 4197// Type and constants for component health validation. 4198type ComponentConditionType string 4199 4200// These are the valid conditions for the component. 4201const ( 4202 ComponentHealthy ComponentConditionType = "Healthy" 4203) 4204 4205// Information about the condition of a component. 4206type ComponentCondition struct { 4207 // Type of condition for a component. 4208 // Valid value: "Healthy" 4209 Type ComponentConditionType `json:"type" protobuf:"bytes,1,opt,name=type,casttype=ComponentConditionType"` 4210 // Status of the condition for a component. 4211 // Valid values for "Healthy": "True", "False", or "Unknown". 4212 Status ConditionStatus `json:"status" protobuf:"bytes,2,opt,name=status,casttype=ConditionStatus"` 4213 // Message about the condition for a component. 4214 // For example, information about a health check. 4215 // +optional 4216 Message string `json:"message,omitempty" protobuf:"bytes,3,opt,name=message"` 4217 // Condition error code for a component. 4218 // For example, a health check error code. 4219 // +optional 4220 Error string `json:"error,omitempty" protobuf:"bytes,4,opt,name=error"` 4221} 4222 4223// +genclient=true 4224// +nonNamespaced=true 4225 4226// ComponentStatus (and ComponentStatusList) holds the cluster validation info. 4227type ComponentStatus struct { 4228 metav1.TypeMeta `json:",inline"` 4229 // Standard object's metadata. 4230 // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata 4231 // +optional 4232 metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` 4233 4234 // List of component conditions observed 4235 // +optional 4236 Conditions []ComponentCondition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type" protobuf:"bytes,2,rep,name=conditions"` 4237} 4238 4239// Status of all the conditions for the component as a list of ComponentStatus objects. 4240type ComponentStatusList struct { 4241 metav1.TypeMeta `json:",inline"` 4242 // Standard list metadata. 4243 // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#types-kinds 4244 // +optional 4245 metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` 4246 4247 // List of ComponentStatus objects. 4248 Items []ComponentStatus `json:"items" protobuf:"bytes,2,rep,name=items"` 4249} 4250 4251// DownwardAPIVolumeSource represents a volume containing downward API info. 4252// Downward API volumes support ownership management and SELinux relabeling. 4253type DownwardAPIVolumeSource struct { 4254 // Items is a list of downward API volume file 4255 // +optional 4256 Items []DownwardAPIVolumeFile `json:"items,omitempty" protobuf:"bytes,1,rep,name=items"` 4257 // Optional: mode bits to use on created files by default. Must be a 4258 // value between 0 and 0777. Defaults to 0644. 4259 // Directories within the path are not affected by this setting. 4260 // This might be in conflict with other options that affect the file 4261 // mode, like fsGroup, and the result can be other mode bits set. 4262 // +optional 4263 DefaultMode *int32 `json:"defaultMode,omitempty" protobuf:"varint,2,opt,name=defaultMode"` 4264} 4265 4266const ( 4267 DownwardAPIVolumeSourceDefaultMode int32 = 0644 4268) 4269 4270// DownwardAPIVolumeFile represents information to create the file containing the pod field 4271type DownwardAPIVolumeFile struct { 4272 // 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 '..' 4273 Path string `json:"path" protobuf:"bytes,1,opt,name=path"` 4274 // Required: Selects a field of the pod: only annotations, labels, name and namespace are supported. 4275 // +optional 4276 FieldRef *ObjectFieldSelector `json:"fieldRef,omitempty" protobuf:"bytes,2,opt,name=fieldRef"` 4277 // Selects a resource of the container: only resources limits and requests 4278 // (limits.cpu, limits.memory, requests.cpu and requests.memory) are currently supported. 4279 // +optional 4280 ResourceFieldRef *ResourceFieldSelector `json:"resourceFieldRef,omitempty" protobuf:"bytes,3,opt,name=resourceFieldRef"` 4281 // Optional: mode bits to use on this file, must be a value between 0 4282 // and 0777. If not specified, the volume defaultMode will be used. 4283 // This might be in conflict with other options that affect the file 4284 // mode, like fsGroup, and the result can be other mode bits set. 4285 // +optional 4286 Mode *int32 `json:"mode,omitempty" protobuf:"varint,4,opt,name=mode"` 4287} 4288 4289// Represents downward API info for projecting into a projected volume. 4290// Note that this is identical to a downwardAPI volume source without the default 4291// mode. 4292type DownwardAPIProjection struct { 4293 // Items is a list of DownwardAPIVolume file 4294 // +optional 4295 Items []DownwardAPIVolumeFile `json:"items,omitempty" protobuf:"bytes,1,rep,name=items"` 4296} 4297 4298// SecurityContext holds security configuration that will be applied to a container. 4299// Some fields are present in both SecurityContext and PodSecurityContext. When both 4300// are set, the values in SecurityContext take precedence. 4301type SecurityContext struct { 4302 // The capabilities to add/drop when running containers. 4303 // Defaults to the default set of capabilities granted by the container runtime. 4304 // +optional 4305 Capabilities *Capabilities `json:"capabilities,omitempty" protobuf:"bytes,1,opt,name=capabilities"` 4306 // Run container in privileged mode. 4307 // Processes in privileged containers are essentially equivalent to root on the host. 4308 // Defaults to false. 4309 // +optional 4310 Privileged *bool `json:"privileged,omitempty" protobuf:"varint,2,opt,name=privileged"` 4311 // The SELinux context to be applied to the container. 4312 // If unspecified, the container runtime will allocate a random SELinux context for each 4313 // container. May also be set in PodSecurityContext. If set in both SecurityContext and 4314 // PodSecurityContext, the value specified in SecurityContext takes precedence. 4315 // +optional 4316 SELinuxOptions *SELinuxOptions `json:"seLinuxOptions,omitempty" protobuf:"bytes,3,opt,name=seLinuxOptions"` 4317 // The UID to run the entrypoint of the container process. 4318 // Defaults to user specified in image metadata if unspecified. 4319 // May also be set in PodSecurityContext. If set in both SecurityContext and 4320 // PodSecurityContext, the value specified in SecurityContext takes precedence. 4321 // +optional 4322 RunAsUser *int64 `json:"runAsUser,omitempty" protobuf:"varint,4,opt,name=runAsUser"` 4323 // Indicates that the container must run as a non-root user. 4324 // If true, the Kubelet will validate the image at runtime to ensure that it 4325 // does not run as UID 0 (root) and fail to start the container if it does. 4326 // If unset or false, no such validation will be performed. 4327 // May also be set in PodSecurityContext. If set in both SecurityContext and 4328 // PodSecurityContext, the value specified in SecurityContext takes precedence. 4329 // +optional 4330 RunAsNonRoot *bool `json:"runAsNonRoot,omitempty" protobuf:"varint,5,opt,name=runAsNonRoot"` 4331 // Whether this container has a read-only root filesystem. 4332 // Default is false. 4333 // +optional 4334 ReadOnlyRootFilesystem *bool `json:"readOnlyRootFilesystem,omitempty" protobuf:"varint,6,opt,name=readOnlyRootFilesystem"` 4335} 4336 4337// SELinuxOptions are the labels to be applied to the container 4338type SELinuxOptions struct { 4339 // User is a SELinux user label that applies to the container. 4340 // +optional 4341 User string `json:"user,omitempty" protobuf:"bytes,1,opt,name=user"` 4342 // Role is a SELinux role label that applies to the container. 4343 // +optional 4344 Role string `json:"role,omitempty" protobuf:"bytes,2,opt,name=role"` 4345 // Type is a SELinux type label that applies to the container. 4346 // +optional 4347 Type string `json:"type,omitempty" protobuf:"bytes,3,opt,name=type"` 4348 // Level is SELinux level label that applies to the container. 4349 // +optional 4350 Level string `json:"level,omitempty" protobuf:"bytes,4,opt,name=level"` 4351} 4352 4353// RangeAllocation is not a public type. 4354type RangeAllocation struct { 4355 metav1.TypeMeta `json:",inline"` 4356 // Standard object's metadata. 4357 // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata 4358 // +optional 4359 metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` 4360 4361 // Range is string that identifies the range represented by 'data'. 4362 Range string `json:"range" protobuf:"bytes,2,opt,name=range"` 4363 // Data is a bit array containing all allocated addresses in the previous segment. 4364 Data []byte `json:"data" protobuf:"bytes,3,opt,name=data"` 4365} 4366 4367const ( 4368 // "default-scheduler" is the name of default scheduler. 4369 DefaultSchedulerName = "default-scheduler" 4370 4371 // RequiredDuringScheduling affinity is not symmetric, but there is an implicit PreferredDuringScheduling affinity rule 4372 // corresponding to every RequiredDuringScheduling affinity rule. 4373 // When the --hard-pod-affinity-weight scheduler flag is not specified, 4374 // DefaultHardPodAffinityWeight defines the weight of the implicit PreferredDuringScheduling affinity rule. 4375 DefaultHardPodAffinitySymmetricWeight int = 1 4376 4377 // When the --failure-domains scheduler flag is not specified, 4378 // DefaultFailureDomains defines the set of label keys used when TopologyKey is empty in PreferredDuringScheduling anti-affinity. 4379 DefaultFailureDomains string = metav1.LabelHostname + "," + metav1.LabelZoneFailureDomain + "," + metav1.LabelZoneRegion 4380) 4381