k8s-crds-cluster-api 1.12.5

Kubernetes CRDs for cluster-api
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
// WARNING: generated by kopium - manual changes will be overwritten
// kopium command: kopium -f machinepools.yml --schema=derived --docs -b --derive=Default --derive=PartialEq --smart-derive-elision
// kopium version: 0.23.0

#[allow(unused_imports)]
mod prelude {
    pub use k8s_openapi::api::core::v1::ObjectReference;
    pub use k8s_openapi::apimachinery::pkg::apis::meta::v1::Condition;
    pub use kube_derive::CustomResource;
    #[cfg(feature = "schemars")]
    pub use schemars::JsonSchema;
    pub use serde::{Deserialize, Serialize};
    pub use std::collections::BTreeMap;
    #[cfg(feature = "builder")]
    pub use typed_builder::TypedBuilder;
}

use self::prelude::*;

/// spec is the desired state of MachinePool.
#[derive(CustomResource, Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
#[cfg_attr(feature = "builder", derive(TypedBuilder))]
#[cfg_attr(feature = "schemars", derive(JsonSchema))]
#[cfg_attr(not(feature = "schemars"), kube(schema = "disabled"))]
#[kube(
    group = "cluster.x-k8s.io",
    version = "v1beta2",
    kind = "MachinePool",
    plural = "machinepools"
)]
#[kube(namespaced)]
#[kube(status = "MachinePoolStatus")]
#[kube(derive = "Default")]
#[kube(derive = "PartialEq")]
pub struct MachinePoolSpec {
    /// clusterName is the name of the Cluster this object belongs to.
    #[serde(rename = "clusterName")]
    pub cluster_name: String,
    /// failureDomains is the list of failure domains this MachinePool should be attached to.
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "failureDomains"
    )]
    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
    pub failure_domains: Option<Vec<String>>,
    /// providerIDList are the identification IDs of machine instances provided by the provider.
    /// This field must match the provider IDs as seen on the node objects corresponding to a machine pool's machine instances.
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "providerIDList"
    )]
    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
    pub provider_id_list: Option<Vec<String>>,
    /// replicas is the number of desired machines. Defaults to 1.
    /// This is a pointer to distinguish between explicit zero and not specified.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
    pub replicas: Option<i32>,
    /// template describes the machines that will be created.
    pub template: MachinePoolTemplate,
}

/// template describes the machines that will be created.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
#[cfg_attr(feature = "builder", derive(TypedBuilder))]
#[cfg_attr(feature = "schemars", derive(JsonSchema))]
pub struct MachinePoolTemplate {
    /// metadata is the standard object's metadata.
    /// More info: <https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata>
    #[serde(default, skip_serializing_if = "Option::is_none")]
    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
    pub metadata: Option<MachinePoolTemplateMetadata>,
    /// spec is the specification of the desired behavior of the machine.
    /// More info: <https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status>
    pub spec: MachinePoolTemplateSpec,
}

/// metadata is the standard object's metadata.
/// More info: <https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata>
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
#[cfg_attr(feature = "builder", derive(TypedBuilder))]
#[cfg_attr(feature = "schemars", derive(JsonSchema))]
pub struct MachinePoolTemplateMetadata {
    /// annotations is an unstructured key value map stored with a resource that may be
    /// set by external tools to store and retrieve arbitrary metadata. They are not
    /// queryable and should be preserved when modifying objects.
    /// More info: <http://kubernetes.io/docs/user-guide/annotations>
    #[serde(default, skip_serializing_if = "Option::is_none")]
    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
    pub annotations: Option<BTreeMap<String, String>>,
    /// labels is a map of string keys and values that can be used to organize and categorize
    /// (scope and select) objects. May match selectors of replication controllers
    /// and services.
    /// More info: <http://kubernetes.io/docs/user-guide/labels>
    #[serde(default, skip_serializing_if = "Option::is_none")]
    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
    pub labels: Option<BTreeMap<String, String>>,
}

