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