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
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
// WARNING: generated by kopium - manual changes will be overwritten
// kopium command: kopium -f machines.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::apimachinery::pkg::apis::meta::v1::Condition;
    pub use kube_derive::CustomResource;
    #[cfg(feature = "schemars")]
    pub use schemars::JsonSchema;
    pub use serde::{Deserialize, Serialize};
    #[cfg(feature = "builder")]
    pub use typed_builder::TypedBuilder;
}

use self::prelude::*;

/// spec is the desired state of Machine.
#[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 = "Machine",
    plural = "machines"
)]
#[kube(namespaced)]
#[kube(status = "MachineStatus")]
#[kube(derive = "Default")]
#[kube(derive = "PartialEq")]
pub struct MachineSpec {
    /// bootstrap is a reference to a local struct which encapsulates
    /// fields to configure the Machine’s bootstrapping mechanism.
    pub bootstrap: MachineBootstrap,
    /// 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<MachineDeletion>,
    /// 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: MachineInfrastructureRef,
    /// 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<MachineReadinessGates>>,
    /// 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<MachineTaints>>,
    /// 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 MachineBootstrap {
    /// 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<MachineBootstrapConfigRef>,
    /// 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 MachineBootstrapConfigRef {
    /// 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 MachineDeletion {
    /// 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 MachineInfrastructureRef {
    /// 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 MachineReadinessGates {
    /// 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<MachineReadinessGatesPolarity>,
}

/// 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 MachineReadinessGatesPolarity {
    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 MachineTaints {
    /// effect is the effect for the taint. Valid values are NoSchedule, PreferNoSchedule and NoExecute.
    pub effect: MachineTaintsEffect,
    /// 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: MachineTaintsPropagation,
    /// 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 MachineTaintsEffect {
    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 MachineTaintsPropagation {
    Always,
    OnInitialization,
}

/// status is the observed state of Machine.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
#[cfg_attr(feature = "builder", derive(TypedBuilder))]
#[cfg_attr(feature = "schemars", derive(JsonSchema))]
pub struct MachineStatus {
    /// addresses is a list of addresses assigned to the machine.
    /// This field is copied from the infrastructure provider reference.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
    pub addresses: Option<Vec<MachineStatusAddresses>>,
    /// certificatesExpiryDate is the expiry date of the machine certificates.
    /// This value is only set for control plane machines.
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "certificatesExpiryDate"
    )]
    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
    pub certificates_expiry_date: Option<String>,
    /// conditions represents the observations of a Machine's current state.
    /// Known condition types are Available, Ready, UpToDate, BootstrapConfigReady, InfrastructureReady, NodeReady,
    /// NodeHealthy, Updating, Deleting, Paused.
    /// If a MachineHealthCheck is targeting this machine, also HealthCheckSucceeded, OwnerRemediated conditions are added.
    /// Additionally control plane Machines controlled by KubeadmControlPlane will have following additional conditions:
    /// APIServerPodHealthy, ControllerManagerPodHealthy, SchedulerPodHealthy, EtcdPodHealthy, EtcdMemberHealthy.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
    pub conditions: Option<Vec<Condition>>,
    /// deletion contains information relating to removal of the Machine.
    /// Only present when the Machine has a deletionTimestamp and drain or wait for volume detach started.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
    pub deletion: Option<MachineStatusDeletion>,
    /// 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<MachineStatusDeprecated>,
    /// initialization provides observations of the Machine initialization process.
    /// NOTE: Fields in this struct are part of the Cluster API contract and are used to orchestrate initial Machine provisioning.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
    pub initialization: Option<MachineStatusInitialization>,
    /// lastUpdated identifies when the phase of the Machine last transitioned.
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "lastUpdated"
    )]
    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
    pub last_updated: Option<String>,
    /// nodeInfo is a set of ids/uuids to uniquely identify the node.
    /// More info: <https://kubernetes.io/docs/concepts/nodes/node/#info>
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "nodeInfo")]
    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
    pub node_info: Option<MachineStatusNodeInfo>,
    /// nodeRef will point to the corresponding Node if it exists.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "nodeRef")]
    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
    pub node_ref: Option<MachineStatusNodeRef>,
    /// 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 machine actuation.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
    pub phase: Option<MachineStatusPhase>,
}