/// spec is the specification of the desired behavior of the machine.
/// More info: <https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status>
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
#[cfg_attr(feature = "builder", derive(TypedBuilder))]
#[cfg_attr(feature = "schemars", derive(JsonSchema))]
pub struct MachinePoolTemplateSpec {
    /// bootstrap is a reference to a local struct which encapsulates
    /// fields to configure the Machine’s bootstrapping mechanism.
    pub bootstrap: MachinePoolTemplateSpecBootstrap,
    /// clusterName is the name of the Cluster this object belongs to.
    #[serde(rename = "clusterName")]
    pub cluster_name: String,
    /// deletion contains configuration options for Machine deletion.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
    pub deletion: Option<MachinePoolTemplateSpecDeletion>,
    /// failureDomain is the failure domain the machine will be created in.
    /// Must match the name of a FailureDomain from the Cluster status.
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "failureDomain"
    )]
    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
    pub failure_domain: Option<String>,
    /// infrastructureRef is a required reference to a custom resource
    /// offered by an infrastructure provider.
    #[serde(rename = "infrastructureRef")]
    pub infrastructure_ref: MachinePoolTemplateSpecInfrastructureRef,
    /// minReadySeconds is the minimum number of seconds for which a Machine should be ready before considering it available.
    /// Defaults to 0 (Machine will be considered available as soon as the Machine is ready)
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "minReadySeconds"
    )]
    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
    pub min_ready_seconds: Option<i32>,
    /// providerID is the identification ID of the machine provided by the provider.
    /// This field must match the provider ID as seen on the node object corresponding to this machine.
    /// This field is required by higher level consumers of cluster-api. Example use case is cluster autoscaler
    /// with cluster-api as provider. Clean-up logic in the autoscaler compares machines to nodes to find out
    /// machines at provider which could not get registered as Kubernetes nodes. With cluster-api as a
    /// generic out-of-tree provider for autoscaler, this field is required by autoscaler to be
    /// able to have a provider view of the list of machines. Another list of nodes is queried from the k8s apiserver
    /// and then a comparison is done to find out unregistered machines and are marked for delete.
    /// This field will be set by the actuators and consumed by higher level entities like autoscaler that will
    /// be interfacing with cluster-api as generic provider.
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "providerID"
    )]
    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
    pub provider_id: Option<String>,
    /// readinessGates specifies additional conditions to include when evaluating Machine Ready condition.
    ///
    /// This field can be used e.g. by Cluster API control plane providers to extend the semantic of the
    /// Ready condition for the Machine they control, like the kubeadm control provider adding ReadinessGates
    /// for the APIServerPodHealthy, SchedulerPodHealthy conditions, etc.
    ///
    /// Another example are external controllers, e.g. responsible to install special software/hardware on the Machines;
    /// they can include the status of those components with a new condition and add this condition to ReadinessGates.
    ///
    /// NOTE: In case readinessGates conditions start with the APIServer, ControllerManager, Scheduler prefix, and all those
    /// readiness gates condition are reporting the same message, when computing the Machine's Ready condition those
    /// readinessGates will be replaced by a single entry reporting "Control plane components: " + message.
    /// This helps to improve readability of conditions bubbling up to the Machine's owner resource / to the Cluster).
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "readinessGates"
    )]
    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
    pub readiness_gates: Option<Vec<MachinePoolTemplateSpecReadinessGates>>,
    /// taints are the node taints that Cluster API will manage.
    /// This list is not necessarily complete: other Kubernetes components may add or remove other taints from nodes,
    /// e.g. the node controller might add the node.kubernetes.io/not-ready taint.
    /// Only those taints defined in this list will be added or removed by core Cluster API controllers.
    ///
    /// There can be at most 64 taints.
    /// A pod would have to tolerate all existing taints to run on the corresponding node.
    ///
    /// NOTE: This list is implemented as a "map" type, meaning that individual elements can be managed by different owners.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
    pub taints: Option<Vec<MachinePoolTemplateSpecTaints>>,
    /// version defines the desired Kubernetes version.
    /// This field is meant to be optionally used by bootstrap providers.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
    pub version: Option<String>,
}

/// bootstrap is a reference to a local struct which encapsulates
/// fields to configure the Machine’s bootstrapping mechanism.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
#[cfg_attr(feature = "builder", derive(TypedBuilder))]
#[cfg_attr(feature = "schemars", derive(JsonSchema))]
pub struct MachinePoolTemplateSpecBootstrap {
    /// configRef is a reference to a bootstrap provider-specific resource
    /// that holds configuration details. The reference is optional to
    /// allow users/operators to specify Bootstrap.DataSecretName without
    /// the need of a controller.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "configRef")]
    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
    pub config_ref: Option<MachinePoolTemplateSpecBootstrapConfigRef>,
    /// dataSecretName is the name of the secret that stores the bootstrap data script.
    /// If nil, the Machine should remain in the Pending state.
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "dataSecretName"
    )]
    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
    pub data_secret_name: Option<String>,
}

