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