/// MachineAddress contains information for the node's address.
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
#[cfg_attr(feature = "builder", derive(TypedBuilder))]
#[cfg_attr(feature = "schemars", derive(JsonSchema))]
pub struct MachineStatusAddresses {
    /// address is the machine address.
    pub address: String,
    /// type is the machine address type, one of Hostname, ExternalIP, InternalIP, ExternalDNS or InternalDNS.
    #[serde(rename = "type")]
    pub r#type: MachineStatusAddressesType,
}

/// MachineAddress contains information for the node's address.
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
#[cfg_attr(feature = "schemars", derive(JsonSchema))]
pub enum MachineStatusAddressesType {
    Hostname,
    #[serde(rename = "ExternalIP")]
    ExternalIp,
    #[serde(rename = "InternalIP")]
    InternalIp,
    #[serde(rename = "ExternalDNS")]
    ExternalDns,
    #[serde(rename = "InternalDNS")]
    InternalDns,
}

/// deletion contains information relating to removal of the Machine.
/// Only present when the Machine has a deletionTimestamp and drain or wait for volume detach started.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
#[cfg_attr(feature = "builder", derive(TypedBuilder))]
#[cfg_attr(feature = "schemars", derive(JsonSchema))]
pub struct MachineStatusDeletion {
    /// nodeDrainStartTime is the time when the drain of the node started and is used to determine
    /// if the nodeDrainTimeoutSeconds is exceeded.
    /// Only present when the Machine has a deletionTimestamp and draining the node had been started.
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "nodeDrainStartTime"
    )]
    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
    pub node_drain_start_time: Option<String>,
    /// waitForNodeVolumeDetachStartTime is the time when waiting for volume detachment started
    /// and is used to determine if the nodeVolumeDetachTimeoutSeconds is exceeded.
    /// Detaching volumes from nodes is usually done by CSI implementations and the current state
    /// is observed from the node's `.Status.VolumesAttached` field.
    /// Only present when the Machine has a deletionTimestamp and waiting for volume detachments had been started.
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "waitForNodeVolumeDetachStartTime"
    )]
    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
    pub wait_for_node_volume_detach_start_time: Option<String>,
}

/// 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 MachineStatusDeprecated {
    /// v1beta1 groups all the status fields that are deprecated and will be removed when support for v1beta1 will be dropped.
    ///
    /// 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 v1beta1: Option<MachineStatusDeprecatedV1beta1>,
}

/// v1beta1 groups all the status fields that are deprecated and will be removed when support for v1beta1 will be dropped.
///
/// 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.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
#[cfg_attr(feature = "builder", derive(TypedBuilder))]
#[cfg_attr(feature = "schemars", derive(JsonSchema))]
pub struct MachineStatusDeprecatedV1beta1 {
    /// conditions defines current service state of the Machine.
    ///
    /// 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 will be set in the event that there is a terminal problem
    /// reconciling the Machine and will contain a more verbose string suitable
    /// for logging and human consumption.
    ///
    /// This field should not be set for transitive errors that a controller
    /// faces that are expected to be fixed automatically over
    /// time (like service outages), but instead indicate that something is
    /// fundamentally wrong with the Machine's spec or the configuration of
    /// the controller, and that manual intervention is required. Examples
    /// of terminal errors would be invalid combinations of settings in the
    /// spec, values that are unsupported by the controller, or the
    /// responsible controller itself being critically misconfigured.
    ///
    /// Any transient errors that occur during the reconciliation of Machines
    /// can be added as events to the Machine object and/or logged in the
    /// controller's output.
    ///
    /// 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 will be set in the event that there is a terminal problem
    /// reconciling the Machine and will contain a succinct value suitable
    /// for machine interpretation.
    ///
    /// This field should not be set for transitive errors that a controller
    /// faces that are expected to be fixed automatically over
    /// time (like service outages), but instead indicate that something is
    /// fundamentally wrong with the Machine's spec or the configuration of
    /// the controller, and that manual intervention is required. Examples
    /// of terminal errors would be invalid combinations of settings in the
    /// spec, values that are unsupported by the controller, or the
    /// responsible controller itself being critically misconfigured.
    ///
    /// Any transient errors that occur during the reconciliation of Machines
    /// can be added as events to the Machine object and/or logged in the
    /// controller's output.
    ///
    /// 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>,
}