/// configRef is a reference to a bootstrap provider-specific resource
/// that holds configuration details. The reference is optional to
/// allow users/operators to specify Bootstrap.DataSecretName without
/// the need of a controller.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
#[cfg_attr(feature = "builder", derive(TypedBuilder))]
#[cfg_attr(feature = "schemars", derive(JsonSchema))]
pub struct MachinePoolTemplateSpecBootstrapConfigRef {
    /// apiGroup is the group of the resource being referenced.
    /// apiGroup must be fully qualified domain name.
    /// The corresponding version for this reference will be looked up from the contract
    /// labels of the corresponding CRD of the resource being referenced.
    #[serde(rename = "apiGroup")]
    pub api_group: String,
    /// kind of the resource being referenced.
    /// kind must consist of alphanumeric characters or '-', start with an alphabetic character, and end with an alphanumeric character.
    pub kind: String,
    /// name of the resource being referenced.
    /// name must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character.
    pub name: String,
}

/// deletion contains configuration options for Machine deletion.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
#[cfg_attr(feature = "builder", derive(TypedBuilder))]
#[cfg_attr(feature = "schemars", derive(JsonSchema))]
pub struct MachinePoolTemplateSpecDeletion {
    /// nodeDeletionTimeoutSeconds defines how long the controller will attempt to delete the Node that the Machine
    /// hosts after the Machine is marked for deletion. A duration of 0 will retry deletion indefinitely.
    /// Defaults to 10 seconds.
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "nodeDeletionTimeoutSeconds"
    )]
    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
    pub node_deletion_timeout_seconds: Option<i32>,
    /// nodeDrainTimeoutSeconds is the total amount of time that the controller will spend on draining a node.
    /// The default value is 0, meaning that the node can be drained without any time limitations.
    /// NOTE: nodeDrainTimeoutSeconds is different from `kubectl drain --timeout`
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "nodeDrainTimeoutSeconds"
    )]
    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
    pub node_drain_timeout_seconds: Option<i32>,
    /// nodeVolumeDetachTimeoutSeconds is the total amount of time that the controller will spend on waiting for all volumes
    /// to be detached. The default value is 0, meaning that the volumes can be detached without any time limitations.
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "nodeVolumeDetachTimeoutSeconds"
    )]
    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
    pub node_volume_detach_timeout_seconds: Option<i32>,
}

/// infrastructureRef is a required reference to a custom resource
/// offered by an infrastructure provider.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
#[cfg_attr(feature = "builder", derive(TypedBuilder))]
#[cfg_attr(feature = "schemars", derive(JsonSchema))]
pub struct MachinePoolTemplateSpecInfrastructureRef {
    /// apiGroup is the group of the resource being referenced.
    /// apiGroup must be fully qualified domain name.
    /// The corresponding version for this reference will be looked up from the contract
    /// labels of the corresponding CRD of the resource being referenced.
    #[serde(rename = "apiGroup")]
    pub api_group: String,
    /// kind of the resource being referenced.
    /// kind must consist of alphanumeric characters or '-', start with an alphabetic character, and end with an alphanumeric character.
    pub kind: String,
    /// name of the resource being referenced.
    /// name must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character.
    pub name: String,
}

/// MachineReadinessGate contains the type of a Machine condition to be used as a readiness gate.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
#[cfg_attr(feature = "builder", derive(TypedBuilder))]
#[cfg_attr(feature = "schemars", derive(JsonSchema))]
pub struct MachinePoolTemplateSpecReadinessGates {
    /// conditionType refers to a condition with matching type in the Machine's condition list.
    /// If the conditions doesn't exist, it will be treated as unknown.
    /// Note: Both Cluster API conditions or conditions added by 3rd party controllers can be used as readiness gates.
    #[serde(rename = "conditionType")]
    pub condition_type: String,
    /// polarity of the conditionType specified in this readinessGate.
    /// Valid values are Positive, Negative and omitted.
    /// When omitted, the default behaviour will be Positive.
    /// A positive polarity means that the condition should report a true status under normal conditions.
    /// A negative polarity means that the condition should report a false status under normal conditions.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
    pub polarity: Option<MachinePoolTemplateSpecReadinessGatesPolarity>,
}

