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