Skip to main content

cluster_api_rs/api/
capi_machine.rs

1// WARNING: generated by kopium - manual changes will be overwritten
2// kopium command: kopium --smart-derive-elision -D Default -D PartialEq -A -d -f -
3// kopium version: 0.22.5
4
5#[allow(unused_imports)]
6mod prelude {
7    pub use k8s_openapi::apimachinery::pkg::apis::meta::v1::Condition;
8    pub use kube::CustomResource;
9    pub use schemars::JsonSchema;
10    pub use serde::{Deserialize, Serialize};
11}
12
13use self::prelude::*;
14
15/// spec is the desired state of Machine.
16#[derive(CustomResource, Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
17#[kube(
18    group = "cluster.x-k8s.io",
19    version = "v1beta2",
20    kind = "Machine",
21    plural = "machines"
22)]
23#[kube(namespaced)]
24#[kube(status = "MachineStatus")]
25#[kube(derive = "Default")]
26#[kube(derive = "PartialEq")]
27pub struct MachineSpec {
28    /// bootstrap is a reference to a local struct which encapsulates
29    /// fields to configure the Machine’s bootstrapping mechanism.
30    pub bootstrap: MachineBootstrap,
31    /// clusterName is the name of the Cluster this object belongs to.
32    #[serde(rename = "clusterName")]
33    pub cluster_name: String,
34    /// deletion contains configuration options for Machine deletion.
35    #[serde(default, skip_serializing_if = "Option::is_none")]
36    pub deletion: Option<MachineDeletion>,
37    /// failureDomain is the failure domain the machine will be created in.
38    /// Must match the name of a FailureDomain from the Cluster status.
39    #[serde(
40        default,
41        skip_serializing_if = "Option::is_none",
42        rename = "failureDomain"
43    )]
44    pub failure_domain: Option<String>,
45    /// infrastructureRef is a required reference to a custom resource
46    /// offered by an infrastructure provider.
47    #[serde(rename = "infrastructureRef")]
48    pub infrastructure_ref: MachineInfrastructureRef,
49    /// minReadySeconds is the minimum number of seconds for which a Machine should be ready before considering it available.
50    /// Defaults to 0 (Machine will be considered available as soon as the Machine is ready)
51    #[serde(
52        default,
53        skip_serializing_if = "Option::is_none",
54        rename = "minReadySeconds"
55    )]
56    pub min_ready_seconds: Option<i32>,
57    /// providerID is the identification ID of the machine provided by the provider.
58    /// This field must match the provider ID as seen on the node object corresponding to this machine.
59    /// This field is required by higher level consumers of cluster-api. Example use case is cluster autoscaler
60    /// with cluster-api as provider. Clean-up logic in the autoscaler compares machines to nodes to find out
61    /// machines at provider which could not get registered as Kubernetes nodes. With cluster-api as a
62    /// generic out-of-tree provider for autoscaler, this field is required by autoscaler to be
63    /// able to have a provider view of the list of machines. Another list of nodes is queried from the k8s apiserver
64    /// and then a comparison is done to find out unregistered machines and are marked for delete.
65    /// This field will be set by the actuators and consumed by higher level entities like autoscaler that will
66    /// be interfacing with cluster-api as generic provider.
67    #[serde(
68        default,
69        skip_serializing_if = "Option::is_none",
70        rename = "providerID"
71    )]
72    pub provider_id: Option<String>,
73    /// readinessGates specifies additional conditions to include when evaluating Machine Ready condition.
74    ///
75    /// This field can be used e.g. by Cluster API control plane providers to extend the semantic of the
76    /// Ready condition for the Machine they control, like the kubeadm control provider adding ReadinessGates
77    /// for the APIServerPodHealthy, SchedulerPodHealthy conditions, etc.
78    ///
79    /// Another example are external controllers, e.g. responsible to install special software/hardware on the Machines;
80    /// they can include the status of those components with a new condition and add this condition to ReadinessGates.
81    ///
82    /// NOTE: In case readinessGates conditions start with the APIServer, ControllerManager, Scheduler prefix, and all those
83    /// readiness gates condition are reporting the same message, when computing the Machine's Ready condition those
84    /// readinessGates will be replaced by a single entry reporting "Control plane components: " + message.
85    /// This helps to improve readability of conditions bubbling up to the Machine's owner resource / to the Cluster).
86    #[serde(
87        default,
88        skip_serializing_if = "Option::is_none",
89        rename = "readinessGates"
90    )]
91    pub readiness_gates: Option<Vec<MachineReadinessGates>>,
92    /// taints are the node taints that Cluster API will manage.
93    /// This list is not necessarily complete: other Kubernetes components may add or remove other taints from nodes,
94    /// e.g. the node controller might add the node.kubernetes.io/not-ready taint.
95    /// Only those taints defined in this list will be added or removed by core Cluster API controllers.
96    ///
97    /// There can be at most 64 taints.
98    /// A pod would have to tolerate all existing taints to run on the corresponding node.
99    ///
100    /// NOTE: This list is implemented as a "map" type, meaning that individual elements can be managed by different owners.
101    #[serde(default, skip_serializing_if = "Option::is_none")]
102    pub taints: Option<Vec<MachineTaints>>,
103    /// version defines the desired Kubernetes version.
104    /// This field is meant to be optionally used by bootstrap providers.
105    #[serde(default, skip_serializing_if = "Option::is_none")]
106    pub version: Option<String>,
107}
108
109/// bootstrap is a reference to a local struct which encapsulates
110/// fields to configure the Machine’s bootstrapping mechanism.
111#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
112pub struct MachineBootstrap {
113    /// configRef is a reference to a bootstrap provider-specific resource
114    /// that holds configuration details. The reference is optional to
115    /// allow users/operators to specify Bootstrap.DataSecretName without
116    /// the need of a controller.
117    #[serde(default, skip_serializing_if = "Option::is_none", rename = "configRef")]
118    pub config_ref: Option<MachineBootstrapConfigRef>,
119    /// dataSecretName is the name of the secret that stores the bootstrap data script.
120    /// If nil, the Machine should remain in the Pending state.
121    #[serde(
122        default,
123        skip_serializing_if = "Option::is_none",
124        rename = "dataSecretName"
125    )]
126    pub data_secret_name: Option<String>,
127}
128
129/// configRef is a reference to a bootstrap provider-specific resource
130/// that holds configuration details. The reference is optional to
131/// allow users/operators to specify Bootstrap.DataSecretName without
132/// the need of a controller.
133#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
134pub struct MachineBootstrapConfigRef {
135    /// apiGroup is the group of the resource being referenced.
136    /// apiGroup must be fully qualified domain name.
137    /// The corresponding version for this reference will be looked up from the contract
138    /// labels of the corresponding CRD of the resource being referenced.
139    #[serde(rename = "apiGroup")]
140    pub api_group: String,
141    /// kind of the resource being referenced.
142    /// kind must consist of alphanumeric characters or '-', start with an alphabetic character, and end with an alphanumeric character.
143    pub kind: String,
144    /// name of the resource being referenced.
145    /// name must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character.
146    pub name: String,
147}
148
149/// deletion contains configuration options for Machine deletion.
150#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
151pub struct MachineDeletion {
152    /// nodeDeletionTimeoutSeconds defines how long the controller will attempt to delete the Node that the Machine
153    /// hosts after the Machine is marked for deletion. A duration of 0 will retry deletion indefinitely.
154    /// Defaults to 10 seconds.
155    #[serde(
156        default,
157        skip_serializing_if = "Option::is_none",
158        rename = "nodeDeletionTimeoutSeconds"
159    )]
160    pub node_deletion_timeout_seconds: Option<i32>,
161    /// nodeDrainTimeoutSeconds is the total amount of time that the controller will spend on draining a node.
162    /// The default value is 0, meaning that the node can be drained without any time limitations.
163    /// NOTE: nodeDrainTimeoutSeconds is different from `kubectl drain --timeout`
164    #[serde(
165        default,
166        skip_serializing_if = "Option::is_none",
167        rename = "nodeDrainTimeoutSeconds"
168    )]
169    pub node_drain_timeout_seconds: Option<i32>,
170    /// nodeVolumeDetachTimeoutSeconds is the total amount of time that the controller will spend on waiting for all volumes
171    /// to be detached. The default value is 0, meaning that the volumes can be detached without any time limitations.
172    #[serde(
173        default,
174        skip_serializing_if = "Option::is_none",
175        rename = "nodeVolumeDetachTimeoutSeconds"
176    )]
177    pub node_volume_detach_timeout_seconds: Option<i32>,
178}
179
180/// infrastructureRef is a required reference to a custom resource
181/// offered by an infrastructure provider.
182#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
183pub struct MachineInfrastructureRef {
184    /// apiGroup is the group of the resource being referenced.
185    /// apiGroup must be fully qualified domain name.
186    /// The corresponding version for this reference will be looked up from the contract
187    /// labels of the corresponding CRD of the resource being referenced.
188    #[serde(rename = "apiGroup")]
189    pub api_group: String,
190    /// kind of the resource being referenced.
191    /// kind must consist of alphanumeric characters or '-', start with an alphabetic character, and end with an alphanumeric character.
192    pub kind: String,
193    /// name of the resource being referenced.
194    /// name must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character.
195    pub name: String,
196}
197
198/// MachineReadinessGate contains the type of a Machine condition to be used as a readiness gate.
199#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
200pub struct MachineReadinessGates {
201    /// conditionType refers to a condition with matching type in the Machine's condition list.
202    /// If the conditions doesn't exist, it will be treated as unknown.
203    /// Note: Both Cluster API conditions or conditions added by 3rd party controllers can be used as readiness gates.
204    #[serde(rename = "conditionType")]
205    pub condition_type: String,
206    /// polarity of the conditionType specified in this readinessGate.
207    /// Valid values are Positive, Negative and omitted.
208    /// When omitted, the default behaviour will be Positive.
209    /// A positive polarity means that the condition should report a true status under normal conditions.
210    /// A negative polarity means that the condition should report a false status under normal conditions.
211    #[serde(default, skip_serializing_if = "Option::is_none")]
212    pub polarity: Option<MachineReadinessGatesPolarity>,
213}
214
215/// MachineReadinessGate contains the type of a Machine condition to be used as a readiness gate.
216#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
217pub enum MachineReadinessGatesPolarity {
218    Positive,
219    Negative,
220}
221
222/// MachineTaint defines a taint equivalent to corev1.Taint, but additionally having a propagation field.
223#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
224pub struct MachineTaints {
225    /// effect is the effect for the taint. Valid values are NoSchedule, PreferNoSchedule and NoExecute.
226    pub effect: MachineTaintsEffect,
227    /// key is the taint key to be applied to a node.
228    /// Must be a valid qualified name of maximum size 63 characters
229    /// with an optional subdomain prefix of maximum size 253 characters,
230    /// separated by a `/`.
231    pub key: String,
232    /// propagation defines how this taint should be propagated to nodes.
233    /// Valid values are 'Always' and 'OnInitialization'.
234    /// Always: The taint will be continuously reconciled. If it is not set for a node, it will be added during reconciliation.
235    /// OnInitialization: The taint will be added during node initialization. If it gets removed from the node later on it will not get added again.
236    pub propagation: MachineTaintsPropagation,
237    /// value is the taint value corresponding to the taint key.
238    /// It must be a valid label value of maximum size 63 characters.
239    #[serde(default, skip_serializing_if = "Option::is_none")]
240    pub value: Option<String>,
241}
242
243/// MachineTaint defines a taint equivalent to corev1.Taint, but additionally having a propagation field.
244#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
245pub enum MachineTaintsEffect {
246    NoSchedule,
247    PreferNoSchedule,
248    NoExecute,
249}
250
251/// MachineTaint defines a taint equivalent to corev1.Taint, but additionally having a propagation field.
252#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
253pub enum MachineTaintsPropagation {
254    Always,
255    OnInitialization,
256}
257
258/// status is the observed state of Machine.
259#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
260pub struct MachineStatus {
261    /// addresses is a list of addresses assigned to the machine.
262    /// This field is copied from the infrastructure provider reference.
263    #[serde(default, skip_serializing_if = "Option::is_none")]
264    pub addresses: Option<Vec<MachineStatusAddresses>>,
265    /// certificatesExpiryDate is the expiry date of the machine certificates.
266    /// This value is only set for control plane machines.
267    #[serde(
268        default,
269        skip_serializing_if = "Option::is_none",
270        rename = "certificatesExpiryDate"
271    )]
272    pub certificates_expiry_date: Option<String>,
273    /// conditions represents the observations of a Machine's current state.
274    /// Known condition types are Available, Ready, UpToDate, BootstrapConfigReady, InfrastructureReady, NodeReady,
275    /// NodeHealthy, Updating, Deleting, Paused.
276    /// If a MachineHealthCheck is targeting this machine, also HealthCheckSucceeded, OwnerRemediated conditions are added.
277    /// Additionally control plane Machines controlled by KubeadmControlPlane will have following additional conditions:
278    /// APIServerPodHealthy, ControllerManagerPodHealthy, SchedulerPodHealthy, EtcdPodHealthy, EtcdMemberHealthy.
279    #[serde(default, skip_serializing_if = "Option::is_none")]
280    pub conditions: Option<Vec<Condition>>,
281    /// deletion contains information relating to removal of the Machine.
282    /// Only present when the Machine has a deletionTimestamp and drain or wait for volume detach started.
283    #[serde(default, skip_serializing_if = "Option::is_none")]
284    pub deletion: Option<MachineStatusDeletion>,
285    /// deprecated groups all the status fields that are deprecated and will be removed when all the nested field are removed.
286    #[serde(default, skip_serializing_if = "Option::is_none")]
287    pub deprecated: Option<MachineStatusDeprecated>,
288    /// initialization provides observations of the Machine initialization process.
289    /// NOTE: Fields in this struct are part of the Cluster API contract and are used to orchestrate initial Machine provisioning.
290    #[serde(default, skip_serializing_if = "Option::is_none")]
291    pub initialization: Option<MachineStatusInitialization>,
292    /// lastUpdated identifies when the phase of the Machine last transitioned.
293    #[serde(
294        default,
295        skip_serializing_if = "Option::is_none",
296        rename = "lastUpdated"
297    )]
298    pub last_updated: Option<String>,
299    /// nodeInfo is a set of ids/uuids to uniquely identify the node.
300    /// More info: <https://kubernetes.io/docs/concepts/nodes/node/#info>
301    #[serde(default, skip_serializing_if = "Option::is_none", rename = "nodeInfo")]
302    pub node_info: Option<MachineStatusNodeInfo>,
303    /// nodeRef will point to the corresponding Node if it exists.
304    #[serde(default, skip_serializing_if = "Option::is_none", rename = "nodeRef")]
305    pub node_ref: Option<MachineStatusNodeRef>,
306    /// observedGeneration is the latest generation observed by the controller.
307    #[serde(
308        default,
309        skip_serializing_if = "Option::is_none",
310        rename = "observedGeneration"
311    )]
312    pub observed_generation: Option<i64>,
313    /// phase represents the current phase of machine actuation.
314    #[serde(default, skip_serializing_if = "Option::is_none")]
315    pub phase: Option<MachineStatusPhase>,
316}
317
318/// MachineAddress contains information for the node's address.
319#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
320pub struct MachineStatusAddresses {
321    /// address is the machine address.
322    pub address: String,
323    /// type is the machine address type, one of Hostname, ExternalIP, InternalIP, ExternalDNS or InternalDNS.
324    #[serde(rename = "type")]
325    pub r#type: MachineStatusAddressesType,
326}
327
328/// MachineAddress contains information for the node's address.
329#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
330pub enum MachineStatusAddressesType {
331    Hostname,
332    #[serde(rename = "ExternalIP")]
333    ExternalIp,
334    #[serde(rename = "InternalIP")]
335    InternalIp,
336    #[serde(rename = "ExternalDNS")]
337    ExternalDns,
338    #[serde(rename = "InternalDNS")]
339    InternalDns,
340}
341
342/// deletion contains information relating to removal of the Machine.
343/// Only present when the Machine has a deletionTimestamp and drain or wait for volume detach started.
344#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
345pub struct MachineStatusDeletion {
346    /// nodeDrainStartTime is the time when the drain of the node started and is used to determine
347    /// if the nodeDrainTimeoutSeconds is exceeded.
348    /// Only present when the Machine has a deletionTimestamp and draining the node had been started.
349    #[serde(
350        default,
351        skip_serializing_if = "Option::is_none",
352        rename = "nodeDrainStartTime"
353    )]
354    pub node_drain_start_time: Option<String>,
355    /// waitForNodeVolumeDetachStartTime is the time when waiting for volume detachment started
356    /// and is used to determine if the nodeVolumeDetachTimeoutSeconds is exceeded.
357    /// Detaching volumes from nodes is usually done by CSI implementations and the current state
358    /// is observed from the node's `.Status.VolumesAttached` field.
359    /// Only present when the Machine has a deletionTimestamp and waiting for volume detachments had been started.
360    #[serde(
361        default,
362        skip_serializing_if = "Option::is_none",
363        rename = "waitForNodeVolumeDetachStartTime"
364    )]
365    pub wait_for_node_volume_detach_start_time: Option<String>,
366}
367
368/// deprecated groups all the status fields that are deprecated and will be removed when all the nested field are removed.
369#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
370pub struct MachineStatusDeprecated {
371    /// v1beta1 groups all the status fields that are deprecated and will be removed when support for v1beta1 will be dropped.
372    ///
373    /// 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.
374    #[serde(default, skip_serializing_if = "Option::is_none")]
375    pub v1beta1: Option<MachineStatusDeprecatedV1beta1>,
376}
377
378/// v1beta1 groups all the status fields that are deprecated and will be removed when support for v1beta1 will be dropped.
379///
380/// 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.
381#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
382pub struct MachineStatusDeprecatedV1beta1 {
383    /// conditions defines current service state of the Machine.
384    ///
385    /// 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.
386    #[serde(default, skip_serializing_if = "Option::is_none")]
387    pub conditions: Option<Vec<Condition>>,
388    /// failureMessage will be set in the event that there is a terminal problem
389    /// reconciling the Machine and will contain a more verbose string suitable
390    /// for logging and human consumption.
391    ///
392    /// This field should not be set for transitive errors that a controller
393    /// faces that are expected to be fixed automatically over
394    /// time (like service outages), but instead indicate that something is
395    /// fundamentally wrong with the Machine's spec or the configuration of
396    /// the controller, and that manual intervention is required. Examples
397    /// of terminal errors would be invalid combinations of settings in the
398    /// spec, values that are unsupported by the controller, or the
399    /// responsible controller itself being critically misconfigured.
400    ///
401    /// Any transient errors that occur during the reconciliation of Machines
402    /// can be added as events to the Machine object and/or logged in the
403    /// controller's output.
404    ///
405    /// 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.
406    #[serde(
407        default,
408        skip_serializing_if = "Option::is_none",
409        rename = "failureMessage"
410    )]
411    pub failure_message: Option<String>,
412    /// failureReason will be set in the event that there is a terminal problem
413    /// reconciling the Machine and will contain a succinct value suitable
414    /// for machine interpretation.
415    ///
416    /// This field should not be set for transitive errors that a controller
417    /// faces that are expected to be fixed automatically over
418    /// time (like service outages), but instead indicate that something is
419    /// fundamentally wrong with the Machine's spec or the configuration of
420    /// the controller, and that manual intervention is required. Examples
421    /// of terminal errors would be invalid combinations of settings in the
422    /// spec, values that are unsupported by the controller, or the
423    /// responsible controller itself being critically misconfigured.
424    ///
425    /// Any transient errors that occur during the reconciliation of Machines
426    /// can be added as events to the Machine object and/or logged in the
427    /// controller's output.
428    ///
429    /// 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.
430    #[serde(
431        default,
432        skip_serializing_if = "Option::is_none",
433        rename = "failureReason"
434    )]
435    pub failure_reason: Option<String>,
436}
437
438/// initialization provides observations of the Machine initialization process.
439/// NOTE: Fields in this struct are part of the Cluster API contract and are used to orchestrate initial Machine provisioning.
440#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
441pub struct MachineStatusInitialization {
442    /// bootstrapDataSecretCreated is true when the bootstrap provider reports that the Machine's boostrap secret is created.
443    /// NOTE: this field is part of the Cluster API contract, and it is used to orchestrate provisioning.
444    /// The value of this field is never updated after provisioning is completed.
445    #[serde(
446        default,
447        skip_serializing_if = "Option::is_none",
448        rename = "bootstrapDataSecretCreated"
449    )]
450    pub bootstrap_data_secret_created: Option<bool>,
451    /// infrastructureProvisioned is true when the infrastructure provider reports that Machine's infrastructure is fully provisioned.
452    /// NOTE: this field is part of the Cluster API contract, and it is used to orchestrate provisioning.
453    /// The value of this field is never updated after provisioning is completed.
454    #[serde(
455        default,
456        skip_serializing_if = "Option::is_none",
457        rename = "infrastructureProvisioned"
458    )]
459    pub infrastructure_provisioned: Option<bool>,
460}
461
462/// nodeInfo is a set of ids/uuids to uniquely identify the node.
463/// More info: <https://kubernetes.io/docs/concepts/nodes/node/#info>
464#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
465pub struct MachineStatusNodeInfo {
466    /// The Architecture reported by the node
467    pub architecture: String,
468    /// Boot ID reported by the node.
469    #[serde(rename = "bootID")]
470    pub boot_id: String,
471    /// ContainerRuntime Version reported by the node through runtime remote API (e.g. containerd://1.4.2).
472    #[serde(rename = "containerRuntimeVersion")]
473    pub container_runtime_version: String,
474    /// Kernel Version reported by the node from 'uname -r' (e.g. 3.16.0-0.bpo.4-amd64).
475    #[serde(rename = "kernelVersion")]
476    pub kernel_version: String,
477    /// Deprecated: KubeProxy Version reported by the node.
478    #[serde(rename = "kubeProxyVersion")]
479    pub kube_proxy_version: String,
480    /// Kubelet Version reported by the node.
481    #[serde(rename = "kubeletVersion")]
482    pub kubelet_version: String,
483    /// MachineID reported by the node. For unique machine identification
484    /// in the cluster this field is preferred. Learn more from man(5)
485    /// machine-id: <http://man7.org/linux/man-pages/man5/machine-id.5.html>
486    #[serde(rename = "machineID")]
487    pub machine_id: String,
488    /// The Operating System reported by the node
489    #[serde(rename = "operatingSystem")]
490    pub operating_system: String,
491    /// OS Image reported by the node from /etc/os-release (e.g. Debian GNU/Linux 7 (wheezy)).
492    #[serde(rename = "osImage")]
493    pub os_image: String,
494    /// Swap Info reported by the node.
495    #[serde(default, skip_serializing_if = "Option::is_none")]
496    pub swap: Option<MachineStatusNodeInfoSwap>,
497    /// SystemUUID reported by the node. For unique machine identification
498    /// MachineID is preferred. This field is specific to Red Hat hosts
499    /// <https://access.redhat.com/documentation/en-us/red_hat_subscription_management/1/html/rhsm/uuid>
500    #[serde(rename = "systemUUID")]
501    pub system_uuid: String,
502}
503
504/// Swap Info reported by the node.
505#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
506pub struct MachineStatusNodeInfoSwap {
507    /// Total amount of swap memory in bytes.
508    #[serde(default, skip_serializing_if = "Option::is_none")]
509    pub capacity: Option<i64>,
510}
511
512/// nodeRef will point to the corresponding Node if it exists.
513#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
514pub struct MachineStatusNodeRef {
515    /// name of the node.
516    /// name must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character.
517    pub name: String,
518}
519
520/// status is the observed state of Machine.
521#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
522pub enum MachineStatusPhase {
523    Pending,
524    Provisioning,
525    Provisioned,
526    Running,
527    Updating,
528    Deleting,
529    Deleted,
530    Failed,
531    Unknown,
532}