/// initialization provides observations of the Machine initialization process.
/// NOTE: Fields in this struct are part of the Cluster API contract and are used to orchestrate initial Machine provisioning.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
#[cfg_attr(feature = "builder", derive(TypedBuilder))]
#[cfg_attr(feature = "schemars", derive(JsonSchema))]
pub struct MachineStatusInitialization {
    /// bootstrapDataSecretCreated is true when the bootstrap provider reports that the Machine'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 Machine'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>,
}

/// nodeInfo is a set of ids/uuids to uniquely identify the node.
/// More info: <https://kubernetes.io/docs/concepts/nodes/node/#info>
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
#[cfg_attr(feature = "builder", derive(TypedBuilder))]
#[cfg_attr(feature = "schemars", derive(JsonSchema))]
pub struct MachineStatusNodeInfo {
    /// The Architecture reported by the node
    pub architecture: String,
    /// Boot ID reported by the node.
    #[serde(rename = "bootID")]
    pub boot_id: String,
    /// ContainerRuntime Version reported by the node through runtime remote API (e.g. containerd://1.4.2).
    #[serde(rename = "containerRuntimeVersion")]
    pub container_runtime_version: String,
    /// Kernel Version reported by the node from 'uname -r' (e.g. 3.16.0-0.bpo.4-amd64).
    #[serde(rename = "kernelVersion")]
    pub kernel_version: String,
    /// Deprecated: KubeProxy Version reported by the node.
    #[serde(rename = "kubeProxyVersion")]
    pub kube_proxy_version: String,
    /// Kubelet Version reported by the node.
    #[serde(rename = "kubeletVersion")]
    pub kubelet_version: String,
    /// MachineID reported by the node. For unique machine identification
    /// in the cluster this field is preferred. Learn more from man(5)
    /// machine-id: <http://man7.org/linux/man-pages/man5/machine-id.5.html>
    #[serde(rename = "machineID")]
    pub machine_id: String,
    /// The Operating System reported by the node
    #[serde(rename = "operatingSystem")]
    pub operating_system: String,
    /// OS Image reported by the node from /etc/os-release (e.g. Debian GNU/Linux 7 (wheezy)).
    #[serde(rename = "osImage")]
    pub os_image: String,
    /// Swap Info reported by the node.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
    pub swap: Option<MachineStatusNodeInfoSwap>,
    /// SystemUUID reported by the node. For unique machine identification
    /// MachineID is preferred. This field is specific to Red Hat hosts
    /// <https://access.redhat.com/documentation/en-us/red_hat_subscription_management/1/html/rhsm/uuid>
    #[serde(rename = "systemUUID")]
    pub system_uuid: String,
}

/// Swap Info reported by the node.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
#[cfg_attr(feature = "builder", derive(TypedBuilder))]
#[cfg_attr(feature = "schemars", derive(JsonSchema))]
pub struct MachineStatusNodeInfoSwap {
    /// Total amount of swap memory in bytes.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
    pub capacity: Option<i64>,
}

/// nodeRef will point to the corresponding Node if it exists.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
#[cfg_attr(feature = "builder", derive(TypedBuilder))]
#[cfg_attr(feature = "schemars", derive(JsonSchema))]
pub struct MachineStatusNodeRef {
    /// name of the node.
    /// name must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character.
    pub name: String,
}

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