/// MachineReadinessGate contains the type of a Machine condition to be used as a readiness gate.
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
#[cfg_attr(feature = "schemars", derive(JsonSchema))]
pub enum MachinePoolTemplateSpecReadinessGatesPolarity {
    Positive,
    Negative,
}

/// MachineTaint defines a taint equivalent to corev1.Taint, but additionally having a propagation field.
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
#[cfg_attr(feature = "builder", derive(TypedBuilder))]
#[cfg_attr(feature = "schemars", derive(JsonSchema))]
pub struct MachinePoolTemplateSpecTaints {
    /// effect is the effect for the taint. Valid values are NoSchedule, PreferNoSchedule and NoExecute.
    pub effect: MachinePoolTemplateSpecTaintsEffect,
    /// key is the taint key to be applied to a node.
    /// Must be a valid qualified name of maximum size 63 characters
    /// with an optional subdomain prefix of maximum size 253 characters,
    /// separated by a `/`.
    pub key: String,
    /// propagation defines how this taint should be propagated to nodes.
    /// Valid values are 'Always' and 'OnInitialization'.
    /// Always: The taint will be continuously reconciled. If it is not set for a node, it will be added during reconciliation.
    /// OnInitialization: The taint will be added during node initialization. If it gets removed from the node later on it will not get added again.
    pub propagation: MachinePoolTemplateSpecTaintsPropagation,
    /// value is the taint value corresponding to the taint key.
    /// It must be a valid label value of maximum size 63 characters.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
    pub value: Option<String>,
}

/// MachineTaint defines a taint equivalent to corev1.Taint, but additionally having a propagation field.
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
#[cfg_attr(feature = "schemars", derive(JsonSchema))]
pub enum MachinePoolTemplateSpecTaintsEffect {
    NoSchedule,
    PreferNoSchedule,
    NoExecute,
}

/// MachineTaint defines a taint equivalent to corev1.Taint, but additionally having a propagation field.
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
#[cfg_attr(feature = "schemars", derive(JsonSchema))]
pub enum MachinePoolTemplateSpecTaintsPropagation {
    Always,
    OnInitialization,
}

/// status is the observed state of MachinePool.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
#[cfg_attr(feature = "builder", derive(TypedBuilder))]
#[cfg_attr(feature = "schemars", derive(JsonSchema))]
pub struct MachinePoolStatus {
    /// availableReplicas is the number of available replicas for this MachinePool. A machine is considered available when Machine's Available condition is true.
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "availableReplicas"
    )]
    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
    pub available_replicas: Option<i32>,
    /// conditions represents the observations of a MachinePool's current state.
    /// Known condition types are Available, BootstrapConfigReady, InfrastructureReady, MachinesReady, MachinesUpToDate,
    /// ScalingUp, ScalingDown, Remediating, Deleting, Paused.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
    pub conditions: Option<Vec<Condition>>,
    /// deprecated groups all the status fields that are deprecated and will be removed when all the nested field are removed.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
    pub deprecated: Option<MachinePoolStatusDeprecated>,
    /// initialization provides observations of the MachinePool initialization process.
    /// NOTE: Fields in this struct are part of the Cluster API contract and are used to orchestrate initial MachinePool provisioning.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
    pub initialization: Option<MachinePoolStatusInitialization>,
    /// nodeRefs will point to the corresponding Nodes if it they exist.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "nodeRefs")]
    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
    pub node_refs: Option<Vec<ObjectReference>>,
    /// observedGeneration is the latest generation observed by the controller.
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "observedGeneration"
    )]
    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
    pub observed_generation: Option<i64>,
    /// phase represents the current phase of cluster actuation.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
    pub phase: Option<MachinePoolStatusPhase>,
    /// readyReplicas is the number of ready replicas for this MachinePool. A machine is considered ready when Machine's Ready condition is true.
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "readyReplicas"
    )]
    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
    pub ready_replicas: Option<i32>,
    /// replicas is the most recently observed number of replicas.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
    pub replicas: Option<i32>,
    /// upToDateReplicas is the number of up-to-date replicas targeted by this MachinePool. A machine is considered up-to-date when Machine's UpToDate condition is true.
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "upToDateReplicas"
    )]
    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
    pub up_to_date_replicas: Option<i32>,
}

