1package v1
2
3import (
4 "cue.dev/x/k8s.io/apimachinery/pkg/runtime"
5 "cue.dev/x/k8s.io/apimachinery/pkg/apis/meta/v1"
6 v1_9 "cue.dev/x/k8s.io/api/core/v1"
7 "cue.dev/x/k8s.io/apimachinery/pkg/util/intstr"
8)
9
10// ControllerRevision implements an immutable snapshot of state
11// data. Clients are responsible for serializing and
12// deserializing the objects that contain their internal state.
13// Once a ControllerRevision has been successfully created, it
14// can not be updated. The API Server will fail validation of all
15// requests that attempt to mutate the Data field.
16// ControllerRevisions may, however, be deleted. Note that, due
17// to its use by both the DaemonSet and StatefulSet controllers
18// for update and rollback, this object is beta. However, it may
19// be subject to name and representation changes in future
20// releases, and clients should not depend on its stability. It
21// is primarily for internal use by controllers.
22#ControllerRevision: {
23 // APIVersion defines the versioned schema of this representation
24 // of an object. Servers should convert recognized schemas to the
25 // latest internal value, and may reject unrecognized values.
26 // More info:
27 // https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
28 "apiVersion": "apps/v1"
29
30 // Data is the serialized representation of the state.
31 "data"?: runtime.#RawExtension
32
33 // Kind is a string value representing the REST resource this
34 // object represents. Servers may infer this from the endpoint
35 // the client submits requests to. Cannot be updated. In
36 // CamelCase. More info:
37 // https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
38 "kind": "ControllerRevision"
39
40 // Standard object's metadata. More info:
41 // https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
42 "metadata"?: v1.#ObjectMeta
43
44 // Revision indicates the revision of the state represented by
45 // Data.
46 "revision"!: int64 & int
47}
48
49// ControllerRevisionList is a resource containing a list of
50// ControllerRevision objects.
51#ControllerRevisionList: {
52 // APIVersion defines the versioned schema of this representation
53 // of an object. Servers should convert recognized schemas to the
54 // latest internal value, and may reject unrecognized values.
55 // More info:
56 // https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
57 "apiVersion": "apps/v1"
58
59 // Items is the list of ControllerRevisions
60 "items"!: [...#ControllerRevision]
61
62 // Kind is a string value representing the REST resource this
63 // object represents. Servers may infer this from the endpoint
64 // the client submits requests to. Cannot be updated. In
65 // CamelCase. More info:
66 // https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
67 "kind": "ControllerRevisionList"
68
69 // More info:
70 // https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
71 "metadata"?: v1.#ListMeta
72}
73
74// DaemonSet represents the configuration of a daemon set.
75#DaemonSet: {
76 // APIVersion defines the versioned schema of this representation
77 // of an object. Servers should convert recognized schemas to the
78 // latest internal value, and may reject unrecognized values.
79 // More info:
80 // https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
81 "apiVersion": "apps/v1"
82
83 // Kind is a string value representing the REST resource this
84 // object represents. Servers may infer this from the endpoint
85 // the client submits requests to. Cannot be updated. In
86 // CamelCase. More info:
87 // https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
88 "kind": "DaemonSet"
89
90 // Standard object's metadata. More info:
91 // https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
92 "metadata"?: v1.#ObjectMeta
93
94 // The desired behavior of this daemon set. More info:
95 // https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
96 "spec"?: #DaemonSetSpec
97
98 // The current status of this daemon set. This data may be out of
99 // date by some window of time. Populated by the system.
100 // Read-only. More info:
101 // https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
102 "status"?: #DaemonSetStatus
103}
104
105// DaemonSetCondition describes the state of a DaemonSet at a
106// certain point.
107#DaemonSetCondition: {
108 // Last time the condition transitioned from one status to
109 // another.
110 "lastTransitionTime"?: v1.#Time
111
112 // A human readable message indicating details about the
113 // transition.
114 "message"?: string
115
116 // The reason for the condition's last transition.
117 "reason"?: string
118
119 // Status of the condition, one of True, False, Unknown.
120 "status"!: string
121
122 // Type of DaemonSet condition.
123 "type"!: string
124}
125
126// DaemonSetList is a collection of daemon sets.
127#DaemonSetList: {
128 // APIVersion defines the versioned schema of this representation
129 // of an object. Servers should convert recognized schemas to the
130 // latest internal value, and may reject unrecognized values.
131 // More info:
132 // https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
133 "apiVersion": "apps/v1"
134
135 // A list of daemon sets.
136 "items"!: [...#DaemonSet]
137
138 // Kind is a string value representing the REST resource this
139 // object represents. Servers may infer this from the endpoint
140 // the client submits requests to. Cannot be updated. In
141 // CamelCase. More info:
142 // https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
143 "kind": "DaemonSetList"
144
145 // Standard list metadata. More info:
146 // https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
147 "metadata"?: v1.#ListMeta
148}
149
150// DaemonSetSpec is the specification of a daemon set.
151#DaemonSetSpec: {
152 // The minimum number of seconds for which a newly created
153 // DaemonSet pod should be ready without any of its container
154 // crashing, for it to be considered available. Defaults to 0
155 // (pod will be considered available as soon as it is ready).
156 "minReadySeconds"?: int32 & int
157
158 // The number of old history to retain to allow rollback. This is
159 // a pointer to distinguish between explicit zero and not
160 // specified. Defaults to 10.
161 "revisionHistoryLimit"?: int32 & int
162
163 // A label query over pods that are managed by the daemon set.
164 // Must match in order to be controlled. It must match the pod
165 // template's labels. More info:
166 // https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors
167 "selector"!: v1.#LabelSelector
168
169 // An object that describes the pod that will be created. The
170 // DaemonSet will create exactly one copy of this pod on every
171 // node that matches the template's node selector (or on every
172 // node if no node selector is specified). The only allowed
173 // template.spec.restartPolicy value is "Always". More info:
174 // https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller#pod-template
175 "template"!: v1_9.#PodTemplateSpec
176
177 // An update strategy to replace existing DaemonSet pods with new
178 // pods.
179 "updateStrategy"?: #DaemonSetUpdateStrategy
180}
181
182// DaemonSetStatus represents the current status of a daemon set.
183#DaemonSetStatus: {
184 // Count of hash collisions for the DaemonSet. The DaemonSet
185 // controller uses this field as a collision avoidance mechanism
186 // when it needs to create the name for the newest
187 // ControllerRevision.
188 "collisionCount"?: int32 & int
189
190 // Represents the latest available observations of a DaemonSet's
191 // current state.
192 "conditions"?: [...#DaemonSetCondition]
193
194 // The number of nodes that are running at least 1 daemon pod and
195 // are supposed to run the daemon pod. More info:
196 // https://kubernetes.io/docs/concepts/workloads/controllers/daemonset/
197 "currentNumberScheduled"!: int32 & int
198
199 // The total number of nodes that should be running the daemon pod
200 // (including nodes correctly running the daemon pod). More info:
201 // https://kubernetes.io/docs/concepts/workloads/controllers/daemonset/
202 "desiredNumberScheduled"!: int32 & int
203
204 // The number of nodes that should be running the daemon pod and
205 // have one or more of the daemon pod running and available
206 // (ready for at least spec.minReadySeconds)
207 "numberAvailable"?: int32 & int
208
209 // The number of nodes that are running the daemon pod, but are
210 // not supposed to run the daemon pod. More info:
211 // https://kubernetes.io/docs/concepts/workloads/controllers/daemonset/
212 "numberMisscheduled"!: int32 & int
213
214 // numberReady is the number of nodes that should be running the
215 // daemon pod and have one or more of the daemon pod running with
216 // a Ready Condition.
217 "numberReady"!: int32 & int
218
219 // The number of nodes that should be running the daemon pod and
220 // have none of the daemon pod running and available (ready for
221 // at least spec.minReadySeconds)
222 "numberUnavailable"?: int32 & int
223
224 // The most recent generation observed by the daemon set
225 // controller.
226 "observedGeneration"?: int64 & int
227
228 // The total number of nodes that are running updated daemon pod
229 "updatedNumberScheduled"?: int32 & int
230}
231
232// DaemonSetUpdateStrategy is a struct used to control the update
233// strategy for a DaemonSet.
234#DaemonSetUpdateStrategy: {
235 // Rolling update config params. Present only if type =
236 // "RollingUpdate".
237 "rollingUpdate"?: #RollingUpdateDaemonSet
238
239 // Type of daemon set update. Can be "RollingUpdate" or
240 // "OnDelete". Default is RollingUpdate.
241 "type"?: string
242}
243
244// Deployment enables declarative updates for Pods and
245// ReplicaSets.
246#Deployment: {
247 // APIVersion defines the versioned schema of this representation
248 // of an object. Servers should convert recognized schemas to the
249 // latest internal value, and may reject unrecognized values.
250 // More info:
251 // https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
252 "apiVersion": "apps/v1"
253
254 // Kind is a string value representing the REST resource this
255 // object represents. Servers may infer this from the endpoint
256 // the client submits requests to. Cannot be updated. In
257 // CamelCase. More info:
258 // https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
259 "kind": "Deployment"
260
261 // Standard object's metadata. More info:
262 // https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
263 "metadata"?: v1.#ObjectMeta
264
265 // Specification of the desired behavior of the Deployment.
266 "spec"?: #DeploymentSpec
267
268 // Most recently observed status of the Deployment.
269 "status"?: #DeploymentStatus
270}
271
272// DeploymentCondition describes the state of a deployment at a
273// certain point.
274#DeploymentCondition: {
275 // Last time the condition transitioned from one status to
276 // another.
277 "lastTransitionTime"?: v1.#Time
278
279 // The last time this condition was updated.
280 "lastUpdateTime"?: v1.#Time
281
282 // A human readable message indicating details about the
283 // transition.
284 "message"?: string
285
286 // The reason for the condition's last transition.
287 "reason"?: string
288
289 // Status of the condition, one of True, False, Unknown.
290 "status"!: string
291
292 // Type of deployment condition.
293 "type"!: string
294}
295
296// DeploymentList is a list of Deployments.
297#DeploymentList: {
298 // APIVersion defines the versioned schema of this representation
299 // of an object. Servers should convert recognized schemas to the
300 // latest internal value, and may reject unrecognized values.
301 // More info:
302 // https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
303 "apiVersion": "apps/v1"
304
305 // Items is the list of Deployments.
306 "items"!: [...#Deployment]
307
308 // Kind is a string value representing the REST resource this
309 // object represents. Servers may infer this from the endpoint
310 // the client submits requests to. Cannot be updated. In
311 // CamelCase. More info:
312 // https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
313 "kind": "DeploymentList"
314
315 // Standard list metadata.
316 "metadata"?: v1.#ListMeta
317}
318
319// DeploymentSpec is the specification of the desired behavior of
320// the Deployment.
321#DeploymentSpec: {
322 // Minimum number of seconds for which a newly created pod should
323 // be ready without any of its container crashing, for it to be
324 // considered available. Defaults to 0 (pod will be considered
325 // available as soon as it is ready)
326 "minReadySeconds"?: int32 & int
327
328 // Indicates that the deployment is paused.
329 "paused"?: bool
330
331 // The maximum time in seconds for a deployment to make progress
332 // before it is considered to be failed. The deployment
333 // controller will continue to process failed deployments and a
334 // condition with a ProgressDeadlineExceeded reason will be
335 // surfaced in the deployment status. Note that progress will not
336 // be estimated during the time a deployment is paused. Defaults
337 // to 600s.
338 "progressDeadlineSeconds"?: int32 & int
339
340 // Number of desired pods. This is a pointer to distinguish
341 // between explicit zero and not specified. Defaults to 1.
342 "replicas"?: int32 & int
343
344 // The number of old ReplicaSets to retain to allow rollback. This
345 // is a pointer to distinguish between explicit zero and not
346 // specified. Defaults to 10.
347 "revisionHistoryLimit"?: int32 & int
348
349 // Label selector for pods. Existing ReplicaSets whose pods are
350 // selected by this will be the ones affected by this deployment.
351 // It must match the pod template's labels.
352 "selector"!: v1.#LabelSelector
353
354 // The deployment strategy to use to replace existing pods with
355 // new ones.
356 "strategy"?: #DeploymentStrategy
357
358 // Template describes the pods that will be created. The only
359 // allowed template.spec.restartPolicy value is "Always".
360 "template"!: v1_9.#PodTemplateSpec
361}
362
363// DeploymentStatus is the most recently observed status of the
364// Deployment.
365#DeploymentStatus: {
366 // Total number of available non-terminating pods (ready for at
367 // least minReadySeconds) targeted by this deployment.
368 "availableReplicas"?: int32 & int
369
370 // Count of hash collisions for the Deployment. The Deployment
371 // controller uses this field as a collision avoidance mechanism
372 // when it needs to create the name for the newest ReplicaSet.
373 "collisionCount"?: int32 & int
374
375 // Represents the latest available observations of a deployment's
376 // current state.
377 "conditions"?: [...#DeploymentCondition]
378
379 // The generation observed by the deployment controller.
380 "observedGeneration"?: int64 & int
381
382 // Total number of non-terminating pods targeted by this
383 // Deployment with a Ready Condition.
384 "readyReplicas"?: int32 & int
385
386 // Total number of non-terminating pods targeted by this
387 // deployment (their labels match the selector).
388 "replicas"?: int32 & int
389
390 // Total number of terminating pods targeted by this deployment.
391 // Terminating pods have a non-null .metadata.deletionTimestamp
392 // and have not yet reached the Failed or Succeeded
393 // .status.phase.
394 //
395 // This is a beta field and requires enabling
396 // DeploymentReplicaSetTerminatingReplicas feature (enabled by
397 // default).
398 "terminatingReplicas"?: int32 & int
399
400 // Total number of unavailable pods targeted by this deployment.
401 // This is the total number of pods that are still required for
402 // the deployment to have 100% available capacity. They may
403 // either be pods that are running but not yet available or pods
404 // that still have not been created.
405 "unavailableReplicas"?: int32 & int
406
407 // Total number of non-terminating pods targeted by this
408 // deployment that have the desired template spec.
409 "updatedReplicas"?: int32 & int
410}
411
412// DeploymentStrategy describes how to replace existing pods with
413// new ones.
414#DeploymentStrategy: {
415 // Rolling update config params. Present only if
416 // DeploymentStrategyType = RollingUpdate.
417 "rollingUpdate"?: #RollingUpdateDeployment
418
419 // Type of deployment. Can be "Recreate" or "RollingUpdate".
420 // Default is RollingUpdate.
421 "type"?: string
422}
423
424// ReplicaSet ensures that a specified number of pod replicas are
425// running at any given time.
426#ReplicaSet: {
427 // APIVersion defines the versioned schema of this representation
428 // of an object. Servers should convert recognized schemas to the
429 // latest internal value, and may reject unrecognized values.
430 // More info:
431 // https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
432 "apiVersion": "apps/v1"
433
434 // Kind is a string value representing the REST resource this
435 // object represents. Servers may infer this from the endpoint
436 // the client submits requests to. Cannot be updated. In
437 // CamelCase. More info:
438 // https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
439 "kind": "ReplicaSet"
440
441 // If the Labels of a ReplicaSet are empty, they are defaulted to
442 // be the same as the Pod(s) that the ReplicaSet manages.
443 // Standard object's metadata. More info:
444 // https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
445 "metadata"?: v1.#ObjectMeta
446
447 // Spec defines the specification of the desired behavior of the
448 // ReplicaSet. More info:
449 // https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
450 "spec"?: #ReplicaSetSpec
451
452 // Status is the most recently observed status of the ReplicaSet.
453 // This data may be out of date by some window of time. Populated
454 // by the system. Read-only. More info:
455 // https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
456 "status"?: #ReplicaSetStatus
457}
458
459// ReplicaSetCondition describes the state of a replica set at a
460// certain point.
461#ReplicaSetCondition: {
462 // The last time the condition transitioned from one status to
463 // another.
464 "lastTransitionTime"?: v1.#Time
465
466 // A human readable message indicating details about the
467 // transition.
468 "message"?: string
469
470 // The reason for the condition's last transition.
471 "reason"?: string
472
473 // Status of the condition, one of True, False, Unknown.
474 "status"!: string
475
476 // Type of replica set condition.
477 "type"!: string
478}
479
480// ReplicaSetList is a collection of ReplicaSets.
481#ReplicaSetList: {
482 // APIVersion defines the versioned schema of this representation
483 // of an object. Servers should convert recognized schemas to the
484 // latest internal value, and may reject unrecognized values.
485 // More info:
486 // https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
487 "apiVersion": "apps/v1"
488
489 // List of ReplicaSets. More info:
490 // https://kubernetes.io/docs/concepts/workloads/controllers/replicaset
491 "items"!: [...#ReplicaSet]
492
493 // Kind is a string value representing the REST resource this
494 // object represents. Servers may infer this from the endpoint
495 // the client submits requests to. Cannot be updated. In
496 // CamelCase. More info:
497 // https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
498 "kind": "ReplicaSetList"
499
500 // Standard list metadata. More info:
501 // https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
502 "metadata"?: v1.#ListMeta
503}
504
505// ReplicaSetSpec is the specification of a ReplicaSet.
506#ReplicaSetSpec: {
507 // Minimum number of seconds for which a newly created pod should
508 // be ready without any of its container crashing, for it to be
509 // considered available. Defaults to 0 (pod will be considered
510 // available as soon as it is ready)
511 "minReadySeconds"?: int32 & int
512
513 // Replicas is the number of desired pods. This is a pointer to
514 // distinguish between explicit zero and unspecified. Defaults to
515 // 1. More info:
516 // https://kubernetes.io/docs/concepts/workloads/controllers/replicaset
517 "replicas"?: int32 & int
518
519 // Selector is a label query over pods that should match the
520 // replica count. Label keys and values that must match in order
521 // to be controlled by this replica set. It must match the pod
522 // template's labels. More info:
523 // https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors
524 "selector"!: v1.#LabelSelector
525
526 // Template is the object that describes the pod that will be
527 // created if insufficient replicas are detected. More info:
528 // https://kubernetes.io/docs/concepts/workloads/controllers/replicaset/#pod-template
529 "template"?: v1_9.#PodTemplateSpec
530}
531
532// ReplicaSetStatus represents the current status of a ReplicaSet.
533#ReplicaSetStatus: {
534 // The number of available non-terminating pods (ready for at
535 // least minReadySeconds) for this replica set.
536 "availableReplicas"?: int32 & int
537
538 // Represents the latest available observations of a replica set's
539 // current state.
540 "conditions"?: [...#ReplicaSetCondition]
541
542 // The number of non-terminating pods that have labels matching
543 // the labels of the pod template of the replicaset.
544 "fullyLabeledReplicas"?: int32 & int
545
546 // ObservedGeneration reflects the generation of the most recently
547 // observed ReplicaSet.
548 "observedGeneration"?: int64 & int
549
550 // The number of non-terminating pods targeted by this ReplicaSet
551 // with a Ready Condition.
552 "readyReplicas"?: int32 & int
553
554 // Replicas is the most recently observed number of
555 // non-terminating pods. More info:
556 // https://kubernetes.io/docs/concepts/workloads/controllers/replicaset
557 "replicas"!: int32 & int
558
559 // The number of terminating pods for this replica set.
560 // Terminating pods have a non-null .metadata.deletionTimestamp
561 // and have not yet reached the Failed or Succeeded
562 // .status.phase.
563 //
564 // This is a beta field and requires enabling
565 // DeploymentReplicaSetTerminatingReplicas feature (enabled by
566 // default).
567 "terminatingReplicas"?: int32 & int
568}
569
570// Spec to control the desired behavior of daemon set rolling
571// update.
572#RollingUpdateDaemonSet: {
573 // The maximum number of nodes with an existing available
574 // DaemonSet pod that can have an updated DaemonSet pod during
575 // during an update. Value can be an absolute number (ex: 5) or a
576 // percentage of desired pods (ex: 10%). This can not be 0 if
577 // MaxUnavailable is 0. Absolute number is calculated from
578 // percentage by rounding up to a minimum of 1. Default value is
579 // 0. Example: when this is set to 30%, at most 30% of the total
580 // number of nodes that should be running the daemon pod (i.e.
581 // status.desiredNumberScheduled) can have their a new pod
582 // created before the old pod is marked as deleted. The update
583 // starts by launching new pods on 30% of nodes. Once an updated
584 // pod is available (Ready for at least minReadySeconds) the old
585 // DaemonSet pod on that node is marked deleted. If the old pod
586 // becomes unavailable for any reason (Ready transitions to
587 // false, is evicted, or is drained) an updated pod is
588 // immediately created on that node without considering surge
589 // limits. Allowing surge implies the possibility that the
590 // resources consumed by the daemonset on any given node can
591 // double if the readiness check fails, and so resource intensive
592 // daemonsets should take into account that they may cause
593 // evictions during disruption.
594 "maxSurge"?: intstr.#IntOrString
595
596 // The maximum number of DaemonSet pods that can be unavailable
597 // during the update. Value can be an absolute number (ex: 5) or
598 // a percentage of total number of DaemonSet pods at the start of
599 // the update (ex: 10%). Absolute number is calculated from
600 // percentage by rounding up. This cannot be 0 if MaxSurge is 0
601 // Default value is 1. Example: when this is set to 30%, at most
602 // 30% of the total number of nodes that should be running the
603 // daemon pod (i.e. status.desiredNumberScheduled) can have their
604 // pods stopped for an update at any given time. The update
605 // starts by stopping at most 30% of those DaemonSet pods and
606 // then brings up new DaemonSet pods in their place. Once the new
607 // pods are available, it then proceeds onto other DaemonSet
608 // pods, thus ensuring that at least 70% of original number of
609 // DaemonSet pods are available at all times during the update.
610 "maxUnavailable"?: intstr.#IntOrString
611}
612
613// Spec to control the desired behavior of rolling update.
614#RollingUpdateDeployment: {
615 // The maximum number of pods that can be scheduled above the
616 // desired number of pods. Value can be an absolute number (ex:
617 // 5) or a percentage of desired pods (ex: 10%). This can not be
618 // 0 if MaxUnavailable is 0. Absolute number is calculated from
619 // percentage by rounding up. Defaults to 25%. Example: when this
620 // is set to 30%, the new ReplicaSet can be scaled up immediately
621 // when the rolling update starts, such that the total number of
622 // old and new pods do not exceed 130% of desired pods. Once old
623 // pods have been killed, new ReplicaSet can be scaled up
624 // further, ensuring that total number of pods running at any
625 // time during the update is at most 130% of desired pods.
626 "maxSurge"?: intstr.#IntOrString
627
628 // The maximum number of pods that can be unavailable during the
629 // update. Value can be an absolute number (ex: 5) or a
630 // percentage of desired pods (ex: 10%). Absolute number is
631 // calculated from percentage by rounding down. This can not be 0
632 // if MaxSurge is 0. Defaults to 25%. Example: when this is set
633 // to 30%, the old ReplicaSet can be scaled down to 70% of
634 // desired pods immediately when the rolling update starts. Once
635 // new pods are ready, old ReplicaSet can be scaled down further,
636 // followed by scaling up the new ReplicaSet, ensuring that the
637 // total number of pods available at all times during the update
638 // is at least 70% of desired pods.
639 "maxUnavailable"?: intstr.#IntOrString
640}
641
642// RollingUpdateStatefulSetStrategy is used to communicate
643// parameter for RollingUpdateStatefulSetStrategyType.
644#RollingUpdateStatefulSetStrategy: {
645 // The maximum number of pods that can be unavailable during the
646 // update. Value can be an absolute number (ex: 5) or a
647 // percentage of desired pods (ex: 10%). Absolute number is
648 // calculated from percentage by rounding up. This can not be 0.
649 // Defaults to 1. This field is beta-level and is enabled by
650 // default. The field applies to all pods in the range 0 to
651 // Replicas-1. That means if there is any unavailable pod in the
652 // range 0 to Replicas-1, it will be counted towards
653 // MaxUnavailable. This setting might not be effective for the
654 // OrderedReady podManagementPolicy. That policy ensures pods are
655 // created and become ready one at a time.
656 "maxUnavailable"?: intstr.#IntOrString
657
658 // Partition indicates the ordinal at which the StatefulSet should
659 // be partitioned for updates. During a rolling update, all pods
660 // from ordinal Replicas-1 to Partition are updated. All pods
661 // from ordinal Partition-1 to 0 remain untouched. This is
662 // helpful in being able to do a canary based deployment. The
663 // default value is 0.
664 "partition"?: int32 & int
665}
666
667// StatefulSet represents a set of pods with consistent
668// identities. Identities are defined as:
669// - Network: A single stable DNS and hostname.
670// - Storage: As many VolumeClaims as requested.
671//
672// The StatefulSet guarantees that a given network identity will
673// always map to the same storage identity.
674#StatefulSet: {
675 // APIVersion defines the versioned schema of this representation
676 // of an object. Servers should convert recognized schemas to the
677 // latest internal value, and may reject unrecognized values.
678 // More info:
679 // https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
680 "apiVersion": "apps/v1"
681
682 // Kind is a string value representing the REST resource this
683 // object represents. Servers may infer this from the endpoint
684 // the client submits requests to. Cannot be updated. In
685 // CamelCase. More info:
686 // https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
687 "kind": "StatefulSet"
688
689 // Standard object's metadata. More info:
690 // https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
691 "metadata"?: v1.#ObjectMeta
692
693 // Spec defines the desired identities of pods in this set.
694 "spec"?: #StatefulSetSpec
695
696 // Status is the current status of Pods in this StatefulSet. This
697 // data may be out of date by some window of time.
698 "status"?: #StatefulSetStatus
699}
700
701// StatefulSetCondition describes the state of a statefulset at a
702// certain point.
703#StatefulSetCondition: {
704 // Last time the condition transitioned from one status to
705 // another.
706 "lastTransitionTime"?: v1.#Time
707
708 // A human readable message indicating details about the
709 // transition.
710 "message"?: string
711
712 // The reason for the condition's last transition.
713 "reason"?: string
714
715 // Status of the condition, one of True, False, Unknown.
716 "status"!: string
717
718 // Type of statefulset condition.
719 "type"!: string
720}
721
722// StatefulSetList is a collection of StatefulSets.
723#StatefulSetList: {
724 // APIVersion defines the versioned schema of this representation
725 // of an object. Servers should convert recognized schemas to the
726 // latest internal value, and may reject unrecognized values.
727 // More info:
728 // https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
729 "apiVersion": "apps/v1"
730
731 // Items is the list of stateful sets.
732 "items"!: [...#StatefulSet]
733
734 // Kind is a string value representing the REST resource this
735 // object represents. Servers may infer this from the endpoint
736 // the client submits requests to. Cannot be updated. In
737 // CamelCase. More info:
738 // https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
739 "kind": "StatefulSetList"
740
741 // Standard list's metadata. More info:
742 // https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
743 "metadata"?: v1.#ListMeta
744}
745
746// StatefulSetOrdinals describes the policy used for replica
747// ordinal assignment in this StatefulSet.
748#StatefulSetOrdinals: {
749 // start is the number representing the first replica's index. It
750 // may be used to number replicas from an alternate index (eg:
751 // 1-indexed) over the default 0-indexed names, or to orchestrate
752 // progressive movement of replicas from one StatefulSet to
753 // another. If set, replica indices will be in the range:
754 // [.spec.ordinals.start, .spec.ordinals.start + .spec.replicas).
755 // If unset, defaults to 0. Replica indices will be in the range:
756 // [0, .spec.replicas).
757 "start"?: int32 & int
758}
759
760// StatefulSetPersistentVolumeClaimRetentionPolicy describes the
761// policy used for PVCs created from the StatefulSet
762// VolumeClaimTemplates.
763#StatefulSetPersistentVolumeClaimRetentionPolicy: {
764 // WhenDeleted specifies what happens to PVCs created from
765 // StatefulSet VolumeClaimTemplates when the StatefulSet is
766 // deleted. The default policy of `Retain` causes PVCs to not be
767 // affected by StatefulSet deletion. The `Delete` policy causes
768 // those PVCs to be deleted.
769 "whenDeleted"?: string
770
771 // WhenScaled specifies what happens to PVCs created from
772 // StatefulSet VolumeClaimTemplates when the StatefulSet is
773 // scaled down. The default policy of `Retain` causes PVCs to not
774 // be affected by a scaledown. The `Delete` policy causes the
775 // associated PVCs for any excess pods above the replica count to
776 // be deleted.
777 "whenScaled"?: string
778}
779
780// A StatefulSetSpec is the specification of a StatefulSet.
781#StatefulSetSpec: {
782 // Minimum number of seconds for which a newly created pod should
783 // be ready without any of its container crashing for it to be
784 // considered available. Defaults to 0 (pod will be considered
785 // available as soon as it is ready)
786 "minReadySeconds"?: int32 & int
787
788 // ordinals controls the numbering of replica indices in a
789 // StatefulSet. The default ordinals behavior assigns a "0" index
790 // to the first replica and increments the index by one for each
791 // additional replica requested.
792 "ordinals"?: #StatefulSetOrdinals
793
794 // persistentVolumeClaimRetentionPolicy describes the lifecycle of
795 // persistent volume claims created from volumeClaimTemplates. By
796 // default, all persistent volume claims are created as needed
797 // and retained until manually deleted. This policy allows the
798 // lifecycle to be altered, for example by deleting persistent
799 // volume claims when their stateful set is deleted, or when
800 // their pod is scaled down.
801 "persistentVolumeClaimRetentionPolicy"?: #StatefulSetPersistentVolumeClaimRetentionPolicy
802
803 // podManagementPolicy controls how pods are created during
804 // initial scale up, when replacing pods on nodes, or when
805 // scaling down. The default policy is `OrderedReady`, where pods
806 // are created in increasing order (pod-0, then pod-1, etc) and
807 // the controller will wait until each pod is ready before
808 // continuing. When scaling down, the pods are removed in the
809 // opposite order. The alternative policy is `Parallel` which
810 // will create pods in parallel to match the desired scale
811 // without waiting, and on scale down will delete all pods at
812 // once.
813 "podManagementPolicy"?: string
814
815 // replicas is the desired number of replicas of the given
816 // Template. These are replicas in the sense that they are
817 // instantiations of the same Template, but individual replicas
818 // also have a consistent identity. If unspecified, defaults to
819 // 1.
820 "replicas"?: int32 & int
821
822 // revisionHistoryLimit is the maximum number of revisions that
823 // will be maintained in the StatefulSet's revision history. The
824 // revision history consists of all revisions not represented by
825 // a currently applied StatefulSetSpec version. The default value
826 // is 10.
827 "revisionHistoryLimit"?: int32 & int
828
829 // selector is a label query over pods that should match the
830 // replica count. It must match the pod template's labels. More
831 // info:
832 // https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors
833 "selector"!: v1.#LabelSelector
834
835 // serviceName is the name of the service that governs this
836 // StatefulSet. This service must exist before the StatefulSet,
837 // and is responsible for the network identity of the set. Pods
838 // get DNS/hostnames that follow the pattern:
839 // pod-specific-string.serviceName.default.svc.cluster.local
840 // where "pod-specific-string" is managed by the StatefulSet
841 // controller.
842 "serviceName"?: string
843
844 // template is the object that describes the pod that will be
845 // created if insufficient replicas are detected. Each pod
846 // stamped out by the StatefulSet will fulfill this Template, but
847 // have a unique identity from the rest of the StatefulSet. Each
848 // pod will be named with the format
849 // <statefulsetname>-<podindex>. For example, a pod in a
850 // StatefulSet named "web" with index number "3" would be named
851 // "web-3". The only allowed template.spec.restartPolicy value is
852 // "Always".
853 "template"!: v1_9.#PodTemplateSpec
854
855 // updateStrategy indicates the StatefulSetUpdateStrategy that
856 // will be employed to update Pods in the StatefulSet when a
857 // revision is made to Template.
858 "updateStrategy"?: #StatefulSetUpdateStrategy
859
860 // volumeClaimTemplates is a list of claims that pods are allowed
861 // to reference. The StatefulSet controller is responsible for
862 // mapping network identities to claims in a way that maintains
863 // the identity of a pod. Every claim in this list must have at
864 // least one matching (by name) volumeMount in one container in
865 // the template. A claim in this list takes precedence over any
866 // volumes in the template, with the same name.
867 "volumeClaimTemplates"?: [...v1_9.#PersistentVolumeClaim]
868}
869
870// StatefulSetStatus represents the current state of a
871// StatefulSet.
872#StatefulSetStatus: {
873 // Total number of available pods (ready for at least
874 // minReadySeconds) targeted by this statefulset.
875 "availableReplicas"?: int32 & int
876
877 // collisionCount is the count of hash collisions for the
878 // StatefulSet. The StatefulSet controller uses this field as a
879 // collision avoidance mechanism when it needs to create the name
880 // for the newest ControllerRevision.
881 "collisionCount"?: int32 & int
882
883 // Represents the latest available observations of a statefulset's
884 // current state.
885 "conditions"?: [...#StatefulSetCondition]
886
887 // currentReplicas is the number of Pods created by the
888 // StatefulSet controller from the StatefulSet version indicated
889 // by currentRevision.
890 "currentReplicas"?: int32 & int
891
892 // currentRevision, if not empty, indicates the version of the
893 // StatefulSet used to generate Pods in the sequence
894 // [0,currentReplicas).
895 "currentRevision"?: string
896
897 // observedGeneration is the most recent generation observed for
898 // this StatefulSet. It corresponds to the StatefulSet's
899 // generation, which is updated on mutation by the API Server.
900 "observedGeneration"?: int64 & int
901
902 // readyReplicas is the number of pods created for this
903 // StatefulSet with a Ready Condition.
904 "readyReplicas"?: int32 & int
905
906 // replicas is the number of Pods created by the StatefulSet
907 // controller.
908 "replicas"!: int32 & int
909
910 // updateRevision, if not empty, indicates the version of the
911 // StatefulSet used to generate Pods in the sequence
912 // [replicas-updatedReplicas,replicas)
913 "updateRevision"?: string
914
915 // updatedReplicas is the number of Pods created by the
916 // StatefulSet controller from the StatefulSet version indicated
917 // by updateRevision.
918 "updatedReplicas"?: int32 & int
919}
920
921// StatefulSetUpdateStrategy indicates the strategy that the
922// StatefulSet controller will use to perform updates. It
923// includes any additional parameters necessary to perform the
924// update for the indicated strategy.
925#StatefulSetUpdateStrategy: {
926 // RollingUpdate is used to communicate parameters when Type is
927 // RollingUpdateStatefulSetStrategyType.
928 "rollingUpdate"?: #RollingUpdateStatefulSetStrategy
929
930 // Type indicates the type of the StatefulSetUpdateStrategy.
931 // Default is RollingUpdate.
932 "type"?: string
933}