2 Copyright 2015 The Kubernetes Authors.
4 Licensed under the Apache License, Version 2.0 (the "License");
5 you may not use this file except in compliance with the License.
6 You may obtain a copy of the License at
8 http://www.apache.org/licenses/LICENSE-2.0
10 Unless required by applicable law or agreed to in writing, software
11 distributed under the License is distributed on an "AS IS" BASIS,
12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 See the License for the specific language governing permissions and
14 limitations under the License.
20 appsv1beta1 "k8s.io/api/apps/v1beta1"
22 metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
23 "k8s.io/apimachinery/pkg/util/intstr"
26 // describes the attributes of a scale subresource
27 type ScaleSpec struct {
28 // desired number of instances for the scaled object.
30 Replicas int32 `json:"replicas,omitempty" protobuf:"varint,1,opt,name=replicas"`
33 // represents the current status of a scale subresource.
34 type ScaleStatus struct {
35 // actual number of observed instances of the scaled object.
36 Replicas int32 `json:"replicas" protobuf:"varint,1,opt,name=replicas"`
38 // label query over pods that should match the replicas count. More info: http://kubernetes.io/docs/user-guide/labels#label-selectors
40 Selector map[string]string `json:"selector,omitempty" protobuf:"bytes,2,rep,name=selector"`
42 // label selector for pods that should match the replicas count. This is a serializated
43 // version of both map-based and more expressive set-based selectors. This is done to
44 // avoid introspection in the clients. The string will be in the same format as the
45 // query-param syntax. If the target type only supports map-based selectors, both this
46 // field and map-based selector field are populated.
47 // More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors
49 TargetSelector string `json:"targetSelector,omitempty" protobuf:"bytes,3,opt,name=targetSelector"`
52 // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
54 // represents a scaling request for a resource.
56 metav1.TypeMeta `json:",inline"`
57 // Standard object metadata; More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata.
59 metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
61 // defines the behavior of the scale. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status.
63 Spec ScaleSpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"`
65 // current status of the scale. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status. Read-only.
67 Status ScaleStatus `json:"status,omitempty" protobuf:"bytes,3,opt,name=status"`
70 // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
73 type ReplicationControllerDummy struct {
74 metav1.TypeMeta `json:",inline"`
78 // +genclient:method=GetScale,verb=get,subresource=scale,result=Scale
79 // +genclient:method=UpdateScale,verb=update,subresource=scale,input=Scale,result=Scale
80 // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
82 // DEPRECATED - This group version of Deployment is deprecated by apps/v1beta2/Deployment. See the release notes for
84 // Deployment enables declarative updates for Pods and ReplicaSets.
85 type Deployment struct {
86 metav1.TypeMeta `json:",inline"`
87 // Standard object metadata.
89 metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
91 // Specification of the desired behavior of the Deployment.
93 Spec DeploymentSpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"`
95 // Most recently observed status of the Deployment.
97 Status DeploymentStatus `json:"status,omitempty" protobuf:"bytes,3,opt,name=status"`
100 // DeploymentSpec is the specification of the desired behavior of the Deployment.
101 type DeploymentSpec struct {
102 // Number of desired pods. This is a pointer to distinguish between explicit
103 // zero and not specified. Defaults to 1.
105 Replicas *int32 `json:"replicas,omitempty" protobuf:"varint,1,opt,name=replicas"`
107 // Label selector for pods. Existing ReplicaSets whose pods are
108 // selected by this will be the ones affected by this deployment.
110 Selector *metav1.LabelSelector `json:"selector,omitempty" protobuf:"bytes,2,opt,name=selector"`
112 // Template describes the pods that will be created.
113 Template v1.PodTemplateSpec `json:"template" protobuf:"bytes,3,opt,name=template"`
115 // The deployment strategy to use to replace existing pods with new ones.
117 // +patchStrategy=retainKeys
118 Strategy DeploymentStrategy `json:"strategy,omitempty" patchStrategy:"retainKeys" protobuf:"bytes,4,opt,name=strategy"`
120 // Minimum number of seconds for which a newly created pod should be ready
121 // without any of its container crashing, for it to be considered available.
122 // Defaults to 0 (pod will be considered available as soon as it is ready)
124 MinReadySeconds int32 `json:"minReadySeconds,omitempty" protobuf:"varint,5,opt,name=minReadySeconds"`
126 // The number of old ReplicaSets to retain to allow rollback.
127 // This is a pointer to distinguish between explicit zero and not specified.
128 // This is set to the max value of int32 (i.e. 2147483647) by default, which
129 // means "retaining all old RelicaSets".
131 RevisionHistoryLimit *int32 `json:"revisionHistoryLimit,omitempty" protobuf:"varint,6,opt,name=revisionHistoryLimit"`
133 // Indicates that the deployment is paused and will not be processed by the
134 // deployment controller.
136 Paused bool `json:"paused,omitempty" protobuf:"varint,7,opt,name=paused"`
139 // The config this deployment is rolling back to. Will be cleared after rollback is done.
141 RollbackTo *RollbackConfig `json:"rollbackTo,omitempty" protobuf:"bytes,8,opt,name=rollbackTo"`
143 // The maximum time in seconds for a deployment to make progress before it
144 // is considered to be failed. The deployment controller will continue to
145 // process failed deployments and a condition with a ProgressDeadlineExceeded
146 // reason will be surfaced in the deployment status. Note that progress will
147 // not be estimated during the time a deployment is paused. This is set to
148 // the max value of int32 (i.e. 2147483647) by default, which means "no deadline".
150 ProgressDeadlineSeconds *int32 `json:"progressDeadlineSeconds,omitempty" protobuf:"varint,9,opt,name=progressDeadlineSeconds"`
153 // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
156 // DeploymentRollback stores the information required to rollback a deployment.
157 type DeploymentRollback struct {
158 metav1.TypeMeta `json:",inline"`
159 // Required: This must match the Name of a deployment.
160 Name string `json:"name" protobuf:"bytes,1,opt,name=name"`
161 // The annotations to be updated to a deployment
163 UpdatedAnnotations map[string]string `json:"updatedAnnotations,omitempty" protobuf:"bytes,2,rep,name=updatedAnnotations"`
164 // The config of this deployment rollback.
165 RollbackTo RollbackConfig `json:"rollbackTo" protobuf:"bytes,3,opt,name=rollbackTo"`
169 type RollbackConfig struct {
170 // The revision to rollback to. If set to 0, rollback to the last revision.
172 Revision int64 `json:"revision,omitempty" protobuf:"varint,1,opt,name=revision"`
176 // DefaultDeploymentUniqueLabelKey is the default key of the selector that is added
177 // to existing RCs (and label key that is added to its pods) to prevent the existing RCs
178 // to select new pods (and old pods being select by new RC).
179 DefaultDeploymentUniqueLabelKey string = "pod-template-hash"
182 // DeploymentStrategy describes how to replace existing pods with new ones.
183 type DeploymentStrategy struct {
184 // Type of deployment. Can be "Recreate" or "RollingUpdate". Default is RollingUpdate.
186 Type DeploymentStrategyType `json:"type,omitempty" protobuf:"bytes,1,opt,name=type,casttype=DeploymentStrategyType"`
188 // Rolling update config params. Present only if DeploymentStrategyType =
191 // TODO: Update this to follow our convention for oneOf, whatever we decide it
194 RollingUpdate *RollingUpdateDeployment `json:"rollingUpdate,omitempty" protobuf:"bytes,2,opt,name=rollingUpdate"`
197 type DeploymentStrategyType string
200 // Kill all existing pods before creating new ones.
201 RecreateDeploymentStrategyType DeploymentStrategyType = "Recreate"
203 // Replace the old RCs by new one using rolling update i.e gradually scale down the old RCs and scale up the new one.
204 RollingUpdateDeploymentStrategyType DeploymentStrategyType = "RollingUpdate"
207 // Spec to control the desired behavior of rolling update.
208 type RollingUpdateDeployment struct {
209 // The maximum number of pods that can be unavailable during the update.
210 // Value can be an absolute number (ex: 5) or a percentage of desired pods (ex: 10%).
211 // Absolute number is calculated from percentage by rounding down.
212 // This can not be 0 if MaxSurge is 0.
213 // By default, a fixed value of 1 is used.
214 // Example: when this is set to 30%, the old RC can be scaled down to 70% of desired pods
215 // immediately when the rolling update starts. Once new pods are ready, old RC
216 // can be scaled down further, followed by scaling up the new RC, ensuring
217 // that the total number of pods available at all times during the update is at
218 // least 70% of desired pods.
220 MaxUnavailable *intstr.IntOrString `json:"maxUnavailable,omitempty" protobuf:"bytes,1,opt,name=maxUnavailable"`
222 // The maximum number of pods that can be scheduled above the desired number of
224 // Value can be an absolute number (ex: 5) or a percentage of desired pods (ex: 10%).
225 // This can not be 0 if MaxUnavailable is 0.
226 // Absolute number is calculated from percentage by rounding up.
227 // By default, a value of 1 is used.
228 // Example: when this is set to 30%, the new RC can be scaled up immediately when
229 // the rolling update starts, such that the total number of old and new pods do not exceed
230 // 130% of desired pods. Once old pods have been killed,
231 // new RC can be scaled up further, ensuring that total number of pods running
232 // at any time during the update is atmost 130% of desired pods.
234 MaxSurge *intstr.IntOrString `json:"maxSurge,omitempty" protobuf:"bytes,2,opt,name=maxSurge"`
237 // DeploymentStatus is the most recently observed status of the Deployment.
238 type DeploymentStatus struct {
239 // The generation observed by the deployment controller.
241 ObservedGeneration int64 `json:"observedGeneration,omitempty" protobuf:"varint,1,opt,name=observedGeneration"`
243 // Total number of non-terminated pods targeted by this deployment (their labels match the selector).
245 Replicas int32 `json:"replicas,omitempty" protobuf:"varint,2,opt,name=replicas"`
247 // Total number of non-terminated pods targeted by this deployment that have the desired template spec.
249 UpdatedReplicas int32 `json:"updatedReplicas,omitempty" protobuf:"varint,3,opt,name=updatedReplicas"`
251 // Total number of ready pods targeted by this deployment.
253 ReadyReplicas int32 `json:"readyReplicas,omitempty" protobuf:"varint,7,opt,name=readyReplicas"`
255 // Total number of available pods (ready for at least minReadySeconds) targeted by this deployment.
257 AvailableReplicas int32 `json:"availableReplicas,omitempty" protobuf:"varint,4,opt,name=availableReplicas"`
259 // Total number of unavailable pods targeted by this deployment. This is the total number of
260 // pods that are still required for the deployment to have 100% available capacity. They may
261 // either be pods that are running but not yet available or pods that still have not been created.
263 UnavailableReplicas int32 `json:"unavailableReplicas,omitempty" protobuf:"varint,5,opt,name=unavailableReplicas"`
265 // Represents the latest available observations of a deployment's current state.
266 // +patchMergeKey=type
267 // +patchStrategy=merge
268 Conditions []DeploymentCondition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type" protobuf:"bytes,6,rep,name=conditions"`
270 // Count of hash collisions for the Deployment. The Deployment controller uses this
271 // field as a collision avoidance mechanism when it needs to create the name for the
272 // newest ReplicaSet.
274 CollisionCount *int32 `json:"collisionCount,omitempty" protobuf:"varint,8,opt,name=collisionCount"`
277 type DeploymentConditionType string
279 // These are valid conditions of a deployment.
281 // Available means the deployment is available, ie. at least the minimum available
282 // replicas required are up and running for at least minReadySeconds.
283 DeploymentAvailable DeploymentConditionType = "Available"
284 // Progressing means the deployment is progressing. Progress for a deployment is
285 // considered when a new replica set is created or adopted, and when new pods scale
286 // up or old pods scale down. Progress is not estimated for paused deployments or
287 // when progressDeadlineSeconds is not specified.
288 DeploymentProgressing DeploymentConditionType = "Progressing"
289 // ReplicaFailure is added in a deployment when one of its pods fails to be created
291 DeploymentReplicaFailure DeploymentConditionType = "ReplicaFailure"
294 // DeploymentCondition describes the state of a deployment at a certain point.
295 type DeploymentCondition struct {
296 // Type of deployment condition.
297 Type DeploymentConditionType `json:"type" protobuf:"bytes,1,opt,name=type,casttype=DeploymentConditionType"`
298 // Status of the condition, one of True, False, Unknown.
299 Status v1.ConditionStatus `json:"status" protobuf:"bytes,2,opt,name=status,casttype=k8s.io/api/core/v1.ConditionStatus"`
300 // The last time this condition was updated.
301 LastUpdateTime metav1.Time `json:"lastUpdateTime,omitempty" protobuf:"bytes,6,opt,name=lastUpdateTime"`
302 // Last time the condition transitioned from one status to another.
303 LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty" protobuf:"bytes,7,opt,name=lastTransitionTime"`
304 // The reason for the condition's last transition.
305 Reason string `json:"reason,omitempty" protobuf:"bytes,4,opt,name=reason"`
306 // A human readable message indicating details about the transition.
307 Message string `json:"message,omitempty" protobuf:"bytes,5,opt,name=message"`
310 // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
312 // DeploymentList is a list of Deployments.
313 type DeploymentList struct {
314 metav1.TypeMeta `json:",inline"`
315 // Standard list metadata.
317 metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
319 // Items is the list of Deployments.
320 Items []Deployment `json:"items" protobuf:"bytes,2,rep,name=items"`
323 type DaemonSetUpdateStrategy struct {
324 // Type of daemon set update. Can be "RollingUpdate" or "OnDelete".
325 // Default is OnDelete.
327 Type DaemonSetUpdateStrategyType `json:"type,omitempty" protobuf:"bytes,1,opt,name=type"`
329 // Rolling update config params. Present only if type = "RollingUpdate".
331 // TODO: Update this to follow our convention for oneOf, whatever we decide it
332 // to be. Same as Deployment `strategy.rollingUpdate`.
333 // See https://github.com/kubernetes/kubernetes/issues/35345
335 RollingUpdate *RollingUpdateDaemonSet `json:"rollingUpdate,omitempty" protobuf:"bytes,2,opt,name=rollingUpdate"`
338 type DaemonSetUpdateStrategyType string
341 // Replace the old daemons by new ones using rolling update i.e replace them on each node one after the other.
342 RollingUpdateDaemonSetStrategyType DaemonSetUpdateStrategyType = "RollingUpdate"
344 // Replace the old daemons only when it's killed
345 OnDeleteDaemonSetStrategyType DaemonSetUpdateStrategyType = "OnDelete"
348 // Spec to control the desired behavior of daemon set rolling update.
349 type RollingUpdateDaemonSet struct {
350 // The maximum number of DaemonSet pods that can be unavailable during the
351 // update. Value can be an absolute number (ex: 5) or a percentage of total
352 // number of DaemonSet pods at the start of the update (ex: 10%). Absolute
353 // number is calculated from percentage by rounding up.
355 // Default value is 1.
356 // Example: when this is set to 30%, at most 30% of the total number of nodes
357 // that should be running the daemon pod (i.e. status.desiredNumberScheduled)
358 // can have their pods stopped for an update at any given
359 // time. The update starts by stopping at most 30% of those DaemonSet pods
360 // and then brings up new DaemonSet pods in their place. Once the new pods
361 // are available, it then proceeds onto other DaemonSet pods, thus ensuring
362 // that at least 70% of original number of DaemonSet pods are available at
363 // all times during the update.
365 MaxUnavailable *intstr.IntOrString `json:"maxUnavailable,omitempty" protobuf:"bytes,1,opt,name=maxUnavailable"`
368 // DaemonSetSpec is the specification of a daemon set.
369 type DaemonSetSpec struct {
370 // A label query over pods that are managed by the daemon set.
371 // Must match in order to be controlled.
372 // If empty, defaulted to labels on Pod template.
373 // More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors
375 Selector *metav1.LabelSelector `json:"selector,omitempty" protobuf:"bytes,1,opt,name=selector"`
377 // An object that describes the pod that will be created.
378 // The DaemonSet will create exactly one copy of this pod on every node
379 // that matches the template's node selector (or on every node if no node
380 // selector is specified).
381 // More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller#pod-template
382 Template v1.PodTemplateSpec `json:"template" protobuf:"bytes,2,opt,name=template"`
384 // An update strategy to replace existing DaemonSet pods with new pods.
386 UpdateStrategy DaemonSetUpdateStrategy `json:"updateStrategy,omitempty" protobuf:"bytes,3,opt,name=updateStrategy"`
388 // The minimum number of seconds for which a newly created DaemonSet pod should
389 // be ready without any of its container crashing, for it to be considered
390 // available. Defaults to 0 (pod will be considered available as soon as it
393 MinReadySeconds int32 `json:"minReadySeconds,omitempty" protobuf:"varint,4,opt,name=minReadySeconds"`
396 // A sequence number representing a specific generation of the template.
397 // Populated by the system. It can be set only during the creation.
399 TemplateGeneration int64 `json:"templateGeneration,omitempty" protobuf:"varint,5,opt,name=templateGeneration"`
401 // The number of old history to retain to allow rollback.
402 // This is a pointer to distinguish between explicit zero and not specified.
405 RevisionHistoryLimit *int32 `json:"revisionHistoryLimit,omitempty" protobuf:"varint,6,opt,name=revisionHistoryLimit"`
408 // DaemonSetStatus represents the current status of a daemon set.
409 type DaemonSetStatus struct {
410 // The number of nodes that are running at least 1
411 // daemon pod and are supposed to run the daemon pod.
412 // More info: https://kubernetes.io/docs/concepts/workloads/controllers/daemonset/
413 CurrentNumberScheduled int32 `json:"currentNumberScheduled" protobuf:"varint,1,opt,name=currentNumberScheduled"`
415 // The number of nodes that are running the daemon pod, but are
416 // not supposed to run the daemon pod.
417 // More info: https://kubernetes.io/docs/concepts/workloads/controllers/daemonset/
418 NumberMisscheduled int32 `json:"numberMisscheduled" protobuf:"varint,2,opt,name=numberMisscheduled"`
420 // The total number of nodes that should be running the daemon
421 // pod (including nodes correctly running the daemon pod).
422 // More info: https://kubernetes.io/docs/concepts/workloads/controllers/daemonset/
423 DesiredNumberScheduled int32 `json:"desiredNumberScheduled" protobuf:"varint,3,opt,name=desiredNumberScheduled"`
425 // The number of nodes that should be running the daemon pod and have one
426 // or more of the daemon pod running and ready.
427 NumberReady int32 `json:"numberReady" protobuf:"varint,4,opt,name=numberReady"`
429 // The most recent generation observed by the daemon set controller.
431 ObservedGeneration int64 `json:"observedGeneration,omitempty" protobuf:"varint,5,opt,name=observedGeneration"`
433 // The total number of nodes that are running updated daemon pod
435 UpdatedNumberScheduled int32 `json:"updatedNumberScheduled,omitempty" protobuf:"varint,6,opt,name=updatedNumberScheduled"`
437 // The number of nodes that should be running the
438 // daemon pod and have one or more of the daemon pod running and
439 // available (ready for at least spec.minReadySeconds)
441 NumberAvailable int32 `json:"numberAvailable,omitempty" protobuf:"varint,7,opt,name=numberAvailable"`
443 // The number of nodes that should be running the
444 // daemon pod and have none of the daemon pod running and available
445 // (ready for at least spec.minReadySeconds)
447 NumberUnavailable int32 `json:"numberUnavailable,omitempty" protobuf:"varint,8,opt,name=numberUnavailable"`
449 // Count of hash collisions for the DaemonSet. The DaemonSet controller
450 // uses this field as a collision avoidance mechanism when it needs to
451 // create the name for the newest ControllerRevision.
453 CollisionCount *int32 `json:"collisionCount,omitempty" protobuf:"varint,9,opt,name=collisionCount"`
455 // Represents the latest available observations of a DaemonSet's current state.
457 // +patchMergeKey=type
458 // +patchStrategy=merge
459 Conditions []DaemonSetCondition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type" protobuf:"bytes,10,rep,name=conditions"`
462 type DaemonSetConditionType string
464 // TODO: Add valid condition types of a DaemonSet.
466 // DaemonSetCondition describes the state of a DaemonSet at a certain point.
467 type DaemonSetCondition struct {
468 // Type of DaemonSet condition.
469 Type DaemonSetConditionType `json:"type" protobuf:"bytes,1,opt,name=type,casttype=DaemonSetConditionType"`
470 // Status of the condition, one of True, False, Unknown.
471 Status v1.ConditionStatus `json:"status" protobuf:"bytes,2,opt,name=status,casttype=k8s.io/api/core/v1.ConditionStatus"`
472 // Last time the condition transitioned from one status to another.
474 LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty" protobuf:"bytes,3,opt,name=lastTransitionTime"`
475 // The reason for the condition's last transition.
477 Reason string `json:"reason,omitempty" protobuf:"bytes,4,opt,name=reason"`
478 // A human readable message indicating details about the transition.
480 Message string `json:"message,omitempty" protobuf:"bytes,5,opt,name=message"`
484 // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
486 // DEPRECATED - This group version of DaemonSet is deprecated by apps/v1beta2/DaemonSet. See the release notes for
488 // DaemonSet represents the configuration of a daemon set.
489 type DaemonSet struct {
490 metav1.TypeMeta `json:",inline"`
491 // Standard object's metadata.
492 // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
494 metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
496 // The desired behavior of this daemon set.
497 // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status
499 Spec DaemonSetSpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"`
501 // The current status of this daemon set. This data may be
502 // out of date by some window of time.
503 // Populated by the system.
505 // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status
507 Status DaemonSetStatus `json:"status,omitempty" protobuf:"bytes,3,opt,name=status"`
511 // DEPRECATED: DefaultDaemonSetUniqueLabelKey is used instead.
512 // DaemonSetTemplateGenerationKey is the key of the labels that is added
513 // to daemon set pods to distinguish between old and new pod templates
514 // during DaemonSet template update.
515 DaemonSetTemplateGenerationKey string = "pod-template-generation"
517 // DefaultDaemonSetUniqueLabelKey is the default label key that is added
518 // to existing DaemonSet pods to distinguish between old and new
519 // DaemonSet pods during DaemonSet template updates.
520 DefaultDaemonSetUniqueLabelKey = appsv1beta1.ControllerRevisionHashLabelKey
523 // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
525 // DaemonSetList is a collection of daemon sets.
526 type DaemonSetList struct {
527 metav1.TypeMeta `json:",inline"`
528 // Standard list metadata.
529 // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
531 metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
533 // A list of daemon sets.
534 Items []DaemonSet `json:"items" protobuf:"bytes,2,rep,name=items"`
538 // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
540 // Ingress is a collection of rules that allow inbound connections to reach the
541 // endpoints defined by a backend. An Ingress can be configured to give services
542 // externally-reachable urls, load balance traffic, terminate SSL, offer name
543 // based virtual hosting etc.
544 type Ingress struct {
545 metav1.TypeMeta `json:",inline"`
546 // Standard object's metadata.
547 // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
549 metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
551 // Spec is the desired state of the Ingress.
552 // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status
554 Spec IngressSpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"`
556 // Status is the current state of the Ingress.
557 // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status
559 Status IngressStatus `json:"status,omitempty" protobuf:"bytes,3,opt,name=status"`
562 // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
564 // IngressList is a collection of Ingress.
565 type IngressList struct {
566 metav1.TypeMeta `json:",inline"`
567 // Standard object's metadata.
568 // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
570 metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
572 // Items is the list of Ingress.
573 Items []Ingress `json:"items" protobuf:"bytes,2,rep,name=items"`
576 // IngressSpec describes the Ingress the user wishes to exist.
577 type IngressSpec struct {
578 // A default backend capable of servicing requests that don't match any
579 // rule. At least one of 'backend' or 'rules' must be specified. This field
580 // is optional to allow the loadbalancer controller or defaulting logic to
581 // specify a global default.
583 Backend *IngressBackend `json:"backend,omitempty" protobuf:"bytes,1,opt,name=backend"`
585 // TLS configuration. Currently the Ingress only supports a single TLS
586 // port, 443. If multiple members of this list specify different hosts, they
587 // will be multiplexed on the same port according to the hostname specified
588 // through the SNI TLS extension, if the ingress controller fulfilling the
589 // ingress supports SNI.
591 TLS []IngressTLS `json:"tls,omitempty" protobuf:"bytes,2,rep,name=tls"`
593 // A list of host rules used to configure the Ingress. If unspecified, or
594 // no rule matches, all traffic is sent to the default backend.
596 Rules []IngressRule `json:"rules,omitempty" protobuf:"bytes,3,rep,name=rules"`
597 // TODO: Add the ability to specify load-balancer IP through claims
600 // IngressTLS describes the transport layer security associated with an Ingress.
601 type IngressTLS struct {
602 // Hosts are a list of hosts included in the TLS certificate. The values in
603 // this list must match the name/s used in the tlsSecret. Defaults to the
604 // wildcard host setting for the loadbalancer controller fulfilling this
605 // Ingress, if left unspecified.
607 Hosts []string `json:"hosts,omitempty" protobuf:"bytes,1,rep,name=hosts"`
608 // SecretName is the name of the secret used to terminate SSL traffic on 443.
609 // Field is left optional to allow SSL routing based on SNI hostname alone.
610 // If the SNI host in a listener conflicts with the "Host" header field used
611 // by an IngressRule, the SNI host is used for termination and value of the
612 // Host header is used for routing.
614 SecretName string `json:"secretName,omitempty" protobuf:"bytes,2,opt,name=secretName"`
615 // TODO: Consider specifying different modes of termination, protocols etc.
618 // IngressStatus describe the current state of the Ingress.
619 type IngressStatus struct {
620 // LoadBalancer contains the current status of the load-balancer.
622 LoadBalancer v1.LoadBalancerStatus `json:"loadBalancer,omitempty" protobuf:"bytes,1,opt,name=loadBalancer"`
625 // IngressRule represents the rules mapping the paths under a specified host to
626 // the related backend services. Incoming requests are first evaluated for a host
627 // match, then routed to the backend associated with the matching IngressRuleValue.
628 type IngressRule struct {
629 // Host is the fully qualified domain name of a network host, as defined
630 // by RFC 3986. Note the following deviations from the "host" part of the
631 // URI as defined in the RFC:
632 // 1. IPs are not allowed. Currently an IngressRuleValue can only apply to the
633 // IP in the Spec of the parent Ingress.
634 // 2. The `:` delimiter is not respected because ports are not allowed.
635 // Currently the port of an Ingress is implicitly :80 for http and
637 // Both these may change in the future.
638 // Incoming requests are matched against the host before the IngressRuleValue.
639 // If the host is unspecified, the Ingress routes all traffic based on the
640 // specified IngressRuleValue.
642 Host string `json:"host,omitempty" protobuf:"bytes,1,opt,name=host"`
643 // IngressRuleValue represents a rule to route requests for this IngressRule.
644 // If unspecified, the rule defaults to a http catch-all. Whether that sends
645 // just traffic matching the host to the default backend or all traffic to the
646 // default backend, is left to the controller fulfilling the Ingress. Http is
647 // currently the only supported IngressRuleValue.
649 IngressRuleValue `json:",inline,omitempty" protobuf:"bytes,2,opt,name=ingressRuleValue"`
652 // IngressRuleValue represents a rule to apply against incoming requests. If the
653 // rule is satisfied, the request is routed to the specified backend. Currently
654 // mixing different types of rules in a single Ingress is disallowed, so exactly
655 // one of the following must be set.
656 type IngressRuleValue struct {
658 // 1. Consider renaming this resource and the associated rules so they
659 // aren't tied to Ingress. They can be used to route intra-cluster traffic.
660 // 2. Consider adding fields for ingress-type specific global options
661 // usable by a loadbalancer, like http keep-alive.
664 HTTP *HTTPIngressRuleValue `json:"http,omitempty" protobuf:"bytes,1,opt,name=http"`
667 // HTTPIngressRuleValue is a list of http selectors pointing to backends.
668 // In the example: http://<host>/<path>?<searchpart> -> backend where
669 // where parts of the url correspond to RFC 3986, this resource will be used
670 // to match against everything after the last '/' and before the first '?'
672 type HTTPIngressRuleValue struct {
673 // A collection of paths that map requests to backends.
674 Paths []HTTPIngressPath `json:"paths" protobuf:"bytes,1,rep,name=paths"`
675 // TODO: Consider adding fields for ingress-type specific global
676 // options usable by a loadbalancer, like http keep-alive.
679 // HTTPIngressPath associates a path regex with a backend. Incoming urls matching
680 // the path are forwarded to the backend.
681 type HTTPIngressPath struct {
682 // Path is an extended POSIX regex as defined by IEEE Std 1003.1,
683 // (i.e this follows the egrep/unix syntax, not the perl syntax)
684 // matched against the path of an incoming request. Currently it can
685 // contain characters disallowed from the conventional "path"
686 // part of a URL as defined by RFC 3986. Paths must begin with
687 // a '/'. If unspecified, the path defaults to a catch all sending
688 // traffic to the backend.
690 Path string `json:"path,omitempty" protobuf:"bytes,1,opt,name=path"`
692 // Backend defines the referenced service endpoint to which the traffic
693 // will be forwarded to.
694 Backend IngressBackend `json:"backend" protobuf:"bytes,2,opt,name=backend"`
697 // IngressBackend describes all endpoints for a given service and port.
698 type IngressBackend struct {
699 // Specifies the name of the referenced service.
700 ServiceName string `json:"serviceName" protobuf:"bytes,1,opt,name=serviceName"`
702 // Specifies the port of the referenced service.
703 ServicePort intstr.IntOrString `json:"servicePort" protobuf:"bytes,2,opt,name=servicePort"`
707 // +genclient:method=GetScale,verb=get,subresource=scale,result=Scale
708 // +genclient:method=UpdateScale,verb=update,subresource=scale,input=Scale,result=Scale
709 // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
711 // DEPRECATED - This group version of ReplicaSet is deprecated by apps/v1beta2/ReplicaSet. See the release notes for
713 // ReplicaSet ensures that a specified number of pod replicas are running at any given time.
714 type ReplicaSet struct {
715 metav1.TypeMeta `json:",inline"`
717 // If the Labels of a ReplicaSet are empty, they are defaulted to
718 // be the same as the Pod(s) that the ReplicaSet manages.
719 // Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
721 metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
723 // Spec defines the specification of the desired behavior of the ReplicaSet.
724 // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status
726 Spec ReplicaSetSpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"`
728 // Status is the most recently observed status of the ReplicaSet.
729 // This data may be out of date by some window of time.
730 // Populated by the system.
732 // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status
734 Status ReplicaSetStatus `json:"status,omitempty" protobuf:"bytes,3,opt,name=status"`
737 // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
739 // ReplicaSetList is a collection of ReplicaSets.
740 type ReplicaSetList struct {
741 metav1.TypeMeta `json:",inline"`
742 // Standard list metadata.
743 // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds
745 metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
747 // List of ReplicaSets.
748 // More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller
749 Items []ReplicaSet `json:"items" protobuf:"bytes,2,rep,name=items"`
752 // ReplicaSetSpec is the specification of a ReplicaSet.
753 type ReplicaSetSpec struct {
754 // Replicas is the number of desired replicas.
755 // This is a pointer to distinguish between explicit zero and unspecified.
757 // More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller/#what-is-a-replicationcontroller
759 Replicas *int32 `json:"replicas,omitempty" protobuf:"varint,1,opt,name=replicas"`
761 // Minimum number of seconds for which a newly created pod should be ready
762 // without any of its container crashing, for it to be considered available.
763 // Defaults to 0 (pod will be considered available as soon as it is ready)
765 MinReadySeconds int32 `json:"minReadySeconds,omitempty" protobuf:"varint,4,opt,name=minReadySeconds"`
767 // Selector is a label query over pods that should match the replica count.
768 // If the selector is empty, it is defaulted to the labels present on the pod template.
769 // Label keys and values that must match in order to be controlled by this replica set.
770 // More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors
772 Selector *metav1.LabelSelector `json:"selector,omitempty" protobuf:"bytes,2,opt,name=selector"`
774 // Template is the object that describes the pod that will be created if
775 // insufficient replicas are detected.
776 // More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller#pod-template
778 Template v1.PodTemplateSpec `json:"template,omitempty" protobuf:"bytes,3,opt,name=template"`
781 // ReplicaSetStatus represents the current status of a ReplicaSet.
782 type ReplicaSetStatus struct {
783 // Replicas is the most recently oberved number of replicas.
784 // More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller/#what-is-a-replicationcontroller
785 Replicas int32 `json:"replicas" protobuf:"varint,1,opt,name=replicas"`
787 // The number of pods that have labels matching the labels of the pod template of the replicaset.
789 FullyLabeledReplicas int32 `json:"fullyLabeledReplicas,omitempty" protobuf:"varint,2,opt,name=fullyLabeledReplicas"`
791 // The number of ready replicas for this replica set.
793 ReadyReplicas int32 `json:"readyReplicas,omitempty" protobuf:"varint,4,opt,name=readyReplicas"`
795 // The number of available replicas (ready for at least minReadySeconds) for this replica set.
797 AvailableReplicas int32 `json:"availableReplicas,omitempty" protobuf:"varint,5,opt,name=availableReplicas"`
799 // ObservedGeneration reflects the generation of the most recently observed ReplicaSet.
801 ObservedGeneration int64 `json:"observedGeneration,omitempty" protobuf:"varint,3,opt,name=observedGeneration"`
803 // Represents the latest available observations of a replica set's current state.
805 // +patchMergeKey=type
806 // +patchStrategy=merge
807 Conditions []ReplicaSetCondition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type" protobuf:"bytes,6,rep,name=conditions"`
810 type ReplicaSetConditionType string
812 // These are valid conditions of a replica set.
814 // ReplicaSetReplicaFailure is added in a replica set when one of its pods fails to be created
815 // due to insufficient quota, limit ranges, pod security policy, node selectors, etc. or deleted
816 // due to kubelet being down or finalizers are failing.
817 ReplicaSetReplicaFailure ReplicaSetConditionType = "ReplicaFailure"
820 // ReplicaSetCondition describes the state of a replica set at a certain point.
821 type ReplicaSetCondition struct {
822 // Type of replica set condition.
823 Type ReplicaSetConditionType `json:"type" protobuf:"bytes,1,opt,name=type,casttype=ReplicaSetConditionType"`
824 // Status of the condition, one of True, False, Unknown.
825 Status v1.ConditionStatus `json:"status" protobuf:"bytes,2,opt,name=status,casttype=k8s.io/api/core/v1.ConditionStatus"`
826 // The last time the condition transitioned from one status to another.
828 LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty" protobuf:"bytes,3,opt,name=lastTransitionTime"`
829 // The reason for the condition's last transition.
831 Reason string `json:"reason,omitempty" protobuf:"bytes,4,opt,name=reason"`
832 // A human readable message indicating details about the transition.
834 Message string `json:"message,omitempty" protobuf:"bytes,5,opt,name=message"`
838 // +genclient:nonNamespaced
839 // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
841 // PodSecurityPolicy governs the ability to make requests that affect the Security Context
842 // that will be applied to a pod and container.
843 // Deprecated: use PodSecurityPolicy from policy API Group instead.
844 type PodSecurityPolicy struct {
845 metav1.TypeMeta `json:",inline"`
846 // Standard object's metadata.
847 // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
849 metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
851 // spec defines the policy enforced.
853 Spec PodSecurityPolicySpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"`
856 // PodSecurityPolicySpec defines the policy enforced.
857 // Deprecated: use PodSecurityPolicySpec from policy API Group instead.
858 type PodSecurityPolicySpec struct {
859 // privileged determines if a pod can request to be run as privileged.
861 Privileged bool `json:"privileged,omitempty" protobuf:"varint,1,opt,name=privileged"`
862 // defaultAddCapabilities is the default set of capabilities that will be added to the container
863 // unless the pod spec specifically drops the capability. You may not list a capability in both
864 // defaultAddCapabilities and requiredDropCapabilities. Capabilities added here are implicitly
865 // allowed, and need not be included in the allowedCapabilities list.
867 DefaultAddCapabilities []v1.Capability `json:"defaultAddCapabilities,omitempty" protobuf:"bytes,2,rep,name=defaultAddCapabilities,casttype=k8s.io/api/core/v1.Capability"`
868 // requiredDropCapabilities are the capabilities that will be dropped from the container. These
869 // are required to be dropped and cannot be added.
871 RequiredDropCapabilities []v1.Capability `json:"requiredDropCapabilities,omitempty" protobuf:"bytes,3,rep,name=requiredDropCapabilities,casttype=k8s.io/api/core/v1.Capability"`
872 // allowedCapabilities is a list of capabilities that can be requested to add to the container.
873 // Capabilities in this field may be added at the pod author's discretion.
874 // You must not list a capability in both allowedCapabilities and requiredDropCapabilities.
876 AllowedCapabilities []v1.Capability `json:"allowedCapabilities,omitempty" protobuf:"bytes,4,rep,name=allowedCapabilities,casttype=k8s.io/api/core/v1.Capability"`
877 // volumes is a white list of allowed volume plugins. Empty indicates that
878 // no volumes may be used. To allow all volumes you may use '*'.
880 Volumes []FSType `json:"volumes,omitempty" protobuf:"bytes,5,rep,name=volumes,casttype=FSType"`
881 // hostNetwork determines if the policy allows the use of HostNetwork in the pod spec.
883 HostNetwork bool `json:"hostNetwork,omitempty" protobuf:"varint,6,opt,name=hostNetwork"`
884 // hostPorts determines which host port ranges are allowed to be exposed.
886 HostPorts []HostPortRange `json:"hostPorts,omitempty" protobuf:"bytes,7,rep,name=hostPorts"`
887 // hostPID determines if the policy allows the use of HostPID in the pod spec.
889 HostPID bool `json:"hostPID,omitempty" protobuf:"varint,8,opt,name=hostPID"`
890 // hostIPC determines if the policy allows the use of HostIPC in the pod spec.
892 HostIPC bool `json:"hostIPC,omitempty" protobuf:"varint,9,opt,name=hostIPC"`
893 // seLinux is the strategy that will dictate the allowable labels that may be set.
894 SELinux SELinuxStrategyOptions `json:"seLinux" protobuf:"bytes,10,opt,name=seLinux"`
895 // runAsUser is the strategy that will dictate the allowable RunAsUser values that may be set.
896 RunAsUser RunAsUserStrategyOptions `json:"runAsUser" protobuf:"bytes,11,opt,name=runAsUser"`
897 // RunAsGroup is the strategy that will dictate the allowable RunAsGroup values that may be set.
898 // If this field is omitted, the pod's RunAsGroup can take any value. This field requires the
899 // RunAsGroup feature gate to be enabled.
901 RunAsGroup *RunAsGroupStrategyOptions `json:"runAsGroup,omitempty" protobuf:"bytes,22,opt,name=runAsGroup"`
902 // supplementalGroups is the strategy that will dictate what supplemental groups are used by the SecurityContext.
903 SupplementalGroups SupplementalGroupsStrategyOptions `json:"supplementalGroups" protobuf:"bytes,12,opt,name=supplementalGroups"`
904 // fsGroup is the strategy that will dictate what fs group is used by the SecurityContext.
905 FSGroup FSGroupStrategyOptions `json:"fsGroup" protobuf:"bytes,13,opt,name=fsGroup"`
906 // readOnlyRootFilesystem when set to true will force containers to run with a read only root file
907 // system. If the container specifically requests to run with a non-read only root file system
908 // the PSP should deny the pod.
909 // If set to false the container may run with a read only root file system if it wishes but it
910 // will not be forced to.
912 ReadOnlyRootFilesystem bool `json:"readOnlyRootFilesystem,omitempty" protobuf:"varint,14,opt,name=readOnlyRootFilesystem"`
913 // defaultAllowPrivilegeEscalation controls the default setting for whether a
914 // process can gain more privileges than its parent process.
916 DefaultAllowPrivilegeEscalation *bool `json:"defaultAllowPrivilegeEscalation,omitempty" protobuf:"varint,15,opt,name=defaultAllowPrivilegeEscalation"`
917 // allowPrivilegeEscalation determines if a pod can request to allow
918 // privilege escalation. If unspecified, defaults to true.
920 AllowPrivilegeEscalation *bool `json:"allowPrivilegeEscalation,omitempty" protobuf:"varint,16,opt,name=allowPrivilegeEscalation"`
921 // allowedHostPaths is a white list of allowed host paths. Empty indicates
922 // that all host paths may be used.
924 AllowedHostPaths []AllowedHostPath `json:"allowedHostPaths,omitempty" protobuf:"bytes,17,rep,name=allowedHostPaths"`
925 // allowedFlexVolumes is a whitelist of allowed Flexvolumes. Empty or nil indicates that all
926 // Flexvolumes may be used. This parameter is effective only when the usage of the Flexvolumes
927 // is allowed in the "volumes" field.
929 AllowedFlexVolumes []AllowedFlexVolume `json:"allowedFlexVolumes,omitempty" protobuf:"bytes,18,rep,name=allowedFlexVolumes"`
930 // allowedUnsafeSysctls is a list of explicitly allowed unsafe sysctls, defaults to none.
931 // Each entry is either a plain sysctl name or ends in "*" in which case it is considered
932 // as a prefix of allowed sysctls. Single * means all unsafe sysctls are allowed.
933 // Kubelet has to whitelist all allowed unsafe sysctls explicitly to avoid rejection.
936 // e.g. "foo/*" allows "foo/bar", "foo/baz", etc.
937 // e.g. "foo.*" allows "foo.bar", "foo.baz", etc.
939 AllowedUnsafeSysctls []string `json:"allowedUnsafeSysctls,omitempty" protobuf:"bytes,19,rep,name=allowedUnsafeSysctls"`
940 // forbiddenSysctls is a list of explicitly forbidden sysctls, defaults to none.
941 // Each entry is either a plain sysctl name or ends in "*" in which case it is considered
942 // as a prefix of forbidden sysctls. Single * means all sysctls are forbidden.
945 // e.g. "foo/*" forbids "foo/bar", "foo/baz", etc.
946 // e.g. "foo.*" forbids "foo.bar", "foo.baz", etc.
948 ForbiddenSysctls []string `json:"forbiddenSysctls,omitempty" protobuf:"bytes,20,rep,name=forbiddenSysctls"`
949 // AllowedProcMountTypes is a whitelist of allowed ProcMountTypes.
950 // Empty or nil indicates that only the DefaultProcMountType may be used.
951 // This requires the ProcMountType feature flag to be enabled.
953 AllowedProcMountTypes []v1.ProcMountType `json:"allowedProcMountTypes,omitempty" protobuf:"bytes,21,opt,name=allowedProcMountTypes"`
956 // AllowedHostPath defines the host volume conditions that will be enabled by a policy
957 // for pods to use. It requires the path prefix to be defined.
958 // Deprecated: use AllowedHostPath from policy API Group instead.
959 type AllowedHostPath struct {
960 // pathPrefix is the path prefix that the host volume must match.
961 // It does not support `*`.
962 // Trailing slashes are trimmed when validating the path prefix with a host path.
965 // `/foo` would allow `/foo`, `/foo/` and `/foo/bar`
966 // `/foo` would not allow `/food` or `/etc/foo`
967 PathPrefix string `json:"pathPrefix,omitempty" protobuf:"bytes,1,rep,name=pathPrefix"`
969 // when set to true, will allow host volumes matching the pathPrefix only if all volume mounts are readOnly.
971 ReadOnly bool `json:"readOnly,omitempty" protobuf:"varint,2,opt,name=readOnly"`
974 // FSType gives strong typing to different file systems that are used by volumes.
975 // Deprecated: use FSType from policy API Group instead.
979 AzureFile FSType = "azureFile"
980 Flocker FSType = "flocker"
981 FlexVolume FSType = "flexVolume"
982 HostPath FSType = "hostPath"
983 EmptyDir FSType = "emptyDir"
984 GCEPersistentDisk FSType = "gcePersistentDisk"
985 AWSElasticBlockStore FSType = "awsElasticBlockStore"
986 GitRepo FSType = "gitRepo"
987 Secret FSType = "secret"
989 ISCSI FSType = "iscsi"
990 Glusterfs FSType = "glusterfs"
991 PersistentVolumeClaim FSType = "persistentVolumeClaim"
993 Cinder FSType = "cinder"
994 CephFS FSType = "cephFS"
995 DownwardAPI FSType = "downwardAPI"
997 ConfigMap FSType = "configMap"
998 Quobyte FSType = "quobyte"
999 AzureDisk FSType = "azureDisk"
1003 // AllowedFlexVolume represents a single Flexvolume that is allowed to be used.
1004 // Deprecated: use AllowedFlexVolume from policy API Group instead.
1005 type AllowedFlexVolume struct {
1006 // driver is the name of the Flexvolume driver.
1007 Driver string `json:"driver" protobuf:"bytes,1,opt,name=driver"`
1010 // HostPortRange defines a range of host ports that will be enabled by a policy
1011 // for pods to use. It requires both the start and end to be defined.
1012 // Deprecated: use HostPortRange from policy API Group instead.
1013 type HostPortRange struct {
1014 // min is the start of the range, inclusive.
1015 Min int32 `json:"min" protobuf:"varint,1,opt,name=min"`
1016 // max is the end of the range, inclusive.
1017 Max int32 `json:"max" protobuf:"varint,2,opt,name=max"`
1020 // SELinuxStrategyOptions defines the strategy type and any options used to create the strategy.
1021 // Deprecated: use SELinuxStrategyOptions from policy API Group instead.
1022 type SELinuxStrategyOptions struct {
1023 // rule is the strategy that will dictate the allowable labels that may be set.
1024 Rule SELinuxStrategy `json:"rule" protobuf:"bytes,1,opt,name=rule,casttype=SELinuxStrategy"`
1025 // seLinuxOptions required to run as; required for MustRunAs
1026 // More info: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/
1028 SELinuxOptions *v1.SELinuxOptions `json:"seLinuxOptions,omitempty" protobuf:"bytes,2,opt,name=seLinuxOptions"`
1031 // SELinuxStrategy denotes strategy types for generating SELinux options for a
1032 // Security Context.
1033 // Deprecated: use SELinuxStrategy from policy API Group instead.
1034 type SELinuxStrategy string
1037 // SELinuxStrategyMustRunAs means that container must have SELinux labels of X applied.
1038 // Deprecated: use SELinuxStrategyMustRunAs from policy API Group instead.
1039 SELinuxStrategyMustRunAs SELinuxStrategy = "MustRunAs"
1040 // SELinuxStrategyRunAsAny means that container may make requests for any SELinux context labels.
1041 // Deprecated: use SELinuxStrategyRunAsAny from policy API Group instead.
1042 SELinuxStrategyRunAsAny SELinuxStrategy = "RunAsAny"
1045 // RunAsUserStrategyOptions defines the strategy type and any options used to create the strategy.
1046 // Deprecated: use RunAsUserStrategyOptions from policy API Group instead.
1047 type RunAsUserStrategyOptions struct {
1048 // rule is the strategy that will dictate the allowable RunAsUser values that may be set.
1049 Rule RunAsUserStrategy `json:"rule" protobuf:"bytes,1,opt,name=rule,casttype=RunAsUserStrategy"`
1050 // ranges are the allowed ranges of uids that may be used. If you would like to force a single uid
1051 // then supply a single range with the same start and end. Required for MustRunAs.
1053 Ranges []IDRange `json:"ranges,omitempty" protobuf:"bytes,2,rep,name=ranges"`
1056 // RunAsGroupStrategyOptions defines the strategy type and any options used to create the strategy.
1057 // Deprecated: use RunAsGroupStrategyOptions from policy API Group instead.
1058 type RunAsGroupStrategyOptions struct {
1059 // rule is the strategy that will dictate the allowable RunAsGroup values that may be set.
1060 Rule RunAsGroupStrategy `json:"rule" protobuf:"bytes,1,opt,name=rule,casttype=RunAsGroupStrategy"`
1061 // ranges are the allowed ranges of gids that may be used. If you would like to force a single gid
1062 // then supply a single range with the same start and end. Required for MustRunAs.
1064 Ranges []IDRange `json:"ranges,omitempty" protobuf:"bytes,2,rep,name=ranges"`
1067 // IDRange provides a min/max of an allowed range of IDs.
1068 // Deprecated: use IDRange from policy API Group instead.
1069 type IDRange struct {
1070 // min is the start of the range, inclusive.
1071 Min int64 `json:"min" protobuf:"varint,1,opt,name=min"`
1072 // max is the end of the range, inclusive.
1073 Max int64 `json:"max" protobuf:"varint,2,opt,name=max"`
1076 // RunAsUserStrategy denotes strategy types for generating RunAsUser values for a
1077 // Security Context.
1078 // Deprecated: use RunAsUserStrategy from policy API Group instead.
1079 type RunAsUserStrategy string
1082 // RunAsUserStrategyMustRunAs means that container must run as a particular uid.
1083 // Deprecated: use RunAsUserStrategyMustRunAs from policy API Group instead.
1084 RunAsUserStrategyMustRunAs RunAsUserStrategy = "MustRunAs"
1085 // RunAsUserStrategyMustRunAsNonRoot means that container must run as a non-root uid.
1086 // Deprecated: use RunAsUserStrategyMustRunAsNonRoot from policy API Group instead.
1087 RunAsUserStrategyMustRunAsNonRoot RunAsUserStrategy = "MustRunAsNonRoot"
1088 // RunAsUserStrategyRunAsAny means that container may make requests for any uid.
1089 // Deprecated: use RunAsUserStrategyRunAsAny from policy API Group instead.
1090 RunAsUserStrategyRunAsAny RunAsUserStrategy = "RunAsAny"
1093 // RunAsGroupStrategy denotes strategy types for generating RunAsGroup values for a
1094 // Security Context.
1095 // Deprecated: use RunAsGroupStrategy from policy API Group instead.
1096 type RunAsGroupStrategy string
1099 // RunAsGroupStrategyMayRunAs means that container does not need to run with a particular gid.
1100 // However, when RunAsGroup are specified, they have to fall in the defined range.
1101 RunAsGroupStrategyMayRunAs RunAsGroupStrategy = "MayRunAs"
1102 // RunAsGroupStrategyMustRunAs means that container must run as a particular gid.
1103 // Deprecated: use RunAsGroupStrategyMustRunAs from policy API Group instead.
1104 RunAsGroupStrategyMustRunAs RunAsGroupStrategy = "MustRunAs"
1105 // RunAsGroupStrategyRunAsAny means that container may make requests for any gid.
1106 // Deprecated: use RunAsGroupStrategyRunAsAny from policy API Group instead.
1107 RunAsGroupStrategyRunAsAny RunAsGroupStrategy = "RunAsAny"
1110 // FSGroupStrategyOptions defines the strategy type and options used to create the strategy.
1111 // Deprecated: use FSGroupStrategyOptions from policy API Group instead.
1112 type FSGroupStrategyOptions struct {
1113 // rule is the strategy that will dictate what FSGroup is used in the SecurityContext.
1115 Rule FSGroupStrategyType `json:"rule,omitempty" protobuf:"bytes,1,opt,name=rule,casttype=FSGroupStrategyType"`
1116 // ranges are the allowed ranges of fs groups. If you would like to force a single
1117 // fs group then supply a single range with the same start and end. Required for MustRunAs.
1119 Ranges []IDRange `json:"ranges,omitempty" protobuf:"bytes,2,rep,name=ranges"`
1122 // FSGroupStrategyType denotes strategy types for generating FSGroup values for a
1124 // Deprecated: use FSGroupStrategyType from policy API Group instead.
1125 type FSGroupStrategyType string
1128 // FSGroupStrategyMustRunAs meant that container must have FSGroup of X applied.
1129 // Deprecated: use FSGroupStrategyMustRunAs from policy API Group instead.
1130 FSGroupStrategyMustRunAs FSGroupStrategyType = "MustRunAs"
1131 // FSGroupStrategyRunAsAny means that container may make requests for any FSGroup labels.
1132 // Deprecated: use FSGroupStrategyRunAsAny from policy API Group instead.
1133 FSGroupStrategyRunAsAny FSGroupStrategyType = "RunAsAny"
1136 // SupplementalGroupsStrategyOptions defines the strategy type and options used to create the strategy.
1137 // Deprecated: use SupplementalGroupsStrategyOptions from policy API Group instead.
1138 type SupplementalGroupsStrategyOptions struct {
1139 // rule is the strategy that will dictate what supplemental groups is used in the SecurityContext.
1141 Rule SupplementalGroupsStrategyType `json:"rule,omitempty" protobuf:"bytes,1,opt,name=rule,casttype=SupplementalGroupsStrategyType"`
1142 // ranges are the allowed ranges of supplemental groups. If you would like to force a single
1143 // supplemental group then supply a single range with the same start and end. Required for MustRunAs.
1145 Ranges []IDRange `json:"ranges,omitempty" protobuf:"bytes,2,rep,name=ranges"`
1148 // SupplementalGroupsStrategyType denotes strategy types for determining valid supplemental
1149 // groups for a SecurityContext.
1150 // Deprecated: use SupplementalGroupsStrategyType from policy API Group instead.
1151 type SupplementalGroupsStrategyType string
1154 // SupplementalGroupsStrategyMustRunAs means that container must run as a particular gid.
1155 // Deprecated: use SupplementalGroupsStrategyMustRunAs from policy API Group instead.
1156 SupplementalGroupsStrategyMustRunAs SupplementalGroupsStrategyType = "MustRunAs"
1157 // SupplementalGroupsStrategyRunAsAny means that container may make requests for any gid.
1158 // Deprecated: use SupplementalGroupsStrategyRunAsAny from policy API Group instead.
1159 SupplementalGroupsStrategyRunAsAny SupplementalGroupsStrategyType = "RunAsAny"
1162 // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
1164 // PodSecurityPolicyList is a list of PodSecurityPolicy objects.
1165 // Deprecated: use PodSecurityPolicyList from policy API Group instead.
1166 type PodSecurityPolicyList struct {
1167 metav1.TypeMeta `json:",inline"`
1168 // Standard list metadata.
1169 // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
1171 metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
1173 // items is a list of schema objects.
1174 Items []PodSecurityPolicy `json:"items" protobuf:"bytes,2,rep,name=items"`
1177 // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
1179 // DEPRECATED 1.9 - This group version of NetworkPolicy is deprecated by networking/v1/NetworkPolicy.
1180 // NetworkPolicy describes what network traffic is allowed for a set of Pods
1181 type NetworkPolicy struct {
1182 metav1.TypeMeta `json:",inline"`
1183 // Standard object's metadata.
1184 // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
1186 metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
1188 // Specification of the desired behavior for this NetworkPolicy.
1190 Spec NetworkPolicySpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"`
1193 // DEPRECATED 1.9 - This group version of PolicyType is deprecated by networking/v1/PolicyType.
1194 // Policy Type string describes the NetworkPolicy type
1195 // This type is beta-level in 1.8
1196 type PolicyType string
1199 // PolicyTypeIngress is a NetworkPolicy that affects ingress traffic on selected pods
1200 PolicyTypeIngress PolicyType = "Ingress"
1201 // PolicyTypeEgress is a NetworkPolicy that affects egress traffic on selected pods
1202 PolicyTypeEgress PolicyType = "Egress"
1205 // DEPRECATED 1.9 - This group version of NetworkPolicySpec is deprecated by networking/v1/NetworkPolicySpec.
1206 type NetworkPolicySpec struct {
1207 // Selects the pods to which this NetworkPolicy object applies. The array of ingress rules
1208 // is applied to any pods selected by this field. Multiple network policies can select the
1209 // same set of pods. In this case, the ingress rules for each are combined additively.
1210 // This field is NOT optional and follows standard label selector semantics.
1211 // An empty podSelector matches all pods in this namespace.
1212 PodSelector metav1.LabelSelector `json:"podSelector" protobuf:"bytes,1,opt,name=podSelector"`
1214 // List of ingress rules to be applied to the selected pods.
1215 // Traffic is allowed to a pod if there are no NetworkPolicies selecting the pod
1216 // OR if the traffic source is the pod's local node,
1217 // OR if the traffic matches at least one ingress rule across all of the NetworkPolicy
1218 // objects whose podSelector matches the pod.
1219 // If this field is empty then this NetworkPolicy does not allow any traffic
1220 // (and serves solely to ensure that the pods it selects are isolated by default).
1222 Ingress []NetworkPolicyIngressRule `json:"ingress,omitempty" protobuf:"bytes,2,rep,name=ingress"`
1224 // List of egress rules to be applied to the selected pods. Outgoing traffic is
1225 // allowed if there are no NetworkPolicies selecting the pod (and cluster policy
1226 // otherwise allows the traffic), OR if the traffic matches at least one egress rule
1227 // across all of the NetworkPolicy objects whose podSelector matches the pod. If
1228 // this field is empty then this NetworkPolicy limits all outgoing traffic (and serves
1229 // solely to ensure that the pods it selects are isolated by default).
1230 // This field is beta-level in 1.8
1232 Egress []NetworkPolicyEgressRule `json:"egress,omitempty" protobuf:"bytes,3,rep,name=egress"`
1234 // List of rule types that the NetworkPolicy relates to.
1235 // Valid options are Ingress, Egress, or Ingress,Egress.
1236 // If this field is not specified, it will default based on the existence of Ingress or Egress rules;
1237 // policies that contain an Egress section are assumed to affect Egress, and all policies
1238 // (whether or not they contain an Ingress section) are assumed to affect Ingress.
1239 // If you want to write an egress-only policy, you must explicitly specify policyTypes [ "Egress" ].
1240 // Likewise, if you want to write a policy that specifies that no egress is allowed,
1241 // you must specify a policyTypes value that include "Egress" (since such a policy would not include
1242 // an Egress section and would otherwise default to just [ "Ingress" ]).
1243 // This field is beta-level in 1.8
1245 PolicyTypes []PolicyType `json:"policyTypes,omitempty" protobuf:"bytes,4,rep,name=policyTypes,casttype=PolicyType"`
1248 // DEPRECATED 1.9 - This group version of NetworkPolicyIngressRule is deprecated by networking/v1/NetworkPolicyIngressRule.
1249 // This NetworkPolicyIngressRule matches traffic if and only if the traffic matches both ports AND from.
1250 type NetworkPolicyIngressRule struct {
1251 // List of ports which should be made accessible on the pods selected for this rule.
1252 // Each item in this list is combined using a logical OR.
1253 // If this field is empty or missing, this rule matches all ports (traffic not restricted by port).
1254 // If this field is present and contains at least one item, then this rule allows traffic
1255 // only if the traffic matches at least one port in the list.
1257 Ports []NetworkPolicyPort `json:"ports,omitempty" protobuf:"bytes,1,rep,name=ports"`
1259 // List of sources which should be able to access the pods selected for this rule.
1260 // Items in this list are combined using a logical OR operation.
1261 // If this field is empty or missing, this rule matches all sources (traffic not restricted by source).
1262 // If this field is present and contains at least on item, this rule allows traffic only if the
1263 // traffic matches at least one item in the from list.
1265 From []NetworkPolicyPeer `json:"from,omitempty" protobuf:"bytes,2,rep,name=from"`
1268 // DEPRECATED 1.9 - This group version of NetworkPolicyEgressRule is deprecated by networking/v1/NetworkPolicyEgressRule.
1269 // NetworkPolicyEgressRule describes a particular set of traffic that is allowed out of pods
1270 // matched by a NetworkPolicySpec's podSelector. The traffic must match both ports and to.
1271 // This type is beta-level in 1.8
1272 type NetworkPolicyEgressRule struct {
1273 // List of destination ports for outgoing traffic.
1274 // Each item in this list is combined using a logical OR. If this field is
1275 // empty or missing, this rule matches all ports (traffic not restricted by port).
1276 // If this field is present and contains at least one item, then this rule allows
1277 // traffic only if the traffic matches at least one port in the list.
1279 Ports []NetworkPolicyPort `json:"ports,omitempty" protobuf:"bytes,1,rep,name=ports"`
1281 // List of destinations for outgoing traffic of pods selected for this rule.
1282 // Items in this list are combined using a logical OR operation. If this field is
1283 // empty or missing, this rule matches all destinations (traffic not restricted by
1284 // destination). If this field is present and contains at least one item, this rule
1285 // allows traffic only if the traffic matches at least one item in the to list.
1287 To []NetworkPolicyPeer `json:"to,omitempty" protobuf:"bytes,2,rep,name=to"`
1290 // DEPRECATED 1.9 - This group version of NetworkPolicyPort is deprecated by networking/v1/NetworkPolicyPort.
1291 type NetworkPolicyPort struct {
1292 // Optional. The protocol (TCP, UDP, or SCTP) which traffic must match.
1293 // If not specified, this field defaults to TCP.
1295 Protocol *v1.Protocol `json:"protocol,omitempty" protobuf:"bytes,1,opt,name=protocol,casttype=k8s.io/api/core/v1.Protocol"`
1297 // If specified, the port on the given protocol. This can
1298 // either be a numerical or named port on a pod. If this field is not provided,
1299 // this matches all port names and numbers.
1300 // If present, only traffic on the specified protocol AND port
1303 Port *intstr.IntOrString `json:"port,omitempty" protobuf:"bytes,2,opt,name=port"`
1306 // DEPRECATED 1.9 - This group version of IPBlock is deprecated by networking/v1/IPBlock.
1307 // IPBlock describes a particular CIDR (Ex. "192.168.1.1/24") that is allowed to the pods
1308 // matched by a NetworkPolicySpec's podSelector. The except entry describes CIDRs that should
1309 // not be included within this rule.
1310 type IPBlock struct {
1311 // CIDR is a string representing the IP Block
1312 // Valid examples are "192.168.1.1/24"
1313 CIDR string `json:"cidr" protobuf:"bytes,1,name=cidr"`
1314 // Except is a slice of CIDRs that should not be included within an IP Block
1315 // Valid examples are "192.168.1.1/24"
1316 // Except values will be rejected if they are outside the CIDR range
1318 Except []string `json:"except,omitempty" protobuf:"bytes,2,rep,name=except"`
1321 // DEPRECATED 1.9 - This group version of NetworkPolicyPeer is deprecated by networking/v1/NetworkPolicyPeer.
1322 type NetworkPolicyPeer struct {
1323 // This is a label selector which selects Pods. This field follows standard label
1324 // selector semantics; if present but empty, it selects all pods.
1326 // If NamespaceSelector is also set, then the NetworkPolicyPeer as a whole selects
1327 // the Pods matching PodSelector in the Namespaces selected by NamespaceSelector.
1328 // Otherwise it selects the Pods matching PodSelector in the policy's own Namespace.
1330 PodSelector *metav1.LabelSelector `json:"podSelector,omitempty" protobuf:"bytes,1,opt,name=podSelector"`
1332 // Selects Namespaces using cluster-scoped labels. This field follows standard label
1333 // selector semantics; if present but empty, it selects all namespaces.
1335 // If PodSelector is also set, then the NetworkPolicyPeer as a whole selects
1336 // the Pods matching PodSelector in the Namespaces selected by NamespaceSelector.
1337 // Otherwise it selects all Pods in the Namespaces selected by NamespaceSelector.
1339 NamespaceSelector *metav1.LabelSelector `json:"namespaceSelector,omitempty" protobuf:"bytes,2,opt,name=namespaceSelector"`
1341 // IPBlock defines policy on a particular IPBlock. If this field is set then
1342 // neither of the other fields can be.
1344 IPBlock *IPBlock `json:"ipBlock,omitempty" protobuf:"bytes,3,rep,name=ipBlock"`
1347 // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
1349 // DEPRECATED 1.9 - This group version of NetworkPolicyList is deprecated by networking/v1/NetworkPolicyList.
1350 // Network Policy List is a list of NetworkPolicy objects.
1351 type NetworkPolicyList struct {
1352 metav1.TypeMeta `json:",inline"`
1353 // Standard list metadata.
1354 // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
1356 metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
1358 // Items is a list of schema objects.
1359 Items []NetworkPolicy `json:"items" protobuf:"bytes,2,rep,name=items"`