blob: 5ba6f95854528db3d8feb3b4f079b72c566aeaf4 [file] [log] [blame]
sslobodrd046be82019-01-16 10:02:22 -05001/*
2Copyright 2015 The Kubernetes Authors.
3
4Licensed under the Apache License, Version 2.0 (the "License");
5you may not use this file except in compliance with the License.
6You may obtain a copy of the License at
7
8 http://www.apache.org/licenses/LICENSE-2.0
9
10Unless required by applicable law or agreed to in writing, software
11distributed under the License is distributed on an "AS IS" BASIS,
12WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13See the License for the specific language governing permissions and
14limitations under the License.
15*/
16
17package v1beta1
18
19import (
20 appsv1beta1 "k8s.io/api/apps/v1beta1"
21 "k8s.io/api/core/v1"
22 metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
23 "k8s.io/apimachinery/pkg/util/intstr"
24)
25
26// describes the attributes of a scale subresource
27type ScaleSpec struct {
28 // desired number of instances for the scaled object.
29 // +optional
30 Replicas int32 `json:"replicas,omitempty" protobuf:"varint,1,opt,name=replicas"`
31}
32
33// represents the current status of a scale subresource.
34type ScaleStatus struct {
35 // actual number of observed instances of the scaled object.
36 Replicas int32 `json:"replicas" protobuf:"varint,1,opt,name=replicas"`
37
38 // label query over pods that should match the replicas count. More info: http://kubernetes.io/docs/user-guide/labels#label-selectors
39 // +optional
40 Selector map[string]string `json:"selector,omitempty" protobuf:"bytes,2,rep,name=selector"`
41
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
48 // +optional
49 TargetSelector string `json:"targetSelector,omitempty" protobuf:"bytes,3,opt,name=targetSelector"`
50}
51
52// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
53
54// represents a scaling request for a resource.
55type Scale struct {
56 metav1.TypeMeta `json:",inline"`
57 // Standard object metadata; More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata.
58 // +optional
59 metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
60
61 // defines the behavior of the scale. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status.
62 // +optional
63 Spec ScaleSpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"`
64
65 // current status of the scale. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status. Read-only.
66 // +optional
67 Status ScaleStatus `json:"status,omitempty" protobuf:"bytes,3,opt,name=status"`
68}
69
70// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
71
72// Dummy definition
73type ReplicationControllerDummy struct {
74 metav1.TypeMeta `json:",inline"`
75}
76
77// +genclient
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
81
82// DEPRECATED - This group version of Deployment is deprecated by apps/v1beta2/Deployment. See the release notes for
83// more information.
84// Deployment enables declarative updates for Pods and ReplicaSets.
85type Deployment struct {
86 metav1.TypeMeta `json:",inline"`
87 // Standard object metadata.
88 // +optional
89 metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
90
91 // Specification of the desired behavior of the Deployment.
92 // +optional
93 Spec DeploymentSpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"`
94
95 // Most recently observed status of the Deployment.
96 // +optional
97 Status DeploymentStatus `json:"status,omitempty" protobuf:"bytes,3,opt,name=status"`
98}
99
100// DeploymentSpec is the specification of the desired behavior of the Deployment.
101type DeploymentSpec struct {
102 // Number of desired pods. This is a pointer to distinguish between explicit
103 // zero and not specified. Defaults to 1.
104 // +optional
105 Replicas *int32 `json:"replicas,omitempty" protobuf:"varint,1,opt,name=replicas"`
106
107 // Label selector for pods. Existing ReplicaSets whose pods are
108 // selected by this will be the ones affected by this deployment.
109 // +optional
110 Selector *metav1.LabelSelector `json:"selector,omitempty" protobuf:"bytes,2,opt,name=selector"`
111
112 // Template describes the pods that will be created.
113 Template v1.PodTemplateSpec `json:"template" protobuf:"bytes,3,opt,name=template"`
114
115 // The deployment strategy to use to replace existing pods with new ones.
116 // +optional
117 // +patchStrategy=retainKeys
118 Strategy DeploymentStrategy `json:"strategy,omitempty" patchStrategy:"retainKeys" protobuf:"bytes,4,opt,name=strategy"`
119
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)
123 // +optional
124 MinReadySeconds int32 `json:"minReadySeconds,omitempty" protobuf:"varint,5,opt,name=minReadySeconds"`
125
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".
130 // +optional
131 RevisionHistoryLimit *int32 `json:"revisionHistoryLimit,omitempty" protobuf:"varint,6,opt,name=revisionHistoryLimit"`
132
133 // Indicates that the deployment is paused and will not be processed by the
134 // deployment controller.
135 // +optional
136 Paused bool `json:"paused,omitempty" protobuf:"varint,7,opt,name=paused"`
137
138 // DEPRECATED.
139 // The config this deployment is rolling back to. Will be cleared after rollback is done.
140 // +optional
141 RollbackTo *RollbackConfig `json:"rollbackTo,omitempty" protobuf:"bytes,8,opt,name=rollbackTo"`
142
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".
149 // +optional
150 ProgressDeadlineSeconds *int32 `json:"progressDeadlineSeconds,omitempty" protobuf:"varint,9,opt,name=progressDeadlineSeconds"`
151}
152
153// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
154
155// DEPRECATED.
156// DeploymentRollback stores the information required to rollback a deployment.
157type 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
162 // +optional
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"`
166}
167
168// DEPRECATED.
169type RollbackConfig struct {
170 // The revision to rollback to. If set to 0, rollback to the last revision.
171 // +optional
172 Revision int64 `json:"revision,omitempty" protobuf:"varint,1,opt,name=revision"`
173}
174
175const (
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"
180)
181
182// DeploymentStrategy describes how to replace existing pods with new ones.
183type DeploymentStrategy struct {
184 // Type of deployment. Can be "Recreate" or "RollingUpdate". Default is RollingUpdate.
185 // +optional
186 Type DeploymentStrategyType `json:"type,omitempty" protobuf:"bytes,1,opt,name=type,casttype=DeploymentStrategyType"`
187
188 // Rolling update config params. Present only if DeploymentStrategyType =
189 // RollingUpdate.
190 //---
191 // TODO: Update this to follow our convention for oneOf, whatever we decide it
192 // to be.
193 // +optional
194 RollingUpdate *RollingUpdateDeployment `json:"rollingUpdate,omitempty" protobuf:"bytes,2,opt,name=rollingUpdate"`
195}
196
197type DeploymentStrategyType string
198
199const (
200 // Kill all existing pods before creating new ones.
201 RecreateDeploymentStrategyType DeploymentStrategyType = "Recreate"
202
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"
205)
206
207// Spec to control the desired behavior of rolling update.
208type 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.
219 // +optional
220 MaxUnavailable *intstr.IntOrString `json:"maxUnavailable,omitempty" protobuf:"bytes,1,opt,name=maxUnavailable"`
221
222 // The maximum number of pods that can be scheduled above the desired number of
223 // pods.
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.
233 // +optional
234 MaxSurge *intstr.IntOrString `json:"maxSurge,omitempty" protobuf:"bytes,2,opt,name=maxSurge"`
235}
236
237// DeploymentStatus is the most recently observed status of the Deployment.
238type DeploymentStatus struct {
239 // The generation observed by the deployment controller.
240 // +optional
241 ObservedGeneration int64 `json:"observedGeneration,omitempty" protobuf:"varint,1,opt,name=observedGeneration"`
242
243 // Total number of non-terminated pods targeted by this deployment (their labels match the selector).
244 // +optional
245 Replicas int32 `json:"replicas,omitempty" protobuf:"varint,2,opt,name=replicas"`
246
247 // Total number of non-terminated pods targeted by this deployment that have the desired template spec.
248 // +optional
249 UpdatedReplicas int32 `json:"updatedReplicas,omitempty" protobuf:"varint,3,opt,name=updatedReplicas"`
250
251 // Total number of ready pods targeted by this deployment.
252 // +optional
253 ReadyReplicas int32 `json:"readyReplicas,omitempty" protobuf:"varint,7,opt,name=readyReplicas"`
254
255 // Total number of available pods (ready for at least minReadySeconds) targeted by this deployment.
256 // +optional
257 AvailableReplicas int32 `json:"availableReplicas,omitempty" protobuf:"varint,4,opt,name=availableReplicas"`
258
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.
262 // +optional
263 UnavailableReplicas int32 `json:"unavailableReplicas,omitempty" protobuf:"varint,5,opt,name=unavailableReplicas"`
264
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"`
269
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.
273 // +optional
274 CollisionCount *int32 `json:"collisionCount,omitempty" protobuf:"varint,8,opt,name=collisionCount"`
275}
276
277type DeploymentConditionType string
278
279// These are valid conditions of a deployment.
280const (
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
290 // or deleted.
291 DeploymentReplicaFailure DeploymentConditionType = "ReplicaFailure"
292)
293
294// DeploymentCondition describes the state of a deployment at a certain point.
295type 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"`
308}
309
310// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
311
312// DeploymentList is a list of Deployments.
313type DeploymentList struct {
314 metav1.TypeMeta `json:",inline"`
315 // Standard list metadata.
316 // +optional
317 metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
318
319 // Items is the list of Deployments.
320 Items []Deployment `json:"items" protobuf:"bytes,2,rep,name=items"`
321}
322
323type DaemonSetUpdateStrategy struct {
324 // Type of daemon set update. Can be "RollingUpdate" or "OnDelete".
325 // Default is OnDelete.
326 // +optional
327 Type DaemonSetUpdateStrategyType `json:"type,omitempty" protobuf:"bytes,1,opt,name=type"`
328
329 // Rolling update config params. Present only if type = "RollingUpdate".
330 //---
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
334 // +optional
335 RollingUpdate *RollingUpdateDaemonSet `json:"rollingUpdate,omitempty" protobuf:"bytes,2,opt,name=rollingUpdate"`
336}
337
338type DaemonSetUpdateStrategyType string
339
340const (
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"
343
344 // Replace the old daemons only when it's killed
345 OnDeleteDaemonSetStrategyType DaemonSetUpdateStrategyType = "OnDelete"
346)
347
348// Spec to control the desired behavior of daemon set rolling update.
349type 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.
354 // This cannot be 0.
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.
364 // +optional
365 MaxUnavailable *intstr.IntOrString `json:"maxUnavailable,omitempty" protobuf:"bytes,1,opt,name=maxUnavailable"`
366}
367
368// DaemonSetSpec is the specification of a daemon set.
369type 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
374 // +optional
375 Selector *metav1.LabelSelector `json:"selector,omitempty" protobuf:"bytes,1,opt,name=selector"`
376
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"`
383
384 // An update strategy to replace existing DaemonSet pods with new pods.
385 // +optional
386 UpdateStrategy DaemonSetUpdateStrategy `json:"updateStrategy,omitempty" protobuf:"bytes,3,opt,name=updateStrategy"`
387
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
391 // is ready).
392 // +optional
393 MinReadySeconds int32 `json:"minReadySeconds,omitempty" protobuf:"varint,4,opt,name=minReadySeconds"`
394
395 // DEPRECATED.
396 // A sequence number representing a specific generation of the template.
397 // Populated by the system. It can be set only during the creation.
398 // +optional
399 TemplateGeneration int64 `json:"templateGeneration,omitempty" protobuf:"varint,5,opt,name=templateGeneration"`
400
401 // The number of old history to retain to allow rollback.
402 // This is a pointer to distinguish between explicit zero and not specified.
403 // Defaults to 10.
404 // +optional
405 RevisionHistoryLimit *int32 `json:"revisionHistoryLimit,omitempty" protobuf:"varint,6,opt,name=revisionHistoryLimit"`
406}
407
408// DaemonSetStatus represents the current status of a daemon set.
409type 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"`
414
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"`
419
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"`
424
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"`
428
429 // The most recent generation observed by the daemon set controller.
430 // +optional
431 ObservedGeneration int64 `json:"observedGeneration,omitempty" protobuf:"varint,5,opt,name=observedGeneration"`
432
433 // The total number of nodes that are running updated daemon pod
434 // +optional
435 UpdatedNumberScheduled int32 `json:"updatedNumberScheduled,omitempty" protobuf:"varint,6,opt,name=updatedNumberScheduled"`
436
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)
440 // +optional
441 NumberAvailable int32 `json:"numberAvailable,omitempty" protobuf:"varint,7,opt,name=numberAvailable"`
442
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)
446 // +optional
447 NumberUnavailable int32 `json:"numberUnavailable,omitempty" protobuf:"varint,8,opt,name=numberUnavailable"`
448
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.
452 // +optional
453 CollisionCount *int32 `json:"collisionCount,omitempty" protobuf:"varint,9,opt,name=collisionCount"`
454
455 // Represents the latest available observations of a DaemonSet's current state.
456 // +optional
457 // +patchMergeKey=type
458 // +patchStrategy=merge
459 Conditions []DaemonSetCondition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type" protobuf:"bytes,10,rep,name=conditions"`
460}
461
462type DaemonSetConditionType string
463
464// TODO: Add valid condition types of a DaemonSet.
465
466// DaemonSetCondition describes the state of a DaemonSet at a certain point.
467type 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.
473 // +optional
474 LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty" protobuf:"bytes,3,opt,name=lastTransitionTime"`
475 // The reason for the condition's last transition.
476 // +optional
477 Reason string `json:"reason,omitempty" protobuf:"bytes,4,opt,name=reason"`
478 // A human readable message indicating details about the transition.
479 // +optional
480 Message string `json:"message,omitempty" protobuf:"bytes,5,opt,name=message"`
481}
482
483// +genclient
484// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
485
486// DEPRECATED - This group version of DaemonSet is deprecated by apps/v1beta2/DaemonSet. See the release notes for
487// more information.
488// DaemonSet represents the configuration of a daemon set.
489type 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
493 // +optional
494 metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
495
496 // The desired behavior of this daemon set.
497 // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status
498 // +optional
499 Spec DaemonSetSpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"`
500
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.
504 // Read-only.
505 // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status
506 // +optional
507 Status DaemonSetStatus `json:"status,omitempty" protobuf:"bytes,3,opt,name=status"`
508}
509
510const (
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"
516
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
521)
522
523// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
524
525// DaemonSetList is a collection of daemon sets.
526type 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
530 // +optional
531 metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
532
533 // A list of daemon sets.
534 Items []DaemonSet `json:"items" protobuf:"bytes,2,rep,name=items"`
535}
536
537// +genclient
538// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
539
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.
544type 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
548 // +optional
549 metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
550
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
553 // +optional
554 Spec IngressSpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"`
555
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
558 // +optional
559 Status IngressStatus `json:"status,omitempty" protobuf:"bytes,3,opt,name=status"`
560}
561
562// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
563
564// IngressList is a collection of Ingress.
565type 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
569 // +optional
570 metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
571
572 // Items is the list of Ingress.
573 Items []Ingress `json:"items" protobuf:"bytes,2,rep,name=items"`
574}
575
576// IngressSpec describes the Ingress the user wishes to exist.
577type 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.
582 // +optional
583 Backend *IngressBackend `json:"backend,omitempty" protobuf:"bytes,1,opt,name=backend"`
584
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.
590 // +optional
591 TLS []IngressTLS `json:"tls,omitempty" protobuf:"bytes,2,rep,name=tls"`
592
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.
595 // +optional
596 Rules []IngressRule `json:"rules,omitempty" protobuf:"bytes,3,rep,name=rules"`
597 // TODO: Add the ability to specify load-balancer IP through claims
598}
599
600// IngressTLS describes the transport layer security associated with an Ingress.
601type 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.
606 // +optional
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.
613 // +optional
614 SecretName string `json:"secretName,omitempty" protobuf:"bytes,2,opt,name=secretName"`
615 // TODO: Consider specifying different modes of termination, protocols etc.
616}
617
618// IngressStatus describe the current state of the Ingress.
619type IngressStatus struct {
620 // LoadBalancer contains the current status of the load-balancer.
621 // +optional
622 LoadBalancer v1.LoadBalancerStatus `json:"loadBalancer,omitempty" protobuf:"bytes,1,opt,name=loadBalancer"`
623}
624
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.
628type 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
636 // :443 for https.
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.
641 // +optional
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.
648 // +optional
649 IngressRuleValue `json:",inline,omitempty" protobuf:"bytes,2,opt,name=ingressRuleValue"`
650}
651
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.
656type IngressRuleValue struct {
657 //TODO:
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.
662
663 // +optional
664 HTTP *HTTPIngressRuleValue `json:"http,omitempty" protobuf:"bytes,1,opt,name=http"`
665}
666
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 '?'
671// or '#'.
672type 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.
677}
678
679// HTTPIngressPath associates a path regex with a backend. Incoming urls matching
680// the path are forwarded to the backend.
681type 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.
689 // +optional
690 Path string `json:"path,omitempty" protobuf:"bytes,1,opt,name=path"`
691
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"`
695}
696
697// IngressBackend describes all endpoints for a given service and port.
698type IngressBackend struct {
699 // Specifies the name of the referenced service.
700 ServiceName string `json:"serviceName" protobuf:"bytes,1,opt,name=serviceName"`
701
702 // Specifies the port of the referenced service.
703 ServicePort intstr.IntOrString `json:"servicePort" protobuf:"bytes,2,opt,name=servicePort"`
704}
705
706// +genclient
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
710
711// DEPRECATED - This group version of ReplicaSet is deprecated by apps/v1beta2/ReplicaSet. See the release notes for
712// more information.
713// ReplicaSet ensures that a specified number of pod replicas are running at any given time.
714type ReplicaSet struct {
715 metav1.TypeMeta `json:",inline"`
716
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
720 // +optional
721 metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
722
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
725 // +optional
726 Spec ReplicaSetSpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"`
727
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.
731 // Read-only.
732 // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status
733 // +optional
734 Status ReplicaSetStatus `json:"status,omitempty" protobuf:"bytes,3,opt,name=status"`
735}
736
737// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
738
739// ReplicaSetList is a collection of ReplicaSets.
740type 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
744 // +optional
745 metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
746
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"`
750}
751
752// ReplicaSetSpec is the specification of a ReplicaSet.
753type ReplicaSetSpec struct {
754 // Replicas is the number of desired replicas.
755 // This is a pointer to distinguish between explicit zero and unspecified.
756 // Defaults to 1.
757 // More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller/#what-is-a-replicationcontroller
758 // +optional
759 Replicas *int32 `json:"replicas,omitempty" protobuf:"varint,1,opt,name=replicas"`
760
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)
764 // +optional
765 MinReadySeconds int32 `json:"minReadySeconds,omitempty" protobuf:"varint,4,opt,name=minReadySeconds"`
766
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
771 // +optional
772 Selector *metav1.LabelSelector `json:"selector,omitempty" protobuf:"bytes,2,opt,name=selector"`
773
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
777 // +optional
778 Template v1.PodTemplateSpec `json:"template,omitempty" protobuf:"bytes,3,opt,name=template"`
779}
780
781// ReplicaSetStatus represents the current status of a ReplicaSet.
782type 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"`
786
787 // The number of pods that have labels matching the labels of the pod template of the replicaset.
788 // +optional
789 FullyLabeledReplicas int32 `json:"fullyLabeledReplicas,omitempty" protobuf:"varint,2,opt,name=fullyLabeledReplicas"`
790
791 // The number of ready replicas for this replica set.
792 // +optional
793 ReadyReplicas int32 `json:"readyReplicas,omitempty" protobuf:"varint,4,opt,name=readyReplicas"`
794
795 // The number of available replicas (ready for at least minReadySeconds) for this replica set.
796 // +optional
797 AvailableReplicas int32 `json:"availableReplicas,omitempty" protobuf:"varint,5,opt,name=availableReplicas"`
798
799 // ObservedGeneration reflects the generation of the most recently observed ReplicaSet.
800 // +optional
801 ObservedGeneration int64 `json:"observedGeneration,omitempty" protobuf:"varint,3,opt,name=observedGeneration"`
802
803 // Represents the latest available observations of a replica set's current state.
804 // +optional
805 // +patchMergeKey=type
806 // +patchStrategy=merge
807 Conditions []ReplicaSetCondition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type" protobuf:"bytes,6,rep,name=conditions"`
808}
809
810type ReplicaSetConditionType string
811
812// These are valid conditions of a replica set.
813const (
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"
818)
819
820// ReplicaSetCondition describes the state of a replica set at a certain point.
821type 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.
827 // +optional
828 LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty" protobuf:"bytes,3,opt,name=lastTransitionTime"`
829 // The reason for the condition's last transition.
830 // +optional
831 Reason string `json:"reason,omitempty" protobuf:"bytes,4,opt,name=reason"`
832 // A human readable message indicating details about the transition.
833 // +optional
834 Message string `json:"message,omitempty" protobuf:"bytes,5,opt,name=message"`
835}
836
837// +genclient
838// +genclient:nonNamespaced
839// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
840
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.
844type 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
848 // +optional
849 metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
850
851 // spec defines the policy enforced.
852 // +optional
853 Spec PodSecurityPolicySpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"`
854}
855
856// PodSecurityPolicySpec defines the policy enforced.
857// Deprecated: use PodSecurityPolicySpec from policy API Group instead.
858type PodSecurityPolicySpec struct {
859 // privileged determines if a pod can request to be run as privileged.
860 // +optional
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.
866 // +optional
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.
870 // +optional
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.
875 // +optional
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 '*'.
879 // +optional
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.
882 // +optional
883 HostNetwork bool `json:"hostNetwork,omitempty" protobuf:"varint,6,opt,name=hostNetwork"`
884 // hostPorts determines which host port ranges are allowed to be exposed.
885 // +optional
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.
888 // +optional
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.
891 // +optional
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.
900 // +optional
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.
911 // +optional
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.
915 // +optional
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.
919 // +optional
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.
923 // +optional
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.
928 // +optional
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.
934 //
935 // Examples:
936 // e.g. "foo/*" allows "foo/bar", "foo/baz", etc.
937 // e.g. "foo.*" allows "foo.bar", "foo.baz", etc.
938 // +optional
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.
943 //
944 // Examples:
945 // e.g. "foo/*" forbids "foo/bar", "foo/baz", etc.
946 // e.g. "foo.*" forbids "foo.bar", "foo.baz", etc.
947 // +optional
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.
952 // +optional
953 AllowedProcMountTypes []v1.ProcMountType `json:"allowedProcMountTypes,omitempty" protobuf:"bytes,21,opt,name=allowedProcMountTypes"`
954}
955
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.
959type 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.
963 //
964 // Examples:
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"`
968
969 // when set to true, will allow host volumes matching the pathPrefix only if all volume mounts are readOnly.
970 // +optional
971 ReadOnly bool `json:"readOnly,omitempty" protobuf:"varint,2,opt,name=readOnly"`
972}
973
974// FSType gives strong typing to different file systems that are used by volumes.
975// Deprecated: use FSType from policy API Group instead.
976type FSType string
977
978var (
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"
988 NFS FSType = "nfs"
989 ISCSI FSType = "iscsi"
990 Glusterfs FSType = "glusterfs"
991 PersistentVolumeClaim FSType = "persistentVolumeClaim"
992 RBD FSType = "rbd"
993 Cinder FSType = "cinder"
994 CephFS FSType = "cephFS"
995 DownwardAPI FSType = "downwardAPI"
996 FC FSType = "fc"
997 ConfigMap FSType = "configMap"
998 Quobyte FSType = "quobyte"
999 AzureDisk FSType = "azureDisk"
1000 All FSType = "*"
1001)
1002
1003// AllowedFlexVolume represents a single Flexvolume that is allowed to be used.
1004// Deprecated: use AllowedFlexVolume from policy API Group instead.
1005type AllowedFlexVolume struct {
1006 // driver is the name of the Flexvolume driver.
1007 Driver string `json:"driver" protobuf:"bytes,1,opt,name=driver"`
1008}
1009
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.
1013type 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"`
1018}
1019
1020// SELinuxStrategyOptions defines the strategy type and any options used to create the strategy.
1021// Deprecated: use SELinuxStrategyOptions from policy API Group instead.
1022type 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/
1027 // +optional
1028 SELinuxOptions *v1.SELinuxOptions `json:"seLinuxOptions,omitempty" protobuf:"bytes,2,opt,name=seLinuxOptions"`
1029}
1030
1031// SELinuxStrategy denotes strategy types for generating SELinux options for a
1032// Security Context.
1033// Deprecated: use SELinuxStrategy from policy API Group instead.
1034type SELinuxStrategy string
1035
1036const (
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"
1043)
1044
1045// RunAsUserStrategyOptions defines the strategy type and any options used to create the strategy.
1046// Deprecated: use RunAsUserStrategyOptions from policy API Group instead.
1047type 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.
1052 // +optional
1053 Ranges []IDRange `json:"ranges,omitempty" protobuf:"bytes,2,rep,name=ranges"`
1054}
1055
1056// RunAsGroupStrategyOptions defines the strategy type and any options used to create the strategy.
1057// Deprecated: use RunAsGroupStrategyOptions from policy API Group instead.
1058type 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.
1063 // +optional
1064 Ranges []IDRange `json:"ranges,omitempty" protobuf:"bytes,2,rep,name=ranges"`
1065}
1066
1067// IDRange provides a min/max of an allowed range of IDs.
1068// Deprecated: use IDRange from policy API Group instead.
1069type 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"`
1074}
1075
1076// RunAsUserStrategy denotes strategy types for generating RunAsUser values for a
1077// Security Context.
1078// Deprecated: use RunAsUserStrategy from policy API Group instead.
1079type RunAsUserStrategy string
1080
1081const (
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"
1091)
1092
1093// RunAsGroupStrategy denotes strategy types for generating RunAsGroup values for a
1094// Security Context.
1095// Deprecated: use RunAsGroupStrategy from policy API Group instead.
1096type RunAsGroupStrategy string
1097
1098const (
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"
1108)
1109
1110// FSGroupStrategyOptions defines the strategy type and options used to create the strategy.
1111// Deprecated: use FSGroupStrategyOptions from policy API Group instead.
1112type FSGroupStrategyOptions struct {
1113 // rule is the strategy that will dictate what FSGroup is used in the SecurityContext.
1114 // +optional
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.
1118 // +optional
1119 Ranges []IDRange `json:"ranges,omitempty" protobuf:"bytes,2,rep,name=ranges"`
1120}
1121
1122// FSGroupStrategyType denotes strategy types for generating FSGroup values for a
1123// SecurityContext
1124// Deprecated: use FSGroupStrategyType from policy API Group instead.
1125type FSGroupStrategyType string
1126
1127const (
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"
1134)
1135
1136// SupplementalGroupsStrategyOptions defines the strategy type and options used to create the strategy.
1137// Deprecated: use SupplementalGroupsStrategyOptions from policy API Group instead.
1138type SupplementalGroupsStrategyOptions struct {
1139 // rule is the strategy that will dictate what supplemental groups is used in the SecurityContext.
1140 // +optional
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.
1144 // +optional
1145 Ranges []IDRange `json:"ranges,omitempty" protobuf:"bytes,2,rep,name=ranges"`
1146}
1147
1148// SupplementalGroupsStrategyType denotes strategy types for determining valid supplemental
1149// groups for a SecurityContext.
1150// Deprecated: use SupplementalGroupsStrategyType from policy API Group instead.
1151type SupplementalGroupsStrategyType string
1152
1153const (
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"
1160)
1161
1162// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
1163
1164// PodSecurityPolicyList is a list of PodSecurityPolicy objects.
1165// Deprecated: use PodSecurityPolicyList from policy API Group instead.
1166type 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
1170 // +optional
1171 metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
1172
1173 // items is a list of schema objects.
1174 Items []PodSecurityPolicy `json:"items" protobuf:"bytes,2,rep,name=items"`
1175}
1176
1177// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
1178
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
1181type 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
1185 // +optional
1186 metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
1187
1188 // Specification of the desired behavior for this NetworkPolicy.
1189 // +optional
1190 Spec NetworkPolicySpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"`
1191}
1192
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
1196type PolicyType string
1197
1198const (
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"
1203)
1204
1205// DEPRECATED 1.9 - This group version of NetworkPolicySpec is deprecated by networking/v1/NetworkPolicySpec.
1206type 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"`
1213
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).
1221 // +optional
1222 Ingress []NetworkPolicyIngressRule `json:"ingress,omitempty" protobuf:"bytes,2,rep,name=ingress"`
1223
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
1231 // +optional
1232 Egress []NetworkPolicyEgressRule `json:"egress,omitempty" protobuf:"bytes,3,rep,name=egress"`
1233
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
1244 // +optional
1245 PolicyTypes []PolicyType `json:"policyTypes,omitempty" protobuf:"bytes,4,rep,name=policyTypes,casttype=PolicyType"`
1246}
1247
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.
1250type 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.
1256 // +optional
1257 Ports []NetworkPolicyPort `json:"ports,omitempty" protobuf:"bytes,1,rep,name=ports"`
1258
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.
1264 // +optional
1265 From []NetworkPolicyPeer `json:"from,omitempty" protobuf:"bytes,2,rep,name=from"`
1266}
1267
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
1272type 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.
1278 // +optional
1279 Ports []NetworkPolicyPort `json:"ports,omitempty" protobuf:"bytes,1,rep,name=ports"`
1280
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.
1286 // +optional
1287 To []NetworkPolicyPeer `json:"to,omitempty" protobuf:"bytes,2,rep,name=to"`
1288}
1289
1290// DEPRECATED 1.9 - This group version of NetworkPolicyPort is deprecated by networking/v1/NetworkPolicyPort.
1291type NetworkPolicyPort struct {
1292 // Optional. The protocol (TCP, UDP, or SCTP) which traffic must match.
1293 // If not specified, this field defaults to TCP.
1294 // +optional
1295 Protocol *v1.Protocol `json:"protocol,omitempty" protobuf:"bytes,1,opt,name=protocol,casttype=k8s.io/api/core/v1.Protocol"`
1296
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
1301 // will be matched.
1302 // +optional
1303 Port *intstr.IntOrString `json:"port,omitempty" protobuf:"bytes,2,opt,name=port"`
1304}
1305
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.
1310type 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
1317 // +optional
1318 Except []string `json:"except,omitempty" protobuf:"bytes,2,rep,name=except"`
1319}
1320
1321// DEPRECATED 1.9 - This group version of NetworkPolicyPeer is deprecated by networking/v1/NetworkPolicyPeer.
1322type 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.
1325 //
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.
1329 // +optional
1330 PodSelector *metav1.LabelSelector `json:"podSelector,omitempty" protobuf:"bytes,1,opt,name=podSelector"`
1331
1332 // Selects Namespaces using cluster-scoped labels. This field follows standard label
1333 // selector semantics; if present but empty, it selects all namespaces.
1334 //
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.
1338 // +optional
1339 NamespaceSelector *metav1.LabelSelector `json:"namespaceSelector,omitempty" protobuf:"bytes,2,opt,name=namespaceSelector"`
1340
1341 // IPBlock defines policy on a particular IPBlock. If this field is set then
1342 // neither of the other fields can be.
1343 // +optional
1344 IPBlock *IPBlock `json:"ipBlock,omitempty" protobuf:"bytes,3,rep,name=ipBlock"`
1345}
1346
1347// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
1348
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.
1351type 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
1355 // +optional
1356 metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
1357
1358 // Items is a list of schema objects.
1359 Items []NetworkPolicy `json:"items" protobuf:"bytes,2,rep,name=items"`
1360}