golang.org/x/build@v0.0.0-20240506185731-218518f32b70/kubernetes/api/types.go (about) 1 /* 2 Copyright 2015 The Kubernetes Authors All rights reserved. 3 4 Licensed under the Apache License, Version 2.0 (the "License"); 5 you may not use this file except in compliance with the License. 6 You may obtain a copy of the License at 7 8 http://www.apache.org/licenses/LICENSE-2.0 9 10 Unless required by applicable law or agreed to in writing, software 11 distributed under the License is distributed on an "AS IS" BASIS, 12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 See the License for the specific language governing permissions and 14 limitations under the License. 15 */ 16 17 // Package api contains the Kubernetes v1 API types. 18 package api 19 20 // The comments for the structs and fields can be used from go-resful to 21 // generate Swagger API documentation for its models. Please read this PR for more 22 // information on the implementation: https://github.com/emicklei/go-restful/pull/215 23 // 24 // TODOs are ignored from the parser. (e.g. TODO(andronat):... || TODO:...) iff 25 // are on one line! For multiple line or blocks that you want to ignore use ---. 26 // Any context after a --- is ignored and not exported to the SwaggerAPI. 27 // 28 // The aforementioned methods can be generated by hack/update-generated-swagger-docs.sh 29 30 // Common string formats 31 // --------------------- 32 // Many fields in this API have formatting requirements. The commonly used 33 // formats are defined here. 34 // 35 // C_IDENTIFIER: This is a string that conforms to the definition of an "identifier" 36 // in the C language. This is captured by the following regex: 37 // [A-Za-z_][A-Za-z0-9_]* 38 // This defines the format, but not the length restriction, which should be 39 // specified at the definition of any field of this type. 40 // 41 // DNS_LABEL: This is a string, no more than 63 characters long, that conforms 42 // to the definition of a "label" in RFCs 1035 and 1123. This is captured 43 // by the following regex: 44 // [a-z0-9]([-a-z0-9]*[a-z0-9])? 45 // 46 // DNS_SUBDOMAIN: This is a string, no more than 253 characters long, that conforms 47 // to the definition of a "subdomain" in RFCs 1035 and 1123. This is captured 48 // by the following regex: 49 // [a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)* 50 // or more simply: 51 // DNS_LABEL(\.DNS_LABEL)* 52 // 53 // IANA_SVC_NAME: This is a string, no more than 15 characters long, that 54 // conforms to the definition of IANA service name in RFC 6335. 55 // It must contains at least one letter [a-z] and it must contains only [a-z0-9-]. 56 // Hyphens ('-') cannot be leading or trailing character of the string 57 // and cannot be adjacent to other hyphens. 58 59 // TypeMeta describes an individual object in an API response or request 60 // with strings representing the type of the object and its API schema version. 61 // Structures that are versioned or persisted should inline TypeMeta. 62 type TypeMeta struct { 63 // A string value representing the REST resource this object represents. 64 // Servers may infer this from the endpoint the client submits requests to. 65 // Cannot be updated. 66 // In CamelCase. 67 // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#types-kinds 68 Kind string `json:"kind,omitempty"` 69 70 // APIVersion defines the version of the schema of an object. 71 // Servers should convert recognized schemas to the latest internal value, and 72 // may reject unrecognized values. 73 // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#resources 74 APIVersion string `json:"apiVersion,omitempty"` 75 } 76 77 // ListMeta describes metadata that synthetic resources must have, including lists and 78 // various status objects. 79 type ListMeta struct { 80 // SelfLink is a URL representing this object. 81 // Populated by the system. 82 // Read-only. 83 SelfLink string `json:"selfLink,omitempty"` 84 85 // String that identifies the server's internal version of this object that 86 // can be used by clients to determine when objects have changed. 87 // Value must be treated as opaque by clients and passed unmodified back to the server. 88 // Populated by the system. 89 // Read-only. 90 // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#concurrency-control-and-consistency 91 ResourceVersion string `json:"resourceVersion,omitempty"` 92 } 93 94 // ObjectMeta is metadata that all persisted resources must have, which includes all objects 95 // users must create. 96 type ObjectMeta struct { 97 // Name must be unique within a namespace. Is required when creating resources, although 98 // some resources may allow a client to request the generation of an appropriate name 99 // automatically. Name is primarily intended for creation idempotence and configuration 100 // definition. 101 // Cannot be updated. 102 // More info: http://releases.k8s.io/HEAD/docs/user-guide/identifiers.md#names 103 Name string `json:"name,omitempty"` 104 105 // GenerateName is an optional prefix, used by the server, to generate a unique 106 // name ONLY IF the Name field has not been provided. 107 // If this field is used, the name returned to the client will be different 108 // than the name passed. This value will also be combined with a unique suffix. 109 // The provided value has the same validation rules as the Name field, 110 // and may be truncated by the length of the suffix required to make the value 111 // unique on the server. 112 // 113 // If this field is specified and the generated name exists, the server will 114 // NOT return a 409 - instead, it will either return 201 Created or 500 with Reason 115 // ServerTimeout indicating a unique name could not be found in the time allotted, and the client 116 // should retry (optionally after the time indicated in the Retry-After header). 117 // 118 // Applied only if Name is not specified. 119 // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#idempotency 120 GenerateName string `json:"generateName,omitempty"` 121 122 // Namespace defines the space within each name must be unique. An empty namespace is 123 // equivalent to the "default" namespace, but "default" is the canonical representation. 124 // Not all objects are required to be scoped to a namespace - the value of this field for 125 // those objects will be empty. 126 // 127 // Must be a DNS_LABEL. 128 // Cannot be updated. 129 // More info: http://releases.k8s.io/HEAD/docs/user-guide/namespaces.md 130 Namespace string `json:"namespace,omitempty"` 131 132 // SelfLink is a URL representing this object. 133 // Populated by the system. 134 // Read-only. 135 SelfLink string `json:"selfLink,omitempty"` 136 137 // UID is the unique in time and space value for this object. It is typically generated by 138 // the server on successful creation of a resource and is not allowed to change on PUT 139 // operations. 140 // 141 // Populated by the system. 142 // Read-only. 143 // More info: http://releases.k8s.io/HEAD/docs/user-guide/identifiers.md#uids 144 UID UID `json:"uid,omitempty"` 145 146 // An opaque value that represents the internal version of this object that can 147 // be used by clients to determine when objects have changed. May be used for optimistic 148 // concurrency, change detection, and the watch operation on a resource or set of resources. 149 // Clients must treat these values as opaque and passed unmodified back to the server. 150 // They may only be valid for a particular resource or set of resources. 151 // 152 // Populated by the system. 153 // Read-only. 154 // Value must be treated as opaque by clients and . 155 // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#concurrency-control-and-consistency 156 ResourceVersion string `json:"resourceVersion,omitempty"` 157 158 // A sequence number representing a specific generation of the desired state. 159 // Currently only implemented by replication controllers. 160 // Populated by the system. 161 // Read-only. 162 Generation int64 `json:"generation,omitempty"` 163 164 // CreationTimestamp is a timestamp representing the server time when this object was 165 // created. It is not guaranteed to be set in happens-before order across separate operations. 166 // Clients may not set this value. It is represented in RFC3339 form and is in UTC. 167 // 168 // Populated by the system. 169 // Read-only. 170 // Null for lists. 171 // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata 172 CreationTimestamp Time `json:"creationTimestamp,omitempty"` 173 174 // DeletionTimestamp is RFC 3339 date and time at which this resource will be deleted. This 175 // field is set by the server when a graceful deletion is requested by the user, and is not 176 // directly settable by a client. The resource will be deleted (no longer visible from 177 // resource lists, and not reachable by name) after the time in this field. Once set, this 178 // value may not be unset or be set further into the future, although it may be shortened 179 // or the resource may be deleted prior to this time. For example, a user may request that 180 // a pod is deleted in 30 seconds. The Kubelet will react by sending a graceful termination 181 // signal to the containers in the pod. Once the resource is deleted in the API, the Kubelet 182 // will send a hard termination signal to the container. 183 // If not set, graceful deletion of the object has not been requested. 184 // 185 // Populated by the system when a graceful deletion is requested. 186 // Read-only. 187 // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata 188 DeletionTimestamp *Time `json:"deletionTimestamp,omitempty"` 189 190 // Number of seconds allowed for this object to gracefully terminate before 191 // it will be removed from the system. Only set when deletionTimestamp is also set. 192 // May only be shortened. 193 // Read-only. 194 DeletionGracePeriodSeconds *int64 `json:"deletionGracePeriodSeconds,omitempty"` 195 196 // Map of string keys and values that can be used to organize and categorize 197 // (scope and select) objects. May match selectors of replication controllers 198 // and services. 199 // More info: http://releases.k8s.io/HEAD/docs/user-guide/labels.md 200 // TODO: replace map[string]string with labels.LabelSet type 201 Labels map[string]string `json:"labels,omitempty"` 202 203 // Annotations is an unstructured key value map stored with a resource that may be 204 // set by external tools to store and retrieve arbitrary metadata. They are not 205 // queryable and should be preserved when modifying objects. 206 // More info: http://releases.k8s.io/HEAD/docs/user-guide/annotations.md 207 Annotations map[string]string `json:"annotations,omitempty"` 208 } 209 210 const ( 211 // NamespaceDefault means the object is in the default namespace which is applied when not specified by clients 212 NamespaceDefault string = "default" 213 // NamespaceAll is the default argument to specify on a context when you want to list or filter resources across all namespaces 214 NamespaceAll string = "" 215 ) 216 217 // Volume represents a named volume in a pod that may be accessed by any container in the pod. 218 type Volume struct { 219 // Volume's name. 220 // Must be a DNS_LABEL and unique within the pod. 221 // More info: http://releases.k8s.io/HEAD/docs/user-guide/identifiers.md#names 222 Name string `json:"name"` 223 // VolumeSource represents the location and type of the mounted volume. 224 // If not specified, the Volume is implied to be an EmptyDir. 225 // This implied behavior is deprecated and will be removed in a future version. 226 VolumeSource `json:",inline"` 227 } 228 229 // VolumeSource represents the source location of a volume to mount. 230 // Only one of its members may be specified. 231 type VolumeSource struct { 232 // HostPath represents a pre-existing file or directory on the host 233 // machine that is directly exposed to the container. This is generally 234 // used for system agents or other privileged things that are allowed 235 // to see the host machine. Most containers will NOT need this. 236 // More info: http://releases.k8s.io/HEAD/docs/user-guide/volumes.md#hostpath 237 // --- 238 // TODO(jonesdl) We need to restrict who can use host directory mounts and who can/can not 239 // mount host directories as read/write. 240 HostPath *HostPathVolumeSource `json:"hostPath,omitempty"` 241 // EmptyDir represents a temporary directory that shares a pod's lifetime. 242 // More info: http://releases.k8s.io/HEAD/docs/user-guide/volumes.md#emptydir 243 EmptyDir *EmptyDirVolumeSource `json:"emptyDir,omitempty"` 244 // GCEPersistentDisk represents a GCE Disk resource that is attached to a 245 // kubelet's host machine and then exposed to the pod. 246 // More info: http://releases.k8s.io/HEAD/docs/user-guide/volumes.md#gcepersistentdisk 247 GCEPersistentDisk *GCEPersistentDiskVolumeSource `json:"gcePersistentDisk,omitempty"` 248 // AWSElasticBlockStore represents an AWS Disk resource that is attached to a 249 // kubelet's host machine and then exposed to the pod. 250 // More info: http://releases.k8s.io/HEAD/docs/user-guide/volumes.md#awselasticblockstore 251 AWSElasticBlockStore *AWSElasticBlockStoreVolumeSource `json:"awsElasticBlockStore,omitempty"` 252 // GitRepo represents a git repository at a particular revision. 253 GitRepo *GitRepoVolumeSource `json:"gitRepo,omitempty"` 254 // Secret represents a secret that should populate this volume. 255 // More info: http://releases.k8s.io/HEAD/docs/user-guide/volumes.md#secrets 256 Secret *SecretVolumeSource `json:"secret,omitempty"` 257 // NFS represents an NFS mount on the host that shares a pod's lifetime 258 // More info: http://releases.k8s.io/HEAD/docs/user-guide/volumes.md#nfs 259 NFS *NFSVolumeSource `json:"nfs,omitempty"` 260 // ISCSI represents an ISCSI Disk resource that is attached to a 261 // kubelet's host machine and then exposed to the pod. 262 // More info: http://releases.k8s.io/HEAD/examples/iscsi/README.md 263 ISCSI *ISCSIVolumeSource `json:"iscsi,omitempty"` 264 // Glusterfs represents a Glusterfs mount on the host that shares a pod's lifetime. 265 // More info: http://releases.k8s.io/HEAD/examples/glusterfs/README.md 266 Glusterfs *GlusterfsVolumeSource `json:"glusterfs,omitempty"` 267 // PersistentVolumeClaimVolumeSource represents a reference to a 268 // PersistentVolumeClaim in the same namespace. 269 // More info: http://releases.k8s.io/HEAD/docs/user-guide/persistent-volumes.md#persistentvolumeclaims 270 PersistentVolumeClaim *PersistentVolumeClaimVolumeSource `json:"persistentVolumeClaim,omitempty"` 271 // RBD represents a Rados Block Device mount on the host that shares a pod's lifetime. 272 // More info: http://releases.k8s.io/HEAD/examples/rbd/README.md 273 RBD *RBDVolumeSource `json:"rbd,omitempty"` 274 // Cinder represents a cinder volume attached and mounted on kubelets host machine 275 // More info: http://releases.k8s.io/HEAD/examples/mysql-cinder-pd/README.md 276 Cinder *CinderVolumeSource `json:"cinder,omitempty"` 277 278 // CephFS represents a Ceph FS mount on the host that shares a pod's lifetime 279 CephFS *CephFSVolumeSource `json:"cephfs,omitempty"` 280 281 // DownwardAPI represents downward API about the pod that should populate this volume 282 DownwardAPI *DownwardAPIVolumeSource `json:"downwardAPI,omitempty"` 283 } 284 285 // PersistentVolumeClaimVolumeSource references the user's PVC in the same namespace. 286 // This volume finds the bound PV and mounts that volume for the pod. A 287 // PersistentVolumeClaimVolumeSource is, essentially, a wrapper around another 288 // type of volume that is owned by someone else (the system). 289 type PersistentVolumeClaimVolumeSource struct { 290 // ClaimName is the name of a PersistentVolumeClaim in the same namespace as the pod using this volume. 291 // More info: http://releases.k8s.io/HEAD/docs/user-guide/persistent-volumes.md#persistentvolumeclaims 292 ClaimName string `json:"claimName"` 293 // Will force the ReadOnly setting in VolumeMounts. 294 // Default false. 295 ReadOnly bool `json:"readOnly,omitempty"` 296 } 297 298 // PersistentVolumeSource is similar to VolumeSource but meant for the 299 // administrator who creates PVs. Exactly one of its members must be set. 300 type PersistentVolumeSource struct { 301 // GCEPersistentDisk represents a GCE Disk resource that is attached to a 302 // kubelet's host machine and then exposed to the pod. Provisioned by an admin. 303 // More info: http://releases.k8s.io/HEAD/docs/user-guide/volumes.md#gcepersistentdisk 304 GCEPersistentDisk *GCEPersistentDiskVolumeSource `json:"gcePersistentDisk,omitempty"` 305 // AWSElasticBlockStore represents an AWS Disk resource that is attached to a 306 // kubelet's host machine and then exposed to the pod. 307 // More info: http://releases.k8s.io/HEAD/docs/user-guide/volumes.md#awselasticblockstore 308 AWSElasticBlockStore *AWSElasticBlockStoreVolumeSource `json:"awsElasticBlockStore,omitempty"` 309 // HostPath represents a directory on the host. 310 // Provisioned by a developer or tester. 311 // This is useful for development and testing only. 312 // On-host storage is not supported in any way. 313 // More info: http://releases.k8s.io/HEAD/docs/user-guide/volumes.md#hostpath 314 HostPath *HostPathVolumeSource `json:"hostPath,omitempty"` 315 // Glusterfs represents a Glusterfs volume that is attached to a host and 316 // exposed to the pod. Provisioned by an admin. 317 // More info: http://releases.k8s.io/HEAD/examples/glusterfs/README.md 318 Glusterfs *GlusterfsVolumeSource `json:"glusterfs,omitempty"` 319 // NFS represents an NFS mount on the host. Provisioned by an admin. 320 // More info: http://releases.k8s.io/HEAD/docs/user-guide/volumes.md#nfs 321 NFS *NFSVolumeSource `json:"nfs,omitempty"` 322 // RBD represents a Rados Block Device mount on the host that shares a pod's lifetime. 323 // More info: http://releases.k8s.io/HEAD/examples/rbd/README.md 324 RBD *RBDVolumeSource `json:"rbd,omitempty"` 325 // ISCSI represents an ISCSI Disk resource that is attached to a 326 // kubelet's host machine and then exposed to the pod. Provisioned by an admin. 327 ISCSI *ISCSIVolumeSource `json:"iscsi,omitempty"` 328 // Cinder represents a cinder volume attached and mounted on kubelets host machine 329 // More info: http://releases.k8s.io/HEAD/examples/mysql-cinder-pd/README.md 330 Cinder *CinderVolumeSource `json:"cinder,omitempty"` 331 // CephFS represents a Ceph FS mount on the host that shares a pod's lifetime 332 CephFS *CephFSVolumeSource `json:"cephfs,omitempty"` 333 } 334 335 // PersistentVolume (PV) is a storage resource provisioned by an administrator. 336 // It is analogous to a node. 337 // More info: http://releases.k8s.io/HEAD/docs/user-guide/persistent-volumes.md 338 type PersistentVolume struct { 339 TypeMeta `json:",inline"` 340 // Standard object's metadata. 341 // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata 342 ObjectMeta `json:"metadata,omitempty"` 343 344 // Spec defines a specification of a persistent volume owned by the cluster. 345 // Provisioned by an administrator. 346 // More info: http://releases.k8s.io/HEAD/docs/user-guide/persistent-volumes.md#persistent-volumes 347 Spec PersistentVolumeSpec `json:"spec,omitempty"` 348 349 // Status represents the current information/status for the persistent volume. 350 // Populated by the system. 351 // Read-only. 352 // More info: http://releases.k8s.io/HEAD/docs/user-guide/persistent-volumes.md#persistent-volumes 353 Status PersistentVolumeStatus `json:"status,omitempty"` 354 } 355 356 // PersistentVolumeSpec is the specification of a persistent volume. 357 type PersistentVolumeSpec struct { 358 // A description of the persistent volume's resources and capacity. 359 // More info: http://releases.k8s.io/HEAD/docs/user-guide/persistent-volumes.md#capacity 360 Capacity ResourceList `json:"capacity,omitempty"` 361 // The actual volume backing the persistent volume. 362 PersistentVolumeSource `json:",inline"` 363 // AccessModes contains all ways the volume can be mounted. 364 // More info: http://releases.k8s.io/HEAD/docs/user-guide/persistent-volumes.md#access-modes 365 AccessModes []PersistentVolumeAccessMode `json:"accessModes,omitempty"` 366 // ClaimRef is part of a bi-directional binding between PersistentVolume and PersistentVolumeClaim. 367 // Expected to be non-nil when bound. 368 // claim.VolumeName is the authoritative bind between PV and PVC. 369 // More info: http://releases.k8s.io/HEAD/docs/user-guide/persistent-volumes.md#binding 370 ClaimRef *ObjectReference `json:"claimRef,omitempty"` 371 // What happens to a persistent volume when released from its claim. 372 // Valid options are Retain (default) and Recycle. 373 // Recycling must be supported by the volume plugin underlying this persistent volume. 374 // More info: http://releases.k8s.io/HEAD/docs/user-guide/persistent-volumes.md#recycling-policy 375 PersistentVolumeReclaimPolicy PersistentVolumeReclaimPolicy `json:"persistentVolumeReclaimPolicy,omitempty"` 376 } 377 378 // PersistentVolumeReclaimPolicy describes a policy for end-of-life maintenance of persistent volumes. 379 type PersistentVolumeReclaimPolicy string 380 381 const ( 382 // PersistentVolumeReclaimRecycle means the volume will be recycled back into the pool of unbound persistent volumes on release from its claim. 383 // The volume plugin must support Recycling. 384 PersistentVolumeReclaimRecycle PersistentVolumeReclaimPolicy = "Recycle" 385 386 // PersistentVolumeReclaimDelete means the volume will be deleted from Kubernetes on release from its claim. 387 // The volume plugin must support Deletion. 388 // TODO: implement w/ DeletableVolumePlugin 389 // PersistentVolumeReclaimDelete PersistentVolumeReclaimPolicy = "Delete" 390 391 // PersistentVolumeReclaimRetain means the volume will left in its current phase (Released) for manual reclamation by the administrator. 392 // The default policy is Retain. 393 PersistentVolumeReclaimRetain PersistentVolumeReclaimPolicy = "Retain" 394 ) 395 396 // PersistentVolumeStatus is the current status of a persistent volume. 397 type PersistentVolumeStatus struct { 398 // Phase indicates if a volume is available, bound to a claim, or released by a claim. 399 // More info: http://releases.k8s.io/HEAD/docs/user-guide/persistent-volumes.md#phase 400 Phase PersistentVolumePhase `json:"phase,omitempty"` 401 // A human-readable message indicating details about why the volume is in this state. 402 Message string `json:"message,omitempty"` 403 // Reason is a brief CamelCase string that describes any failure and is meant 404 // for machine parsing and tidy display in the CLI. 405 Reason string `json:"reason,omitempty"` 406 } 407 408 // PersistentVolumeList is a list of PersistentVolume items. 409 type PersistentVolumeList struct { 410 TypeMeta `json:",inline"` 411 // Standard list metadata. 412 // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#types-kinds 413 ListMeta `json:"metadata,omitempty"` 414 // List of persistent volumes. 415 // More info: http://releases.k8s.io/HEAD/docs/user-guide/persistent-volumes.md 416 Items []PersistentVolume `json:"items"` 417 } 418 419 // PersistentVolumeClaim is a user's request for and claim to a persistent volume 420 type PersistentVolumeClaim struct { 421 TypeMeta `json:",inline"` 422 // Standard object's metadata. 423 // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata 424 ObjectMeta `json:"metadata,omitempty"` 425 426 // Spec defines the desired characteristics of a volume requested by a pod author. 427 // More info: http://releases.k8s.io/HEAD/docs/user-guide/persistent-volumes.md#persistentvolumeclaims 428 Spec PersistentVolumeClaimSpec `json:"spec,omitempty"` 429 430 // Status represents the current information/status of a persistent volume claim. 431 // Read-only. 432 // More info: http://releases.k8s.io/HEAD/docs/user-guide/persistent-volumes.md#persistentvolumeclaims 433 Status PersistentVolumeClaimStatus `json:"status,omitempty"` 434 } 435 436 // PersistentVolumeClaimList is a list of PersistentVolumeClaim items. 437 type PersistentVolumeClaimList struct { 438 TypeMeta `json:",inline"` 439 // Standard list metadata. 440 // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#types-kinds 441 ListMeta `json:"metadata,omitempty"` 442 // A list of persistent volume claims. 443 // More info: http://releases.k8s.io/HEAD/docs/user-guide/persistent-volumes.md#persistentvolumeclaims 444 Items []PersistentVolumeClaim `json:"items"` 445 } 446 447 // PersistentVolumeClaimSpec describes the common attributes of storage devices 448 // and allows a Source for provider-specific attributes 449 type PersistentVolumeClaimSpec struct { 450 // AccessModes contains the desired access modes the volume should have. 451 // More info: http://releases.k8s.io/HEAD/docs/user-guide/persistent-volumes.md#access-modes-1 452 AccessModes []PersistentVolumeAccessMode `json:"accessModes,omitempty"` 453 // Resources represents the minimum resources the volume should have. 454 // More info: http://releases.k8s.io/HEAD/docs/user-guide/persistent-volumes.md#resources 455 Resources ResourceRequirements `json:"resources,omitempty"` 456 // VolumeName is the binding reference to the PersistentVolume backing this claim. 457 VolumeName string `json:"volumeName,omitempty"` 458 } 459 460 // PersistentVolumeClaimStatus is the current status of a persistent volume claim. 461 type PersistentVolumeClaimStatus struct { 462 // Phase represents the current phase of PersistentVolumeClaim. 463 Phase PersistentVolumeClaimPhase `json:"phase,omitempty"` 464 // AccessModes contains the actual access modes the volume backing the PVC has. 465 // More info: http://releases.k8s.io/HEAD/docs/user-guide/persistent-volumes.md#access-modes-1 466 AccessModes []PersistentVolumeAccessMode `json:"accessModes,omitempty"` 467 // Represents the actual resources of the underlying volume. 468 Capacity ResourceList `json:"capacity,omitempty"` 469 } 470 471 type PersistentVolumeAccessMode string 472 473 const ( 474 // can be mounted read/write mode to exactly 1 host 475 ReadWriteOnce PersistentVolumeAccessMode = "ReadWriteOnce" 476 // can be mounted in read-only mode to many hosts 477 ReadOnlyMany PersistentVolumeAccessMode = "ReadOnlyMany" 478 // can be mounted in read/write mode to many hosts 479 ReadWriteMany PersistentVolumeAccessMode = "ReadWriteMany" 480 ) 481 482 type PersistentVolumePhase string 483 484 const ( 485 // used for PersistentVolumes that are not available 486 VolumePending PersistentVolumePhase = "Pending" 487 // used for PersistentVolumes that are not yet bound 488 // Available volumes are held by the binder and matched to PersistentVolumeClaims 489 VolumeAvailable PersistentVolumePhase = "Available" 490 // used for PersistentVolumes that are bound 491 VolumeBound PersistentVolumePhase = "Bound" 492 // used for PersistentVolumes where the bound PersistentVolumeClaim was deleted 493 // released volumes must be recycled before becoming available again 494 // this phase is used by the persistent volume claim binder to signal to another process to reclaim the resource 495 VolumeReleased PersistentVolumePhase = "Released" 496 // used for PersistentVolumes that failed to be correctly recycled or deleted after being released from a claim 497 VolumeFailed PersistentVolumePhase = "Failed" 498 ) 499 500 type PersistentVolumeClaimPhase string 501 502 const ( 503 // used for PersistentVolumeClaims that are not yet bound 504 ClaimPending PersistentVolumeClaimPhase = "Pending" 505 // used for PersistentVolumeClaims that are bound 506 ClaimBound PersistentVolumeClaimPhase = "Bound" 507 ) 508 509 // HostPathVolumeSource represents bare host directory volume. 510 type HostPathVolumeSource struct { 511 // Path of the directory on the host. 512 // More info: http://releases.k8s.io/HEAD/docs/user-guide/volumes.md#hostpath 513 Path string `json:"path"` 514 } 515 516 // EmptyDirVolumeSource is temporary directory that shares a pod's lifetime. 517 type EmptyDirVolumeSource struct { 518 // What type of storage medium should back this directory. 519 // The default is "" which means to use the node's default medium. 520 // Must be an empty string (default) or Memory. 521 // More info: http://releases.k8s.io/HEAD/docs/user-guide/volumes.md#emptydir 522 Medium StorageMedium `json:"medium,omitempty"` 523 } 524 525 // GlusterfsVolumeSource represents a Glusterfs Mount that lasts the lifetime of a pod. 526 type GlusterfsVolumeSource struct { 527 // EndpointsName is the endpoint name that details Glusterfs topology. 528 // More info: http://releases.k8s.io/HEAD/examples/glusterfs/README.md#create-a-pod 529 EndpointsName string `json:"endpoints"` 530 531 // Path is the Glusterfs volume path. 532 // More info: http://releases.k8s.io/HEAD/examples/glusterfs/README.md#create-a-pod 533 Path string `json:"path"` 534 535 // ReadOnly here will force the Glusterfs volume to be mounted with read-only permissions. 536 // Defaults to false. 537 // More info: http://releases.k8s.io/HEAD/examples/glusterfs/README.md#create-a-pod 538 ReadOnly bool `json:"readOnly,omitempty"` 539 } 540 541 // StorageMedium defines ways that storage can be allocated to a volume. 542 type StorageMedium string 543 544 // RBDVolumeSource represents a Rados Block Device Mount that lasts the lifetime of a pod 545 type RBDVolumeSource struct { 546 // A collection of Ceph monitors. 547 // More info: http://releases.k8s.io/HEAD/examples/rbd/README.md#how-to-use-it 548 CephMonitors []string `json:"monitors"` 549 // The rados image name. 550 // More info: http://releases.k8s.io/HEAD/examples/rbd/README.md#how-to-use-it 551 RBDImage string `json:"image"` 552 // Filesystem type of the volume that you want to mount. 553 // Tip: Ensure that the filesystem type is supported by the host operating system. 554 // Examples: "ext4", "xfs", "ntfs". 555 // More info: http://releases.k8s.io/HEAD/docs/user-guide/volumes.md#rbd 556 // TODO: how do we prevent errors in the filesystem from compromising the machine 557 FSType string `json:"fsType,omitempty"` 558 // The rados pool name. 559 // Default is rbd. 560 // More info: http://releases.k8s.io/HEAD/examples/rbd/README.md#how-to-use-it. 561 RBDPool string `json:"pool"` 562 // The rados user name. 563 // Default is admin. 564 // More info: http://releases.k8s.io/HEAD/examples/rbd/README.md#how-to-use-it 565 RadosUser string `json:"user"` 566 // Keyring is the path to key ring for RBDUser. 567 // Default is /etc/ceph/keyring. 568 // More info: http://releases.k8s.io/HEAD/examples/rbd/README.md#how-to-use-it 569 Keyring string `json:"keyring"` 570 // SecretRef is name of the authentication secret for RBDUser. If provided 571 // overrides keyring. 572 // Default is empty. 573 // More info: http://releases.k8s.io/HEAD/examples/rbd/README.md#how-to-use-it 574 SecretRef *LocalObjectReference `json:"secretRef"` 575 // ReadOnly here will force the ReadOnly setting in VolumeMounts. 576 // Defaults to false. 577 // More info: http://releases.k8s.io/HEAD/examples/rbd/README.md#how-to-use-it 578 ReadOnly bool `json:"readOnly,omitempty"` 579 } 580 581 // CinderVolumeSource represents a cinder volume resource in Openstack. 582 // A Cinder volume must exist before mounting to a container. 583 // The volume must also be in the same region as the kubelet. 584 type CinderVolumeSource struct { 585 // volume id used to identify the volume in cinder 586 // More info: http://releases.k8s.io/HEAD/examples/mysql-cinder-pd/README.md 587 VolumeID string `json:"volumeID"` 588 // Required: Filesystem type to mount. 589 // Must be a filesystem type supported by the host operating system. 590 // Only ext3 and ext4 are allowed 591 // More info: http://releases.k8s.io/HEAD/examples/mysql-cinder-pd/README.md 592 FSType string `json:"fsType,omitempty"` 593 // Optional: Defaults to false (read/write). ReadOnly here will force 594 // the ReadOnly setting in VolumeMounts. 595 // More info: http://releases.k8s.io/HEAD/examples/mysql-cinder-pd/README.md 596 ReadOnly bool `json:"readOnly,omitempty"` 597 } 598 599 // CephFSVolumeSource represents a Ceph Filesystem Mount that lasts the lifetime of a pod 600 type CephFSVolumeSource struct { 601 // Required: Monitors is a collection of Ceph monitors 602 // More info: http://releases.k8s.io/HEAD/examples/cephfs/README.md#how-to-use-it 603 Monitors []string `json:"monitors"` 604 // Optional: User is the rados user name, default is admin 605 // More info: http://releases.k8s.io/HEAD/examples/cephfs/README.md#how-to-use-it 606 User string `json:"user,omitempty"` 607 // Optional: SecretFile is the path to key ring for User, default is /etc/ceph/user.secret 608 // More info: http://releases.k8s.io/HEAD/examples/cephfs/README.md#how-to-use-it 609 SecretFile string `json:"secretFile,omitempty"` 610 // Optional: SecretRef is reference to the authentication secret for User, default is empty. 611 // More info: http://releases.k8s.io/HEAD/examples/cephfs/README.md#how-to-use-it 612 SecretRef *LocalObjectReference `json:"secretRef,omitempty"` 613 // Optional: Defaults to false (read/write). ReadOnly here will force 614 // the ReadOnly setting in VolumeMounts. 615 // More info: http://releases.k8s.io/HEAD/examples/cephfs/README.md#how-to-use-it 616 ReadOnly bool `json:"readOnly,omitempty"` 617 } 618 619 const ( 620 StorageMediumDefault StorageMedium = "" // use whatever the default is for the node 621 StorageMediumMemory StorageMedium = "Memory" // use memory (tmpfs) 622 ) 623 624 // Protocol defines network protocols supported for things like container ports. 625 type Protocol string 626 627 const ( 628 // ProtocolTCP is the TCP protocol. 629 ProtocolTCP Protocol = "TCP" 630 // ProtocolUDP is the UDP protocol. 631 ProtocolUDP Protocol = "UDP" 632 ) 633 634 // GCEPersistentDiskVolumeSource represents a Persistent Disk resource in Google Compute Engine. 635 // 636 // A GCE PD must exist and be formatted before mounting to a container. 637 // The disk must also be in the same GCE project and zone as the kubelet. 638 // A GCE PD can only be mounted as read/write once. 639 type GCEPersistentDiskVolumeSource struct { 640 // Unique name of the PD resource in GCE. Used to identify the disk in GCE. 641 // More info: http://releases.k8s.io/HEAD/docs/user-guide/volumes.md#gcepersistentdisk 642 PDName string `json:"pdName"` 643 // Filesystem type of the volume that you want to mount. 644 // Tip: Ensure that the filesystem type is supported by the host operating system. 645 // Examples: "ext4", "xfs", "ntfs". 646 // More info: http://releases.k8s.io/HEAD/docs/user-guide/volumes.md#gcepersistentdisk 647 // TODO: how do we prevent errors in the filesystem from compromising the machine 648 FSType string `json:"fsType"` 649 // The partition in the volume that you want to mount. 650 // If omitted, the default is to mount by volume name. 651 // Examples: For volume /dev/sda1, you specify the partition as "1". 652 // Similarly, the volume partition for /dev/sda is "0" (or you can leave the property empty). 653 // More info: http://releases.k8s.io/HEAD/docs/user-guide/volumes.md#gcepersistentdisk 654 Partition int `json:"partition,omitempty"` 655 // ReadOnly here will force the ReadOnly setting in VolumeMounts. 656 // Defaults to false. 657 // More info: http://releases.k8s.io/HEAD/docs/user-guide/volumes.md#gcepersistentdisk 658 ReadOnly bool `json:"readOnly,omitempty"` 659 } 660 661 // Represents a persistent disk resource in AWS. 662 // 663 // An Amazon Elastic Block Store (EBS) must already be created, formatted, 664 // and reside in the same AWS zone as the kubelet before it can be mounted. 665 // Note: Amazon EBS volumes can be mounted to only one instance at a time. 666 type AWSElasticBlockStoreVolumeSource struct { 667 // Unique ID of the persistent disk resource in AWS (Amazon EBS volume). 668 // More info: http://releases.k8s.io/HEAD/docs/user-guide/volumes.md#awselasticblockstore 669 VolumeID string `json:"volumeID"` 670 // Filesystem type of the volume that you want to mount. 671 // Tip: Ensure that the filesystem type is supported by the host operating system. 672 // Examples: "ext4", "xfs", "ntfs". 673 // More info: http://releases.k8s.io/HEAD/docs/user-guide/volumes.md#awselasticblockstore 674 // TODO: how do we prevent errors in the filesystem from compromising the machine 675 FSType string `json:"fsType"` 676 // The partition in the volume that you want to mount. 677 // If omitted, the default is to mount by volume name. 678 // Examples: For volume /dev/sda1, you specify the partition as "1". 679 // Similarly, the volume partition for /dev/sda is "0" (or you can leave the property empty). 680 Partition int `json:"partition,omitempty"` 681 // Specify "true" to force and set the ReadOnly property in VolumeMounts to "true". 682 // If omitted, the default is "false". 683 // More info: http://releases.k8s.io/HEAD/docs/user-guide/volumes.md#awselasticblockstore 684 ReadOnly bool `json:"readOnly,omitempty"` 685 } 686 687 // GitRepoVolumeSource represents a volume that is pulled from git when the pod is created. 688 type GitRepoVolumeSource struct { 689 // Repository URL 690 Repository string `json:"repository"` 691 // Commit hash for the specified revision. 692 Revision string `json:"revision"` 693 } 694 695 // SecretVolumeSource adapts a Secret into a VolumeSource. 696 // More info: http://releases.k8s.io/HEAD/docs/design/secrets.md 697 type SecretVolumeSource struct { 698 // SecretName is the name of a secret in the pod's namespace. 699 // More info: http://releases.k8s.io/HEAD/docs/user-guide/volumes.md#secrets 700 SecretName string `json:"secretName"` 701 } 702 703 // NFSVolumeSource represents an NFS mount that lasts the lifetime of a pod 704 type NFSVolumeSource struct { 705 // Server is the hostname or IP address of the NFS server. 706 // More info: http://releases.k8s.io/HEAD/docs/user-guide/volumes.md#nfs 707 Server string `json:"server"` 708 709 // Path that is exported by the NFS server. 710 // More info: http://releases.k8s.io/HEAD/docs/user-guide/volumes.md#nfs 711 Path string `json:"path"` 712 713 // ReadOnly here will force 714 // the NFS export to be mounted with read-only permissions. 715 // Defaults to false. 716 // More info: http://releases.k8s.io/HEAD/docs/user-guide/volumes.md#nfs 717 ReadOnly bool `json:"readOnly,omitempty"` 718 } 719 720 // ISCSIVolumeSource describes an ISCSI Disk can only be mounted as read/write once. 721 type ISCSIVolumeSource struct { 722 // iSCSI target portal. The portal is either an IP or ip_addr:port if the port 723 // is other than default (typically TCP ports 860 and 3260). 724 TargetPortal string `json:"targetPortal"` 725 // Target iSCSI Qualified Name. 726 IQN string `json:"iqn"` 727 // iSCSI target lun number. 728 Lun int `json:"lun"` 729 // Filesystem type of the volume that you want to mount. 730 // Tip: Ensure that the filesystem type is supported by the host operating system. 731 // Examples: "ext4", "xfs", "ntfs". 732 // More info: http://releases.k8s.io/HEAD/docs/user-guide/volumes.md#iscsi 733 // TODO: how do we prevent errors in the filesystem from compromising the machine 734 FSType string `json:"fsType"` 735 // ReadOnly here will force the ReadOnly setting in VolumeMounts. 736 // Defaults to false. 737 ReadOnly bool `json:"readOnly,omitempty"` 738 } 739 740 // ContainerPort represents a network port in a single container. 741 type ContainerPort struct { 742 // If specified, this must be an IANA_SVC_NAME and unique within the pod. Each 743 // named port in a pod must have a unique name. Name for the port that can be 744 // referred to by services. 745 Name string `json:"name,omitempty"` 746 // Number of port to expose on the host. 747 // If specified, this must be a valid port number, 0 < x < 65536. 748 // If HostNetwork is specified, this must match ContainerPort. 749 // Most containers do not need this. 750 HostPort int `json:"hostPort,omitempty"` 751 // Number of port to expose on the pod's IP address. 752 // This must be a valid port number, 0 < x < 65536. 753 ContainerPort int `json:"containerPort"` 754 // Protocol for port. Must be UDP or TCP. 755 // Defaults to "TCP". 756 Protocol Protocol `json:"protocol,omitempty"` 757 // What host IP to bind the external port to. 758 HostIP string `json:"hostIP,omitempty"` 759 } 760 761 // VolumeMount describes a mounting of a Volume within a container. 762 type VolumeMount struct { 763 // This must match the Name of a Volume. 764 Name string `json:"name"` 765 // Mounted read-only if true, read-write otherwise (false or unspecified). 766 // Defaults to false. 767 ReadOnly bool `json:"readOnly,omitempty"` 768 // Path within the container at which the volume should be mounted. 769 MountPath string `json:"mountPath"` 770 } 771 772 // EnvVar represents an environment variable present in a Container. 773 type EnvVar struct { 774 // Name of the environment variable. Must be a C_IDENTIFIER. 775 Name string `json:"name"` 776 777 // Optional: no more than one of the following may be specified. 778 779 // Variable references $(VAR_NAME) are expanded 780 // using the previous defined environment variables in the container and 781 // any service environment variables. If a variable cannot be resolved, 782 // the reference in the input string will be unchanged. The $(VAR_NAME) 783 // syntax can be escaped with a double $$, ie: $$(VAR_NAME). Escaped 784 // references will never be expanded, regardless of whether the variable 785 // exists or not. 786 // Defaults to "". 787 Value string `json:"value,omitempty"` 788 // Source for the environment variable's value. Cannot be used if value is not empty. 789 ValueFrom *EnvVarSource `json:"valueFrom,omitempty"` 790 } 791 792 // EnvVarSource represents a source for the value of an EnvVar. 793 type EnvVarSource struct { 794 // Selects a field of the pod. Only name and namespace are supported. 795 FieldRef *ObjectFieldSelector `json:"fieldRef"` 796 } 797 798 // ObjectFieldSelector selects an APIVersioned field of an object. 799 type ObjectFieldSelector struct { 800 // Version of the schema the FieldPath is written in terms of, defaults to "v1". 801 APIVersion string `json:"apiVersion,omitempty"` 802 // Path of the field to select in the specified API version. 803 FieldPath string `json:"fieldPath"` 804 } 805 806 // HTTPGetAction describes an action based on HTTP Get requests. 807 type HTTPGetAction struct { 808 // Path to access on the HTTP server. 809 Path string `json:"path,omitempty"` 810 // Name or number of the port to access on the container. 811 // Number must be in the range 1 to 65535. 812 // Name must be an IANA_SVC_NAME. 813 Port IntOrString `json:"port"` 814 // Host name to connect to, defaults to the pod IP. 815 Host string `json:"host,omitempty"` 816 // Scheme to use for connecting to the host. 817 // Defaults to HTTP. 818 Scheme URIScheme `json:"scheme,omitempty"` 819 } 820 821 // URIScheme identifies the scheme used for connection to a host for Get actions 822 type URIScheme string 823 824 const ( 825 // URISchemeHTTP means that the scheme used will be http:// 826 URISchemeHTTP URIScheme = "HTTP" 827 // URISchemeHTTPS means that the scheme used will be https:// 828 URISchemeHTTPS URIScheme = "HTTPS" 829 ) 830 831 // TCPSocketAction describes an action based on opening a socket 832 type TCPSocketAction struct { 833 // Number or name of the port to access on the container. 834 // Number must be in the range 1 to 65535. 835 // Name must be an IANA_SVC_NAME. 836 Port IntOrString `json:"port"` 837 } 838 839 // ExecAction describes a "run in container" action. 840 type ExecAction struct { 841 // Command is the command line to execute inside the container, the working directory for the 842 // command is root ('/') in the container's filesystem. The command is simply exec'd, it is 843 // not run inside a shell, so traditional shell instructions ('|', etc) won't work. To use 844 // a shell, you need to explicitly call out to that shell. 845 // Exit status of 0 is treated as live/healthy and non-zero is unhealthy. 846 Command []string `json:"command,omitempty"` 847 } 848 849 // Probe describes a liveness probe to be examined to the container. 850 type Probe struct { 851 // The action taken to determine the health of a container 852 Handler `json:",inline"` 853 // Number of seconds after the container has started before liveness probes are initiated. 854 // More info: http://releases.k8s.io/HEAD/docs/user-guide/pod-states.md#container-probes 855 InitialDelaySeconds int64 `json:"initialDelaySeconds,omitempty"` 856 // Number of seconds after which liveness probes timeout. 857 // Defaults to 1 second. 858 // More info: http://releases.k8s.io/HEAD/docs/user-guide/pod-states.md#container-probes 859 TimeoutSeconds int64 `json:"timeoutSeconds,omitempty"` 860 } 861 862 // PullPolicy describes a policy for if/when to pull a container image 863 type PullPolicy string 864 865 const ( 866 // PullAlways means that kubelet always attempts to pull the latest image. Container will fail If the pull fails. 867 PullAlways PullPolicy = "Always" 868 // PullNever means that kubelet never pulls an image, but only uses a local image. Container will fail if the image isn't present 869 PullNever PullPolicy = "Never" 870 // 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. 871 PullIfNotPresent PullPolicy = "IfNotPresent" 872 ) 873 874 // Capability represent POSIX capabilities type 875 type Capability string 876 877 // Adds and removes POSIX capabilities from running containers. 878 type Capabilities struct { 879 // Added capabilities 880 Add []Capability `json:"add,omitempty"` 881 // Removed capabilities 882 Drop []Capability `json:"drop,omitempty"` 883 } 884 885 // ResourceRequirements describes the compute resource requirements. 886 type ResourceRequirements struct { 887 // Limits describes the maximum amount of compute resources allowed. 888 // More info: http://releases.k8s.io/HEAD/docs/design/resources.md#resource-specifications 889 Limits ResourceList `json:"limits,omitempty"` 890 // Requests describes the minimum amount of compute resources required. 891 // If Requests is omitted for a container, it defaults to Limits if that is explicitly specified, 892 // otherwise to an implementation-defined value. 893 // More info: http://releases.k8s.io/HEAD/docs/design/resources.md#resource-specifications 894 Requests ResourceList `json:"requests,omitempty"` 895 } 896 897 const ( 898 // TerminationMessagePathDefault means the default path to capture the application termination message running in a container 899 TerminationMessagePathDefault string = "/dev/termination-log" 900 ) 901 902 // A single application container that you want to run within a pod. 903 type Container struct { 904 // Name of the container specified as a DNS_LABEL. 905 // Each container in a pod must have a unique name (DNS_LABEL). 906 // Cannot be updated. 907 Name string `json:"name"` 908 // Docker image name. 909 // More info: http://releases.k8s.io/HEAD/docs/user-guide/images.md 910 Image string `json:"image,omitempty"` 911 // Entrypoint array. Not executed within a shell. 912 // The docker image's entrypoint is used if this is not provided. 913 // Variable references $(VAR_NAME) are expanded using the container's environment. If a variable 914 // cannot be resolved, the reference in the input string will be unchanged. The $(VAR_NAME) syntax 915 // can be escaped with a double $$, ie: $$(VAR_NAME). Escaped references will never be expanded, 916 // regardless of whether the variable exists or not. 917 // Cannot be updated. 918 // More info: http://releases.k8s.io/HEAD/docs/user-guide/containers.md#containers-and-commands 919 Command []string `json:"command,omitempty"` 920 // Arguments to the entrypoint. 921 // The docker image's cmd is used if this is not provided. 922 // Variable references $(VAR_NAME) are expanded using the container's environment. If a variable 923 // cannot be resolved, the reference in the input string will be unchanged. The $(VAR_NAME) syntax 924 // can be escaped with a double $$, ie: $$(VAR_NAME). Escaped references will never be expanded, 925 // regardless of whether the variable exists or not. 926 // Cannot be updated. 927 // More info: http://releases.k8s.io/HEAD/docs/user-guide/containers.md#containers-and-commands 928 Args []string `json:"args,omitempty"` 929 // Container's working directory. 930 // Defaults to Docker's default. D 931 // efaults to image's default. 932 // Cannot be updated. 933 WorkingDir string `json:"workingDir,omitempty"` 934 // List of ports to expose from the container. 935 // Cannot be updated. 936 Ports []ContainerPort `json:"ports,omitempty" patchStrategy:"merge" patchMergeKey:"containerPort"` 937 // List of environment variables to set in the container. 938 // Cannot be updated. 939 Env []EnvVar `json:"env,omitempty" patchStrategy:"merge" patchMergeKey:"name"` 940 // Compute Resources required by this container. 941 // Cannot be updated. 942 // More info: http://releases.k8s.io/HEAD/docs/user-guide/persistent-volumes.md#resources 943 Resources ResourceRequirements `json:"resources,omitempty"` 944 // Pod volumes to mount into the container's filesyste. 945 // Cannot be updated. 946 VolumeMounts []VolumeMount `json:"volumeMounts,omitempty" patchStrategy:"merge" patchMergeKey:"name"` 947 // Periodic probe of container liveness. 948 // Container will be restarted if the probe fails. 949 // Cannot be updated. 950 // More info: http://releases.k8s.io/HEAD/docs/user-guide/pod-states.md#container-probes 951 LivenessProbe *Probe `json:"livenessProbe,omitempty"` 952 // Periodic probe of container service readiness. 953 // Container will be removed from service endpoints if the probe fails. 954 // Cannot be updated. 955 // More info: http://releases.k8s.io/HEAD/docs/user-guide/pod-states.md#container-probes 956 ReadinessProbe *Probe `json:"readinessProbe,omitempty"` 957 // Actions that the management system should take in response to container lifecycle events. 958 // Cannot be updated. 959 Lifecycle *Lifecycle `json:"lifecycle,omitempty"` 960 // Optional: Path at which the file to which the container's termination message 961 // will be written is mounted into the container's filesystem. 962 // Message written is intended to be brief final status, such as an assertion failure message. 963 // Defaults to /dev/termination-log. 964 // Cannot be updated. 965 TerminationMessagePath string `json:"terminationMessagePath,omitempty"` 966 // Image pull policy. 967 // One of Always, Never, IfNotPresent. 968 // Defaults to Always if :latest tag is specified, or IfNotPresent otherwise. 969 // Cannot be updated. 970 // More info: http://releases.k8s.io/HEAD/docs/user-guide/images.md#updating-images 971 ImagePullPolicy PullPolicy `json:"imagePullPolicy,omitempty"` 972 // Security options the pod should run with. 973 // More info: http://releases.k8s.io/HEAD/docs/design/security_context.md 974 SecurityContext *SecurityContext `json:"securityContext,omitempty"` 975 976 // Variables for interactive containers, these have very specialized use-cases (e.g. debugging) 977 // and shouldn't be used for general purpose containers. 978 979 // Whether this container should allocate a buffer for stdin in the container runtime. 980 // Default is false. 981 Stdin bool `json:"stdin,omitempty"` 982 // Whether this container should allocate a TTY for itself, also requires 'stdin' to be true. 983 // Default is false. 984 TTY bool `json:"tty,omitempty"` 985 } 986 987 // Handler defines a specific action that should be taken 988 // TODO: pass structured data to these actions, and document that data here. 989 type Handler struct { 990 // One and only one of the following should be specified. 991 // Exec specifies the action to take. 992 Exec *ExecAction `json:"exec,omitempty"` 993 // HTTPGet specifies the http request to perform. 994 HTTPGet *HTTPGetAction `json:"httpGet,omitempty"` 995 // TCPSocket specifies an action involving a TCP port. 996 // TCP hooks not yet supported 997 // TODO: implement a realistic TCP lifecycle hook 998 TCPSocket *TCPSocketAction `json:"tcpSocket,omitempty"` 999 } 1000 1001 // Lifecycle describes actions that the management system should take in response to container lifecycle 1002 // events. For the PostStart and PreStop lifecycle handlers, management of the container blocks 1003 // until the action is complete, unless the container process fails, in which case the handler is aborted. 1004 type Lifecycle struct { 1005 // PostStart is called immediately after a container is created. If the handler fails, 1006 // the container is terminated and restarted according to its restart policy. 1007 // Other management of the container blocks until the hook completes. 1008 // More info: http://releases.k8s.io/HEAD/docs/user-guide/container-environment.md#hook-details 1009 PostStart *Handler `json:"postStart,omitempty"` 1010 // PreStop is called immediately before a container is terminated. 1011 // The container is terminated after the handler completes. 1012 // The reason for termination is passed to the handler. 1013 // Regardless of the outcome of the handler, the container is eventually terminated. 1014 // Other management of the container blocks until the hook completes. 1015 // More info: http://releases.k8s.io/HEAD/docs/user-guide/container-environment.md#hook-details 1016 PreStop *Handler `json:"preStop,omitempty"` 1017 } 1018 1019 type ConditionStatus string 1020 1021 // These are valid condition statuses. "ConditionTrue" means a resource is in the condition. 1022 // "ConditionFalse" means a resource is not in the condition. "ConditionUnknown" means kubernetes 1023 // can't decide if a resource is in the condition or not. In the future, we could add other 1024 // intermediate conditions, e.g. ConditionDegraded. 1025 const ( 1026 ConditionTrue ConditionStatus = "True" 1027 ConditionFalse ConditionStatus = "False" 1028 ConditionUnknown ConditionStatus = "Unknown" 1029 ) 1030 1031 // ContainerStateWaiting is a waiting state of a container. 1032 type ContainerStateWaiting struct { 1033 // (brief) reason the container is not yet running, such as pulling its image. 1034 Reason string `json:"reason,omitempty"` 1035 } 1036 1037 // ContainerStateRunning is a running state of a container. 1038 type ContainerStateRunning struct { 1039 // Time at which the container was last (re-)started 1040 StartedAt Time `json:"startedAt,omitempty"` 1041 } 1042 1043 // ContainerStateTerminated is a terminated state of a container. 1044 type ContainerStateTerminated struct { 1045 // Exit status from the last termination of the container 1046 ExitCode int `json:"exitCode"` 1047 // Signal from the last termination of the container 1048 Signal int `json:"signal,omitempty"` 1049 // (brief) reason from the last termination of the container 1050 Reason string `json:"reason,omitempty"` 1051 // Message regarding the last termination of the container 1052 Message string `json:"message,omitempty"` 1053 // Time at which previous execution of the container started 1054 StartedAt Time `json:"startedAt,omitempty"` 1055 // Time at which the container last terminated 1056 FinishedAt Time `json:"finishedAt,omitempty"` 1057 // Container's ID in the format 'docker://<container_id>' 1058 ContainerID string `json:"containerID,omitempty"` 1059 } 1060 1061 // ContainerState holds a possible state of container. 1062 // Only one of its members may be specified. 1063 // If none of them is specified, the default one is ContainerStateWaiting. 1064 type ContainerState struct { 1065 // Details about a waiting container 1066 Waiting *ContainerStateWaiting `json:"waiting,omitempty"` 1067 // Details about a running container 1068 Running *ContainerStateRunning `json:"running,omitempty"` 1069 // Details about a terminated container 1070 Terminated *ContainerStateTerminated `json:"terminated,omitempty"` 1071 } 1072 1073 // ContainerStatus contains details for the current status of this container. 1074 type ContainerStatus struct { 1075 // This must be a DNS_LABEL. Each container in a pod must have a unique name. 1076 // Cannot be updated. 1077 Name string `json:"name"` 1078 // Details about the container's current condition. 1079 State ContainerState `json:"state,omitempty"` 1080 // Details about the container's last termination condition. 1081 LastTerminationState ContainerState `json:"lastState,omitempty"` 1082 // Specifies whether the container has passed its readiness probe. 1083 Ready bool `json:"ready"` 1084 // The number of times the container has been restarted, currently based on 1085 // the number of dead containers that have not yet been removed. 1086 // Note that this is calculated from dead containers. But those containers are subject to 1087 // garbage collection. This value will get capped at 5 by GC. 1088 RestartCount int `json:"restartCount"` 1089 // The image the container is running. 1090 // More info: http://releases.k8s.io/HEAD/docs/user-guide/images.md 1091 // TODO(dchen1107): Which image the container is running with? 1092 Image string `json:"image"` 1093 // ImageID of the container's image. 1094 ImageID string `json:"imageID"` 1095 // Container's ID in the format 'docker://<container_id>'. 1096 // More info: http://releases.k8s.io/HEAD/docs/user-guide/container-environment.md#container-information 1097 ContainerID string `json:"containerID,omitempty"` 1098 } 1099 1100 // PodPhase is a label for the condition of a pod at the current time. 1101 type PodPhase string 1102 1103 // These are the valid statuses of pods. 1104 const ( 1105 // PodPending means the pod has been accepted by the system, but one or more of the containers 1106 // has not been started. This includes time before being bound to a node, as well as time spent 1107 // pulling images onto the host. 1108 PodPending PodPhase = "Pending" 1109 // PodRunning means the pod has been bound to a node and all of the containers have been started. 1110 // At least one container is still running or is in the process of being restarted. 1111 PodRunning PodPhase = "Running" 1112 // PodSucceeded means that all containers in the pod have voluntarily terminated 1113 // with a container exit code of 0, and the system is not going to restart any of these containers. 1114 PodSucceeded PodPhase = "Succeeded" 1115 // PodFailed means that all containers in the pod have terminated, and at least one container has 1116 // terminated in a failure (exited with a non-zero exit code or was stopped by the system). 1117 PodFailed PodPhase = "Failed" 1118 // PodUnknown means that for some reason the state of the pod could not be obtained, typically due 1119 // to an error in communicating with the host of the pod. 1120 PodUnknown PodPhase = "Unknown" 1121 ) 1122 1123 // PodConditionType is a valid value for PodCondition.Type 1124 type PodConditionType string 1125 1126 // These are valid conditions of pod. 1127 const ( 1128 // PodReady means the pod is able to service requests and should be added to the 1129 // load balancing pools of all matching services. 1130 PodReady PodConditionType = "Ready" 1131 ) 1132 1133 // PodCondition contains details for the current condition of this pod. 1134 // TODO: add LastTransitionTime, Reason, Message to match NodeCondition api. 1135 type PodCondition struct { 1136 // Type is the type of the condition. 1137 // Currently only Ready. 1138 // More info: http://releases.k8s.io/HEAD/docs/user-guide/pod-states.md#pod-conditions 1139 Type PodConditionType `json:"type"` 1140 // Status is the status of the condition. 1141 // Can be True, False, Unknown. 1142 // More info: http://releases.k8s.io/HEAD/docs/user-guide/pod-states.md#pod-conditions 1143 Status ConditionStatus `json:"status"` 1144 } 1145 1146 // RestartPolicy describes how the container should be restarted. 1147 // Only one of the following restart policies may be specified. 1148 // If none of the following policies is specified, the default one 1149 // is RestartPolicyAlways. 1150 type RestartPolicy string 1151 1152 const ( 1153 RestartPolicyAlways RestartPolicy = "Always" 1154 RestartPolicyOnFailure RestartPolicy = "OnFailure" 1155 RestartPolicyNever RestartPolicy = "Never" 1156 ) 1157 1158 // DNSPolicy defines how a pod's DNS will be configured. 1159 type DNSPolicy string 1160 1161 const ( 1162 // DNSClusterFirst indicates that the pod should use cluster DNS 1163 // first, if it is available, then fall back on the default (as 1164 // determined by kubelet) DNS settings. 1165 DNSClusterFirst DNSPolicy = "ClusterFirst" 1166 1167 // DNSDefault indicates that the pod should use the default (as 1168 // determined by kubelet) DNS settings. 1169 DNSDefault DNSPolicy = "Default" 1170 1171 DefaultTerminationGracePeriodSeconds = 30 1172 ) 1173 1174 // PodSpec is a description of a pod. 1175 type PodSpec struct { 1176 // List of volumes that can be mounted by containers belonging to the pod. 1177 // More info: http://releases.k8s.io/HEAD/docs/user-guide/volumes.md 1178 Volumes []Volume `json:"volumes,omitempty" patchStrategy:"merge" patchMergeKey:"name"` 1179 // List of containers belonging to the pod. 1180 // Containers cannot currently be added or removed. 1181 // There must be at least one container in a Pod. 1182 // Cannot be updated. 1183 // More info: http://releases.k8s.io/HEAD/docs/user-guide/containers.md 1184 Containers []Container `json:"containers" patchStrategy:"merge" patchMergeKey:"name"` 1185 // Restart policy for all containers within the pod. 1186 // One of Always, OnFailure, Never. 1187 // Default to Always. 1188 // More info: http://releases.k8s.io/HEAD/docs/user-guide/pod-states.md#restartpolicy 1189 RestartPolicy RestartPolicy `json:"restartPolicy,omitempty"` 1190 // Optional duration in seconds the pod needs to terminate gracefully. May be decreased in delete request. 1191 // Value must be non-negative integer. The value zero indicates delete immediately. 1192 // If this value is nil, the default grace period will be used instead. 1193 // The grace period is the duration in seconds after the processes running in the pod are sent 1194 // a termination signal and the time when the processes are forcibly halted with a kill signal. 1195 // Set this value longer than the expected cleanup time for your process. 1196 // Defaults to 30 seconds. 1197 TerminationGracePeriodSeconds *int64 `json:"terminationGracePeriodSeconds,omitempty"` 1198 // Optional duration in seconds the pod may be active on the node relative to 1199 // StartTime before the system will actively try to mark it failed and kill associated containers. 1200 // Value must be a positive integer. 1201 ActiveDeadlineSeconds *int64 `json:"activeDeadlineSeconds,omitempty"` 1202 // Set DNS policy for containers within the pod. 1203 // One of 'ClusterFirst' or 'Default'. 1204 // Defaults to "ClusterFirst". 1205 DNSPolicy DNSPolicy `json:"dnsPolicy,omitempty"` 1206 // NodeSelector is a selector which must be true for the pod to fit on a node. 1207 // Selector which must match a node's labels for the pod to be scheduled on that node. 1208 // More info: http://releases.k8s.io/HEAD/docs/user-guide/node-selection/README.md 1209 NodeSelector map[string]string `json:"nodeSelector,omitempty"` 1210 1211 // ServiceAccountName is the name of the ServiceAccount to use to run this pod. 1212 // More info: http://releases.k8s.io/HEAD/docs/design/service_accounts.md 1213 ServiceAccountName string `json:"serviceAccountName,omitempty"` 1214 // DeprecatedServiceAccount is a depreciated alias for ServiceAccountName. 1215 // Deprecated: Use serviceAccountName instead. 1216 DeprecatedServiceAccount string `json:"serviceAccount,omitempty"` 1217 1218 // NodeName is a request to schedule this pod onto a specific node. If it is non-empty, 1219 // the scheduler simply schedules this pod onto that node, assuming that it fits resource 1220 // requirements. 1221 NodeName string `json:"nodeName,omitempty"` 1222 // Host networking requested for this pod. Uses the host's network namespace. 1223 // If this option is set, the ports that will be used must be specified. 1224 // Default to false. 1225 HostNetwork bool `json:"hostNetwork,omitempty"` 1226 // 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. 1227 // If specified, these secrets will be passed to individual puller implementations for them to use. For example, 1228 // in the case of docker, only DockerConfig type secrets are honored. 1229 // More info: http://releases.k8s.io/HEAD/docs/user-guide/images.md#specifying-imagepullsecrets-on-a-pod 1230 ImagePullSecrets []LocalObjectReference `json:"imagePullSecrets,omitempty" patchStrategy:"merge" patchMergeKey:"name"` 1231 } 1232 1233 // PodStatus represents information about the status of a pod. Status may trail the actual 1234 // state of a system. 1235 type PodStatus struct { 1236 // Current condition of the pod. 1237 // More info: http://releases.k8s.io/HEAD/docs/user-guide/pod-states.md#pod-phase 1238 Phase PodPhase `json:"phase,omitempty"` 1239 // Current service state of pod. 1240 // More info: http://releases.k8s.io/HEAD/docs/user-guide/pod-states.md#pod-conditions 1241 Conditions []PodCondition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type"` 1242 // A human readable message indicating details about why the pod is in this condition. 1243 Message string `json:"message,omitempty"` 1244 // A brief CamelCase message indicating details about why the pod is in this state. 1245 // e.g. 'OutOfDisk' 1246 Reason string `json:"reason,omitempty"` 1247 1248 // IP address of the host to which the pod is assigned. Empty if not yet scheduled. 1249 HostIP string `json:"hostIP,omitempty"` 1250 // IP address allocated to the pod. Routable at least within the cluster. 1251 // Empty if not yet allocated. 1252 PodIP string `json:"podIP,omitempty"` 1253 1254 // RFC 3339 date and time at which the object was acknowledged by the Kubelet. 1255 // This is before the Kubelet pulled the container image(s) for the pod. 1256 StartTime *Time `json:"startTime,omitempty"` 1257 1258 // The list has one entry per container in the manifest. Each entry is currently the output 1259 // of `docker inspect`. 1260 // More info: http://releases.k8s.io/HEAD/docs/user-guide/pod-states.md#container-statuses 1261 ContainerStatuses []ContainerStatus `json:"containerStatuses,omitempty"` 1262 } 1263 1264 // PodStatusResult is a wrapper for PodStatus returned by kubelet that can be encode/decoded 1265 type PodStatusResult struct { 1266 TypeMeta `json:",inline"` 1267 // Standard object's metadata. 1268 // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata 1269 ObjectMeta `json:"metadata,omitempty"` 1270 // Most recently observed status of the pod. 1271 // This data may not be up to date. 1272 // Populated by the system. 1273 // Read-only. 1274 // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status 1275 Status PodStatus `json:"status,omitempty"` 1276 } 1277 1278 // Pod is a collection of containers that can run on a host. This resource is created 1279 // by clients and scheduled onto hosts. 1280 type Pod struct { 1281 TypeMeta `json:",inline"` 1282 // Standard object's metadata. 1283 // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata 1284 ObjectMeta `json:"metadata,omitempty"` 1285 1286 // Specification of the desired behavior of the pod. 1287 // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status 1288 Spec PodSpec `json:"spec,omitempty"` 1289 1290 // Most recently observed status of the pod. 1291 // This data may not be up to date. 1292 // Populated by the system. 1293 // Read-only. 1294 // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status 1295 Status PodStatus `json:"status,omitempty"` 1296 } 1297 1298 // PodList is a list of Pods. 1299 type PodList struct { 1300 TypeMeta `json:",inline"` 1301 // Standard list metadata. 1302 // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#types-kinds 1303 ListMeta `json:"metadata,omitempty"` 1304 1305 // List of pods. 1306 // More info: http://releases.k8s.io/HEAD/docs/user-guide/pods.md 1307 Items []Pod `json:"items"` 1308 } 1309 1310 // PodTemplateSpec describes the data a pod should have when created from a template 1311 type PodTemplateSpec struct { 1312 // Standard object's metadata. 1313 // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata 1314 ObjectMeta `json:"metadata,omitempty"` 1315 1316 // Specification of the desired behavior of the pod. 1317 // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status 1318 Spec PodSpec `json:"spec,omitempty"` 1319 } 1320 1321 // PodTemplate describes a template for creating copies of a predefined pod. 1322 type PodTemplate struct { 1323 TypeMeta `json:",inline"` 1324 // Standard object's metadata. 1325 // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata 1326 ObjectMeta `json:"metadata,omitempty"` 1327 1328 // Template defines the pods that will be created from this pod template. 1329 // http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status 1330 Template PodTemplateSpec `json:"template,omitempty"` 1331 } 1332 1333 // PodTemplateList is a list of PodTemplates. 1334 type PodTemplateList struct { 1335 TypeMeta `json:",inline"` 1336 // Standard list metadata. 1337 // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#types-kinds 1338 ListMeta `json:"metadata,omitempty"` 1339 1340 // List of pod templates 1341 Items []PodTemplate `json:"items"` 1342 } 1343 1344 // ReplicationControllerSpec is the specification of a replication controller. 1345 type ReplicationControllerSpec struct { 1346 // Replicas is the number of desired replicas. 1347 // This is a pointer to distinguish between explicit zero and unspecified. 1348 // Defaults to 1. 1349 // More info: http://releases.k8s.io/HEAD/docs/user-guide/replication-controller.md#what-is-a-replication-controller 1350 Replicas *int `json:"replicas,omitempty"` 1351 1352 // Selector is a label query over pods that should match the Replicas count. 1353 // If Selector is empty, it is defaulted to the labels present on the Pod template. 1354 // Label keys and values that must match in order to be controlled by this replication 1355 // controller, if empty defaulted to labels on Pod template. 1356 // More info: http://releases.k8s.io/HEAD/docs/user-guide/labels.md#label-selectors 1357 Selector map[string]string `json:"selector,omitempty"` 1358 1359 // TemplateRef is a reference to an object that describes the pod that will be created if 1360 // insufficient replicas are detected. 1361 // Reference to an object that describes the pod that will be created if insufficient replicas are detected. 1362 // TemplateRef *ObjectReference `json:"templateRef,omitempty"` 1363 1364 // Template is the object that describes the pod that will be created if 1365 // insufficient replicas are detected. This takes precedence over a TemplateRef. 1366 // More info: http://releases.k8s.io/HEAD/docs/user-guide/replication-controller.md#pod-template 1367 Template *PodTemplateSpec `json:"template,omitempty"` 1368 } 1369 1370 // ReplicationControllerStatus represents the current status of a replication 1371 // controller. 1372 type ReplicationControllerStatus struct { 1373 // Replicas is the most recently observed number of replicas. 1374 // More info: http://releases.k8s.io/HEAD/docs/user-guide/replication-controller.md#what-is-a-replication-controller 1375 Replicas int `json:"replicas"` 1376 1377 // ObservedGeneration reflects the generation of the most recently observed replication controller. 1378 ObservedGeneration int64 `json:"observedGeneration,omitempty"` 1379 } 1380 1381 // ReplicationController represents the configuration of a replication controller. 1382 type ReplicationController struct { 1383 TypeMeta `json:",inline"` 1384 1385 // If the Labels of a ReplicationController are empty, they are defaulted to 1386 // be the same as the Pod(s) that the replication controller manages. 1387 // Standard object's metadata. More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata 1388 ObjectMeta `json:"metadata,omitempty"` 1389 1390 // Spec defines the specification of the desired behavior of the replication controller. 1391 // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status 1392 Spec ReplicationControllerSpec `json:"spec,omitempty"` 1393 1394 // Status is the most recently observed status of the replication controller. 1395 // This data may be out of date by some window of time. 1396 // Populated by the system. 1397 // Read-only. 1398 // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status 1399 Status ReplicationControllerStatus `json:"status,omitempty"` 1400 } 1401 1402 // ReplicationControllerList is a collection of replication controllers. 1403 type ReplicationControllerList struct { 1404 TypeMeta `json:",inline"` 1405 // Standard list metadata. 1406 // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#types-kinds 1407 ListMeta `json:"metadata,omitempty"` 1408 1409 // List of replication controllers. 1410 // More info: http://releases.k8s.io/HEAD/docs/user-guide/replication-controller.md 1411 Items []ReplicationController `json:"items"` 1412 } 1413 1414 // Session Affinity Type string 1415 type ServiceAffinity string 1416 1417 const ( 1418 // ServiceAffinityClientIP is the Client IP based. 1419 ServiceAffinityClientIP ServiceAffinity = "ClientIP" 1420 1421 // ServiceAffinityNone - no session affinity. 1422 ServiceAffinityNone ServiceAffinity = "None" 1423 ) 1424 1425 // Service Type string describes ingress methods for a service 1426 type ServiceType string 1427 1428 const ( 1429 // ServiceTypeClusterIP means a service will only be accessible inside the 1430 // cluster, via the cluster IP. 1431 ServiceTypeClusterIP ServiceType = "ClusterIP" 1432 1433 // ServiceTypeNodePort means a service will be exposed on one port of 1434 // every node, in addition to 'ClusterIP' type. 1435 ServiceTypeNodePort ServiceType = "NodePort" 1436 1437 // ServiceTypeLoadBalancer means a service will be exposed via an 1438 // external load balancer (if the cloud provider supports it), in addition 1439 // to 'NodePort' type. 1440 ServiceTypeLoadBalancer ServiceType = "LoadBalancer" 1441 ) 1442 1443 // ServiceStatus represents the current status of a service. 1444 type ServiceStatus struct { 1445 // LoadBalancer contains the current status of the load-balancer, 1446 // if one is present. 1447 LoadBalancer LoadBalancerStatus `json:"loadBalancer,omitempty"` 1448 } 1449 1450 // LoadBalancerStatus represents the status of a load-balancer. 1451 type LoadBalancerStatus struct { 1452 // Ingress is a list containing ingress points for the load-balancer. 1453 // Traffic intended for the service should be sent to these ingress points. 1454 Ingress []LoadBalancerIngress `json:"ingress,omitempty"` 1455 } 1456 1457 // LoadBalancerIngress represents the status of a load-balancer ingress point: 1458 // traffic intended for the service should be sent to an ingress point. 1459 type LoadBalancerIngress struct { 1460 // IP is set for load-balancer ingress points that are IP based 1461 // (typically GCE or OpenStack load-balancers) 1462 IP string `json:"ip,omitempty"` 1463 1464 // Hostname is set for load-balancer ingress points that are DNS based 1465 // (typically AWS load-balancers) 1466 Hostname string `json:"hostname,omitempty"` 1467 } 1468 1469 // ServiceSpec describes the attributes that a user creates on a service. 1470 type ServiceSpec struct { 1471 // The list of ports that are exposed by this service. 1472 // More info: http://releases.k8s.io/HEAD/docs/user-guide/services.md#virtual-ips-and-service-proxies 1473 Ports []ServicePort `json:"ports"` 1474 1475 // This service will route traffic to pods having labels matching this selector. 1476 // Label keys and values that must match in order to receive traffic for this service. 1477 // If empty, all pods are selected, if not specified, endpoints must be manually specified. 1478 // More info: http://releases.k8s.io/HEAD/docs/user-guide/services.md#overview 1479 Selector map[string]string `json:"selector,omitempty"` 1480 1481 // ClusterIP is usually assigned by the master and is the IP address of the service. 1482 // If specified, it will be allocated to the service if it is unused 1483 // or else creation of the service will fail. 1484 // Valid values are None, empty string (""), or a valid IP address. 1485 // 'None' can be specified for a headless service when proxying is not required. 1486 // Cannot be updated. 1487 // More info: http://releases.k8s.io/HEAD/docs/user-guide/services.md#virtual-ips-and-service-proxies 1488 ClusterIP string `json:"clusterIP,omitempty"` 1489 1490 // Type of exposed service. Must be ClusterIP, NodePort, or LoadBalancer. 1491 // Defaults to ClusterIP. 1492 // More info: http://releases.k8s.io/HEAD/docs/user-guide/services.md#external-services 1493 Type ServiceType `json:"type,omitempty"` 1494 1495 // ExternalIPs are used by external load balancers, or can be set by 1496 // users to handle external traffic that arrives at a node. 1497 // Externally visible IPs (e.g. load balancers) that should be proxied to this service. 1498 ExternalIPs []string `json:"externalIPs,omitempty"` 1499 1500 // Supports "ClientIP" and "None". Used to maintain session affinity. 1501 // Enable client IP based session affinity. 1502 // Must be ClientIP or None. 1503 // Defaults to None. 1504 // More info: http://releases.k8s.io/HEAD/docs/user-guide/services.md#virtual-ips-and-service-proxies 1505 SessionAffinity ServiceAffinity `json:"sessionAffinity,omitempty"` 1506 } 1507 1508 // ServicePort contains information on service's port. 1509 type ServicePort struct { 1510 // The name of this port within the service. This must be a DNS_LABEL. 1511 // All ports within a ServiceSpec must have unique names. This maps to 1512 // the 'Name' field in EndpointPort objects. 1513 // Optional if only one ServicePort is defined on this service. 1514 Name string `json:"name,omitempty"` 1515 1516 // The IP protocol for this port. Supports "TCP" and "UDP". 1517 // Default is TCP. 1518 Protocol Protocol `json:"protocol,omitempty"` 1519 1520 // The port that will be exposed by this service. 1521 Port int `json:"port"` 1522 1523 // Number or name of the port to access on the pods targeted by the service. 1524 // Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. 1525 // If this is a string, it will be looked up as a named port in the 1526 // target Pod's container ports. If this is not specified, the value 1527 // of Port is used (an identity map). 1528 // Defaults to the service port. 1529 // More info: http://releases.k8s.io/HEAD/docs/user-guide/services.md#defining-a-service 1530 TargetPort IntOrString `json:"targetPort,omitempty"` 1531 1532 // The port on each node on which this service is exposed when type=NodePort or LoadBalancer. 1533 // Usually assigned by the system. If specified, it will be allocated to the service 1534 // if unused or else creation of the service will fail. 1535 // Default is to auto-allocate a port if the ServiceType of this Service requires one. 1536 // More info: http://releases.k8s.io/HEAD/docs/user-guide/services.md#type--nodeport 1537 NodePort int `json:"nodePort,omitempty"` 1538 } 1539 1540 // Service is a named abstraction of software service (for example, mysql) consisting of local port 1541 // (for example 3306) that the proxy listens on, and the selector that determines which pods 1542 // will answer requests sent through the proxy. 1543 type Service struct { 1544 TypeMeta `json:",inline"` 1545 // Standard object's metadata. 1546 // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata 1547 ObjectMeta `json:"metadata,omitempty"` 1548 1549 // Spec defines the behavior of a service. 1550 // http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status 1551 Spec ServiceSpec `json:"spec,omitempty"` 1552 1553 // Most recently observed status of the service. 1554 // Populated by the system. 1555 // Read-only. 1556 // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status 1557 Status ServiceStatus `json:"status,omitempty"` 1558 } 1559 1560 const ( 1561 // ClusterIPNone - do not assign a cluster IP 1562 // no proxying required and no environment variables should be created for pods 1563 ClusterIPNone = "None" 1564 ) 1565 1566 // ServiceList holds a list of services. 1567 type ServiceList struct { 1568 TypeMeta `json:",inline"` 1569 // Standard list metadata. 1570 // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#types-kinds 1571 ListMeta `json:"metadata,omitempty"` 1572 1573 // List of services 1574 Items []Service `json:"items"` 1575 } 1576 1577 // ServiceAccount binds together: 1578 // * a name, understood by users, and perhaps by peripheral systems, for an identity 1579 // * a principal that can be authenticated and authorized 1580 // * a set of secrets 1581 type ServiceAccount struct { 1582 TypeMeta `json:",inline"` 1583 // Standard object's metadata. 1584 // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata 1585 ObjectMeta `json:"metadata,omitempty"` 1586 1587 // Secrets is the list of secrets allowed to be used by pods running using this ServiceAccount. 1588 // More info: http://releases.k8s.io/HEAD/docs/user-guide/secrets.md 1589 Secrets []ObjectReference `json:"secrets,omitempty" patchStrategy:"merge" patchMergeKey:"name"` 1590 1591 // ImagePullSecrets is a list of references to secrets in the same namespace to use for pulling any images 1592 // in pods that reference this ServiceAccount. ImagePullSecrets are distinct from Secrets because Secrets 1593 // can be mounted in the pod, but ImagePullSecrets are only accessed by the kubelet. 1594 // More info: http://releases.k8s.io/HEAD/docs/user-guide/secrets.md#manually-specifying-an-imagepullsecret 1595 ImagePullSecrets []LocalObjectReference `json:"imagePullSecrets,omitempty"` 1596 } 1597 1598 // ServiceAccountList is a list of ServiceAccount objects 1599 type ServiceAccountList struct { 1600 TypeMeta `json:",inline"` 1601 // Standard list metadata. 1602 // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#types-kinds 1603 ListMeta `json:"metadata,omitempty"` 1604 1605 // List of ServiceAccounts. 1606 // More info: http://releases.k8s.io/HEAD/docs/design/service_accounts.md#service-accounts 1607 Items []ServiceAccount `json:"items"` 1608 } 1609 1610 // Endpoints is a collection of endpoints that implement the actual service. Example: 1611 // 1612 // Name: "mysvc", 1613 // Subsets: [ 1614 // { 1615 // Addresses: [{"ip": "10.10.1.1"}, {"ip": "10.10.2.2"}], 1616 // Ports: [{"name": "a", "port": 8675}, {"name": "b", "port": 309}] 1617 // }, 1618 // { 1619 // Addresses: [{"ip": "10.10.3.3"}], 1620 // Ports: [{"name": "a", "port": 93}, {"name": "b", "port": 76}] 1621 // }, 1622 // ] 1623 type Endpoints struct { 1624 TypeMeta `json:",inline"` 1625 // Standard object's metadata. 1626 // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata 1627 ObjectMeta `json:"metadata,omitempty"` 1628 1629 // The set of all endpoints is the union of all subsets. 1630 // Sets of addresses and ports that comprise a service. 1631 Subsets []EndpointSubset `json:"subsets"` 1632 } 1633 1634 // EndpointSubset is a group of addresses with a common set of ports. The 1635 // expanded set of endpoints is the Cartesian product of Addresses x Ports. 1636 // For example, given: 1637 // 1638 // { 1639 // Addresses: [{"ip": "10.10.1.1"}, {"ip": "10.10.2.2"}], 1640 // Ports: [{"name": "a", "port": 8675}, {"name": "b", "port": 309}] 1641 // } 1642 // 1643 // The resulting set of endpoints can be viewed as: 1644 // 1645 // a: [ 10.10.1.1:8675, 10.10.2.2:8675 ], 1646 // b: [ 10.10.1.1:309, 10.10.2.2:309 ] 1647 type EndpointSubset struct { 1648 // IP addresses which offer the related ports. 1649 Addresses []EndpointAddress `json:"addresses,omitempty"` 1650 // Port numbers available on the related IP addresses. 1651 Ports []EndpointPort `json:"ports,omitempty"` 1652 } 1653 1654 // EndpointAddress is a tuple that describes single IP address. 1655 type EndpointAddress struct { 1656 // The IP of this endpoint. 1657 // May not be loopback (127.0.0.0/8), link-local (169.254.0.0/16), 1658 // or link-local multicast ((224.0.0.0/24). 1659 // TODO: This should allow hostname or IP, See #4447. 1660 IP string `json:"ip"` 1661 1662 // Reference to object providing the endpoint. 1663 TargetRef *ObjectReference `json:"targetRef,omitempty"` 1664 } 1665 1666 // EndpointPort is a tuple that describes a single port. 1667 type EndpointPort struct { 1668 // The name of this port (corresponds to ServicePort.Name). 1669 // Must be a DNS_LABEL. 1670 // Optional only if one port is defined. 1671 Name string `json:"name,omitempty"` 1672 1673 // The port number of the endpoint. 1674 Port int `json:"port"` 1675 1676 // The IP protocol for this port. 1677 // Must be UDP or TCP. 1678 // Default is TCP. 1679 Protocol Protocol `json:"protocol,omitempty"` 1680 } 1681 1682 // EndpointsList is a list of endpoints. 1683 type EndpointsList struct { 1684 TypeMeta `json:",inline"` 1685 // Standard list metadata. 1686 // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#types-kinds 1687 ListMeta `json:"metadata,omitempty"` 1688 1689 // List of endpoints. 1690 Items []Endpoints `json:"items"` 1691 } 1692 1693 // NodeSpec describes the attributes that a node is created with. 1694 type NodeSpec struct { 1695 // PodCIDR represents the pod IP range assigned to the node. 1696 PodCIDR string `json:"podCIDR,omitempty"` 1697 // External ID of the node assigned by some machine database (e.g. a cloud provider). 1698 // Deprecated. 1699 ExternalID string `json:"externalID,omitempty"` 1700 // ID of the node assigned by the cloud provider in the format: <ProviderName>://<ProviderSpecificNodeID> 1701 ProviderID string `json:"providerID,omitempty"` 1702 // Unschedulable controls node schedulability of new pods. By default, node is schedulable. 1703 // More info: http://releases.k8s.io/HEAD/docs/admin/node.md#manual-node-administration"` 1704 Unschedulable bool `json:"unschedulable,omitempty"` 1705 } 1706 1707 // NodeSystemInfo is a set of ids/uuids to uniquely identify the node. 1708 type NodeSystemInfo struct { 1709 // MachineID is the machine-id reported by the node. 1710 MachineID string `json:"machineID"` 1711 // SystemUUID is the system-uuid reported by the node. 1712 SystemUUID string `json:"systemUUID"` 1713 // BootID is the boot-id reported by the node. 1714 BootID string `json:"bootID"` 1715 // Kernel version reported by the node from 'uname -r' (e.g. 3.16.0-0.bpo.4-amd64) 1716 KernelVersion string `json:"kernelVersion"` 1717 // OS image used reported by the node from /etc/os-release (e.g. Debian GNU/Linux 7 (wheezy)) 1718 OsImage string `json:"osImage"` 1719 // Container runtime version reported by the node through runtime remote API (e.g. docker://1.5.0) 1720 ContainerRuntimeVersion string `json:"containerRuntimeVersion"` 1721 // Kubelet version reported by the node. 1722 KubeletVersion string `json:"kubeletVersion"` 1723 // Kube-proxy version reported by the node. 1724 KubeProxyVersion string `json:"kubeProxyVersion"` 1725 } 1726 1727 // NodeStatus is information about the current status of a node. 1728 type NodeStatus struct { 1729 // Capacity represents the available resources of a node. 1730 // More info: http://releases.k8s.io/HEAD/docs/user-guide/persistent-volumes.md#capacity for more details. 1731 Capacity ResourceList `json:"capacity,omitempty"` 1732 // NodePhase is the recently observed lifecycle phase of the node. 1733 // More info: http://releases.k8s.io/HEAD/docs/admin/node.md#node-phase 1734 Phase NodePhase `json:"phase,omitempty"` 1735 // Conditions is an array of current observed node conditions. 1736 // More info: http://releases.k8s.io/HEAD/docs/admin/node.md#node-condition 1737 Conditions []NodeCondition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type"` 1738 // List of addresses reachable to the node. 1739 // Queried from cloud provider, if available. 1740 // More info: http://releases.k8s.io/HEAD/docs/admin/node.md#node-addresses 1741 Addresses []NodeAddress `json:"addresses,omitempty" patchStrategy:"merge" patchMergeKey:"type"` 1742 // NodeSystemInfo is a set of ids/uuids to uniquely identify the node. 1743 // More info: http://releases.k8s.io/HEAD/docs/admin/node.md#node-info 1744 NodeInfo NodeSystemInfo `json:"nodeInfo,omitempty"` 1745 } 1746 1747 type NodePhase string 1748 1749 // These are the valid phases of node. 1750 const ( 1751 // NodePending means the node has been created/added by the system, but not configured. 1752 NodePending NodePhase = "Pending" 1753 // NodeRunning means the node has been configured and has Kubernetes components running. 1754 NodeRunning NodePhase = "Running" 1755 // NodeTerminated means the node has been removed from the cluster. 1756 NodeTerminated NodePhase = "Terminated" 1757 ) 1758 1759 type NodeConditionType string 1760 1761 // These are valid conditions of node. Currently, we don't have enough information to decide 1762 // node condition. In the future, we will add more. The proposed set of conditions are: 1763 // NodeReachable, NodeLive, NodeReady, NodeSchedulable, NodeRunnable. 1764 const ( 1765 // NodeReady means kubelet is healthy and ready to accept pods. 1766 NodeReady NodeConditionType = "Ready" 1767 ) 1768 1769 // NodeCondition contains condition information for a node. 1770 type NodeCondition struct { 1771 // Type of node condition, currently only Ready. 1772 Type NodeConditionType `json:"type"` 1773 // Status of the condition, one of True, False, Unknown. 1774 Status ConditionStatus `json:"status"` 1775 // Last time we got an update on a given condition. 1776 LastHeartbeatTime Time `json:"lastHeartbeatTime,omitempty"` 1777 // Last time the condition transit from one status to another. 1778 LastTransitionTime Time `json:"lastTransitionTime,omitempty"` 1779 // (brief) reason for the condition's last transition. 1780 Reason string `json:"reason,omitempty"` 1781 // Human readable message indicating details about last transition. 1782 Message string `json:"message,omitempty"` 1783 } 1784 1785 type NodeAddressType string 1786 1787 // These are valid address type of node. 1788 const ( 1789 NodeHostName NodeAddressType = "Hostname" 1790 NodeExternalIP NodeAddressType = "ExternalIP" 1791 NodeInternalIP NodeAddressType = "InternalIP" 1792 ) 1793 1794 // NodeAddress contains information for the node's address. 1795 type NodeAddress struct { 1796 // Node address type, one of Hostname, ExternalIP or InternalIP. 1797 Type NodeAddressType `json:"type"` 1798 // The node address. 1799 Address string `json:"address"` 1800 } 1801 1802 // ResourceName is the name identifying various resources in a ResourceList. 1803 type ResourceName string 1804 1805 const ( 1806 // CPU, in cores. (500m = .5 cores) 1807 ResourceCPU ResourceName = "cpu" 1808 // Memory, in bytes. (500Gi = 500GiB = 500 * 1024 * 1024 * 1024) 1809 ResourceMemory ResourceName = "memory" 1810 // Volume size, in bytes (e,g. 5Gi = 5GiB = 5 * 1024 * 1024 * 1024) 1811 ResourceStorage ResourceName = "storage" 1812 ) 1813 1814 // ResourceList is a set of (resource name, quantity) pairs. 1815 type ResourceList map[ResourceName]Quantity 1816 1817 // Node is a worker node in Kubernetes, formerly known as minion. 1818 // Each node will have a unique identifier in the cache (i.e. in etcd). 1819 type Node struct { 1820 TypeMeta `json:",inline"` 1821 // Standard object's metadata. 1822 // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata 1823 ObjectMeta `json:"metadata,omitempty"` 1824 1825 // Spec defines the behavior of a node. 1826 // http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status 1827 Spec NodeSpec `json:"spec,omitempty"` 1828 1829 // Most recently observed status of the node. 1830 // Populated by the system. 1831 // Read-only. 1832 // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status 1833 Status NodeStatus `json:"status,omitempty"` 1834 } 1835 1836 // NodeList is the whole list of all Nodes which have been registered with master. 1837 type NodeList struct { 1838 TypeMeta `json:",inline"` 1839 // Standard list metadata. 1840 // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#types-kinds 1841 ListMeta `json:"metadata,omitempty"` 1842 1843 // List of nodes 1844 Items []Node `json:"items"` 1845 } 1846 1847 type FinalizerName string 1848 1849 // These are internal finalizer values to Kubernetes, must be qualified name unless defined here 1850 const ( 1851 FinalizerKubernetes FinalizerName = "kubernetes" 1852 ) 1853 1854 // NamespaceSpec describes the attributes on a Namespace. 1855 type NamespaceSpec struct { 1856 // Finalizers is an opaque list of values that must be empty to permanently remove object from storage. 1857 // More info: http://releases.k8s.io/HEAD/docs/design/namespaces.md#finalizers 1858 Finalizers []FinalizerName `json:"finalizers,omitempty"` 1859 } 1860 1861 // NamespaceStatus is information about the current status of a Namespace. 1862 type NamespaceStatus struct { 1863 // Phase is the current lifecycle phase of the namespace. 1864 // More info: http://releases.k8s.io/HEAD/docs/design/namespaces.md#phases 1865 Phase NamespacePhase `json:"phase,omitempty"` 1866 } 1867 1868 type NamespacePhase string 1869 1870 // These are the valid phases of a namespace. 1871 const ( 1872 // NamespaceActive means the namespace is available for use in the system 1873 NamespaceActive NamespacePhase = "Active" 1874 // NamespaceTerminating means the namespace is undergoing graceful termination 1875 NamespaceTerminating NamespacePhase = "Terminating" 1876 ) 1877 1878 // Namespace provides a scope for Names. 1879 // Use of multiple namespaces is optional. 1880 type Namespace struct { 1881 TypeMeta `json:",inline"` 1882 // Standard object's metadata. 1883 // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata 1884 ObjectMeta `json:"metadata,omitempty"` 1885 1886 // Spec defines the behavior of the Namespace. 1887 // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status 1888 Spec NamespaceSpec `json:"spec,omitempty"` 1889 1890 // Status describes the current status of a Namespace. 1891 // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status 1892 Status NamespaceStatus `json:"status,omitempty"` 1893 } 1894 1895 // NamespaceList is a list of Namespaces. 1896 type NamespaceList struct { 1897 TypeMeta `json:",inline"` 1898 // Standard list metadata. 1899 // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#types-kinds 1900 ListMeta `json:"metadata,omitempty"` 1901 1902 // Items is the list of Namespace objects in the list. 1903 // More info: http://releases.k8s.io/HEAD/docs/user-guide/namespaces.md 1904 Items []Namespace `json:"items"` 1905 } 1906 1907 // Binding ties one object to another. 1908 // For example, a pod is bound to a node by a scheduler. 1909 type Binding struct { 1910 TypeMeta `json:",inline"` 1911 // Standard object's metadata. 1912 // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata 1913 ObjectMeta `json:"metadata,omitempty"` 1914 1915 // The target object that you want to bind to the standard object. 1916 Target ObjectReference `json:"target"` 1917 } 1918 1919 // DeleteOptions may be provided when deleting an API object 1920 type DeleteOptions struct { 1921 TypeMeta `json:",inline"` 1922 1923 // The duration in seconds before the object should be deleted. Value must be non-negative integer. 1924 // The value zero indicates delete immediately. If this value is nil, the default grace period for the 1925 // specified type will be used. 1926 // Defaults to a per object value if not specified. zero means delete immediately. 1927 GracePeriodSeconds *int64 `json:"gracePeriodSeconds"` 1928 } 1929 1930 // ListOptions is the query options to a standard REST list call. 1931 type ListOptions struct { 1932 TypeMeta `json:",inline"` 1933 1934 // A selector to restrict the list of returned objects by their labels. 1935 // Defaults to everything. 1936 LabelSelector string `json:"labelSelector,omitempty"` 1937 // A selector to restrict the list of returned objects by their fields. 1938 // Defaults to everything. 1939 FieldSelector string `json:"fieldSelector,omitempty"` 1940 // Watch for changes to the described resources and return them as a stream of 1941 // add, update, and remove notifications. Specify resourceVersion. 1942 Watch bool `json:"watch,omitempty"` 1943 // When specified with a watch call, shows changes that occur after that particular version of a resource. 1944 // Defaults to changes from the beginning of history. 1945 ResourceVersion string `json:"resourceVersion,omitempty"` 1946 } 1947 1948 // PodLogOptions is the query options for a Pod's logs REST call. 1949 type PodLogOptions struct { 1950 TypeMeta `json:",inline"` 1951 1952 // The container for which to stream logs. Defaults to only container if there is one container in the pod. 1953 Container string `json:"container,omitempty"` 1954 1955 // Follow the log stream of the pod. 1956 // Defaults to false. 1957 Follow bool `json:"follow,omitempty"` 1958 1959 // Return previous terminated container logs. 1960 // Defaults to false. 1961 Previous bool `json:"previous,omitempty"` 1962 } 1963 1964 // PodAttachOptions is the query options to a Pod's remote attach call. 1965 // --- 1966 // TODO: merge w/ PodExecOptions below for stdin, stdout, etc 1967 // and also when we cut V2, we should export a "StreamOptions" or somesuch that contains Stdin, Stdout, Stder and TTY 1968 type PodAttachOptions struct { 1969 TypeMeta `json:",inline"` 1970 1971 // Stdin if true, redirects the standard input stream of the pod for this call. 1972 // Defaults to false. 1973 Stdin bool `json:"stdin,omitempty"` 1974 1975 // Stdout if true indicates that stdout is to be redirected for the attach call. 1976 // Defaults to true. 1977 Stdout bool `json:"stdout,omitempty"` 1978 1979 // Stderr if true indicates that stderr is to be redirected for the attach call. 1980 // Defaults to true. 1981 Stderr bool `json:"stderr,omitempty"` 1982 1983 // TTY if true indicates that a tty will be allocated for the attach call. 1984 // This is passed through the container runtime so the tty 1985 // is allocated on the worker node by the container runtime. 1986 // Defaults to false. 1987 TTY bool `json:"tty,omitempty"` 1988 1989 // The container in which to execute the command. 1990 // Defaults to only container if there is only one container in the pod. 1991 Container string `json:"container,omitempty"` 1992 } 1993 1994 // PodExecOptions is the query options to a Pod's remote exec call. 1995 // --- 1996 // TODO: This is largely identical to PodAttachOptions above, make sure they stay in sync and see about merging 1997 // and also when we cut V2, we should export a "StreamOptions" or somesuch that contains Stdin, Stdout, Stder and TTY 1998 type PodExecOptions struct { 1999 TypeMeta `json:",inline"` 2000 2001 // Redirect the standard input stream of the pod for this call. 2002 // Defaults to false. 2003 Stdin bool `json:"stdin,omitempty"` 2004 2005 // Redirect the standard output stream of the pod for this call. 2006 // Defaults to true. 2007 Stdout bool `json:"stdout,omitempty"` 2008 2009 // Redirect the standard error stream of the pod for this call. 2010 // Defaults to true. 2011 Stderr bool `json:"stderr,omitempty"` 2012 2013 // TTY if true indicates that a tty will be allocated for the exec call. 2014 // Defaults to false. 2015 TTY bool `json:"tty,omitempty"` 2016 2017 // Container in which to execute the command. 2018 // Defaults to only container if there is only one container in the pod. 2019 Container string `json:"container,omitempty"` 2020 2021 // Command is the remote command to execute. argv array. Not executed within a shell. 2022 Command []string `json:"command"` 2023 } 2024 2025 // PodProxyOptions is the query options to a Pod's proxy call. 2026 type PodProxyOptions struct { 2027 TypeMeta `json:",inline"` 2028 2029 // Path is the URL path to use for the current proxy request to pod. 2030 Path string `json:"path,omitempty"` 2031 } 2032 2033 // Status is a return value for calls that don't return other objects. 2034 type Status struct { 2035 TypeMeta `json:",inline"` 2036 // Standard list metadata. 2037 // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#types-kinds 2038 ListMeta `json:"metadata,omitempty"` 2039 2040 // Status of the operation. 2041 // One of: "Success" or "Failure". 2042 // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status 2043 Status string `json:"status,omitempty"` 2044 // A human-readable description of the status of this operation. 2045 Message string `json:"message,omitempty"` 2046 // A machine-readable description of why this operation is in the 2047 // "Failure" status. If this value is empty there 2048 // is no information available. A Reason clarifies an HTTP status 2049 // code but does not override it. 2050 Reason StatusReason `json:"reason,omitempty"` 2051 // Extended data associated with the reason. Each reason may define its 2052 // own extended details. This field is optional and the data returned 2053 // is not guaranteed to conform to any schema except that defined by 2054 // the reason type. 2055 Details *StatusDetails `json:"details,omitempty"` 2056 // Suggested HTTP return code for this status, 0 if not set. 2057 Code int `json:"code,omitempty"` 2058 } 2059 2060 // StatusDetails is a set of additional properties that MAY be set by the 2061 // server to provide additional information about a response. The Reason 2062 // field of a Status object defines what attributes will be set. Clients 2063 // must ignore fields that do not match the defined type of each attribute, 2064 // and should assume that any attribute may be empty, invalid, or under 2065 // defined. 2066 type StatusDetails struct { 2067 // The name attribute of the resource associated with the status StatusReason 2068 // (when there is a single name which can be described). 2069 Name string `json:"name,omitempty"` 2070 // The kind attribute of the resource associated with the status StatusReason. 2071 // On some operations may differ from the requested resource Kind. 2072 // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#types-kinds 2073 Kind string `json:"kind,omitempty"` 2074 // The Causes array includes more details associated with the StatusReason 2075 // failure. Not all StatusReasons may provide detailed causes. 2076 Causes []StatusCause `json:"causes,omitempty"` 2077 // If specified, the time in seconds before the operation should be retried. 2078 RetryAfterSeconds int `json:"retryAfterSeconds,omitempty"` 2079 } 2080 2081 // Values of Status.Status 2082 const ( 2083 StatusSuccess = "Success" 2084 StatusFailure = "Failure" 2085 ) 2086 2087 // StatusReason is an enumeration of possible failure causes. Each StatusReason 2088 // must map to a single HTTP status code, but multiple reasons may map 2089 // to the same HTTP status code. 2090 // TODO: move to apiserver 2091 type StatusReason string 2092 2093 const ( 2094 // StatusReasonUnknown means the server has declined to indicate a specific reason. 2095 // The details field may contain other information about this error. 2096 // Status code 500. 2097 StatusReasonUnknown StatusReason = "" 2098 2099 // StatusReasonNotFound means one or more resources required for this operation 2100 // could not be found. 2101 // Details (optional): 2102 // "kind" string - the kind attribute of the missing resource 2103 // on some operations may differ from the requested 2104 // resource. 2105 // "id" string - the identifier of the missing resource 2106 // Status code 404 2107 StatusReasonNotFound StatusReason = "NotFound" 2108 2109 // StatusReasonAlreadyExists means the resource you are creating already exists. 2110 // Details (optional): 2111 // "kind" string - the kind attribute of the conflicting resource 2112 // "id" string - the identifier of the conflicting resource 2113 // Status code 409 2114 StatusReasonAlreadyExists StatusReason = "AlreadyExists" 2115 2116 // StatusReasonConflict means the requested update operation cannot be completed 2117 // due to a conflict in the operation. The client may need to alter the request. 2118 // Each resource may define custom details that indicate the nature of the 2119 // conflict. 2120 // Status code 409 2121 StatusReasonConflict StatusReason = "Conflict" 2122 2123 // StatusReasonInvalid means the requested create or update operation cannot be 2124 // completed due to invalid data provided as part of the request. The client may 2125 // need to alter the request. When set, the client may use the StatusDetails 2126 // message field as a summary of the issues encountered. 2127 // Details (optional): 2128 // "kind" string - the kind attribute of the invalid resource 2129 // "id" string - the identifier of the invalid resource 2130 // "causes" - one or more StatusCause entries indicating the data in the 2131 // provided resource that was invalid. The code, message, and 2132 // field attributes will be set. 2133 // Status code 422 2134 StatusReasonInvalid StatusReason = "Invalid" 2135 2136 // StatusReasonServerTimeout means the server can be reached and understood the request, 2137 // but cannot complete the action in a reasonable time. The client should retry the request. 2138 // This is may be due to temporary server load or a transient communication issue with 2139 // another server. Status code 500 is used because the HTTP spec provides no suitable 2140 // server-requested client retry and the 5xx class represents actionable errors. 2141 // Details (optional): 2142 // "kind" string - the kind attribute of the resource being acted on. 2143 // "id" string - the operation that is being attempted. 2144 // Status code 500 2145 StatusReasonServerTimeout StatusReason = "ServerTimeout" 2146 ) 2147 2148 // StatusCause provides more information about an api.Status failure, including 2149 // cases when multiple errors are encountered. 2150 type StatusCause struct { 2151 // A machine-readable description of the cause of the error. If this value is 2152 // empty there is no information available. 2153 Type CauseType `json:"reason,omitempty"` 2154 // A human-readable description of the cause of the error. This field may be 2155 // presented as-is to a reader. 2156 Message string `json:"message,omitempty"` 2157 // The field of the resource that has caused this error, as named by its JSON 2158 // serialization. May include dot and postfix notation for nested attributes. 2159 // Arrays are zero-indexed. Fields may appear more than once in an array of 2160 // causes due to fields having multiple errors. 2161 // 2162 // Examples: 2163 // "name" - the field "name" on the current resource 2164 // "items[0].name" - the field "name" on the first array entry in "items" 2165 Field string `json:"field,omitempty"` 2166 } 2167 2168 // CauseType is a machine readable value providing more detail about what 2169 // occurred in a status response. An operation may have multiple causes for a 2170 // status (whether Failure or Success). 2171 type CauseType string 2172 2173 const ( 2174 // CauseTypeFieldValueNotFound is used to report failure to find a requested value 2175 // (e.g. looking up an ID). 2176 CauseTypeFieldValueNotFound CauseType = "FieldValueNotFound" 2177 // CauseTypeFieldValueRequired is used to report required values that are not 2178 // provided (e.g. empty strings, null values, or empty arrays). 2179 CauseTypeFieldValueRequired CauseType = "FieldValueRequired" 2180 // CauseTypeFieldValueDuplicate is used to report collisions of values that must be 2181 // unique (e.g. unique IDs). 2182 CauseTypeFieldValueDuplicate CauseType = "FieldValueDuplicate" 2183 // CauseTypeFieldValueInvalid is used to report malformed values (e.g. failed regex 2184 // match). 2185 CauseTypeFieldValueInvalid CauseType = "FieldValueInvalid" 2186 // CauseTypeFieldValueNotSupported is used to report valid (as per formatting rules) 2187 // values that can not be handled (e.g. an enumerated string). 2188 CauseTypeFieldValueNotSupported CauseType = "FieldValueNotSupported" 2189 ) 2190 2191 // ObjectReference contains enough information to let you inspect or modify the referred object. 2192 type ObjectReference struct { 2193 // Kind of the referent. 2194 // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#types-kinds 2195 Kind string `json:"kind,omitempty"` 2196 // Namespace of the referent. 2197 // More info: http://releases.k8s.io/HEAD/docs/user-guide/namespaces.md 2198 Namespace string `json:"namespace,omitempty"` 2199 // Name of the referent. 2200 // More info: http://releases.k8s.io/HEAD/docs/user-guide/identifiers.md#names 2201 Name string `json:"name,omitempty"` 2202 // UID of the referent. 2203 // More info: http://releases.k8s.io/HEAD/docs/user-guide/identifiers.md#uids 2204 UID UID `json:"uid,omitempty"` 2205 // API version of the referent. 2206 APIVersion string `json:"apiVersion,omitempty"` 2207 // Specific resourceVersion to which this reference is made, if any. 2208 // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#concurrency-control-and-consistency 2209 ResourceVersion string `json:"resourceVersion,omitempty"` 2210 2211 // If referring to a piece of an object instead of an entire object, this string 2212 // should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. 2213 // For example, if the object reference is to a container within a pod, this would take on a value like: 2214 // "spec.containers{name}" (where "name" refers to the name of the container that triggered 2215 // the event) or if no container name is specified "spec.containers[2]" (container with 2216 // index 2 in this pod). This syntax is chosen only to have some well-defined way of 2217 // referencing a part of an object. 2218 // TODO: this design is not final and this field is subject to change in the future. 2219 FieldPath string `json:"fieldPath,omitempty"` 2220 } 2221 2222 // LocalObjectReference contains enough information to let you locate the 2223 // referenced object inside the same namespace. 2224 type LocalObjectReference struct { 2225 // Name of the referent. 2226 // More info: http://releases.k8s.io/HEAD/docs/user-guide/identifiers.md#names 2227 // TODO: Add other useful fields. apiVersion, kind, uid? 2228 Name string `json:"name,omitempty"` 2229 } 2230 2231 // SerializedReference is a reference to serialized object. 2232 type SerializedReference struct { 2233 TypeMeta `json:",inline"` 2234 // The reference to an object in the system. 2235 Reference ObjectReference `json:"reference,omitempty"` 2236 } 2237 2238 // EventSource contains information for an event. 2239 type EventSource struct { 2240 // Component from which the event is generated. 2241 Component string `json:"component,omitempty"` 2242 // Host name on which the event is generated. 2243 Host string `json:"host,omitempty"` 2244 } 2245 2246 // Event is a report of an event somewhere in the cluster. 2247 // TODO: Decide whether to store these separately or with the object they apply to. 2248 type Event struct { 2249 TypeMeta `json:",inline"` 2250 // Standard object's metadata. 2251 // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata 2252 ObjectMeta `json:"metadata"` 2253 2254 // The object that this event is about. 2255 InvolvedObject ObjectReference `json:"involvedObject"` 2256 2257 // This should be a short, machine understandable string that gives the reason 2258 // for the transition into the object's current status. 2259 // TODO: provide exact specification for format. 2260 Reason string `json:"reason,omitempty"` 2261 2262 // A human-readable description of the status of this operation. 2263 // TODO: decide on maximum length. 2264 Message string `json:"message,omitempty"` 2265 2266 // The component reporting this event. Should be a short machine understandable string. 2267 Source EventSource `json:"source,omitempty"` 2268 2269 // The time at which the event was first recorded. (Time of server receipt is in TypeMeta.) 2270 FirstTimestamp Time `json:"firstTimestamp,omitempty"` 2271 2272 // The time at which the most recent occurrence of this event was recorded. 2273 LastTimestamp Time `json:"lastTimestamp,omitempty"` 2274 2275 // The number of times this event has occurred. 2276 Count int `json:"count,omitempty"` 2277 } 2278 2279 // EventList is a list of events. 2280 type EventList struct { 2281 TypeMeta `json:",inline"` 2282 // Standard list metadata. 2283 // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#types-kinds 2284 ListMeta `json:"metadata,omitempty"` 2285 2286 // List of events 2287 Items []Event `json:"items"` 2288 } 2289 2290 // List holds a list of objects, which may not be known by the server. 2291 type List struct { 2292 TypeMeta `json:",inline"` 2293 // Standard list metadata. 2294 // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#types-kinds 2295 ListMeta `json:"metadata,omitempty"` 2296 2297 // List of objects 2298 // TODO: Undelete if needed: Items []runtime.RawExtension `json:"items"` 2299 } 2300 2301 // LimitType is a type of object that is limited 2302 type LimitType string 2303 2304 const ( 2305 // Limit that applies to all pods in a namespace 2306 LimitTypePod LimitType = "Pod" 2307 // Limit that applies to all containers in a namespace 2308 LimitTypeContainer LimitType = "Container" 2309 ) 2310 2311 // LimitRangeItem defines a min/max usage limit for any resource that matches on kind. 2312 type LimitRangeItem struct { 2313 // Type of resource that this limit applies to. 2314 Type LimitType `json:"type,omitempty"` 2315 // Max usage constraints on this kind by resource name. 2316 Max ResourceList `json:"max,omitempty"` 2317 // Min usage constraints on this kind by resource name. 2318 Min ResourceList `json:"min,omitempty"` 2319 // Default resource requirement limit value by resource name if resource limit is omitted. 2320 Default ResourceList `json:"default,omitempty"` 2321 // DefaultRequest is the default resource requirement request value by resource name if resource request is omitted. 2322 DefaultRequest ResourceList `json:"defaultRequest,omitempty"` 2323 // 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. 2324 MaxLimitRequestRatio ResourceList `json:"maxLimitRequestRatio,omitempty"` 2325 } 2326 2327 // LimitRangeSpec defines a min/max usage limit for resources that match on kind. 2328 type LimitRangeSpec struct { 2329 // Limits is the list of LimitRangeItem objects that are enforced. 2330 Limits []LimitRangeItem `json:"limits"` 2331 } 2332 2333 // LimitRange sets resource usage limits for each kind of resource in a Namespace. 2334 type LimitRange struct { 2335 TypeMeta `json:",inline"` 2336 // Standard object's metadata. 2337 // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata 2338 ObjectMeta `json:"metadata,omitempty"` 2339 2340 // Spec defines the limits enforced. 2341 // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status 2342 Spec LimitRangeSpec `json:"spec,omitempty"` 2343 } 2344 2345 // LimitRangeList is a list of LimitRange items. 2346 type LimitRangeList struct { 2347 TypeMeta `json:",inline"` 2348 // Standard list metadata. 2349 // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#types-kinds 2350 ListMeta `json:"metadata,omitempty"` 2351 2352 // Items is a list of LimitRange objects. 2353 // More info: http://releases.k8s.io/HEAD/docs/design/admission_control_limit_range.md 2354 Items []LimitRange `json:"items"` 2355 } 2356 2357 // The following identify resource constants for Kubernetes object types 2358 const ( 2359 // Pods, number 2360 ResourcePods ResourceName = "pods" 2361 // Services, number 2362 ResourceServices ResourceName = "services" 2363 // ReplicationControllers, number 2364 ResourceReplicationControllers ResourceName = "replicationcontrollers" 2365 // ResourceQuotas, number 2366 ResourceQuotas ResourceName = "resourcequotas" 2367 // ResourceSecrets, number 2368 ResourceSecrets ResourceName = "secrets" 2369 // ResourcePersistentVolumeClaims, number 2370 ResourcePersistentVolumeClaims ResourceName = "persistentvolumeclaims" 2371 ) 2372 2373 // ResourceQuotaSpec defines the desired hard limits to enforce for Quota. 2374 type ResourceQuotaSpec struct { 2375 // Hard is the set of desired hard limits for each named resource. 2376 // More info: http://releases.k8s.io/HEAD/docs/design/admission_control_resource_quota.md#admissioncontrol-plugin-resourcequota 2377 Hard ResourceList `json:"hard,omitempty"` 2378 } 2379 2380 // ResourceQuotaStatus defines the enforced hard limits and observed use. 2381 type ResourceQuotaStatus struct { 2382 // Hard is the set of enforced hard limits for each named resource. 2383 // More info: http://releases.k8s.io/HEAD/docs/design/admission_control_resource_quota.md#admissioncontrol-plugin-resourcequota 2384 Hard ResourceList `json:"hard,omitempty"` 2385 // Used is the current observed total usage of the resource in the namespace. 2386 Used ResourceList `json:"used,omitempty"` 2387 } 2388 2389 // ResourceQuota sets aggregate quota restrictions enforced per namespace 2390 type ResourceQuota struct { 2391 TypeMeta `json:",inline"` 2392 // Standard object's metadata. 2393 // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata 2394 ObjectMeta `json:"metadata,omitempty"` 2395 2396 // Spec defines the desired quota. 2397 // http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status 2398 Spec ResourceQuotaSpec `json:"spec,omitempty"` 2399 2400 // Status defines the actual enforced quota and its current usage. 2401 // http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status 2402 Status ResourceQuotaStatus `json:"status,omitempty"` 2403 } 2404 2405 // ResourceQuotaList is a list of ResourceQuota items. 2406 type ResourceQuotaList struct { 2407 TypeMeta `json:",inline"` 2408 // Standard list metadata. 2409 // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#types-kinds 2410 ListMeta `json:"metadata,omitempty"` 2411 2412 // Items is a list of ResourceQuota objects. 2413 // More info: http://releases.k8s.io/HEAD/docs/design/admission_control_resource_quota.md#admissioncontrol-plugin-resourcequota 2414 Items []ResourceQuota `json:"items"` 2415 } 2416 2417 // Secret holds secret data of a certain type. The total bytes of the values in 2418 // the Data field must be less than MaxSecretSize bytes. 2419 type Secret struct { 2420 TypeMeta `json:",inline"` 2421 // Standard object's metadata. 2422 // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata 2423 ObjectMeta `json:"metadata,omitempty"` 2424 2425 // Data contains the secret data. Each key must be a valid DNS_SUBDOMAIN 2426 // or leading dot followed by valid DNS_SUBDOMAIN. 2427 // The serialized form of the secret data is a base64 encoded string, 2428 // representing the arbitrary (possibly non-string) data value here. 2429 // Described in https://tools.ietf.org/html/rfc4648#section-4 2430 Data map[string][]byte `json:"data,omitempty"` 2431 2432 // Used to facilitate programmatic handling of secret data. 2433 Type SecretType `json:"type,omitempty"` 2434 } 2435 2436 const MaxSecretSize = 1 * 1024 * 1024 2437 2438 type SecretType string 2439 2440 const ( 2441 // SecretTypeOpaque is the default. Arbitrary user-defined data 2442 SecretTypeOpaque SecretType = "Opaque" 2443 2444 // SecretTypeServiceAccountToken contains a token that identifies a service account to the API 2445 // 2446 // Required fields: 2447 // - Secret.Annotations["kubernetes.io/service-account.name"] - the name of the ServiceAccount the token identifies 2448 // - Secret.Annotations["kubernetes.io/service-account.uid"] - the UID of the ServiceAccount the token identifies 2449 // - Secret.Data["token"] - a token that identifies the service account to the API 2450 SecretTypeServiceAccountToken SecretType = "kubernetes.io/service-account-token" 2451 2452 // ServiceAccountNameKey is the key of the required annotation for SecretTypeServiceAccountToken secrets 2453 ServiceAccountNameKey = "kubernetes.io/service-account.name" 2454 // ServiceAccountUIDKey is the key of the required annotation for SecretTypeServiceAccountToken secrets 2455 ServiceAccountUIDKey = "kubernetes.io/service-account.uid" 2456 // ServiceAccountTokenKey is the key of the required data for SecretTypeServiceAccountToken secrets 2457 ServiceAccountTokenKey = "token" 2458 // ServiceAccountKubeconfigKey is the key of the optional kubeconfig data for SecretTypeServiceAccountToken secrets 2459 ServiceAccountKubeconfigKey = "kubernetes.kubeconfig" 2460 // ServiceAccountRootCAKey is the key of the optional root certificate authority for SecretTypeServiceAccountToken secrets 2461 ServiceAccountRootCAKey = "ca.crt" 2462 2463 // SecretTypeDockercfg contains a dockercfg file that follows the same format rules as ~/.dockercfg 2464 // 2465 // Required fields: 2466 // - Secret.Data[".dockercfg"] - a serialized ~/.dockercfg file 2467 SecretTypeDockercfg SecretType = "kubernetes.io/dockercfg" 2468 2469 // DockerConfigKey is the key of the required data for SecretTypeDockercfg secrets 2470 DockerConfigKey = ".dockercfg" 2471 ) 2472 2473 // SecretList is a list of Secret. 2474 type SecretList struct { 2475 TypeMeta `json:",inline"` 2476 // Standard list metadata. 2477 // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#types-kinds 2478 ListMeta `json:"metadata,omitempty"` 2479 2480 // Items is a list of secret objects. 2481 // More info: http://releases.k8s.io/HEAD/docs/user-guide/secrets.md 2482 Items []Secret `json:"items"` 2483 } 2484 2485 // Type and constants for component health validation. 2486 type ComponentConditionType string 2487 2488 // These are the valid conditions for the component. 2489 const ( 2490 ComponentHealthy ComponentConditionType = "Healthy" 2491 ) 2492 2493 // Information about the condition of a component. 2494 type ComponentCondition struct { 2495 // Type of condition for a component. 2496 // Valid value: "Healthy" 2497 Type ComponentConditionType `json:"type"` 2498 // Status of the condition for a component. 2499 // Valid values for "Healthy": "True", "False", or "Unknown". 2500 Status ConditionStatus `json:"status"` 2501 // Message about the condition for a component. 2502 // For example, information about a health check. 2503 Message string `json:"message,omitempty"` 2504 // Condition error code for a component. 2505 // For example, a health check error code. 2506 Error string `json:"error,omitempty"` 2507 } 2508 2509 // ComponentStatus (and ComponentStatusList) holds the cluster validation info. 2510 type ComponentStatus struct { 2511 TypeMeta `json:",inline"` 2512 // Standard object's metadata. 2513 // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata 2514 ObjectMeta `json:"metadata,omitempty"` 2515 2516 // List of component conditions observed 2517 Conditions []ComponentCondition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type"` 2518 } 2519 2520 // Status of all the conditions for the component as a list of ComponentStatus objects. 2521 type ComponentStatusList struct { 2522 TypeMeta `json:",inline"` 2523 // Standard list metadata. 2524 // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#types-kinds 2525 ListMeta `json:"metadata,omitempty"` 2526 2527 // List of ComponentStatus objects. 2528 Items []ComponentStatus `json:"items"` 2529 } 2530 2531 // DownwardAPIVolumeSource represents a volume containing downward API info 2532 type DownwardAPIVolumeSource struct { 2533 // Items is a list of downward API volume file 2534 Items []DownwardAPIVolumeFile `json:"items,omitempty"` 2535 } 2536 2537 // DownwardAPIVolumeFile represents information to create the file containing the pod field 2538 type DownwardAPIVolumeFile struct { 2539 // 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 '..' 2540 Path string `json:"path"` 2541 // Required: Selects a field of the pod: only annotations, labels, name and namespace are supported. 2542 FieldRef ObjectFieldSelector `json:"fieldRef"` 2543 } 2544 2545 // SecurityContext holds security configuration that will be applied to a container. 2546 type SecurityContext struct { 2547 // The linux kernel capabilities that should be added or removed. 2548 // Default to Container.Capabilities if left unset. 2549 // More info: http://releases.k8s.io/HEAD/docs/design/security_context.md#security-context 2550 Capabilities *Capabilities `json:"capabilities,omitempty"` 2551 2552 // Run the container in privileged mode. 2553 // Default to Container.Privileged if left unset. 2554 // More info: http://releases.k8s.io/HEAD/docs/design/security_context.md#security-context 2555 Privileged *bool `json:"privileged,omitempty"` 2556 2557 // SELinuxOptions are the labels to be applied to the container 2558 // and volumes. 2559 // Options that control the SELinux labels applied. 2560 // More info: http://releases.k8s.io/HEAD/docs/design/security_context.md#security-context 2561 SELinuxOptions *SELinuxOptions `json:"seLinuxOptions,omitempty"` 2562 2563 // RunAsUser is the UID to run the entrypoint of the container process. 2564 // The user id that runs the first process in the container. 2565 // More info: http://releases.k8s.io/HEAD/docs/design/security_context.md#security-context 2566 RunAsUser *int64 `json:"runAsUser,omitempty"` 2567 2568 // RunAsNonRoot indicates that the container should be run as a non-root user. If the RunAsUser 2569 // field is not explicitly set then the kubelet may check the image for a specified user or 2570 // perform defaulting to specify a user. 2571 RunAsNonRoot bool `json:"runAsNonRoot,omitempty"` 2572 } 2573 2574 // SELinuxOptions are the labels to be applied to the container 2575 type SELinuxOptions struct { 2576 // User is a SELinux user label that applies to the container. 2577 // More info: http://releases.k8s.io/HEAD/docs/user-guide/labels.md 2578 User string `json:"user,omitempty"` 2579 2580 // Role is a SELinux role label that applies to the container. 2581 // More info: http://releases.k8s.io/HEAD/docs/user-guide/labels.md 2582 Role string `json:"role,omitempty"` 2583 2584 // Type is a SELinux type label that applies to the container. 2585 // More info: http://releases.k8s.io/HEAD/docs/user-guide/labels.md 2586 Type string `json:"type,omitempty"` 2587 2588 // Level is SELinux level label that applies to the container. 2589 // More info: http://releases.k8s.io/HEAD/docs/user-guide/labels.md 2590 Level string `json:"level,omitempty"` 2591 } 2592 2593 // RangeAllocation is not a public type. 2594 type RangeAllocation struct { 2595 TypeMeta `json:",inline"` 2596 // Standard object's metadata. 2597 // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata 2598 ObjectMeta `json:"metadata,omitempty"` 2599 2600 // Range is string that identifies the range represented by 'data'. 2601 Range string `json:"range"` 2602 // Data is a bit array containing all allocated addresses in the previous segment. 2603 Data []byte `json:"data"` 2604 } 2605 2606 // A ThirdPartyResource is a generic representation of a resource, it is used by add-ons and plugins to add new resource 2607 // types to the API. It consists of one or more Versions of the api. 2608 type ThirdPartyResource struct { 2609 TypeMeta `json:",inline"` 2610 // Standard object's metadata. 2611 // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata 2612 ObjectMeta `json:"metadata,omitempty"` 2613 2614 // The description of this object. 2615 Description string `json:"description,omitempty"` 2616 2617 // The versions for this third party object. 2618 Versions []APIVersion `json:"versions,omitempty"` 2619 } 2620 2621 // ThirdPartyResourceList is a list of ThirdPartyResource. 2622 type ThirdPartyResourceList struct { 2623 TypeMeta `json:",inline"` 2624 // Standard list metadata. 2625 // More info: http://docs.k8s.io/api-conventions.md#metadata 2626 ListMeta `json:"metadata,omitempty"` 2627 2628 // Items is a list of schema objects. 2629 Items []ThirdPartyResource `json:"items"` 2630 } 2631 2632 // An APIVersion represents a single concrete version of an object model. 2633 type APIVersion struct { 2634 // Name of this version (e.g. 'v1'). 2635 Name string `json:"name,omitempty"` 2636 // The API group to add this object into. 2637 // Default 'experimental'. 2638 APIGroup string `json:"apiGroup,omitempty"` 2639 } 2640 2641 // An internal object, used for versioned storage in etcd. Not exposed to the end user. 2642 type ThirdPartyResourceData struct { 2643 TypeMeta `json:",inline"` 2644 // Standard object's metadata. 2645 // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata 2646 ObjectMeta `json:"metadata,omitempty"` 2647 2648 // The raw JSON data for this data. 2649 Data []byte `json:"name,omitempty"` 2650 }