blob: d014d0baf3d50e8bd0cf619d54678c647c00099c [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"`
Zack Williamse940c7a2019-08-21 14:25:39 -07003004}
3005
3006const (
3007 // The default value for enableServiceLinks attribute.
3008 DefaultEnableServiceLinks = true
3009)
3010
3011// HostAlias holds the mapping between IP and hostnames that will be injected as an entry in the
3012// pod's hosts file.
3013type HostAlias struct {
3014 // IP address of the host file entry.
3015 IP string `json:"ip,omitempty" protobuf:"bytes,1,opt,name=ip"`
3016 // Hostnames for the above IP address.
3017 Hostnames []string `json:"hostnames,omitempty" protobuf:"bytes,2,rep,name=hostnames"`
3018}
3019
3020// PodSecurityContext holds pod-level security attributes and common container settings.
3021// Some fields are also present in container.securityContext. Field values of
3022// container.securityContext take precedence over field values of PodSecurityContext.
3023type PodSecurityContext struct {
3024 // The SELinux context to be applied to all containers.
3025 // If unspecified, the container runtime will allocate a random SELinux context for each
3026 // container. May also be set in SecurityContext. If set in
3027 // both SecurityContext and PodSecurityContext, the value specified in SecurityContext
3028 // takes precedence for that container.
3029 // +optional
3030 SELinuxOptions *SELinuxOptions `json:"seLinuxOptions,omitempty" protobuf:"bytes,1,opt,name=seLinuxOptions"`
3031 // Windows security options.
3032 // +optional
3033 WindowsOptions *WindowsSecurityContextOptions `json:"windowsOptions,omitempty" protobuf:"bytes,8,opt,name=windowsOptions"`
3034 // The UID to run the entrypoint of the container process.
3035 // Defaults to user specified in image metadata if unspecified.
3036 // May also be set in SecurityContext. If set in both SecurityContext and
3037 // PodSecurityContext, the value specified in SecurityContext takes precedence
3038 // for that container.
3039 // +optional
3040 RunAsUser *int64 `json:"runAsUser,omitempty" protobuf:"varint,2,opt,name=runAsUser"`
3041 // The GID to run the entrypoint of the container process.
3042 // Uses runtime default if unset.
3043 // May also be set in SecurityContext. If set in both SecurityContext and
3044 // PodSecurityContext, the value specified in SecurityContext takes precedence
3045 // for that container.
3046 // +optional
3047 RunAsGroup *int64 `json:"runAsGroup,omitempty" protobuf:"varint,6,opt,name=runAsGroup"`
3048 // Indicates that the container must run as a non-root user.
3049 // If true, the Kubelet will validate the image at runtime to ensure that it
3050 // does not run as UID 0 (root) and fail to start the container if it does.
3051 // If unset or false, no such validation will be performed.
3052 // May also be set in SecurityContext. If set in both SecurityContext and
3053 // PodSecurityContext, the value specified in SecurityContext takes precedence.
3054 // +optional
3055 RunAsNonRoot *bool `json:"runAsNonRoot,omitempty" protobuf:"varint,3,opt,name=runAsNonRoot"`
3056 // A list of groups applied to the first process run in each container, in addition
3057 // to the container's primary GID. If unspecified, no groups will be added to
3058 // any container.
3059 // +optional
3060 SupplementalGroups []int64 `json:"supplementalGroups,omitempty" protobuf:"varint,4,rep,name=supplementalGroups"`
3061 // A special supplemental group that applies to all containers in a pod.
3062 // Some volume types allow the Kubelet to change the ownership of that volume
3063 // to be owned by the pod:
3064 //
3065 // 1. The owning GID will be the FSGroup
3066 // 2. The setgid bit is set (new files created in the volume will be owned by FSGroup)
3067 // 3. The permission bits are OR'd with rw-rw----
3068 //
3069 // If unset, the Kubelet will not modify the ownership and permissions of any volume.
3070 // +optional
3071 FSGroup *int64 `json:"fsGroup,omitempty" protobuf:"varint,5,opt,name=fsGroup"`
3072 // Sysctls hold a list of namespaced sysctls used for the pod. Pods with unsupported
3073 // sysctls (by the container runtime) might fail to launch.
3074 // +optional
3075 Sysctls []Sysctl `json:"sysctls,omitempty" protobuf:"bytes,7,rep,name=sysctls"`
3076}
3077
3078// PodQOSClass defines the supported qos classes of Pods.
3079type PodQOSClass string
3080
3081const (
3082 // PodQOSGuaranteed is the Guaranteed qos class.
3083 PodQOSGuaranteed PodQOSClass = "Guaranteed"
3084 // PodQOSBurstable is the Burstable qos class.
3085 PodQOSBurstable PodQOSClass = "Burstable"
3086 // PodQOSBestEffort is the BestEffort qos class.
3087 PodQOSBestEffort PodQOSClass = "BestEffort"
3088)
3089
3090// PodDNSConfig defines the DNS parameters of a pod in addition to
3091// those generated from DNSPolicy.
3092type PodDNSConfig struct {
3093 // A list of DNS name server IP addresses.
3094 // This will be appended to the base nameservers generated from DNSPolicy.
3095 // Duplicated nameservers will be removed.
3096 // +optional
3097 Nameservers []string `json:"nameservers,omitempty" protobuf:"bytes,1,rep,name=nameservers"`
3098 // A list of DNS search domains for host-name lookup.
3099 // This will be appended to the base search paths generated from DNSPolicy.
3100 // Duplicated search paths will be removed.
3101 // +optional
3102 Searches []string `json:"searches,omitempty" protobuf:"bytes,2,rep,name=searches"`
3103 // A list of DNS resolver options.
3104 // This will be merged with the base options generated from DNSPolicy.
3105 // Duplicated entries will be removed. Resolution options given in Options
3106 // will override those that appear in the base DNSPolicy.
3107 // +optional
3108 Options []PodDNSConfigOption `json:"options,omitempty" protobuf:"bytes,3,rep,name=options"`
3109}
3110
3111// PodDNSConfigOption defines DNS resolver options of a pod.
3112type PodDNSConfigOption struct {
3113 // Required.
3114 Name string `json:"name,omitempty" protobuf:"bytes,1,opt,name=name"`
3115 // +optional
3116 Value *string `json:"value,omitempty" protobuf:"bytes,2,opt,name=value"`
3117}
3118
3119// PodStatus represents information about the status of a pod. Status may trail the actual
3120// state of a system, especially if the node that hosts the pod cannot contact the control
3121// plane.
3122type PodStatus struct {
3123 // The phase of a Pod is a simple, high-level summary of where the Pod is in its lifecycle.
3124 // The conditions array, the reason and message fields, and the individual container status
3125 // arrays contain more detail about the pod's status.
3126 // There are five possible phase values:
3127 //
3128 // Pending: The pod has been accepted by the Kubernetes system, but one or more of the
3129 // container images has not been created. This includes time before being scheduled as
3130 // well as time spent downloading images over the network, which could take a while.
3131 // Running: The pod has been bound to a node, and all of the containers have been created.
3132 // At least one container is still running, or is in the process of starting or restarting.
3133 // Succeeded: All containers in the pod have terminated in success, and will not be restarted.
3134 // Failed: All containers in the pod have terminated, and at least one container has
3135 // terminated in failure. The container either exited with non-zero status or was terminated
3136 // by the system.
3137 // Unknown: For some reason the state of the pod could not be obtained, typically due to an
3138 // error in communicating with the host of the pod.
3139 //
3140 // More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#pod-phase
3141 // +optional
3142 Phase PodPhase `json:"phase,omitempty" protobuf:"bytes,1,opt,name=phase,casttype=PodPhase"`
3143 // Current service state of pod.
3144 // More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#pod-conditions
3145 // +optional
3146 // +patchMergeKey=type
3147 // +patchStrategy=merge
3148 Conditions []PodCondition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type" protobuf:"bytes,2,rep,name=conditions"`
3149 // A human readable message indicating details about why the pod is in this condition.
3150 // +optional
3151 Message string `json:"message,omitempty" protobuf:"bytes,3,opt,name=message"`
3152 // A brief CamelCase message indicating details about why the pod is in this state.
3153 // e.g. 'Evicted'
3154 // +optional
3155 Reason string `json:"reason,omitempty" protobuf:"bytes,4,opt,name=reason"`
3156 // nominatedNodeName is set only when this pod preempts other pods on the node, but it cannot be
3157 // scheduled right away as preemption victims receive their graceful termination periods.
3158 // This field does not guarantee that the pod will be scheduled on this node. Scheduler may decide
3159 // to place the pod elsewhere if other nodes become available sooner. Scheduler may also decide to
3160 // give the resources on this node to a higher priority pod that is created after preemption.
3161 // As a result, this field may be different than PodSpec.nodeName when the pod is
3162 // scheduled.
3163 // +optional
3164 NominatedNodeName string `json:"nominatedNodeName,omitempty" protobuf:"bytes,11,opt,name=nominatedNodeName"`
3165
3166 // IP address of the host to which the pod is assigned. Empty if not yet scheduled.
3167 // +optional
3168 HostIP string `json:"hostIP,omitempty" protobuf:"bytes,5,opt,name=hostIP"`
3169 // IP address allocated to the pod. Routable at least within the cluster.
3170 // Empty if not yet allocated.
3171 // +optional
3172 PodIP string `json:"podIP,omitempty" protobuf:"bytes,6,opt,name=podIP"`
3173
3174 // RFC 3339 date and time at which the object was acknowledged by the Kubelet.
3175 // This is before the Kubelet pulled the container image(s) for the pod.
3176 // +optional
3177 StartTime *metav1.Time `json:"startTime,omitempty" protobuf:"bytes,7,opt,name=startTime"`
3178
3179 // The list has one entry per init container in the manifest. The most recent successful
3180 // init container will have ready = true, the most recently started container will have
3181 // startTime set.
3182 // More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#pod-and-container-status
3183 InitContainerStatuses []ContainerStatus `json:"initContainerStatuses,omitempty" protobuf:"bytes,10,rep,name=initContainerStatuses"`
3184
3185 // The list has one entry per container in the manifest. Each entry is currently the output
3186 // of `docker inspect`.
3187 // More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#pod-and-container-status
3188 // +optional
3189 ContainerStatuses []ContainerStatus `json:"containerStatuses,omitempty" protobuf:"bytes,8,rep,name=containerStatuses"`
3190 // The Quality of Service (QOS) classification assigned to the pod based on resource requirements
3191 // See PodQOSClass type for available QOS classes
3192 // More info: https://git.k8s.io/community/contributors/design-proposals/node/resource-qos.md
3193 // +optional
3194 QOSClass PodQOSClass `json:"qosClass,omitempty" protobuf:"bytes,9,rep,name=qosClass"`
3195}
3196
3197// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
3198
3199// PodStatusResult is a wrapper for PodStatus returned by kubelet that can be encode/decoded
3200type PodStatusResult struct {
3201 metav1.TypeMeta `json:",inline"`
3202 // Standard object's metadata.
3203 // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
3204 // +optional
3205 metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
3206 // Most recently observed status of the pod.
3207 // This data may not be up to date.
3208 // Populated by the system.
3209 // Read-only.
3210 // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status
3211 // +optional
3212 Status PodStatus `json:"status,omitempty" protobuf:"bytes,2,opt,name=status"`
3213}
3214
3215// +genclient
3216// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
3217
3218// Pod is a collection of containers that can run on a host. This resource is created
3219// by clients and scheduled onto hosts.
3220type Pod struct {
3221 metav1.TypeMeta `json:",inline"`
3222 // Standard object's metadata.
3223 // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
3224 // +optional
3225 metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
3226
3227 // Specification of the desired behavior of the pod.
3228 // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status
3229 // +optional
3230 Spec PodSpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"`
3231
3232 // Most recently observed status of the pod.
3233 // This data may not be up to date.
3234 // Populated by the system.
3235 // Read-only.
3236 // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status
3237 // +optional
3238 Status PodStatus `json:"status,omitempty" protobuf:"bytes,3,opt,name=status"`
3239}
3240
3241// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
3242
3243// PodList is a list of Pods.
3244type PodList struct {
3245 metav1.TypeMeta `json:",inline"`
3246 // Standard list metadata.
3247 // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds
3248 // +optional
3249 metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
3250
3251 // List of pods.
3252 // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md
3253 Items []Pod `json:"items" protobuf:"bytes,2,rep,name=items"`
3254}
3255
3256// PodTemplateSpec describes the data a pod should have when created from a template
3257type PodTemplateSpec struct {
3258 // Standard object's metadata.
3259 // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
3260 // +optional
3261 metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
3262
3263 // Specification of the desired behavior of the pod.
3264 // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status
3265 // +optional
3266 Spec PodSpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"`
3267}
3268
3269// +genclient
3270// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
3271
3272// PodTemplate describes a template for creating copies of a predefined pod.
3273type PodTemplate struct {
3274 metav1.TypeMeta `json:",inline"`
3275 // Standard object's metadata.
3276 // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
3277 // +optional
3278 metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
3279
3280 // Template defines the pods that will be created from this pod template.
3281 // https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status
3282 // +optional
3283 Template PodTemplateSpec `json:"template,omitempty" protobuf:"bytes,2,opt,name=template"`
3284}
3285
3286// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
3287
3288// PodTemplateList is a list of PodTemplates.
3289type PodTemplateList struct {
3290 metav1.TypeMeta `json:",inline"`
3291 // Standard list metadata.
3292 // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds
3293 // +optional
3294 metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
3295
3296 // List of pod templates
3297 Items []PodTemplate `json:"items" protobuf:"bytes,2,rep,name=items"`
3298}
3299
3300// ReplicationControllerSpec is the specification of a replication controller.
3301type ReplicationControllerSpec struct {
3302 // Replicas is the number of desired replicas.
3303 // This is a pointer to distinguish between explicit zero and unspecified.
3304 // Defaults to 1.
3305 // More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller#what-is-a-replicationcontroller
3306 // +optional
3307 Replicas *int32 `json:"replicas,omitempty" protobuf:"varint,1,opt,name=replicas"`
3308
3309 // Minimum number of seconds for which a newly created pod should be ready
3310 // without any of its container crashing, for it to be considered available.
3311 // Defaults to 0 (pod will be considered available as soon as it is ready)
3312 // +optional
3313 MinReadySeconds int32 `json:"minReadySeconds,omitempty" protobuf:"varint,4,opt,name=minReadySeconds"`
3314
3315 // Selector is a label query over pods that should match the Replicas count.
3316 // If Selector is empty, it is defaulted to the labels present on the Pod template.
3317 // Label keys and values that must match in order to be controlled by this replication
3318 // controller, if empty defaulted to labels on Pod template.
3319 // More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors
3320 // +optional
3321 Selector map[string]string `json:"selector,omitempty" protobuf:"bytes,2,rep,name=selector"`
3322
3323 // TemplateRef is a reference to an object that describes the pod that will be created if
3324 // insufficient replicas are detected.
3325 // Reference to an object that describes the pod that will be created if insufficient replicas are detected.
3326 // +optional
3327 // TemplateRef *ObjectReference `json:"templateRef,omitempty"`
3328
3329 // Template is the object that describes the pod that will be created if
3330 // insufficient replicas are detected. This takes precedence over a TemplateRef.
3331 // More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller#pod-template
3332 // +optional
3333 Template *PodTemplateSpec `json:"template,omitempty" protobuf:"bytes,3,opt,name=template"`
3334}
3335
3336// ReplicationControllerStatus represents the current status of a replication
3337// controller.
3338type ReplicationControllerStatus struct {
3339 // Replicas is the most recently oberved number of replicas.
3340 // More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller#what-is-a-replicationcontroller
3341 Replicas int32 `json:"replicas" protobuf:"varint,1,opt,name=replicas"`
3342
3343 // The number of pods that have labels matching the labels of the pod template of the replication controller.
3344 // +optional
3345 FullyLabeledReplicas int32 `json:"fullyLabeledReplicas,omitempty" protobuf:"varint,2,opt,name=fullyLabeledReplicas"`
3346
3347 // The number of ready replicas for this replication controller.
3348 // +optional
3349 ReadyReplicas int32 `json:"readyReplicas,omitempty" protobuf:"varint,4,opt,name=readyReplicas"`
3350
3351 // The number of available replicas (ready for at least minReadySeconds) for this replication controller.
3352 // +optional
3353 AvailableReplicas int32 `json:"availableReplicas,omitempty" protobuf:"varint,5,opt,name=availableReplicas"`
3354
3355 // ObservedGeneration reflects the generation of the most recently observed replication controller.
3356 // +optional
3357 ObservedGeneration int64 `json:"observedGeneration,omitempty" protobuf:"varint,3,opt,name=observedGeneration"`
3358
3359 // Represents the latest available observations of a replication controller's current state.
3360 // +optional
3361 // +patchMergeKey=type
3362 // +patchStrategy=merge
3363 Conditions []ReplicationControllerCondition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type" protobuf:"bytes,6,rep,name=conditions"`
3364}
3365
3366type ReplicationControllerConditionType string
3367
3368// These are valid conditions of a replication controller.
3369const (
3370 // ReplicationControllerReplicaFailure is added in a replication controller when one of its pods
3371 // fails to be created due to insufficient quota, limit ranges, pod security policy, node selectors,
3372 // etc. or deleted due to kubelet being down or finalizers are failing.
3373 ReplicationControllerReplicaFailure ReplicationControllerConditionType = "ReplicaFailure"
3374)
3375
3376// ReplicationControllerCondition describes the state of a replication controller at a certain point.
3377type ReplicationControllerCondition struct {
3378 // Type of replication controller condition.
3379 Type ReplicationControllerConditionType `json:"type" protobuf:"bytes,1,opt,name=type,casttype=ReplicationControllerConditionType"`
3380 // Status of the condition, one of True, False, Unknown.
3381 Status ConditionStatus `json:"status" protobuf:"bytes,2,opt,name=status,casttype=ConditionStatus"`
3382 // The last time the condition transitioned from one status to another.
3383 // +optional
3384 LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty" protobuf:"bytes,3,opt,name=lastTransitionTime"`
3385 // The reason for the condition's last transition.
3386 // +optional
3387 Reason string `json:"reason,omitempty" protobuf:"bytes,4,opt,name=reason"`
3388 // A human readable message indicating details about the transition.
3389 // +optional
3390 Message string `json:"message,omitempty" protobuf:"bytes,5,opt,name=message"`
3391}
3392
3393// +genclient
3394// +genclient:method=GetScale,verb=get,subresource=scale,result=k8s.io/api/autoscaling/v1.Scale
3395// +genclient:method=UpdateScale,verb=update,subresource=scale,input=k8s.io/api/autoscaling/v1.Scale,result=k8s.io/api/autoscaling/v1.Scale
3396// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
3397
3398// ReplicationController represents the configuration of a replication controller.
3399type ReplicationController struct {
3400 metav1.TypeMeta `json:",inline"`
3401
3402 // If the Labels of a ReplicationController are empty, they are defaulted to
3403 // be the same as the Pod(s) that the replication controller manages.
3404 // Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
3405 // +optional
3406 metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
3407
3408 // Spec defines the specification of the desired behavior of the replication controller.
3409 // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status
3410 // +optional
3411 Spec ReplicationControllerSpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"`
3412
3413 // Status is the most recently observed status of the replication controller.
3414 // This data may be out of date by some window of time.
3415 // Populated by the system.
3416 // Read-only.
3417 // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status
3418 // +optional
3419 Status ReplicationControllerStatus `json:"status,omitempty" protobuf:"bytes,3,opt,name=status"`
3420}
3421
3422// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
3423
3424// ReplicationControllerList is a collection of replication controllers.
3425type ReplicationControllerList struct {
3426 metav1.TypeMeta `json:",inline"`
3427 // Standard list metadata.
3428 // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds
3429 // +optional
3430 metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
3431
3432 // List of replication controllers.
3433 // More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller
3434 Items []ReplicationController `json:"items" protobuf:"bytes,2,rep,name=items"`
3435}
3436
3437// Session Affinity Type string
3438type ServiceAffinity string
3439
3440const (
3441 // ServiceAffinityClientIP is the Client IP based.
3442 ServiceAffinityClientIP ServiceAffinity = "ClientIP"
3443
3444 // ServiceAffinityNone - no session affinity.
3445 ServiceAffinityNone ServiceAffinity = "None"
3446)
3447
3448const DefaultClientIPServiceAffinitySeconds int32 = 10800
3449
3450// SessionAffinityConfig represents the configurations of session affinity.
3451type SessionAffinityConfig struct {
3452 // clientIP contains the configurations of Client IP based session affinity.
3453 // +optional
3454 ClientIP *ClientIPConfig `json:"clientIP,omitempty" protobuf:"bytes,1,opt,name=clientIP"`
3455}
3456
3457// ClientIPConfig represents the configurations of Client IP based session affinity.
3458type ClientIPConfig struct {
3459 // timeoutSeconds specifies the seconds of ClientIP type session sticky time.
3460 // The value must be >0 && <=86400(for 1 day) if ServiceAffinity == "ClientIP".
3461 // Default value is 10800(for 3 hours).
3462 // +optional
3463 TimeoutSeconds *int32 `json:"timeoutSeconds,omitempty" protobuf:"varint,1,opt,name=timeoutSeconds"`
3464}
3465
3466// Service Type string describes ingress methods for a service
3467type ServiceType string
3468
3469const (
3470 // ServiceTypeClusterIP means a service will only be accessible inside the
3471 // cluster, via the cluster IP.
3472 ServiceTypeClusterIP ServiceType = "ClusterIP"
3473
3474 // ServiceTypeNodePort means a service will be exposed on one port of
3475 // every node, in addition to 'ClusterIP' type.
3476 ServiceTypeNodePort ServiceType = "NodePort"
3477
3478 // ServiceTypeLoadBalancer means a service will be exposed via an
3479 // external load balancer (if the cloud provider supports it), in addition
3480 // to 'NodePort' type.
3481 ServiceTypeLoadBalancer ServiceType = "LoadBalancer"
3482
3483 // ServiceTypeExternalName means a service consists of only a reference to
3484 // an external name that kubedns or equivalent will return as a CNAME
3485 // record, with no exposing or proxying of any pods involved.
3486 ServiceTypeExternalName ServiceType = "ExternalName"
3487)
3488
3489// Service External Traffic Policy Type string
3490type ServiceExternalTrafficPolicyType string
3491
3492const (
3493 // ServiceExternalTrafficPolicyTypeLocal specifies node-local endpoints behavior.
3494 ServiceExternalTrafficPolicyTypeLocal ServiceExternalTrafficPolicyType = "Local"
3495 // ServiceExternalTrafficPolicyTypeCluster specifies node-global (legacy) behavior.
3496 ServiceExternalTrafficPolicyTypeCluster ServiceExternalTrafficPolicyType = "Cluster"
3497)
3498
3499// ServiceStatus represents the current status of a service.
3500type ServiceStatus struct {
3501 // LoadBalancer contains the current status of the load-balancer,
3502 // if one is present.
3503 // +optional
3504 LoadBalancer LoadBalancerStatus `json:"loadBalancer,omitempty" protobuf:"bytes,1,opt,name=loadBalancer"`
3505}
3506
3507// LoadBalancerStatus represents the status of a load-balancer.
3508type LoadBalancerStatus struct {
3509 // Ingress is a list containing ingress points for the load-balancer.
3510 // Traffic intended for the service should be sent to these ingress points.
3511 // +optional
3512 Ingress []LoadBalancerIngress `json:"ingress,omitempty" protobuf:"bytes,1,rep,name=ingress"`
3513}
3514
3515// LoadBalancerIngress represents the status of a load-balancer ingress point:
3516// traffic intended for the service should be sent to an ingress point.
3517type LoadBalancerIngress struct {
3518 // IP is set for load-balancer ingress points that are IP based
3519 // (typically GCE or OpenStack load-balancers)
3520 // +optional
3521 IP string `json:"ip,omitempty" protobuf:"bytes,1,opt,name=ip"`
3522
3523 // Hostname is set for load-balancer ingress points that are DNS based
3524 // (typically AWS load-balancers)
3525 // +optional
3526 Hostname string `json:"hostname,omitempty" protobuf:"bytes,2,opt,name=hostname"`
3527}
3528
3529// ServiceSpec describes the attributes that a user creates on a service.
3530type ServiceSpec struct {
3531 // The list of ports that are exposed by this service.
3532 // More info: https://kubernetes.io/docs/concepts/services-networking/service/#virtual-ips-and-service-proxies
3533 // +patchMergeKey=port
3534 // +patchStrategy=merge
3535 // +listType=map
3536 // +listMapKey=port
3537 // +listMapKey=protocol
3538 Ports []ServicePort `json:"ports,omitempty" patchStrategy:"merge" patchMergeKey:"port" protobuf:"bytes,1,rep,name=ports"`
3539
3540 // Route service traffic to pods with label keys and values matching this
3541 // selector. If empty or not present, the service is assumed to have an
3542 // external process managing its endpoints, which Kubernetes will not
3543 // modify. Only applies to types ClusterIP, NodePort, and LoadBalancer.
3544 // Ignored if type is ExternalName.
3545 // More info: https://kubernetes.io/docs/concepts/services-networking/service/
3546 // +optional
3547 Selector map[string]string `json:"selector,omitempty" protobuf:"bytes,2,rep,name=selector"`
3548
3549 // clusterIP is the IP address of the service and is usually assigned
3550 // randomly by the master. If an address is specified manually and is not in
3551 // use by others, it will be allocated to the service; otherwise, creation
3552 // of the service will fail. This field can not be changed through updates.
3553 // Valid values are "None", empty string (""), or a valid IP address. "None"
3554 // can be specified for headless services when proxying is not required.
3555 // Only applies to types ClusterIP, NodePort, and LoadBalancer. Ignored if
3556 // type is ExternalName.
3557 // More info: https://kubernetes.io/docs/concepts/services-networking/service/#virtual-ips-and-service-proxies
3558 // +optional
3559 ClusterIP string `json:"clusterIP,omitempty" protobuf:"bytes,3,opt,name=clusterIP"`
3560
3561 // type determines how the Service is exposed. Defaults to ClusterIP. Valid
3562 // options are ExternalName, ClusterIP, NodePort, and LoadBalancer.
3563 // "ExternalName" maps to the specified externalName.
3564 // "ClusterIP" allocates a cluster-internal IP address for load-balancing to
3565 // endpoints. Endpoints are determined by the selector or if that is not
3566 // specified, by manual construction of an Endpoints object. If clusterIP is
3567 // "None", no virtual IP is allocated and the endpoints are published as a
3568 // set of endpoints rather than a stable IP.
3569 // "NodePort" builds on ClusterIP and allocates a port on every node which
3570 // routes to the clusterIP.
3571 // "LoadBalancer" builds on NodePort and creates an
3572 // external load-balancer (if supported in the current cloud) which routes
3573 // to the clusterIP.
3574 // More info: https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services-service-types
3575 // +optional
3576 Type ServiceType `json:"type,omitempty" protobuf:"bytes,4,opt,name=type,casttype=ServiceType"`
3577
3578 // externalIPs is a list of IP addresses for which nodes in the cluster
3579 // will also accept traffic for this service. These IPs are not managed by
3580 // Kubernetes. The user is responsible for ensuring that traffic arrives
3581 // at a node with this IP. A common example is external load-balancers
3582 // that are not part of the Kubernetes system.
3583 // +optional
3584 ExternalIPs []string `json:"externalIPs,omitempty" protobuf:"bytes,5,rep,name=externalIPs"`
3585
3586 // Supports "ClientIP" and "None". Used to maintain session affinity.
3587 // Enable client IP based session affinity.
3588 // Must be ClientIP or None.
3589 // Defaults to None.
3590 // More info: https://kubernetes.io/docs/concepts/services-networking/service/#virtual-ips-and-service-proxies
3591 // +optional
3592 SessionAffinity ServiceAffinity `json:"sessionAffinity,omitempty" protobuf:"bytes,7,opt,name=sessionAffinity,casttype=ServiceAffinity"`
3593
3594 // Only applies to Service Type: LoadBalancer
3595 // LoadBalancer will get created with the IP specified in this field.
3596 // This feature depends on whether the underlying cloud-provider supports specifying
3597 // the loadBalancerIP when a load balancer is created.
3598 // This field will be ignored if the cloud-provider does not support the feature.
3599 // +optional
3600 LoadBalancerIP string `json:"loadBalancerIP,omitempty" protobuf:"bytes,8,opt,name=loadBalancerIP"`
3601
3602 // If specified and supported by the platform, this will restrict traffic through the cloud-provider
3603 // load-balancer will be restricted to the specified client IPs. This field will be ignored if the
3604 // cloud-provider does not support the feature."
3605 // More info: https://kubernetes.io/docs/tasks/access-application-cluster/configure-cloud-provider-firewall/
3606 // +optional
3607 LoadBalancerSourceRanges []string `json:"loadBalancerSourceRanges,omitempty" protobuf:"bytes,9,opt,name=loadBalancerSourceRanges"`
3608
3609 // externalName is the external reference that kubedns or equivalent will
3610 // return as a CNAME record for this service. No proxying will be involved.
3611 // Must be a valid RFC-1123 hostname (https://tools.ietf.org/html/rfc1123)
3612 // and requires Type to be ExternalName.
3613 // +optional
3614 ExternalName string `json:"externalName,omitempty" protobuf:"bytes,10,opt,name=externalName"`
3615
3616 // externalTrafficPolicy denotes if this Service desires to route external
3617 // traffic to node-local or cluster-wide endpoints. "Local" preserves the
3618 // client source IP and avoids a second hop for LoadBalancer and Nodeport
3619 // type services, but risks potentially imbalanced traffic spreading.
3620 // "Cluster" obscures the client source IP and may cause a second hop to
3621 // another node, but should have good overall load-spreading.
3622 // +optional
3623 ExternalTrafficPolicy ServiceExternalTrafficPolicyType `json:"externalTrafficPolicy,omitempty" protobuf:"bytes,11,opt,name=externalTrafficPolicy"`
3624
3625 // healthCheckNodePort specifies the healthcheck nodePort for the service.
3626 // If not specified, HealthCheckNodePort is created by the service api
3627 // backend with the allocated nodePort. Will use user-specified nodePort value
3628 // if specified by the client. Only effects when Type is set to LoadBalancer
3629 // and ExternalTrafficPolicy is set to Local.
3630 // +optional
3631 HealthCheckNodePort int32 `json:"healthCheckNodePort,omitempty" protobuf:"bytes,12,opt,name=healthCheckNodePort"`
3632
3633 // publishNotReadyAddresses, when set to true, indicates that DNS implementations
3634 // must publish the notReadyAddresses of subsets for the Endpoints associated with
3635 // the Service. The default value is false.
3636 // The primary use case for setting this field is to use a StatefulSet's Headless Service
3637 // to propagate SRV records for its Pods without respect to their readiness for purpose
3638 // of peer discovery.
3639 // +optional
3640 PublishNotReadyAddresses bool `json:"publishNotReadyAddresses,omitempty" protobuf:"varint,13,opt,name=publishNotReadyAddresses"`
3641 // sessionAffinityConfig contains the configurations of session affinity.
3642 // +optional
3643 SessionAffinityConfig *SessionAffinityConfig `json:"sessionAffinityConfig,omitempty" protobuf:"bytes,14,opt,name=sessionAffinityConfig"`
3644}
3645
3646// ServicePort contains information on service's port.
3647type ServicePort struct {
3648 // The name of this port within the service. This must be a DNS_LABEL.
3649 // All ports within a ServiceSpec must have unique names. This maps to
3650 // the 'Name' field in EndpointPort objects.
3651 // Optional if only one ServicePort is defined on this service.
3652 // +optional
3653 Name string `json:"name,omitempty" protobuf:"bytes,1,opt,name=name"`
3654
3655 // The IP protocol for this port. Supports "TCP", "UDP", and "SCTP".
3656 // Default is TCP.
3657 // +optional
3658 Protocol Protocol `json:"protocol,omitempty" protobuf:"bytes,2,opt,name=protocol,casttype=Protocol"`
3659
3660 // The port that will be exposed by this service.
3661 Port int32 `json:"port" protobuf:"varint,3,opt,name=port"`
3662
3663 // Number or name of the port to access on the pods targeted by the service.
3664 // Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME.
3665 // If this is a string, it will be looked up as a named port in the
3666 // target Pod's container ports. If this is not specified, the value
3667 // of the 'port' field is used (an identity map).
3668 // This field is ignored for services with clusterIP=None, and should be
3669 // omitted or set equal to the 'port' field.
3670 // More info: https://kubernetes.io/docs/concepts/services-networking/service/#defining-a-service
3671 // +optional
3672 TargetPort intstr.IntOrString `json:"targetPort,omitempty" protobuf:"bytes,4,opt,name=targetPort"`
3673
3674 // The port on each node on which this service is exposed when type=NodePort or LoadBalancer.
3675 // Usually assigned by the system. If specified, it will be allocated to the service
3676 // if unused or else creation of the service will fail.
3677 // Default is to auto-allocate a port if the ServiceType of this Service requires one.
3678 // More info: https://kubernetes.io/docs/concepts/services-networking/service/#type-nodeport
3679 // +optional
3680 NodePort int32 `json:"nodePort,omitempty" protobuf:"varint,5,opt,name=nodePort"`
3681}
3682
3683// +genclient
3684// +genclient:skipVerbs=deleteCollection
3685// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
3686
3687// Service is a named abstraction of software service (for example, mysql) consisting of local port
3688// (for example 3306) that the proxy listens on, and the selector that determines which pods
3689// will answer requests sent through the proxy.
3690type Service struct {
3691 metav1.TypeMeta `json:",inline"`
3692 // Standard object's metadata.
3693 // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
3694 // +optional
3695 metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
3696
3697 // Spec defines the behavior of a service.
3698 // https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status
3699 // +optional
3700 Spec ServiceSpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"`
3701
3702 // Most recently observed status of the service.
3703 // Populated by the system.
3704 // Read-only.
3705 // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status
3706 // +optional
3707 Status ServiceStatus `json:"status,omitempty" protobuf:"bytes,3,opt,name=status"`
3708}
3709
3710const (
3711 // ClusterIPNone - do not assign a cluster IP
3712 // no proxying required and no environment variables should be created for pods
3713 ClusterIPNone = "None"
3714)
3715
3716// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
3717
3718// ServiceList holds a list of services.
3719type ServiceList struct {
3720 metav1.TypeMeta `json:",inline"`
3721 // Standard list metadata.
3722 // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds
3723 // +optional
3724 metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
3725
3726 // List of services
3727 Items []Service `json:"items" protobuf:"bytes,2,rep,name=items"`
3728}
3729
3730// +genclient
3731// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
3732
3733// ServiceAccount binds together:
3734// * a name, understood by users, and perhaps by peripheral systems, for an identity
3735// * a principal that can be authenticated and authorized
3736// * a set of secrets
3737type ServiceAccount struct {
3738 metav1.TypeMeta `json:",inline"`
3739 // Standard object's metadata.
3740 // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
3741 // +optional
3742 metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
3743
3744 // Secrets is the list of secrets allowed to be used by pods running using this ServiceAccount.
3745 // More info: https://kubernetes.io/docs/concepts/configuration/secret
3746 // +optional
3747 // +patchMergeKey=name
3748 // +patchStrategy=merge
3749 Secrets []ObjectReference `json:"secrets,omitempty" patchStrategy:"merge" patchMergeKey:"name" protobuf:"bytes,2,rep,name=secrets"`
3750
3751 // ImagePullSecrets is a list of references to secrets in the same namespace to use for pulling any images
3752 // in pods that reference this ServiceAccount. ImagePullSecrets are distinct from Secrets because Secrets
3753 // can be mounted in the pod, but ImagePullSecrets are only accessed by the kubelet.
3754 // More info: https://kubernetes.io/docs/concepts/containers/images/#specifying-imagepullsecrets-on-a-pod
3755 // +optional
3756 ImagePullSecrets []LocalObjectReference `json:"imagePullSecrets,omitempty" protobuf:"bytes,3,rep,name=imagePullSecrets"`
3757
3758 // AutomountServiceAccountToken indicates whether pods running as this service account should have an API token automatically mounted.
3759 // Can be overridden at the pod level.
3760 // +optional
3761 AutomountServiceAccountToken *bool `json:"automountServiceAccountToken,omitempty" protobuf:"varint,4,opt,name=automountServiceAccountToken"`
3762}
3763
3764// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
3765
3766// ServiceAccountList is a list of ServiceAccount objects
3767type ServiceAccountList struct {
3768 metav1.TypeMeta `json:",inline"`
3769 // Standard list metadata.
3770 // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds
3771 // +optional
3772 metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
3773
3774 // List of ServiceAccounts.
3775 // More info: https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/
3776 Items []ServiceAccount `json:"items" protobuf:"bytes,2,rep,name=items"`
3777}
3778
3779// +genclient
3780// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
3781
3782// Endpoints is a collection of endpoints that implement the actual service. Example:
3783// Name: "mysvc",
3784// Subsets: [
3785// {
3786// Addresses: [{"ip": "10.10.1.1"}, {"ip": "10.10.2.2"}],
3787// Ports: [{"name": "a", "port": 8675}, {"name": "b", "port": 309}]
3788// },
3789// {
3790// Addresses: [{"ip": "10.10.3.3"}],
3791// Ports: [{"name": "a", "port": 93}, {"name": "b", "port": 76}]
3792// },
3793// ]
3794type Endpoints struct {
3795 metav1.TypeMeta `json:",inline"`
3796 // Standard object's metadata.
3797 // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
3798 // +optional
3799 metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
3800
3801 // The set of all endpoints is the union of all subsets. Addresses are placed into
3802 // subsets according to the IPs they share. A single address with multiple ports,
3803 // some of which are ready and some of which are not (because they come from
3804 // different containers) will result in the address being displayed in different
3805 // subsets for the different ports. No address will appear in both Addresses and
3806 // NotReadyAddresses in the same subset.
3807 // Sets of addresses and ports that comprise a service.
3808 // +optional
3809 Subsets []EndpointSubset `json:"subsets,omitempty" protobuf:"bytes,2,rep,name=subsets"`
3810}
3811
3812// EndpointSubset is a group of addresses with a common set of ports. The
3813// expanded set of endpoints is the Cartesian product of Addresses x Ports.
3814// For example, given:
3815// {
3816// Addresses: [{"ip": "10.10.1.1"}, {"ip": "10.10.2.2"}],
3817// Ports: [{"name": "a", "port": 8675}, {"name": "b", "port": 309}]
3818// }
3819// The resulting set of endpoints can be viewed as:
3820// a: [ 10.10.1.1:8675, 10.10.2.2:8675 ],
3821// b: [ 10.10.1.1:309, 10.10.2.2:309 ]
3822type EndpointSubset struct {
3823 // IP addresses which offer the related ports that are marked as ready. These endpoints
3824 // should be considered safe for load balancers and clients to utilize.
3825 // +optional
3826 Addresses []EndpointAddress `json:"addresses,omitempty" protobuf:"bytes,1,rep,name=addresses"`
3827 // IP addresses which offer the related ports but are not currently marked as ready
3828 // because they have not yet finished starting, have recently failed a readiness check,
3829 // or have recently failed a liveness check.
3830 // +optional
3831 NotReadyAddresses []EndpointAddress `json:"notReadyAddresses,omitempty" protobuf:"bytes,2,rep,name=notReadyAddresses"`
3832 // Port numbers available on the related IP addresses.
3833 // +optional
3834 Ports []EndpointPort `json:"ports,omitempty" protobuf:"bytes,3,rep,name=ports"`
3835}
3836
3837// EndpointAddress is a tuple that describes single IP address.
3838type EndpointAddress struct {
3839 // The IP of this endpoint.
3840 // May not be loopback (127.0.0.0/8), link-local (169.254.0.0/16),
3841 // or link-local multicast ((224.0.0.0/24).
3842 // IPv6 is also accepted but not fully supported on all platforms. Also, certain
3843 // kubernetes components, like kube-proxy, are not IPv6 ready.
3844 // TODO: This should allow hostname or IP, See #4447.
3845 IP string `json:"ip" protobuf:"bytes,1,opt,name=ip"`
3846 // The Hostname of this endpoint
3847 // +optional
3848 Hostname string `json:"hostname,omitempty" protobuf:"bytes,3,opt,name=hostname"`
3849 // Optional: Node hosting this endpoint. This can be used to determine endpoints local to a node.
3850 // +optional
3851 NodeName *string `json:"nodeName,omitempty" protobuf:"bytes,4,opt,name=nodeName"`
3852 // Reference to object providing the endpoint.
3853 // +optional
3854 TargetRef *ObjectReference `json:"targetRef,omitempty" protobuf:"bytes,2,opt,name=targetRef"`
3855}
3856
3857// EndpointPort is a tuple that describes a single port.
3858type EndpointPort struct {
3859 // The name of this port (corresponds to ServicePort.Name).
3860 // Must be a DNS_LABEL.
3861 // Optional only if one port is defined.
3862 // +optional
3863 Name string `json:"name,omitempty" protobuf:"bytes,1,opt,name=name"`
3864
3865 // The port number of the endpoint.
3866 Port int32 `json:"port" protobuf:"varint,2,opt,name=port"`
3867
3868 // The IP protocol for this port.
3869 // Must be UDP, TCP, or SCTP.
3870 // Default is TCP.
3871 // +optional
3872 Protocol Protocol `json:"protocol,omitempty" protobuf:"bytes,3,opt,name=protocol,casttype=Protocol"`
3873}
3874
3875// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
3876
3877// EndpointsList is a list of endpoints.
3878type EndpointsList struct {
3879 metav1.TypeMeta `json:",inline"`
3880 // Standard list metadata.
3881 // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds
3882 // +optional
3883 metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
3884
3885 // List of endpoints.
3886 Items []Endpoints `json:"items" protobuf:"bytes,2,rep,name=items"`
3887}
3888
3889// NodeSpec describes the attributes that a node is created with.
3890type NodeSpec struct {
3891 // PodCIDR represents the pod IP range assigned to the node.
3892 // +optional
3893 PodCIDR string `json:"podCIDR,omitempty" protobuf:"bytes,1,opt,name=podCIDR"`
3894 // ID of the node assigned by the cloud provider in the format: <ProviderName>://<ProviderSpecificNodeID>
3895 // +optional
3896 ProviderID string `json:"providerID,omitempty" protobuf:"bytes,3,opt,name=providerID"`
3897 // Unschedulable controls node schedulability of new pods. By default, node is schedulable.
3898 // More info: https://kubernetes.io/docs/concepts/nodes/node/#manual-node-administration
3899 // +optional
3900 Unschedulable bool `json:"unschedulable,omitempty" protobuf:"varint,4,opt,name=unschedulable"`
3901 // If specified, the node's taints.
3902 // +optional
3903 Taints []Taint `json:"taints,omitempty" protobuf:"bytes,5,opt,name=taints"`
3904 // If specified, the source to get node configuration from
3905 // The DynamicKubeletConfig feature gate must be enabled for the Kubelet to use this field
3906 // +optional
3907 ConfigSource *NodeConfigSource `json:"configSource,omitempty" protobuf:"bytes,6,opt,name=configSource"`
3908
3909 // Deprecated. Not all kubelets will set this field. Remove field after 1.13.
3910 // see: https://issues.k8s.io/61966
3911 // +optional
3912 DoNotUse_ExternalID string `json:"externalID,omitempty" protobuf:"bytes,2,opt,name=externalID"`
3913}
3914
3915// NodeConfigSource specifies a source of node configuration. Exactly one subfield (excluding metadata) must be non-nil.
3916type NodeConfigSource struct {
3917 // For historical context, regarding the below kind, apiVersion, and configMapRef deprecation tags:
3918 // 1. kind/apiVersion were used by the kubelet to persist this struct to disk (they had no protobuf tags)
3919 // 2. configMapRef and proto tag 1 were used by the API to refer to a configmap,
3920 // but used a generic ObjectReference type that didn't really have the fields we needed
3921 // All uses/persistence of the NodeConfigSource struct prior to 1.11 were gated by alpha feature flags,
3922 // so there was no persisted data for these fields that needed to be migrated/handled.
3923
3924 // +k8s:deprecated=kind
3925 // +k8s:deprecated=apiVersion
3926 // +k8s:deprecated=configMapRef,protobuf=1
3927
3928 // ConfigMap is a reference to a Node's ConfigMap
3929 ConfigMap *ConfigMapNodeConfigSource `json:"configMap,omitempty" protobuf:"bytes,2,opt,name=configMap"`
3930}
3931
3932// ConfigMapNodeConfigSource contains the information to reference a ConfigMap as a config source for the Node.
3933type ConfigMapNodeConfigSource struct {
3934 // Namespace is the metadata.namespace of the referenced ConfigMap.
3935 // This field is required in all cases.
3936 Namespace string `json:"namespace" protobuf:"bytes,1,opt,name=namespace"`
3937
3938 // Name is the metadata.name of the referenced ConfigMap.
3939 // This field is required in all cases.
3940 Name string `json:"name" protobuf:"bytes,2,opt,name=name"`
3941
3942 // UID is the metadata.UID of the referenced ConfigMap.
3943 // This field is forbidden in Node.Spec, and required in Node.Status.
3944 // +optional
3945 UID types.UID `json:"uid,omitempty" protobuf:"bytes,3,opt,name=uid"`
3946
3947 // ResourceVersion is the metadata.ResourceVersion of the referenced ConfigMap.
3948 // This field is forbidden in Node.Spec, and required in Node.Status.
3949 // +optional
3950 ResourceVersion string `json:"resourceVersion,omitempty" protobuf:"bytes,4,opt,name=resourceVersion"`
3951
3952 // KubeletConfigKey declares which key of the referenced ConfigMap corresponds to the KubeletConfiguration structure
3953 // This field is required in all cases.
3954 KubeletConfigKey string `json:"kubeletConfigKey" protobuf:"bytes,5,opt,name=kubeletConfigKey"`
3955}
3956
3957// DaemonEndpoint contains information about a single Daemon endpoint.
3958type DaemonEndpoint struct {
3959 /*
3960 The port tag was not properly in quotes in earlier releases, so it must be
3961 uppercased for backwards compat (since it was falling back to var name of
3962 'Port').
3963 */
3964
3965 // Port number of the given endpoint.
3966 Port int32 `json:"Port" protobuf:"varint,1,opt,name=Port"`
3967}
3968
3969// NodeDaemonEndpoints lists ports opened by daemons running on the Node.
3970type NodeDaemonEndpoints struct {
3971 // Endpoint on which Kubelet is listening.
3972 // +optional
3973 KubeletEndpoint DaemonEndpoint `json:"kubeletEndpoint,omitempty" protobuf:"bytes,1,opt,name=kubeletEndpoint"`
3974}
3975
3976// NodeSystemInfo is a set of ids/uuids to uniquely identify the node.
3977type NodeSystemInfo struct {
3978 // MachineID reported by the node. For unique machine identification
3979 // in the cluster this field is preferred. Learn more from man(5)
3980 // machine-id: http://man7.org/linux/man-pages/man5/machine-id.5.html
3981 MachineID string `json:"machineID" protobuf:"bytes,1,opt,name=machineID"`
3982 // SystemUUID reported by the node. For unique machine identification
3983 // MachineID is preferred. This field is specific to Red Hat hosts
3984 // https://access.redhat.com/documentation/en-US/Red_Hat_Subscription_Management/1/html/RHSM/getting-system-uuid.html
3985 SystemUUID string `json:"systemUUID" protobuf:"bytes,2,opt,name=systemUUID"`
3986 // Boot ID reported by the node.
3987 BootID string `json:"bootID" protobuf:"bytes,3,opt,name=bootID"`
3988 // Kernel Version reported by the node from 'uname -r' (e.g. 3.16.0-0.bpo.4-amd64).
3989 KernelVersion string `json:"kernelVersion" protobuf:"bytes,4,opt,name=kernelVersion"`
3990 // OS Image reported by the node from /etc/os-release (e.g. Debian GNU/Linux 7 (wheezy)).
3991 OSImage string `json:"osImage" protobuf:"bytes,5,opt,name=osImage"`
3992 // ContainerRuntime Version reported by the node through runtime remote API (e.g. docker://1.5.0).
3993 ContainerRuntimeVersion string `json:"containerRuntimeVersion" protobuf:"bytes,6,opt,name=containerRuntimeVersion"`
3994 // Kubelet Version reported by the node.
3995 KubeletVersion string `json:"kubeletVersion" protobuf:"bytes,7,opt,name=kubeletVersion"`
3996 // KubeProxy Version reported by the node.
3997 KubeProxyVersion string `json:"kubeProxyVersion" protobuf:"bytes,8,opt,name=kubeProxyVersion"`
3998 // The Operating System reported by the node
3999 OperatingSystem string `json:"operatingSystem" protobuf:"bytes,9,opt,name=operatingSystem"`
4000 // The Architecture reported by the node
4001 Architecture string `json:"architecture" protobuf:"bytes,10,opt,name=architecture"`
4002}
4003
4004// NodeConfigStatus describes the status of the config assigned by Node.Spec.ConfigSource.
4005type NodeConfigStatus struct {
4006 // Assigned reports the checkpointed config the node will try to use.
4007 // When Node.Spec.ConfigSource is updated, the node checkpoints the associated
4008 // config payload to local disk, along with a record indicating intended
4009 // config. The node refers to this record to choose its config checkpoint, and
4010 // reports this record in Assigned. Assigned only updates in the status after
4011 // the record has been checkpointed to disk. When the Kubelet is restarted,
4012 // it tries to make the Assigned config the Active config by loading and
4013 // validating the checkpointed payload identified by Assigned.
4014 // +optional
4015 Assigned *NodeConfigSource `json:"assigned,omitempty" protobuf:"bytes,1,opt,name=assigned"`
4016 // Active reports the checkpointed config the node is actively using.
4017 // Active will represent either the current version of the Assigned config,
4018 // or the current LastKnownGood config, depending on whether attempting to use the
4019 // Assigned config results in an error.
4020 // +optional
4021 Active *NodeConfigSource `json:"active,omitempty" protobuf:"bytes,2,opt,name=active"`
4022 // LastKnownGood reports the checkpointed config the node will fall back to
4023 // when it encounters an error attempting to use the Assigned config.
4024 // The Assigned config becomes the LastKnownGood config when the node determines
4025 // that the Assigned config is stable and correct.
4026 // This is currently implemented as a 10-minute soak period starting when the local
4027 // record of Assigned config is updated. If the Assigned config is Active at the end
4028 // of this period, it becomes the LastKnownGood. Note that if Spec.ConfigSource is
4029 // reset to nil (use local defaults), the LastKnownGood is also immediately reset to nil,
4030 // because the local default config is always assumed good.
4031 // You should not make assumptions about the node's method of determining config stability
4032 // and correctness, as this may change or become configurable in the future.
4033 // +optional
4034 LastKnownGood *NodeConfigSource `json:"lastKnownGood,omitempty" protobuf:"bytes,3,opt,name=lastKnownGood"`
4035 // Error describes any problems reconciling the Spec.ConfigSource to the Active config.
4036 // Errors may occur, for example, attempting to checkpoint Spec.ConfigSource to the local Assigned
4037 // record, attempting to checkpoint the payload associated with Spec.ConfigSource, attempting
4038 // to load or validate the Assigned config, etc.
4039 // Errors may occur at different points while syncing config. Earlier errors (e.g. download or
4040 // checkpointing errors) will not result in a rollback to LastKnownGood, and may resolve across
4041 // Kubelet retries. Later errors (e.g. loading or validating a checkpointed config) will result in
4042 // a rollback to LastKnownGood. In the latter case, it is usually possible to resolve the error
4043 // by fixing the config assigned in Spec.ConfigSource.
4044 // You can find additional information for debugging by searching the error message in the Kubelet log.
4045 // Error is a human-readable description of the error state; machines can check whether or not Error
4046 // is empty, but should not rely on the stability of the Error text across Kubelet versions.
4047 // +optional
4048 Error string `json:"error,omitempty" protobuf:"bytes,4,opt,name=error"`
4049}
4050
4051// NodeStatus is information about the current status of a node.
4052type NodeStatus struct {
4053 // Capacity represents the total resources of a node.
4054 // More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#capacity
4055 // +optional
4056 Capacity ResourceList `json:"capacity,omitempty" protobuf:"bytes,1,rep,name=capacity,casttype=ResourceList,castkey=ResourceName"`
4057 // Allocatable represents the resources of a node that are available for scheduling.
4058 // Defaults to Capacity.
4059 // +optional
4060 Allocatable ResourceList `json:"allocatable,omitempty" protobuf:"bytes,2,rep,name=allocatable,casttype=ResourceList,castkey=ResourceName"`
4061 // NodePhase is the recently observed lifecycle phase of the node.
4062 // More info: https://kubernetes.io/docs/concepts/nodes/node/#phase
4063 // The field is never populated, and now is deprecated.
4064 // +optional
4065 Phase NodePhase `json:"phase,omitempty" protobuf:"bytes,3,opt,name=phase,casttype=NodePhase"`
4066 // Conditions is an array of current observed node conditions.
4067 // More info: https://kubernetes.io/docs/concepts/nodes/node/#condition
4068 // +optional
4069 // +patchMergeKey=type
4070 // +patchStrategy=merge
4071 Conditions []NodeCondition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type" protobuf:"bytes,4,rep,name=conditions"`
4072 // List of addresses reachable to the node.
4073 // Queried from cloud provider, if available.
4074 // More info: https://kubernetes.io/docs/concepts/nodes/node/#addresses
4075 // +optional
4076 // +patchMergeKey=type
4077 // +patchStrategy=merge
4078 Addresses []NodeAddress `json:"addresses,omitempty" patchStrategy:"merge" patchMergeKey:"type" protobuf:"bytes,5,rep,name=addresses"`
4079 // Endpoints of daemons running on the Node.
4080 // +optional
4081 DaemonEndpoints NodeDaemonEndpoints `json:"daemonEndpoints,omitempty" protobuf:"bytes,6,opt,name=daemonEndpoints"`
4082 // Set of ids/uuids to uniquely identify the node.
4083 // More info: https://kubernetes.io/docs/concepts/nodes/node/#info
4084 // +optional
4085 NodeInfo NodeSystemInfo `json:"nodeInfo,omitempty" protobuf:"bytes,7,opt,name=nodeInfo"`
4086 // List of container images on this node
4087 // +optional
4088 Images []ContainerImage `json:"images,omitempty" protobuf:"bytes,8,rep,name=images"`
4089 // List of attachable volumes in use (mounted) by the node.
4090 // +optional
4091 VolumesInUse []UniqueVolumeName `json:"volumesInUse,omitempty" protobuf:"bytes,9,rep,name=volumesInUse"`
4092 // List of volumes that are attached to the node.
4093 // +optional
4094 VolumesAttached []AttachedVolume `json:"volumesAttached,omitempty" protobuf:"bytes,10,rep,name=volumesAttached"`
4095 // Status of the config assigned to the node via the dynamic Kubelet config feature.
4096 // +optional
4097 Config *NodeConfigStatus `json:"config,omitempty" protobuf:"bytes,11,opt,name=config"`
4098}
4099
4100type UniqueVolumeName string
4101
4102// AttachedVolume describes a volume attached to a node
4103type AttachedVolume struct {
4104 // Name of the attached volume
4105 Name UniqueVolumeName `json:"name" protobuf:"bytes,1,rep,name=name"`
4106
4107 // DevicePath represents the device path where the volume should be available
4108 DevicePath string `json:"devicePath" protobuf:"bytes,2,rep,name=devicePath"`
4109}
4110
4111// AvoidPods describes pods that should avoid this node. This is the value for a
4112// Node annotation with key scheduler.alpha.kubernetes.io/preferAvoidPods and
4113// will eventually become a field of NodeStatus.
4114type AvoidPods struct {
4115 // Bounded-sized list of signatures of pods that should avoid this node, sorted
4116 // in timestamp order from oldest to newest. Size of the slice is unspecified.
4117 // +optional
4118 PreferAvoidPods []PreferAvoidPodsEntry `json:"preferAvoidPods,omitempty" protobuf:"bytes,1,rep,name=preferAvoidPods"`
4119}
4120
4121// Describes a class of pods that should avoid this node.
4122type PreferAvoidPodsEntry struct {
4123 // The class of pods.
4124 PodSignature PodSignature `json:"podSignature" protobuf:"bytes,1,opt,name=podSignature"`
4125 // Time at which this entry was added to the list.
4126 // +optional
4127 EvictionTime metav1.Time `json:"evictionTime,omitempty" protobuf:"bytes,2,opt,name=evictionTime"`
4128 // (brief) reason why this entry was added to the list.
4129 // +optional
4130 Reason string `json:"reason,omitempty" protobuf:"bytes,3,opt,name=reason"`
4131 // Human readable message indicating why this entry was added to the list.
4132 // +optional
4133 Message string `json:"message,omitempty" protobuf:"bytes,4,opt,name=message"`
4134}
4135
4136// Describes the class of pods that should avoid this node.
4137// Exactly one field should be set.
4138type PodSignature struct {
4139 // Reference to controller whose pods should avoid this node.
4140 // +optional
4141 PodController *metav1.OwnerReference `json:"podController,omitempty" protobuf:"bytes,1,opt,name=podController"`
4142}
4143
4144// Describe a container image
4145type ContainerImage struct {
4146 // Names by which this image is known.
4147 // e.g. ["k8s.gcr.io/hyperkube:v1.0.7", "dockerhub.io/google_containers/hyperkube:v1.0.7"]
4148 Names []string `json:"names" protobuf:"bytes,1,rep,name=names"`
4149 // The size of the image in bytes.
4150 // +optional
4151 SizeBytes int64 `json:"sizeBytes,omitempty" protobuf:"varint,2,opt,name=sizeBytes"`
4152}
4153
4154type NodePhase string
4155
4156// These are the valid phases of node.
4157const (
4158 // NodePending means the node has been created/added by the system, but not configured.
4159 NodePending NodePhase = "Pending"
4160 // NodeRunning means the node has been configured and has Kubernetes components running.
4161 NodeRunning NodePhase = "Running"
4162 // NodeTerminated means the node has been removed from the cluster.
4163 NodeTerminated NodePhase = "Terminated"
4164)
4165
4166type NodeConditionType string
4167
4168// These are valid conditions of node. Currently, we don't have enough information to decide
4169// node condition. In the future, we will add more. The proposed set of conditions are:
4170// NodeReachable, NodeLive, NodeReady, NodeSchedulable, NodeRunnable.
4171const (
4172 // NodeReady means kubelet is healthy and ready to accept pods.
4173 NodeReady NodeConditionType = "Ready"
4174 // NodeOutOfDisk means the kubelet will not accept new pods due to insufficient free disk
4175 // space on the node.
4176 NodeOutOfDisk NodeConditionType = "OutOfDisk"
4177 // NodeMemoryPressure means the kubelet is under pressure due to insufficient available memory.
4178 NodeMemoryPressure NodeConditionType = "MemoryPressure"
4179 // NodeDiskPressure means the kubelet is under pressure due to insufficient available disk.
4180 NodeDiskPressure NodeConditionType = "DiskPressure"
4181 // NodePIDPressure means the kubelet is under pressure due to insufficient available PID.
4182 NodePIDPressure NodeConditionType = "PIDPressure"
4183 // NodeNetworkUnavailable means that network for the node is not correctly configured.
4184 NodeNetworkUnavailable NodeConditionType = "NetworkUnavailable"
4185)
4186
4187// NodeCondition contains condition information for a node.
4188type NodeCondition struct {
4189 // Type of node condition.
4190 Type NodeConditionType `json:"type" protobuf:"bytes,1,opt,name=type,casttype=NodeConditionType"`
4191 // Status of the condition, one of True, False, Unknown.
4192 Status ConditionStatus `json:"status" protobuf:"bytes,2,opt,name=status,casttype=ConditionStatus"`
4193 // Last time we got an update on a given condition.
4194 // +optional
4195 LastHeartbeatTime metav1.Time `json:"lastHeartbeatTime,omitempty" protobuf:"bytes,3,opt,name=lastHeartbeatTime"`
4196 // Last time the condition transit from one status to another.
4197 // +optional
4198 LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty" protobuf:"bytes,4,opt,name=lastTransitionTime"`
4199 // (brief) reason for the condition's last transition.
4200 // +optional
4201 Reason string `json:"reason,omitempty" protobuf:"bytes,5,opt,name=reason"`
4202 // Human readable message indicating details about last transition.
4203 // +optional
4204 Message string `json:"message,omitempty" protobuf:"bytes,6,opt,name=message"`
4205}
4206
4207type NodeAddressType string
4208
4209// These are valid address type of node.
4210const (
4211 NodeHostName NodeAddressType = "Hostname"
4212 NodeExternalIP NodeAddressType = "ExternalIP"
4213 NodeInternalIP NodeAddressType = "InternalIP"
4214 NodeExternalDNS NodeAddressType = "ExternalDNS"
4215 NodeInternalDNS NodeAddressType = "InternalDNS"
4216)
4217
4218// NodeAddress contains information for the node's address.
4219type NodeAddress struct {
4220 // Node address type, one of Hostname, ExternalIP or InternalIP.
4221 Type NodeAddressType `json:"type" protobuf:"bytes,1,opt,name=type,casttype=NodeAddressType"`
4222 // The node address.
4223 Address string `json:"address" protobuf:"bytes,2,opt,name=address"`
4224}
4225
4226// ResourceName is the name identifying various resources in a ResourceList.
4227type ResourceName string
4228
4229// Resource names must be not more than 63 characters, consisting of upper- or lower-case alphanumeric characters,
4230// with the -, _, and . characters allowed anywhere, except the first or last character.
4231// The default convention, matching that for annotations, is to use lower-case names, with dashes, rather than
4232// camel case, separating compound words.
4233// Fully-qualified resource typenames are constructed from a DNS-style subdomain, followed by a slash `/` and a name.
4234const (
4235 // CPU, in cores. (500m = .5 cores)
4236 ResourceCPU ResourceName = "cpu"
4237 // Memory, in bytes. (500Gi = 500GiB = 500 * 1024 * 1024 * 1024)
4238 ResourceMemory ResourceName = "memory"
4239 // Volume size, in bytes (e,g. 5Gi = 5GiB = 5 * 1024 * 1024 * 1024)
4240 ResourceStorage ResourceName = "storage"
4241 // Local ephemeral storage, in bytes. (500Gi = 500GiB = 500 * 1024 * 1024 * 1024)
4242 // The resource name for ResourceEphemeralStorage is alpha and it can change across releases.
4243 ResourceEphemeralStorage ResourceName = "ephemeral-storage"
4244)
4245
4246const (
4247 // Default namespace prefix.
4248 ResourceDefaultNamespacePrefix = "kubernetes.io/"
4249 // Name prefix for huge page resources (alpha).
4250 ResourceHugePagesPrefix = "hugepages-"
4251 // Name prefix for storage resource limits
4252 ResourceAttachableVolumesPrefix = "attachable-volumes-"
4253)
4254
4255// ResourceList is a set of (resource name, quantity) pairs.
4256type ResourceList map[ResourceName]resource.Quantity
4257
4258// +genclient
4259// +genclient:nonNamespaced
4260// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
4261
4262// Node is a worker node in Kubernetes.
4263// Each node will have a unique identifier in the cache (i.e. in etcd).
4264type Node struct {
4265 metav1.TypeMeta `json:",inline"`
4266 // Standard object's metadata.
4267 // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
4268 // +optional
4269 metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
4270
4271 // Spec defines the behavior of a node.
4272 // https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status
4273 // +optional
4274 Spec NodeSpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"`
4275
4276 // Most recently observed status of the node.
4277 // Populated by the system.
4278 // Read-only.
4279 // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status
4280 // +optional
4281 Status NodeStatus `json:"status,omitempty" protobuf:"bytes,3,opt,name=status"`
4282}
4283
4284// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
4285
4286// NodeList is the whole list of all Nodes which have been registered with master.
4287type NodeList struct {
4288 metav1.TypeMeta `json:",inline"`
4289 // Standard list metadata.
4290 // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds
4291 // +optional
4292 metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
4293
4294 // List of nodes
4295 Items []Node `json:"items" protobuf:"bytes,2,rep,name=items"`
4296}
4297
4298// FinalizerName is the name identifying a finalizer during namespace lifecycle.
4299type FinalizerName string
4300
4301// These are internal finalizer values to Kubernetes, must be qualified name unless defined here or
4302// in metav1.
4303const (
4304 FinalizerKubernetes FinalizerName = "kubernetes"
4305)
4306
4307// NamespaceSpec describes the attributes on a Namespace.
4308type NamespaceSpec struct {
4309 // Finalizers is an opaque list of values that must be empty to permanently remove object from storage.
4310 // More info: https://kubernetes.io/docs/tasks/administer-cluster/namespaces/
4311 // +optional
4312 Finalizers []FinalizerName `json:"finalizers,omitempty" protobuf:"bytes,1,rep,name=finalizers,casttype=FinalizerName"`
4313}
4314
4315// NamespaceStatus is information about the current status of a Namespace.
4316type NamespaceStatus struct {
4317 // Phase is the current lifecycle phase of the namespace.
4318 // More info: https://kubernetes.io/docs/tasks/administer-cluster/namespaces/
4319 // +optional
4320 Phase NamespacePhase `json:"phase,omitempty" protobuf:"bytes,1,opt,name=phase,casttype=NamespacePhase"`
4321}
4322
4323type NamespacePhase string
4324
4325// These are the valid phases of a namespace.
4326const (
4327 // NamespaceActive means the namespace is available for use in the system
4328 NamespaceActive NamespacePhase = "Active"
4329 // NamespaceTerminating means the namespace is undergoing graceful termination
4330 NamespaceTerminating NamespacePhase = "Terminating"
4331)
4332
4333// +genclient
4334// +genclient:nonNamespaced
4335// +genclient:skipVerbs=deleteCollection
4336// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
4337
4338// Namespace provides a scope for Names.
4339// Use of multiple namespaces is optional.
4340type Namespace struct {
4341 metav1.TypeMeta `json:",inline"`
4342 // Standard object's metadata.
4343 // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
4344 // +optional
4345 metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
4346
4347 // Spec defines the behavior of the Namespace.
4348 // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status
4349 // +optional
4350 Spec NamespaceSpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"`
4351
4352 // Status describes the current status of a Namespace.
4353 // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status
4354 // +optional
4355 Status NamespaceStatus `json:"status,omitempty" protobuf:"bytes,3,opt,name=status"`
4356}
4357
4358// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
4359
4360// NamespaceList is a list of Namespaces.
4361type NamespaceList struct {
4362 metav1.TypeMeta `json:",inline"`
4363 // Standard list metadata.
4364 // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds
4365 // +optional
4366 metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
4367
4368 // Items is the list of Namespace objects in the list.
4369 // More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/
4370 Items []Namespace `json:"items" protobuf:"bytes,2,rep,name=items"`
4371}
4372
4373// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
4374
4375// Binding ties one object to another; for example, a pod is bound to a node by a scheduler.
4376// Deprecated in 1.7, please use the bindings subresource of pods instead.
4377type Binding struct {
4378 metav1.TypeMeta `json:",inline"`
4379 // Standard object's metadata.
4380 // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
4381 // +optional
4382 metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
4383
4384 // The target object that you want to bind to the standard object.
4385 Target ObjectReference `json:"target" protobuf:"bytes,2,opt,name=target"`
4386}
4387
4388// Preconditions must be fulfilled before an operation (update, delete, etc.) is carried out.
4389// +k8s:openapi-gen=false
4390type Preconditions struct {
4391 // Specifies the target UID.
4392 // +optional
4393 UID *types.UID `json:"uid,omitempty" protobuf:"bytes,1,opt,name=uid,casttype=k8s.io/apimachinery/pkg/types.UID"`
4394}
4395
4396// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
4397
4398// PodLogOptions is the query options for a Pod's logs REST call.
4399type PodLogOptions struct {
4400 metav1.TypeMeta `json:",inline"`
4401
4402 // The container for which to stream logs. Defaults to only container if there is one container in the pod.
4403 // +optional
4404 Container string `json:"container,omitempty" protobuf:"bytes,1,opt,name=container"`
4405 // Follow the log stream of the pod. Defaults to false.
4406 // +optional
4407 Follow bool `json:"follow,omitempty" protobuf:"varint,2,opt,name=follow"`
4408 // Return previous terminated container logs. Defaults to false.
4409 // +optional
4410 Previous bool `json:"previous,omitempty" protobuf:"varint,3,opt,name=previous"`
4411 // A relative time in seconds before the current time from which to show logs. If this value
4412 // precedes the time a pod was started, only logs since the pod start will be returned.
4413 // If this value is in the future, no logs will be returned.
4414 // Only one of sinceSeconds or sinceTime may be specified.
4415 // +optional
4416 SinceSeconds *int64 `json:"sinceSeconds,omitempty" protobuf:"varint,4,opt,name=sinceSeconds"`
4417 // An RFC3339 timestamp from which to show logs. If this value
4418 // precedes the time a pod was started, only logs since the pod start will be returned.
4419 // If this value is in the future, no logs will be returned.
4420 // Only one of sinceSeconds or sinceTime may be specified.
4421 // +optional
4422 SinceTime *metav1.Time `json:"sinceTime,omitempty" protobuf:"bytes,5,opt,name=sinceTime"`
4423 // If true, add an RFC3339 or RFC3339Nano timestamp at the beginning of every line
4424 // of log output. Defaults to false.
4425 // +optional
4426 Timestamps bool `json:"timestamps,omitempty" protobuf:"varint,6,opt,name=timestamps"`
4427 // If set, the number of lines from the end of the logs to show. If not specified,
4428 // logs are shown from the creation of the container or sinceSeconds or sinceTime
4429 // +optional
4430 TailLines *int64 `json:"tailLines,omitempty" protobuf:"varint,7,opt,name=tailLines"`
4431 // If set, the number of bytes to read from the server before terminating the
4432 // log output. This may not display a complete final line of logging, and may return
4433 // slightly more or slightly less than the specified limit.
4434 // +optional
4435 LimitBytes *int64 `json:"limitBytes,omitempty" protobuf:"varint,8,opt,name=limitBytes"`
4436}
4437
4438// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
4439
4440// PodAttachOptions is the query options to a Pod's remote attach call.
4441// ---
4442// TODO: merge w/ PodExecOptions below for stdin, stdout, etc
4443// and also when we cut V2, we should export a "StreamOptions" or somesuch that contains Stdin, Stdout, Stder and TTY
4444type PodAttachOptions struct {
4445 metav1.TypeMeta `json:",inline"`
4446
4447 // Stdin if true, redirects the standard input stream of the pod for this call.
4448 // Defaults to false.
4449 // +optional
4450 Stdin bool `json:"stdin,omitempty" protobuf:"varint,1,opt,name=stdin"`
4451
4452 // Stdout if true indicates that stdout is to be redirected for the attach call.
4453 // Defaults to true.
4454 // +optional
4455 Stdout bool `json:"stdout,omitempty" protobuf:"varint,2,opt,name=stdout"`
4456
4457 // Stderr if true indicates that stderr is to be redirected for the attach call.
4458 // Defaults to true.
4459 // +optional
4460 Stderr bool `json:"stderr,omitempty" protobuf:"varint,3,opt,name=stderr"`
4461
4462 // TTY if true indicates that a tty will be allocated for the attach call.
4463 // This is passed through the container runtime so the tty
4464 // is allocated on the worker node by the container runtime.
4465 // Defaults to false.
4466 // +optional
4467 TTY bool `json:"tty,omitempty" protobuf:"varint,4,opt,name=tty"`
4468
4469 // The container in which to execute the command.
4470 // Defaults to only container if there is only one container in the pod.
4471 // +optional
4472 Container string `json:"container,omitempty" protobuf:"bytes,5,opt,name=container"`
4473}
4474
4475// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
4476
4477// PodExecOptions is the query options to a Pod's remote exec call.
4478// ---
4479// TODO: This is largely identical to PodAttachOptions above, make sure they stay in sync and see about merging
4480// and also when we cut V2, we should export a "StreamOptions" or somesuch that contains Stdin, Stdout, Stder and TTY
4481type PodExecOptions struct {
4482 metav1.TypeMeta `json:",inline"`
4483
4484 // Redirect the standard input stream of the pod for this call.
4485 // Defaults to false.
4486 // +optional
4487 Stdin bool `json:"stdin,omitempty" protobuf:"varint,1,opt,name=stdin"`
4488
4489 // Redirect the standard output stream of the pod for this call.
4490 // Defaults to true.
4491 // +optional
4492 Stdout bool `json:"stdout,omitempty" protobuf:"varint,2,opt,name=stdout"`
4493
4494 // Redirect the standard error stream of the pod for this call.
4495 // Defaults to true.
4496 // +optional
4497 Stderr bool `json:"stderr,omitempty" protobuf:"varint,3,opt,name=stderr"`
4498
4499 // TTY if true indicates that a tty will be allocated for the exec call.
4500 // Defaults to false.
4501 // +optional
4502 TTY bool `json:"tty,omitempty" protobuf:"varint,4,opt,name=tty"`
4503
4504 // Container in which to execute the command.
4505 // Defaults to only container if there is only one container in the pod.
4506 // +optional
4507 Container string `json:"container,omitempty" protobuf:"bytes,5,opt,name=container"`
4508
4509 // Command is the remote command to execute. argv array. Not executed within a shell.
4510 Command []string `json:"command" protobuf:"bytes,6,rep,name=command"`
4511}
4512
4513// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
4514
4515// PodPortForwardOptions is the query options to a Pod's port forward call
4516// when using WebSockets.
4517// The `port` query parameter must specify the port or
4518// ports (comma separated) to forward over.
4519// Port forwarding over SPDY does not use these options. It requires the port
4520// to be passed in the `port` header as part of request.
4521type PodPortForwardOptions struct {
4522 metav1.TypeMeta `json:",inline"`
4523
4524 // List of ports to forward
4525 // Required when using WebSockets
4526 // +optional
4527 Ports []int32 `json:"ports,omitempty" protobuf:"varint,1,rep,name=ports"`
4528}
4529
4530// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
4531
4532// PodProxyOptions is the query options to a Pod's proxy call.
4533type PodProxyOptions struct {
4534 metav1.TypeMeta `json:",inline"`
4535
4536 // Path is the URL path to use for the current proxy request to pod.
4537 // +optional
4538 Path string `json:"path,omitempty" protobuf:"bytes,1,opt,name=path"`
4539}
4540
4541// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
4542
4543// NodeProxyOptions is the query options to a Node's proxy call.
4544type NodeProxyOptions struct {
4545 metav1.TypeMeta `json:",inline"`
4546
4547 // Path is the URL path to use for the current proxy request to node.
4548 // +optional
4549 Path string `json:"path,omitempty" protobuf:"bytes,1,opt,name=path"`
4550}
4551
4552// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
4553
4554// ServiceProxyOptions is the query options to a Service's proxy call.
4555type ServiceProxyOptions struct {
4556 metav1.TypeMeta `json:",inline"`
4557
4558 // Path is the part of URLs that include service endpoints, suffixes,
4559 // and parameters to use for the current proxy request to service.
4560 // For example, the whole request URL is
4561 // http://localhost/api/v1/namespaces/kube-system/services/elasticsearch-logging/_search?q=user:kimchy.
4562 // Path is _search?q=user:kimchy.
4563 // +optional
4564 Path string `json:"path,omitempty" protobuf:"bytes,1,opt,name=path"`
4565}
4566
4567// ObjectReference contains enough information to let you inspect or modify the referred object.
4568// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
4569type ObjectReference struct {
4570 // Kind of the referent.
4571 // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds
4572 // +optional
4573 Kind string `json:"kind,omitempty" protobuf:"bytes,1,opt,name=kind"`
4574 // Namespace of the referent.
4575 // More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/
4576 // +optional
4577 Namespace string `json:"namespace,omitempty" protobuf:"bytes,2,opt,name=namespace"`
4578 // Name of the referent.
4579 // More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
4580 // +optional
4581 Name string `json:"name,omitempty" protobuf:"bytes,3,opt,name=name"`
4582 // UID of the referent.
4583 // More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids
4584 // +optional
4585 UID types.UID `json:"uid,omitempty" protobuf:"bytes,4,opt,name=uid,casttype=k8s.io/apimachinery/pkg/types.UID"`
4586 // API version of the referent.
4587 // +optional
4588 APIVersion string `json:"apiVersion,omitempty" protobuf:"bytes,5,opt,name=apiVersion"`
4589 // Specific resourceVersion to which this reference is made, if any.
4590 // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#concurrency-control-and-consistency
4591 // +optional
4592 ResourceVersion string `json:"resourceVersion,omitempty" protobuf:"bytes,6,opt,name=resourceVersion"`
4593
4594 // If referring to a piece of an object instead of an entire object, this string
4595 // should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2].
4596 // For example, if the object reference is to a container within a pod, this would take on a value like:
4597 // "spec.containers{name}" (where "name" refers to the name of the container that triggered
4598 // the event) or if no container name is specified "spec.containers[2]" (container with
4599 // index 2 in this pod). This syntax is chosen only to have some well-defined way of
4600 // referencing a part of an object.
4601 // TODO: this design is not final and this field is subject to change in the future.
4602 // +optional
4603 FieldPath string `json:"fieldPath,omitempty" protobuf:"bytes,7,opt,name=fieldPath"`
4604}
4605
4606// LocalObjectReference contains enough information to let you locate the
4607// referenced object inside the same namespace.
4608type LocalObjectReference struct {
4609 // Name of the referent.
4610 // More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
4611 // TODO: Add other useful fields. apiVersion, kind, uid?
4612 // +optional
4613 Name string `json:"name,omitempty" protobuf:"bytes,1,opt,name=name"`
4614}
4615
4616// TypedLocalObjectReference contains enough information to let you locate the
4617// typed referenced object inside the same namespace.
4618type TypedLocalObjectReference struct {
4619 // APIGroup is the group for the resource being referenced.
4620 // If APIGroup is not specified, the specified Kind must be in the core API group.
4621 // For any other third-party types, APIGroup is required.
4622 // +optional
4623 APIGroup *string `json:"apiGroup" protobuf:"bytes,1,opt,name=apiGroup"`
4624 // Kind is the type of resource being referenced
4625 Kind string `json:"kind" protobuf:"bytes,2,opt,name=kind"`
4626 // Name is the name of resource being referenced
4627 Name string `json:"name" protobuf:"bytes,3,opt,name=name"`
4628}
4629
4630// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
4631
4632// SerializedReference is a reference to serialized object.
4633type SerializedReference struct {
4634 metav1.TypeMeta `json:",inline"`
4635 // The reference to an object in the system.
4636 // +optional
4637 Reference ObjectReference `json:"reference,omitempty" protobuf:"bytes,1,opt,name=reference"`
4638}
4639
4640// EventSource contains information for an event.
4641type EventSource struct {
4642 // Component from which the event is generated.
4643 // +optional
4644 Component string `json:"component,omitempty" protobuf:"bytes,1,opt,name=component"`
4645 // Node name on which the event is generated.
4646 // +optional
4647 Host string `json:"host,omitempty" protobuf:"bytes,2,opt,name=host"`
4648}
4649
4650// Valid values for event types (new types could be added in future)
4651const (
4652 // Information only and will not cause any problems
4653 EventTypeNormal string = "Normal"
4654 // These events are to warn that something might go wrong
4655 EventTypeWarning string = "Warning"
4656)
4657
4658// +genclient
4659// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
4660
4661// Event is a report of an event somewhere in the cluster.
4662type Event struct {
4663 metav1.TypeMeta `json:",inline"`
4664 // Standard object's metadata.
4665 // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
4666 metav1.ObjectMeta `json:"metadata" protobuf:"bytes,1,opt,name=metadata"`
4667
4668 // The object that this event is about.
4669 InvolvedObject ObjectReference `json:"involvedObject" protobuf:"bytes,2,opt,name=involvedObject"`
4670
4671 // This should be a short, machine understandable string that gives the reason
4672 // for the transition into the object's current status.
4673 // TODO: provide exact specification for format.
4674 // +optional
4675 Reason string `json:"reason,omitempty" protobuf:"bytes,3,opt,name=reason"`
4676
4677 // A human-readable description of the status of this operation.
4678 // TODO: decide on maximum length.
4679 // +optional
4680 Message string `json:"message,omitempty" protobuf:"bytes,4,opt,name=message"`
4681
4682 // The component reporting this event. Should be a short machine understandable string.
4683 // +optional
4684 Source EventSource `json:"source,omitempty" protobuf:"bytes,5,opt,name=source"`
4685
4686 // The time at which the event was first recorded. (Time of server receipt is in TypeMeta.)
4687 // +optional
4688 FirstTimestamp metav1.Time `json:"firstTimestamp,omitempty" protobuf:"bytes,6,opt,name=firstTimestamp"`
4689
4690 // The time at which the most recent occurrence of this event was recorded.
4691 // +optional
4692 LastTimestamp metav1.Time `json:"lastTimestamp,omitempty" protobuf:"bytes,7,opt,name=lastTimestamp"`
4693
4694 // The number of times this event has occurred.
4695 // +optional
4696 Count int32 `json:"count,omitempty" protobuf:"varint,8,opt,name=count"`
4697
4698 // Type of this event (Normal, Warning), new types could be added in the future
4699 // +optional
4700 Type string `json:"type,omitempty" protobuf:"bytes,9,opt,name=type"`
4701
4702 // Time when this Event was first observed.
4703 // +optional
4704 EventTime metav1.MicroTime `json:"eventTime,omitempty" protobuf:"bytes,10,opt,name=eventTime"`
4705
4706 // Data about the Event series this event represents or nil if it's a singleton Event.
4707 // +optional
4708 Series *EventSeries `json:"series,omitempty" protobuf:"bytes,11,opt,name=series"`
4709
4710 // What action was taken/failed regarding to the Regarding object.
4711 // +optional
4712 Action string `json:"action,omitempty" protobuf:"bytes,12,opt,name=action"`
4713
4714 // Optional secondary object for more complex actions.
4715 // +optional
4716 Related *ObjectReference `json:"related,omitempty" protobuf:"bytes,13,opt,name=related"`
4717
4718 // Name of the controller that emitted this Event, e.g. `kubernetes.io/kubelet`.
4719 // +optional
4720 ReportingController string `json:"reportingComponent" protobuf:"bytes,14,opt,name=reportingComponent"`
4721
4722 // ID of the controller instance, e.g. `kubelet-xyzf`.
4723 // +optional
4724 ReportingInstance string `json:"reportingInstance" protobuf:"bytes,15,opt,name=reportingInstance"`
4725}
4726
4727// EventSeries contain information on series of events, i.e. thing that was/is happening
4728// continuously for some time.
4729type EventSeries struct {
4730 // Number of occurrences in this series up to the last heartbeat time
4731 Count int32 `json:"count,omitempty" protobuf:"varint,1,name=count"`
4732 // Time of the last occurrence observed
4733 LastObservedTime metav1.MicroTime `json:"lastObservedTime,omitempty" protobuf:"bytes,2,name=lastObservedTime"`
4734 // State of this Series: Ongoing or Finished
4735 // Deprecated. Planned removal for 1.18
4736 State EventSeriesState `json:"state,omitempty" protobuf:"bytes,3,name=state"`
4737}
4738
4739type EventSeriesState string
4740
4741const (
4742 EventSeriesStateOngoing EventSeriesState = "Ongoing"
4743 EventSeriesStateFinished EventSeriesState = "Finished"
4744 EventSeriesStateUnknown EventSeriesState = "Unknown"
4745)
4746
4747// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
4748
4749// EventList is a list of events.
4750type EventList struct {
4751 metav1.TypeMeta `json:",inline"`
4752 // Standard list metadata.
4753 // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds
4754 // +optional
4755 metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
4756
4757 // List of events
4758 Items []Event `json:"items" protobuf:"bytes,2,rep,name=items"`
4759}
4760
4761// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
4762
4763// List holds a list of objects, which may not be known by the server.
4764type List metav1.List
4765
4766// LimitType is a type of object that is limited
4767type LimitType string
4768
4769const (
4770 // Limit that applies to all pods in a namespace
4771 LimitTypePod LimitType = "Pod"
4772 // Limit that applies to all containers in a namespace
4773 LimitTypeContainer LimitType = "Container"
4774 // Limit that applies to all persistent volume claims in a namespace
4775 LimitTypePersistentVolumeClaim LimitType = "PersistentVolumeClaim"
4776)
4777
4778// LimitRangeItem defines a min/max usage limit for any resource that matches on kind.
4779type LimitRangeItem struct {
4780 // Type of resource that this limit applies to.
4781 // +optional
4782 Type LimitType `json:"type,omitempty" protobuf:"bytes,1,opt,name=type,casttype=LimitType"`
4783 // Max usage constraints on this kind by resource name.
4784 // +optional
4785 Max ResourceList `json:"max,omitempty" protobuf:"bytes,2,rep,name=max,casttype=ResourceList,castkey=ResourceName"`
4786 // Min usage constraints on this kind by resource name.
4787 // +optional
4788 Min ResourceList `json:"min,omitempty" protobuf:"bytes,3,rep,name=min,casttype=ResourceList,castkey=ResourceName"`
4789 // Default resource requirement limit value by resource name if resource limit is omitted.
4790 // +optional
4791 Default ResourceList `json:"default,omitempty" protobuf:"bytes,4,rep,name=default,casttype=ResourceList,castkey=ResourceName"`
4792 // DefaultRequest is the default resource requirement request value by resource name if resource request is omitted.
4793 // +optional
4794 DefaultRequest ResourceList `json:"defaultRequest,omitempty" protobuf:"bytes,5,rep,name=defaultRequest,casttype=ResourceList,castkey=ResourceName"`
4795 // 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.
4796 // +optional
4797 MaxLimitRequestRatio ResourceList `json:"maxLimitRequestRatio,omitempty" protobuf:"bytes,6,rep,name=maxLimitRequestRatio,casttype=ResourceList,castkey=ResourceName"`
4798}
4799
4800// LimitRangeSpec defines a min/max usage limit for resources that match on kind.
4801type LimitRangeSpec struct {
4802 // Limits is the list of LimitRangeItem objects that are enforced.
4803 Limits []LimitRangeItem `json:"limits" protobuf:"bytes,1,rep,name=limits"`
4804}
4805
4806// +genclient
4807// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
4808
4809// LimitRange sets resource usage limits for each kind of resource in a Namespace.
4810type LimitRange struct {
4811 metav1.TypeMeta `json:",inline"`
4812 // Standard object's metadata.
4813 // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
4814 // +optional
4815 metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
4816
4817 // Spec defines the limits enforced.
4818 // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status
4819 // +optional
4820 Spec LimitRangeSpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"`
4821}
4822
4823// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
4824
4825// LimitRangeList is a list of LimitRange items.
4826type LimitRangeList struct {
4827 metav1.TypeMeta `json:",inline"`
4828 // Standard list metadata.
4829 // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds
4830 // +optional
4831 metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
4832
4833 // Items is a list of LimitRange objects.
4834 // More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/
4835 Items []LimitRange `json:"items" protobuf:"bytes,2,rep,name=items"`
4836}
4837
4838// The following identify resource constants for Kubernetes object types
4839const (
4840 // Pods, number
4841 ResourcePods ResourceName = "pods"
4842 // Services, number
4843 ResourceServices ResourceName = "services"
4844 // ReplicationControllers, number
4845 ResourceReplicationControllers ResourceName = "replicationcontrollers"
4846 // ResourceQuotas, number
4847 ResourceQuotas ResourceName = "resourcequotas"
4848 // ResourceSecrets, number
4849 ResourceSecrets ResourceName = "secrets"
4850 // ResourceConfigMaps, number
4851 ResourceConfigMaps ResourceName = "configmaps"
4852 // ResourcePersistentVolumeClaims, number
4853 ResourcePersistentVolumeClaims ResourceName = "persistentvolumeclaims"
4854 // ResourceServicesNodePorts, number
4855 ResourceServicesNodePorts ResourceName = "services.nodeports"
4856 // ResourceServicesLoadBalancers, number
4857 ResourceServicesLoadBalancers ResourceName = "services.loadbalancers"
4858 // CPU request, in cores. (500m = .5 cores)
4859 ResourceRequestsCPU ResourceName = "requests.cpu"
4860 // Memory request, in bytes. (500Gi = 500GiB = 500 * 1024 * 1024 * 1024)
4861 ResourceRequestsMemory ResourceName = "requests.memory"
4862 // Storage request, in bytes
4863 ResourceRequestsStorage ResourceName = "requests.storage"
4864 // Local ephemeral storage request, in bytes. (500Gi = 500GiB = 500 * 1024 * 1024 * 1024)
4865 ResourceRequestsEphemeralStorage ResourceName = "requests.ephemeral-storage"
4866 // CPU limit, in cores. (500m = .5 cores)
4867 ResourceLimitsCPU ResourceName = "limits.cpu"
4868 // Memory limit, in bytes. (500Gi = 500GiB = 500 * 1024 * 1024 * 1024)
4869 ResourceLimitsMemory ResourceName = "limits.memory"
4870 // Local ephemeral storage limit, in bytes. (500Gi = 500GiB = 500 * 1024 * 1024 * 1024)
4871 ResourceLimitsEphemeralStorage ResourceName = "limits.ephemeral-storage"
4872)
4873
4874// The following identify resource prefix for Kubernetes object types
4875const (
4876 // HugePages request, in bytes. (500Gi = 500GiB = 500 * 1024 * 1024 * 1024)
4877 // As burst is not supported for HugePages, we would only quota its request, and ignore the limit.
4878 ResourceRequestsHugePagesPrefix = "requests.hugepages-"
4879 // Default resource requests prefix
4880 DefaultResourceRequestsPrefix = "requests."
4881)
4882
4883// A ResourceQuotaScope defines a filter that must match each object tracked by a quota
4884type ResourceQuotaScope string
4885
4886const (
4887 // Match all pod objects where spec.activeDeadlineSeconds
4888 ResourceQuotaScopeTerminating ResourceQuotaScope = "Terminating"
4889 // Match all pod objects where !spec.activeDeadlineSeconds
4890 ResourceQuotaScopeNotTerminating ResourceQuotaScope = "NotTerminating"
4891 // Match all pod objects that have best effort quality of service
4892 ResourceQuotaScopeBestEffort ResourceQuotaScope = "BestEffort"
4893 // Match all pod objects that do not have best effort quality of service
4894 ResourceQuotaScopeNotBestEffort ResourceQuotaScope = "NotBestEffort"
4895 // Match all pod objects that have priority class mentioned
4896 ResourceQuotaScopePriorityClass ResourceQuotaScope = "PriorityClass"
4897)
4898
4899// ResourceQuotaSpec defines the desired hard limits to enforce for Quota.
4900type ResourceQuotaSpec struct {
4901 // hard is the set of desired hard limits for each named resource.
4902 // More info: https://kubernetes.io/docs/concepts/policy/resource-quotas/
4903 // +optional
4904 Hard ResourceList `json:"hard,omitempty" protobuf:"bytes,1,rep,name=hard,casttype=ResourceList,castkey=ResourceName"`
4905 // A collection of filters that must match each object tracked by a quota.
4906 // If not specified, the quota matches all objects.
4907 // +optional
4908 Scopes []ResourceQuotaScope `json:"scopes,omitempty" protobuf:"bytes,2,rep,name=scopes,casttype=ResourceQuotaScope"`
4909 // scopeSelector is also a collection of filters like scopes that must match each object tracked by a quota
4910 // but expressed using ScopeSelectorOperator in combination with possible values.
4911 // For a resource to match, both scopes AND scopeSelector (if specified in spec), must be matched.
4912 // +optional
4913 ScopeSelector *ScopeSelector `json:"scopeSelector,omitempty" protobuf:"bytes,3,opt,name=scopeSelector"`
4914}
4915
4916// A scope selector represents the AND of the selectors represented
4917// by the scoped-resource selector requirements.
4918type ScopeSelector struct {
4919 // A list of scope selector requirements by scope of the resources.
4920 // +optional
4921 MatchExpressions []ScopedResourceSelectorRequirement `json:"matchExpressions,omitempty" protobuf:"bytes,1,rep,name=matchExpressions"`
4922}
4923
4924// A scoped-resource selector requirement is a selector that contains values, a scope name, and an operator
4925// that relates the scope name and values.
4926type ScopedResourceSelectorRequirement struct {
4927 // The name of the scope that the selector applies to.
4928 ScopeName ResourceQuotaScope `json:"scopeName" protobuf:"bytes,1,opt,name=scopeName"`
4929 // Represents a scope's relationship to a set of values.
4930 // Valid operators are In, NotIn, Exists, DoesNotExist.
4931 Operator ScopeSelectorOperator `json:"operator" protobuf:"bytes,2,opt,name=operator,casttype=ScopedResourceSelectorOperator"`
4932 // An array of string values. If the operator is In or NotIn,
4933 // the values array must be non-empty. If the operator is Exists or DoesNotExist,
4934 // the values array must be empty.
4935 // This array is replaced during a strategic merge patch.
4936 // +optional
4937 Values []string `json:"values,omitempty" protobuf:"bytes,3,rep,name=values"`
4938}
4939
4940// A scope selector operator is the set of operators that can be used in
4941// a scope selector requirement.
4942type ScopeSelectorOperator string
4943
4944const (
4945 ScopeSelectorOpIn ScopeSelectorOperator = "In"
4946 ScopeSelectorOpNotIn ScopeSelectorOperator = "NotIn"
4947 ScopeSelectorOpExists ScopeSelectorOperator = "Exists"
4948 ScopeSelectorOpDoesNotExist ScopeSelectorOperator = "DoesNotExist"
4949)
4950
4951// ResourceQuotaStatus defines the enforced hard limits and observed use.
4952type ResourceQuotaStatus struct {
4953 // Hard is the set of enforced hard limits for each named resource.
4954 // More info: https://kubernetes.io/docs/concepts/policy/resource-quotas/
4955 // +optional
4956 Hard ResourceList `json:"hard,omitempty" protobuf:"bytes,1,rep,name=hard,casttype=ResourceList,castkey=ResourceName"`
4957 // Used is the current observed total usage of the resource in the namespace.
4958 // +optional
4959 Used ResourceList `json:"used,omitempty" protobuf:"bytes,2,rep,name=used,casttype=ResourceList,castkey=ResourceName"`
4960}
4961
4962// +genclient
4963// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
4964
4965// ResourceQuota sets aggregate quota restrictions enforced per namespace
4966type ResourceQuota struct {
4967 metav1.TypeMeta `json:",inline"`
4968 // Standard object's metadata.
4969 // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
4970 // +optional
4971 metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
4972
4973 // Spec defines the desired quota.
4974 // https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status
4975 // +optional
4976 Spec ResourceQuotaSpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"`
4977
4978 // Status defines the actual enforced quota and its current usage.
4979 // https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status
4980 // +optional
4981 Status ResourceQuotaStatus `json:"status,omitempty" protobuf:"bytes,3,opt,name=status"`
4982}
4983
4984// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
4985
4986// ResourceQuotaList is a list of ResourceQuota items.
4987type ResourceQuotaList struct {
4988 metav1.TypeMeta `json:",inline"`
4989 // Standard list metadata.
4990 // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds
4991 // +optional
4992 metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
4993
4994 // Items is a list of ResourceQuota objects.
4995 // More info: https://kubernetes.io/docs/concepts/policy/resource-quotas/
4996 Items []ResourceQuota `json:"items" protobuf:"bytes,2,rep,name=items"`
4997}
4998
4999// +genclient
5000// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
5001
5002// Secret holds secret data of a certain type. The total bytes of the values in
5003// the Data field must be less than MaxSecretSize bytes.
5004type Secret struct {
5005 metav1.TypeMeta `json:",inline"`
5006 // Standard object's metadata.
5007 // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
5008 // +optional
5009 metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
5010
5011 // Data contains the secret data. Each key must consist of alphanumeric
5012 // characters, '-', '_' or '.'. The serialized form of the secret data is a
5013 // base64 encoded string, representing the arbitrary (possibly non-string)
5014 // data value here. Described in https://tools.ietf.org/html/rfc4648#section-4
5015 // +optional
5016 Data map[string][]byte `json:"data,omitempty" protobuf:"bytes,2,rep,name=data"`
5017
5018 // stringData allows specifying non-binary secret data in string form.
5019 // It is provided as a write-only convenience method.
5020 // All keys and values are merged into the data field on write, overwriting any existing values.
5021 // It is never output when reading from the API.
5022 // +k8s:conversion-gen=false
5023 // +optional
5024 StringData map[string]string `json:"stringData,omitempty" protobuf:"bytes,4,rep,name=stringData"`
5025
5026 // Used to facilitate programmatic handling of secret data.
5027 // +optional
5028 Type SecretType `json:"type,omitempty" protobuf:"bytes,3,opt,name=type,casttype=SecretType"`
5029}
5030
5031const MaxSecretSize = 1 * 1024 * 1024
5032
5033type SecretType string
5034
5035const (
5036 // SecretTypeOpaque is the default. Arbitrary user-defined data
5037 SecretTypeOpaque SecretType = "Opaque"
5038
5039 // SecretTypeServiceAccountToken contains a token that identifies a service account to the API
5040 //
5041 // Required fields:
5042 // - Secret.Annotations["kubernetes.io/service-account.name"] - the name of the ServiceAccount the token identifies
5043 // - Secret.Annotations["kubernetes.io/service-account.uid"] - the UID of the ServiceAccount the token identifies
5044 // - Secret.Data["token"] - a token that identifies the service account to the API
5045 SecretTypeServiceAccountToken SecretType = "kubernetes.io/service-account-token"
5046
5047 // ServiceAccountNameKey is the key of the required annotation for SecretTypeServiceAccountToken secrets
5048 ServiceAccountNameKey = "kubernetes.io/service-account.name"
5049 // ServiceAccountUIDKey is the key of the required annotation for SecretTypeServiceAccountToken secrets
5050 ServiceAccountUIDKey = "kubernetes.io/service-account.uid"
5051 // ServiceAccountTokenKey is the key of the required data for SecretTypeServiceAccountToken secrets
5052 ServiceAccountTokenKey = "token"
5053 // ServiceAccountKubeconfigKey is the key of the optional kubeconfig data for SecretTypeServiceAccountToken secrets
5054 ServiceAccountKubeconfigKey = "kubernetes.kubeconfig"
5055 // ServiceAccountRootCAKey is the key of the optional root certificate authority for SecretTypeServiceAccountToken secrets
5056 ServiceAccountRootCAKey = "ca.crt"
5057 // ServiceAccountNamespaceKey is the key of the optional namespace to use as the default for namespaced API calls
5058 ServiceAccountNamespaceKey = "namespace"
5059
5060 // SecretTypeDockercfg contains a dockercfg file that follows the same format rules as ~/.dockercfg
5061 //
5062 // Required fields:
5063 // - Secret.Data[".dockercfg"] - a serialized ~/.dockercfg file
5064 SecretTypeDockercfg SecretType = "kubernetes.io/dockercfg"
5065
5066 // DockerConfigKey is the key of the required data for SecretTypeDockercfg secrets
5067 DockerConfigKey = ".dockercfg"
5068
5069 // SecretTypeDockerConfigJson contains a dockercfg file that follows the same format rules as ~/.docker/config.json
5070 //
5071 // Required fields:
5072 // - Secret.Data[".dockerconfigjson"] - a serialized ~/.docker/config.json file
5073 SecretTypeDockerConfigJson SecretType = "kubernetes.io/dockerconfigjson"
5074
5075 // DockerConfigJsonKey is the key of the required data for SecretTypeDockerConfigJson secrets
5076 DockerConfigJsonKey = ".dockerconfigjson"
5077
5078 // SecretTypeBasicAuth contains data needed for basic authentication.
5079 //
5080 // Required at least one of fields:
5081 // - Secret.Data["username"] - username used for authentication
5082 // - Secret.Data["password"] - password or token needed for authentication
5083 SecretTypeBasicAuth SecretType = "kubernetes.io/basic-auth"
5084
5085 // BasicAuthUsernameKey is the key of the username for SecretTypeBasicAuth secrets
5086 BasicAuthUsernameKey = "username"
5087 // BasicAuthPasswordKey is the key of the password or token for SecretTypeBasicAuth secrets
5088 BasicAuthPasswordKey = "password"
5089
5090 // SecretTypeSSHAuth contains data needed for SSH authetication.
5091 //
5092 // Required field:
5093 // - Secret.Data["ssh-privatekey"] - private SSH key needed for authentication
5094 SecretTypeSSHAuth SecretType = "kubernetes.io/ssh-auth"
5095
5096 // SSHAuthPrivateKey is the key of the required SSH private key for SecretTypeSSHAuth secrets
5097 SSHAuthPrivateKey = "ssh-privatekey"
5098 // SecretTypeTLS contains information about a TLS client or server secret. It
5099 // is primarily used with TLS termination of the Ingress resource, but may be
5100 // used in other types.
5101 //
5102 // Required fields:
5103 // - Secret.Data["tls.key"] - TLS private key.
5104 // Secret.Data["tls.crt"] - TLS certificate.
5105 // TODO: Consider supporting different formats, specifying CA/destinationCA.
5106 SecretTypeTLS SecretType = "kubernetes.io/tls"
5107
5108 // TLSCertKey is the key for tls certificates in a TLS secert.
5109 TLSCertKey = "tls.crt"
5110 // TLSPrivateKeyKey is the key for the private key field in a TLS secret.
5111 TLSPrivateKeyKey = "tls.key"
5112 // SecretTypeBootstrapToken is used during the automated bootstrap process (first
5113 // implemented by kubeadm). It stores tokens that are used to sign well known
5114 // ConfigMaps. They are used for authn.
5115 SecretTypeBootstrapToken SecretType = "bootstrap.kubernetes.io/token"
5116)
5117
5118// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
5119
5120// SecretList is a list of Secret.
5121type SecretList struct {
5122 metav1.TypeMeta `json:",inline"`
5123 // Standard list metadata.
5124 // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds
5125 // +optional
5126 metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
5127
5128 // Items is a list of secret objects.
5129 // More info: https://kubernetes.io/docs/concepts/configuration/secret
5130 Items []Secret `json:"items" protobuf:"bytes,2,rep,name=items"`
5131}
5132
5133// +genclient
5134// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
5135
5136// ConfigMap holds configuration data for pods to consume.
5137type ConfigMap struct {
5138 metav1.TypeMeta `json:",inline"`
5139 // Standard object's metadata.
5140 // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
5141 // +optional
5142 metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
5143
5144 // Data contains the configuration data.
5145 // Each key must consist of alphanumeric characters, '-', '_' or '.'.
5146 // Values with non-UTF-8 byte sequences must use the BinaryData field.
5147 // The keys stored in Data must not overlap with the keys in
5148 // the BinaryData field, this is enforced during validation process.
5149 // +optional
5150 Data map[string]string `json:"data,omitempty" protobuf:"bytes,2,rep,name=data"`
5151
5152 // BinaryData contains the binary data.
5153 // Each key must consist of alphanumeric characters, '-', '_' or '.'.
5154 // BinaryData can contain byte sequences that are not in the UTF-8 range.
5155 // The keys stored in BinaryData must not overlap with the ones in
5156 // the Data field, this is enforced during validation process.
5157 // Using this field will require 1.10+ apiserver and
5158 // kubelet.
5159 // +optional
5160 BinaryData map[string][]byte `json:"binaryData,omitempty" protobuf:"bytes,3,rep,name=binaryData"`
5161}
5162
5163// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
5164
5165// ConfigMapList is a resource containing a list of ConfigMap objects.
5166type ConfigMapList struct {
5167 metav1.TypeMeta `json:",inline"`
5168
5169 // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
5170 // +optional
5171 metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
5172
5173 // Items is the list of ConfigMaps.
5174 Items []ConfigMap `json:"items" protobuf:"bytes,2,rep,name=items"`
5175}
5176
5177// Type and constants for component health validation.
5178type ComponentConditionType string
5179
5180// These are the valid conditions for the component.
5181const (
5182 ComponentHealthy ComponentConditionType = "Healthy"
5183)
5184
5185// Information about the condition of a component.
5186type ComponentCondition struct {
5187 // Type of condition for a component.
5188 // Valid value: "Healthy"
5189 Type ComponentConditionType `json:"type" protobuf:"bytes,1,opt,name=type,casttype=ComponentConditionType"`
5190 // Status of the condition for a component.
5191 // Valid values for "Healthy": "True", "False", or "Unknown".
5192 Status ConditionStatus `json:"status" protobuf:"bytes,2,opt,name=status,casttype=ConditionStatus"`
5193 // Message about the condition for a component.
5194 // For example, information about a health check.
5195 // +optional
5196 Message string `json:"message,omitempty" protobuf:"bytes,3,opt,name=message"`
5197 // Condition error code for a component.
5198 // For example, a health check error code.
5199 // +optional
5200 Error string `json:"error,omitempty" protobuf:"bytes,4,opt,name=error"`
5201}
5202
5203// +genclient
5204// +genclient:nonNamespaced
5205// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
5206
5207// ComponentStatus (and ComponentStatusList) holds the cluster validation info.
5208type ComponentStatus struct {
5209 metav1.TypeMeta `json:",inline"`
5210 // Standard object's metadata.
5211 // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
5212 // +optional
5213 metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
5214
5215 // List of component conditions observed
5216 // +optional
5217 // +patchMergeKey=type
5218 // +patchStrategy=merge
5219 Conditions []ComponentCondition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type" protobuf:"bytes,2,rep,name=conditions"`
5220}
5221
5222// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
5223
5224// Status of all the conditions for the component as a list of ComponentStatus objects.
5225type ComponentStatusList struct {
5226 metav1.TypeMeta `json:",inline"`
5227 // Standard list metadata.
5228 // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds
5229 // +optional
5230 metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
5231
5232 // List of ComponentStatus objects.
5233 Items []ComponentStatus `json:"items" protobuf:"bytes,2,rep,name=items"`
5234}
5235
5236// DownwardAPIVolumeSource represents a volume containing downward API info.
5237// Downward API volumes support ownership management and SELinux relabeling.
5238type DownwardAPIVolumeSource struct {
5239 // Items is a list of downward API volume file
5240 // +optional
5241 Items []DownwardAPIVolumeFile `json:"items,omitempty" protobuf:"bytes,1,rep,name=items"`
5242 // Optional: mode bits to use on created files by default. Must be a
5243 // value between 0 and 0777. Defaults to 0644.
5244 // Directories within the path are not affected by this setting.
5245 // This might be in conflict with other options that affect the file
5246 // mode, like fsGroup, and the result can be other mode bits set.
5247 // +optional
5248 DefaultMode *int32 `json:"defaultMode,omitempty" protobuf:"varint,2,opt,name=defaultMode"`
5249}
5250
5251const (
5252 DownwardAPIVolumeSourceDefaultMode int32 = 0644
5253)
5254
5255// DownwardAPIVolumeFile represents information to create the file containing the pod field
5256type DownwardAPIVolumeFile struct {
5257 // 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 '..'
5258 Path string `json:"path" protobuf:"bytes,1,opt,name=path"`
5259 // Required: Selects a field of the pod: only annotations, labels, name and namespace are supported.
5260 // +optional
5261 FieldRef *ObjectFieldSelector `json:"fieldRef,omitempty" protobuf:"bytes,2,opt,name=fieldRef"`
5262 // Selects a resource of the container: only resources limits and requests
5263 // (limits.cpu, limits.memory, requests.cpu and requests.memory) are currently supported.
5264 // +optional
5265 ResourceFieldRef *ResourceFieldSelector `json:"resourceFieldRef,omitempty" protobuf:"bytes,3,opt,name=resourceFieldRef"`
5266 // Optional: mode bits to use on this file, must be a value between 0
5267 // and 0777. If not specified, the volume defaultMode will be used.
5268 // This might be in conflict with other options that affect the file
5269 // mode, like fsGroup, and the result can be other mode bits set.
5270 // +optional
5271 Mode *int32 `json:"mode,omitempty" protobuf:"varint,4,opt,name=mode"`
5272}
5273
5274// Represents downward API info for projecting into a projected volume.
5275// Note that this is identical to a downwardAPI volume source without the default
5276// mode.
5277type DownwardAPIProjection struct {
5278 // Items is a list of DownwardAPIVolume file
5279 // +optional
5280 Items []DownwardAPIVolumeFile `json:"items,omitempty" protobuf:"bytes,1,rep,name=items"`
5281}
5282
5283// SecurityContext holds security configuration that will be applied to a container.
5284// Some fields are present in both SecurityContext and PodSecurityContext. When both
5285// are set, the values in SecurityContext take precedence.
5286type SecurityContext struct {
5287 // The capabilities to add/drop when running containers.
5288 // Defaults to the default set of capabilities granted by the container runtime.
5289 // +optional
5290 Capabilities *Capabilities `json:"capabilities,omitempty" protobuf:"bytes,1,opt,name=capabilities"`
5291 // Run container in privileged mode.
5292 // Processes in privileged containers are essentially equivalent to root on the host.
5293 // Defaults to false.
5294 // +optional
5295 Privileged *bool `json:"privileged,omitempty" protobuf:"varint,2,opt,name=privileged"`
5296 // The SELinux context to be applied to the container.
5297 // If unspecified, the container runtime will allocate a random SELinux context for each
5298 // container. May also be set in PodSecurityContext. If set in both SecurityContext and
5299 // PodSecurityContext, the value specified in SecurityContext takes precedence.
5300 // +optional
5301 SELinuxOptions *SELinuxOptions `json:"seLinuxOptions,omitempty" protobuf:"bytes,3,opt,name=seLinuxOptions"`
5302 // Windows security options.
5303 // +optional
5304 WindowsOptions *WindowsSecurityContextOptions `json:"windowsOptions,omitempty" protobuf:"bytes,10,opt,name=windowsOptions"`
5305 // The UID to run the entrypoint of the container process.
5306 // Defaults to user specified in image metadata if unspecified.
5307 // May also be set in PodSecurityContext. If set in both SecurityContext and
5308 // PodSecurityContext, the value specified in SecurityContext takes precedence.
5309 // +optional
5310 RunAsUser *int64 `json:"runAsUser,omitempty" protobuf:"varint,4,opt,name=runAsUser"`
5311 // The GID to run the entrypoint of the container process.
5312 // Uses runtime default if unset.
5313 // May also be set in PodSecurityContext. If set in both SecurityContext and
5314 // PodSecurityContext, the value specified in SecurityContext takes precedence.
5315 // +optional
5316 RunAsGroup *int64 `json:"runAsGroup,omitempty" protobuf:"varint,8,opt,name=runAsGroup"`
5317 // Indicates that the container must run as a non-root user.
5318 // If true, the Kubelet will validate the image at runtime to ensure that it
5319 // does not run as UID 0 (root) and fail to start the container if it does.
5320 // If unset or false, no such validation will be performed.
5321 // May also be set in PodSecurityContext. If set in both SecurityContext and
5322 // PodSecurityContext, the value specified in SecurityContext takes precedence.
5323 // +optional
5324 RunAsNonRoot *bool `json:"runAsNonRoot,omitempty" protobuf:"varint,5,opt,name=runAsNonRoot"`
5325 // Whether this container has a read-only root filesystem.
5326 // Default is false.
5327 // +optional
5328 ReadOnlyRootFilesystem *bool `json:"readOnlyRootFilesystem,omitempty" protobuf:"varint,6,opt,name=readOnlyRootFilesystem"`
5329 // AllowPrivilegeEscalation controls whether a process can gain more
5330 // privileges than its parent process. This bool directly controls if
5331 // the no_new_privs flag will be set on the container process.
5332 // AllowPrivilegeEscalation is true always when the container is:
5333 // 1) run as Privileged
5334 // 2) has CAP_SYS_ADMIN
5335 // +optional
5336 AllowPrivilegeEscalation *bool `json:"allowPrivilegeEscalation,omitempty" protobuf:"varint,7,opt,name=allowPrivilegeEscalation"`
5337 // procMount denotes the type of proc mount to use for the containers.
5338 // The default is DefaultProcMount which uses the container runtime defaults for
5339 // readonly paths and masked paths.
5340 // This requires the ProcMountType feature flag to be enabled.
5341 // +optional
5342 ProcMount *ProcMountType `json:"procMount,omitempty" protobuf:"bytes,9,opt,name=procMount"`
5343}
5344
5345type ProcMountType string
5346
5347const (
5348 // DefaultProcMount uses the container runtime defaults for readonly and masked
5349 // paths for /proc. Most container runtimes mask certain paths in /proc to avoid
5350 // accidental security exposure of special devices or information.
5351 DefaultProcMount ProcMountType = "Default"
5352
5353 // UnmaskedProcMount bypasses the default masking behavior of the container
5354 // runtime and ensures the newly created /proc the container stays in tact with
5355 // no modifications.
5356 UnmaskedProcMount ProcMountType = "Unmasked"
5357)
5358
5359// SELinuxOptions are the labels to be applied to the container
5360type SELinuxOptions struct {
5361 // User is a SELinux user label that applies to the container.
5362 // +optional
5363 User string `json:"user,omitempty" protobuf:"bytes,1,opt,name=user"`
5364 // Role is a SELinux role label that applies to the container.
5365 // +optional
5366 Role string `json:"role,omitempty" protobuf:"bytes,2,opt,name=role"`
5367 // Type is a SELinux type label that applies to the container.
5368 // +optional
5369 Type string `json:"type,omitempty" protobuf:"bytes,3,opt,name=type"`
5370 // Level is SELinux level label that applies to the container.
5371 // +optional
5372 Level string `json:"level,omitempty" protobuf:"bytes,4,opt,name=level"`
5373}
5374
5375// WindowsSecurityContextOptions contain Windows-specific options and credentials.
5376type WindowsSecurityContextOptions struct {
5377 // GMSACredentialSpecName is the name of the GMSA credential spec to use.
5378 // This field is alpha-level and is only honored by servers that enable the WindowsGMSA feature flag.
5379 // +optional
5380 GMSACredentialSpecName *string `json:"gmsaCredentialSpecName,omitempty" protobuf:"bytes,1,opt,name=gmsaCredentialSpecName"`
5381
5382 // GMSACredentialSpec is where the GMSA admission webhook
5383 // (https://github.com/kubernetes-sigs/windows-gmsa) inlines the contents of the
5384 // GMSA credential spec named by the GMSACredentialSpecName field.
5385 // This field is alpha-level and is only honored by servers that enable the WindowsGMSA feature flag.
5386 // +optional
5387 GMSACredentialSpec *string `json:"gmsaCredentialSpec,omitempty" protobuf:"bytes,2,opt,name=gmsaCredentialSpec"`
5388}
5389
5390// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
5391
5392// RangeAllocation is not a public type.
5393type RangeAllocation struct {
5394 metav1.TypeMeta `json:",inline"`
5395 // Standard object's metadata.
5396 // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
5397 // +optional
5398 metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
5399
5400 // Range is string that identifies the range represented by 'data'.
5401 Range string `json:"range" protobuf:"bytes,2,opt,name=range"`
5402 // Data is a bit array containing all allocated addresses in the previous segment.
5403 Data []byte `json:"data" protobuf:"bytes,3,opt,name=data"`
5404}
5405
5406const (
5407 // "default-scheduler" is the name of default scheduler.
5408 DefaultSchedulerName = "default-scheduler"
5409
5410 // RequiredDuringScheduling affinity is not symmetric, but there is an implicit PreferredDuringScheduling affinity rule
5411 // corresponding to every RequiredDuringScheduling affinity rule.
5412 // When the --hard-pod-affinity-weight scheduler flag is not specified,
5413 // DefaultHardPodAffinityWeight defines the weight of the implicit PreferredDuringScheduling affinity rule.
5414 DefaultHardPodAffinitySymmetricWeight int32 = 1
5415)
5416
5417// Sysctl defines a kernel parameter to be set
5418type Sysctl struct {
5419 // Name of a property to set
5420 Name string `json:"name" protobuf:"bytes,1,opt,name=name"`
5421 // Value of a property to set
5422 Value string `json:"value" protobuf:"bytes,2,opt,name=value"`
5423}
5424
5425// NodeResources is an object for conveying resource information about a node.
5426// see http://releases.k8s.io/HEAD/docs/design/resources.md for more details.
5427type NodeResources struct {
5428 // Capacity represents the available resources of a node
5429 Capacity ResourceList `protobuf:"bytes,1,rep,name=capacity,casttype=ResourceList,castkey=ResourceName"`
5430}
5431
5432const (
5433 // Enable stdin for remote command execution
5434 ExecStdinParam = "input"
5435 // Enable stdout for remote command execution
5436 ExecStdoutParam = "output"
5437 // Enable stderr for remote command execution
5438 ExecStderrParam = "error"
5439 // Enable TTY for remote command execution
5440 ExecTTYParam = "tty"
5441 // Command to run for remote command execution
5442 ExecCommandParam = "command"
5443
5444 // Name of header that specifies stream type
5445 StreamType = "streamType"
5446 // Value for streamType header for stdin stream
5447 StreamTypeStdin = "stdin"
5448 // Value for streamType header for stdout stream
5449 StreamTypeStdout = "stdout"
5450 // Value for streamType header for stderr stream
5451 StreamTypeStderr = "stderr"
5452 // Value for streamType header for data stream
5453 StreamTypeData = "data"
5454 // Value for streamType header for error stream
5455 StreamTypeError = "error"
5456 // Value for streamType header for terminal resize stream
5457 StreamTypeResize = "resize"
5458
5459 // Name of header that specifies the port being forwarded
5460 PortHeader = "port"
5461 // Name of header that specifies a request ID used to associate the error
5462 // and data streams for a single forwarded connection
5463 PortForwardRequestIDHeader = "requestID"
5464)