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