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