/// deprecated groups all the status fields that are deprecated and will be removed when all the nested field are removed.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
#[cfg_attr(feature = "builder", derive(TypedBuilder))]
#[cfg_attr(feature = "schemars", derive(JsonSchema))]
pub struct MachinePoolStatusDeprecated {
    /// v1beta1 groups all the status fields that are deprecated and will be removed when support for v1beta1 will be dropped.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
    pub v1beta1: Option<MachinePoolStatusDeprecatedV1beta1>,
}

/// v1beta1 groups all the status fields that are deprecated and will be removed when support for v1beta1 will be dropped.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
#[cfg_attr(feature = "builder", derive(TypedBuilder))]
#[cfg_attr(feature = "schemars", derive(JsonSchema))]
pub struct MachinePoolStatusDeprecatedV1beta1 {
    /// availableReplicas is the number of available replicas (ready for at least minReadySeconds) for this MachinePool.
    ///
    /// Deprecated: This field is deprecated and is going to be removed when support for v1beta1 will be dropped. Please see <https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md> for more details.
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "availableReplicas"
    )]
    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
    pub available_replicas: Option<i32>,
    /// conditions define the current service state of the MachinePool.
    ///
    /// Deprecated: This field is deprecated and is going to be removed when support for v1beta1 will be dropped. Please see <https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md> for more details.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
    pub conditions: Option<Vec<Condition>>,
    /// failureMessage indicates that there is a problem reconciling the state,
    /// and will be set to a descriptive error message.
    ///
    /// Deprecated: This field is deprecated and is going to be removed when support for v1beta1 will be dropped. Please see <https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md> for more details.
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "failureMessage"
    )]
    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
    pub failure_message: Option<String>,
    /// failureReason indicates that there is a problem reconciling the state, and
    /// will be set to a token value suitable for programmatic interpretation.
    ///
    /// Deprecated: This field is deprecated and is going to be removed when support for v1beta1 will be dropped. Please see <https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md> for more details.
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "failureReason"
    )]
    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
    pub failure_reason: Option<String>,
    /// readyReplicas is the number of ready replicas for this MachinePool. A machine is considered ready when the node has been created and is "Ready".
    ///
    /// Deprecated: This field is deprecated and is going to be removed when support for v1beta1 will be dropped. Please see <https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md> for more details.
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "readyReplicas"
    )]
    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
    pub ready_replicas: Option<i32>,
    /// unavailableReplicas is the total number of unavailable machine instances targeted by this machine pool.
    /// This is the total number of machine instances that are still required for
    /// the machine pool to have 100% available capacity. They may either
    /// be machine instances that are running but not yet available or machine instances
    /// that still have not been created.
    ///
    /// Deprecated: This field is deprecated and is going to be removed when support for v1beta1 will be dropped. Please see <https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md> for more details.
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "unavailableReplicas"
    )]
    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
    pub unavailable_replicas: Option<i32>,
}

/// initialization provides observations of the MachinePool initialization process.
/// NOTE: Fields in this struct are part of the Cluster API contract and are used to orchestrate initial MachinePool provisioning.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
#[cfg_attr(feature = "builder", derive(TypedBuilder))]
#[cfg_attr(feature = "schemars", derive(JsonSchema))]
pub struct MachinePoolStatusInitialization {
    /// bootstrapDataSecretCreated is true when the bootstrap provider reports that the MachinePool's boostrap secret is created.
    /// NOTE: this field is part of the Cluster API contract, and it is used to orchestrate provisioning.
    /// The value of this field is never updated after provisioning is completed.
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "bootstrapDataSecretCreated"
    )]
    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
    pub bootstrap_data_secret_created: Option<bool>,
    /// infrastructureProvisioned is true when the infrastructure provider reports that MachinePool's infrastructure is fully provisioned.
    /// NOTE: this field is part of the Cluster API contract, and it is used to orchestrate provisioning.
    /// The value of this field is never updated after provisioning is completed.
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "infrastructureProvisioned"
    )]
    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
    pub infrastructure_provisioned: Option<bool>,
}

/// status is the observed state of MachinePool.
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
#[cfg_attr(feature = "schemars", derive(JsonSchema))]
pub enum MachinePoolStatusPhase {
    Pending,
    Provisioning,
    Provisioned,
    Running,
    ScalingUp,
    ScalingDown,
    Scaling,
    Deleting,
    Failed,
    Unknown,
}