cluster_api_rs/api/
capi_machinedeployment.rs

1// WARNING: generated by kopium - manual changes will be overwritten
2// kopium command: kopium -D Default -D PartialEq -A -d -f -
3// kopium version: 0.21.1
4
5#[allow(unused_imports)]
6mod prelude {
7    pub use k8s_openapi::api::core::v1::ObjectReference;
8    pub use k8s_openapi::apimachinery::pkg::apis::meta::v1::Condition;
9    pub use k8s_openapi::apimachinery::pkg::util::intstr::IntOrString;
10    pub use kube::CustomResource;
11    pub use schemars::JsonSchema;
12    pub use serde::{Deserialize, Serialize};
13    pub use std::collections::BTreeMap;
14}
15use self::prelude::*;
16
17/// MachineDeploymentSpec defines the desired state of MachineDeployment.
18#[derive(CustomResource, Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
19#[kube(
20    group = "cluster.x-k8s.io",
21    version = "v1beta1",
22    kind = "MachineDeployment",
23    plural = "machinedeployments"
24)]
25#[kube(namespaced)]
26#[kube(status = "MachineDeploymentStatus")]
27#[kube(derive = "Default")]
28#[kube(derive = "PartialEq")]
29pub struct MachineDeploymentSpec {
30    /// clusterName is the name of the Cluster this object belongs to.
31    #[serde(rename = "clusterName")]
32    pub cluster_name: String,
33    /// minReadySeconds is the minimum number of seconds for which a Node for a newly created machine should be ready before considering the replica available.
34    /// Defaults to 0 (machine will be considered available as soon as the Node is ready)
35    #[serde(
36        default,
37        skip_serializing_if = "Option::is_none",
38        rename = "minReadySeconds"
39    )]
40    pub min_ready_seconds: Option<i32>,
41    /// Indicates that the deployment is paused.
42    #[serde(default, skip_serializing_if = "Option::is_none")]
43    pub paused: Option<bool>,
44    /// The maximum time in seconds for a deployment to make progress before it
45    /// is considered to be failed. The deployment controller will continue to
46    /// process failed deployments and a condition with a ProgressDeadlineExceeded
47    /// reason will be surfaced in the deployment status. Note that progress will
48    /// not be estimated during the time a deployment is paused. Defaults to 600s.
49    ///
50    /// Deprecated: This field is deprecated and is going to be removed in the next apiVersion. Please see https://github.com/kubernetes-sigs/cluster-api/issues/11470 for more details.
51    #[serde(
52        default,
53        skip_serializing_if = "Option::is_none",
54        rename = "progressDeadlineSeconds"
55    )]
56    pub progress_deadline_seconds: Option<i32>,
57    /// Number of desired machines.
58    /// This is a pointer to distinguish between explicit zero and not specified.
59    ///
60    /// Defaults to:
61    /// * if the Kubernetes autoscaler min size and max size annotations are set:
62    ///   - if it's a new MachineDeployment, use min size
63    ///   - if the replicas field of the old MachineDeployment is < min size, use min size
64    ///   - if the replicas field of the old MachineDeployment is > max size, use max size
65    ///   - if the replicas field of the old MachineDeployment is in the (min size, max size) range, keep the value from the oldMD
66    /// * otherwise use 1
67    /// Note: Defaulting will be run whenever the replicas field is not set:
68    /// * A new MachineDeployment is created with replicas not set.
69    /// * On an existing MachineDeployment the replicas field was first set and is now unset.
70    /// Those cases are especially relevant for the following Kubernetes autoscaler use cases:
71    /// * A new MachineDeployment is created and replicas should be managed by the autoscaler
72    /// * An existing MachineDeployment which initially wasn't controlled by the autoscaler
73    ///   should be later controlled by the autoscaler
74    #[serde(default, skip_serializing_if = "Option::is_none")]
75    pub replicas: Option<i32>,
76    /// The number of old MachineSets to retain to allow rollback.
77    /// This is a pointer to distinguish between explicit zero and not specified.
78    /// Defaults to 1.
79    ///
80    /// Deprecated: This field is deprecated and is going to be removed in the next apiVersion. Please see https://github.com/kubernetes-sigs/cluster-api/issues/10479 for more details.
81    #[serde(
82        default,
83        skip_serializing_if = "Option::is_none",
84        rename = "revisionHistoryLimit"
85    )]
86    pub revision_history_limit: Option<i32>,
87    /// rolloutAfter is a field to indicate a rollout should be performed
88    /// after the specified time even if no changes have been made to the
89    /// MachineDeployment.
90    /// Example: In the YAML the time can be specified in the RFC3339 format.
91    /// To specify the rolloutAfter target as March 9, 2023, at 9 am UTC
92    /// use "2023-03-09T09:00:00Z".
93    #[serde(
94        default,
95        skip_serializing_if = "Option::is_none",
96        rename = "rolloutAfter"
97    )]
98    pub rollout_after: Option<String>,
99    /// Label selector for machines. Existing MachineSets whose machines are
100    /// selected by this will be the ones affected by this deployment.
101    /// It must match the machine template's labels.
102    pub selector: MachineDeploymentSelector,
103    /// The deployment strategy to use to replace existing machines with
104    /// new ones.
105    #[serde(default, skip_serializing_if = "Option::is_none")]
106    pub strategy: Option<MachineDeploymentStrategy>,
107    /// template describes the machines that will be created.
108    pub template: MachineDeploymentTemplate,
109}
110
111/// Label selector for machines. Existing MachineSets whose machines are
112/// selected by this will be the ones affected by this deployment.
113/// It must match the machine template's labels.
114#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
115pub struct MachineDeploymentSelector {
116    /// matchExpressions is a list of label selector requirements. The requirements are ANDed.
117    #[serde(
118        default,
119        skip_serializing_if = "Option::is_none",
120        rename = "matchExpressions"
121    )]
122    pub match_expressions: Option<Vec<MachineDeploymentSelectorMatchExpressions>>,
123    /// matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
124    /// map is equivalent to an element of matchExpressions, whose key field is "key", the
125    /// operator is "In", and the values array contains only "value". The requirements are ANDed.
126    #[serde(
127        default,
128        skip_serializing_if = "Option::is_none",
129        rename = "matchLabels"
130    )]
131    pub match_labels: Option<BTreeMap<String, String>>,
132}
133
134/// A label selector requirement is a selector that contains values, a key, and an operator that
135/// relates the key and values.
136#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
137pub struct MachineDeploymentSelectorMatchExpressions {
138    /// key is the label key that the selector applies to.
139    pub key: String,
140    /// operator represents a key's relationship to a set of values.
141    /// Valid operators are In, NotIn, Exists and DoesNotExist.
142    pub operator: String,
143    /// values is an array of string values. If the operator is In or NotIn,
144    /// the values array must be non-empty. If the operator is Exists or DoesNotExist,
145    /// the values array must be empty. This array is replaced during a strategic
146    /// merge patch.
147    #[serde(default, skip_serializing_if = "Option::is_none")]
148    pub values: Option<Vec<String>>,
149}
150
151/// The deployment strategy to use to replace existing machines with
152/// new ones.
153#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
154pub struct MachineDeploymentStrategy {
155    /// remediation controls the strategy of remediating unhealthy machines
156    /// and how remediating operations should occur during the lifecycle of the dependant MachineSets.
157    #[serde(default, skip_serializing_if = "Option::is_none")]
158    pub remediation: Option<MachineDeploymentStrategyRemediation>,
159    /// Rolling update config params. Present only if
160    /// MachineDeploymentStrategyType = RollingUpdate.
161    #[serde(
162        default,
163        skip_serializing_if = "Option::is_none",
164        rename = "rollingUpdate"
165    )]
166    pub rolling_update: Option<MachineDeploymentStrategyRollingUpdate>,
167    /// type of deployment. Allowed values are RollingUpdate and OnDelete.
168    /// The default is RollingUpdate.
169    #[serde(default, skip_serializing_if = "Option::is_none", rename = "type")]
170    pub r#type: Option<MachineDeploymentStrategyType>,
171}
172
173/// remediation controls the strategy of remediating unhealthy machines
174/// and how remediating operations should occur during the lifecycle of the dependant MachineSets.
175#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
176pub struct MachineDeploymentStrategyRemediation {
177    /// maxInFlight determines how many in flight remediations should happen at the same time.
178    ///
179    /// Remediation only happens on the MachineSet with the most current revision, while
180    /// older MachineSets (usually present during rollout operations) aren't allowed to remediate.
181    ///
182    /// Note: In general (independent of remediations), unhealthy machines are always
183    /// prioritized during scale down operations over healthy ones.
184    ///
185    /// MaxInFlight can be set to a fixed number or a percentage.
186    /// Example: when this is set to 20%, the MachineSet controller deletes at most 20% of
187    /// the desired replicas.
188    ///
189    /// If not set, remediation is limited to all machines (bounded by replicas)
190    /// under the active MachineSet's management.
191    #[serde(
192        default,
193        skip_serializing_if = "Option::is_none",
194        rename = "maxInFlight"
195    )]
196    pub max_in_flight: Option<IntOrString>,
197}
198
199/// Rolling update config params. Present only if
200/// MachineDeploymentStrategyType = RollingUpdate.
201#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
202pub struct MachineDeploymentStrategyRollingUpdate {
203    /// deletePolicy defines the policy used by the MachineDeployment to identify nodes to delete when downscaling.
204    /// Valid values are "Random, "Newest", "Oldest"
205    /// When no value is supplied, the default DeletePolicy of MachineSet is used
206    #[serde(
207        default,
208        skip_serializing_if = "Option::is_none",
209        rename = "deletePolicy"
210    )]
211    pub delete_policy: Option<MachineDeploymentStrategyRollingUpdateDeletePolicy>,
212    /// The maximum number of machines that can be scheduled above the
213    /// desired number of machines.
214    /// Value can be an absolute number (ex: 5) or a percentage of
215    /// desired machines (ex: 10%).
216    /// This can not be 0 if MaxUnavailable is 0.
217    /// Absolute number is calculated from percentage by rounding up.
218    /// Defaults to 1.
219    /// Example: when this is set to 30%, the new MachineSet can be scaled
220    /// up immediately when the rolling update starts, such that the total
221    /// number of old and new machines do not exceed 130% of desired
222    /// machines. Once old machines have been killed, new MachineSet can
223    /// be scaled up further, ensuring that total number of machines running
224    /// at any time during the update is at most 130% of desired machines.
225    #[serde(default, skip_serializing_if = "Option::is_none", rename = "maxSurge")]
226    pub max_surge: Option<IntOrString>,
227    /// The maximum number of machines that can be unavailable during the update.
228    /// Value can be an absolute number (ex: 5) or a percentage of desired
229    /// machines (ex: 10%).
230    /// Absolute number is calculated from percentage by rounding down.
231    /// This can not be 0 if MaxSurge is 0.
232    /// Defaults to 0.
233    /// Example: when this is set to 30%, the old MachineSet can be scaled
234    /// down to 70% of desired machines immediately when the rolling update
235    /// starts. Once new machines are ready, old MachineSet can be scaled
236    /// down further, followed by scaling up the new MachineSet, ensuring
237    /// that the total number of machines available at all times
238    /// during the update is at least 70% of desired machines.
239    #[serde(
240        default,
241        skip_serializing_if = "Option::is_none",
242        rename = "maxUnavailable"
243    )]
244    pub max_unavailable: Option<IntOrString>,
245}
246
247/// Rolling update config params. Present only if
248/// MachineDeploymentStrategyType = RollingUpdate.
249#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
250pub enum MachineDeploymentStrategyRollingUpdateDeletePolicy {
251    Random,
252    Newest,
253    Oldest,
254}
255
256/// The deployment strategy to use to replace existing machines with
257/// new ones.
258#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
259pub enum MachineDeploymentStrategyType {
260    RollingUpdate,
261    OnDelete,
262}
263
264/// template describes the machines that will be created.
265#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
266pub struct MachineDeploymentTemplate {
267    /// Standard object's metadata.
268    /// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
269    #[serde(default, skip_serializing_if = "Option::is_none")]
270    pub metadata: Option<MachineDeploymentTemplateMetadata>,
271    /// Specification of the desired behavior of the machine.
272    /// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
273    #[serde(default, skip_serializing_if = "Option::is_none")]
274    pub spec: Option<MachineDeploymentTemplateSpec>,
275}
276
277/// Standard object's metadata.
278/// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
279#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
280pub struct MachineDeploymentTemplateMetadata {
281    /// annotations is an unstructured key value map stored with a resource that may be
282    /// set by external tools to store and retrieve arbitrary metadata. They are not
283    /// queryable and should be preserved when modifying objects.
284    /// More info: http://kubernetes.io/docs/user-guide/annotations
285    #[serde(default, skip_serializing_if = "Option::is_none")]
286    pub annotations: Option<BTreeMap<String, String>>,
287    /// Map of string keys and values that can be used to organize and categorize
288    /// (scope and select) objects. May match selectors of replication controllers
289    /// and services.
290    /// More info: http://kubernetes.io/docs/user-guide/labels
291    #[serde(default, skip_serializing_if = "Option::is_none")]
292    pub labels: Option<BTreeMap<String, String>>,
293}
294
295/// Specification of the desired behavior of the machine.
296/// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
297#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
298pub struct MachineDeploymentTemplateSpec {
299    /// bootstrap is a reference to a local struct which encapsulates
300    /// fields to configure the Machine’s bootstrapping mechanism.
301    pub bootstrap: MachineDeploymentTemplateSpecBootstrap,
302    /// clusterName is the name of the Cluster this object belongs to.
303    #[serde(rename = "clusterName")]
304    pub cluster_name: String,
305    /// failureDomain is the failure domain the machine will be created in.
306    /// Must match a key in the FailureDomains map stored on the cluster object.
307    #[serde(
308        default,
309        skip_serializing_if = "Option::is_none",
310        rename = "failureDomain"
311    )]
312    pub failure_domain: Option<String>,
313    /// infrastructureRef is a required reference to a custom resource
314    /// offered by an infrastructure provider.
315    #[serde(rename = "infrastructureRef")]
316    pub infrastructure_ref: ObjectReference,
317    /// nodeDeletionTimeout defines how long the controller will attempt to delete the Node that the Machine
318    /// hosts after the Machine is marked for deletion. A duration of 0 will retry deletion indefinitely.
319    /// Defaults to 10 seconds.
320    #[serde(
321        default,
322        skip_serializing_if = "Option::is_none",
323        rename = "nodeDeletionTimeout"
324    )]
325    pub node_deletion_timeout: Option<String>,
326    /// nodeDrainTimeout is the total amount of time that the controller will spend on draining a node.
327    /// The default value is 0, meaning that the node can be drained without any time limitations.
328    /// NOTE: NodeDrainTimeout is different from `kubectl drain --timeout`
329    #[serde(
330        default,
331        skip_serializing_if = "Option::is_none",
332        rename = "nodeDrainTimeout"
333    )]
334    pub node_drain_timeout: Option<String>,
335    /// nodeVolumeDetachTimeout is the total amount of time that the controller will spend on waiting for all volumes
336    /// to be detached. The default value is 0, meaning that the volumes can be detached without any time limitations.
337    #[serde(
338        default,
339        skip_serializing_if = "Option::is_none",
340        rename = "nodeVolumeDetachTimeout"
341    )]
342    pub node_volume_detach_timeout: Option<String>,
343    /// providerID is the identification ID of the machine provided by the provider.
344    /// This field must match the provider ID as seen on the node object corresponding to this machine.
345    /// This field is required by higher level consumers of cluster-api. Example use case is cluster autoscaler
346    /// with cluster-api as provider. Clean-up logic in the autoscaler compares machines to nodes to find out
347    /// machines at provider which could not get registered as Kubernetes nodes. With cluster-api as a
348    /// generic out-of-tree provider for autoscaler, this field is required by autoscaler to be
349    /// able to have a provider view of the list of machines. Another list of nodes is queried from the k8s apiserver
350    /// and then a comparison is done to find out unregistered machines and are marked for delete.
351    /// This field will be set by the actuators and consumed by higher level entities like autoscaler that will
352    /// be interfacing with cluster-api as generic provider.
353    #[serde(
354        default,
355        skip_serializing_if = "Option::is_none",
356        rename = "providerID"
357    )]
358    pub provider_id: Option<String>,
359    /// readinessGates specifies additional conditions to include when evaluating Machine Ready condition.
360    ///
361    /// This field can be used e.g. by Cluster API control plane providers to extend the semantic of the
362    /// Ready condition for the Machine they control, like the kubeadm control provider adding ReadinessGates
363    /// for the APIServerPodHealthy, SchedulerPodHealthy conditions, etc.
364    ///
365    /// Another example are external controllers, e.g. responsible to install special software/hardware on the Machines;
366    /// they can include the status of those components with a new condition and add this condition to ReadinessGates.
367    ///
368    /// NOTE: This field is considered only for computing v1beta2 conditions.
369    /// NOTE: In case readinessGates conditions start with the APIServer, ControllerManager, Scheduler prefix, and all those
370    /// readiness gates condition are reporting the same message, when computing the Machine's Ready condition those
371    /// readinessGates will be replaced by a single entry reporting "Control plane components: " + message.
372    /// This helps to improve readability of conditions bubbling up to the Machine's owner resource / to the Cluster).
373    #[serde(
374        default,
375        skip_serializing_if = "Option::is_none",
376        rename = "readinessGates"
377    )]
378    pub readiness_gates: Option<Vec<MachineDeploymentTemplateSpecReadinessGates>>,
379    /// version defines the desired Kubernetes version.
380    /// This field is meant to be optionally used by bootstrap providers.
381    #[serde(default, skip_serializing_if = "Option::is_none")]
382    pub version: Option<String>,
383}
384
385/// bootstrap is a reference to a local struct which encapsulates
386/// fields to configure the Machine’s bootstrapping mechanism.
387#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
388pub struct MachineDeploymentTemplateSpecBootstrap {
389    /// configRef is a reference to a bootstrap provider-specific resource
390    /// that holds configuration details. The reference is optional to
391    /// allow users/operators to specify Bootstrap.DataSecretName without
392    /// the need of a controller.
393    #[serde(default, skip_serializing_if = "Option::is_none", rename = "configRef")]
394    pub config_ref: Option<ObjectReference>,
395    /// dataSecretName is the name of the secret that stores the bootstrap data script.
396    /// If nil, the Machine should remain in the Pending state.
397    #[serde(
398        default,
399        skip_serializing_if = "Option::is_none",
400        rename = "dataSecretName"
401    )]
402    pub data_secret_name: Option<String>,
403}
404
405/// configRef is a reference to a bootstrap provider-specific resource
406/// that holds configuration details. The reference is optional to
407/// allow users/operators to specify Bootstrap.DataSecretName without
408/// the need of a controller.
409#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
410pub struct MachineDeploymentTemplateSpecBootstrapConfigRef {
411    /// API version of the referent.
412    #[serde(
413        default,
414        skip_serializing_if = "Option::is_none",
415        rename = "apiVersion"
416    )]
417    pub api_version: Option<String>,
418    /// If referring to a piece of an object instead of an entire object, this string
419    /// should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2].
420    /// For example, if the object reference is to a container within a pod, this would take on a value like:
421    /// "spec.containers{name}" (where "name" refers to the name of the container that triggered
422    /// the event) or if no container name is specified "spec.containers[2]" (container with
423    /// index 2 in this pod). This syntax is chosen only to have some well-defined way of
424    /// referencing a part of an object.
425    #[serde(default, skip_serializing_if = "Option::is_none", rename = "fieldPath")]
426    pub field_path: Option<String>,
427    /// Kind of the referent.
428    /// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
429    #[serde(default, skip_serializing_if = "Option::is_none")]
430    pub kind: Option<String>,
431    /// Name of the referent.
432    /// More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
433    #[serde(default, skip_serializing_if = "Option::is_none")]
434    pub name: Option<String>,
435    /// Namespace of the referent.
436    /// More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/
437    #[serde(default, skip_serializing_if = "Option::is_none")]
438    pub namespace: Option<String>,
439    /// Specific resourceVersion to which this reference is made, if any.
440    /// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency
441    #[serde(
442        default,
443        skip_serializing_if = "Option::is_none",
444        rename = "resourceVersion"
445    )]
446    pub resource_version: Option<String>,
447    /// UID of the referent.
448    /// More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids
449    #[serde(default, skip_serializing_if = "Option::is_none")]
450    pub uid: Option<String>,
451}
452
453/// infrastructureRef is a required reference to a custom resource
454/// offered by an infrastructure provider.
455#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
456pub struct MachineDeploymentTemplateSpecInfrastructureRef {
457    /// API version of the referent.
458    #[serde(
459        default,
460        skip_serializing_if = "Option::is_none",
461        rename = "apiVersion"
462    )]
463    pub api_version: Option<String>,
464    /// If referring to a piece of an object instead of an entire object, this string
465    /// should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2].
466    /// For example, if the object reference is to a container within a pod, this would take on a value like:
467    /// "spec.containers{name}" (where "name" refers to the name of the container that triggered
468    /// the event) or if no container name is specified "spec.containers[2]" (container with
469    /// index 2 in this pod). This syntax is chosen only to have some well-defined way of
470    /// referencing a part of an object.
471    #[serde(default, skip_serializing_if = "Option::is_none", rename = "fieldPath")]
472    pub field_path: Option<String>,
473    /// Kind of the referent.
474    /// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
475    #[serde(default, skip_serializing_if = "Option::is_none")]
476    pub kind: Option<String>,
477    /// Name of the referent.
478    /// More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
479    #[serde(default, skip_serializing_if = "Option::is_none")]
480    pub name: Option<String>,
481    /// Namespace of the referent.
482    /// More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/
483    #[serde(default, skip_serializing_if = "Option::is_none")]
484    pub namespace: Option<String>,
485    /// Specific resourceVersion to which this reference is made, if any.
486    /// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency
487    #[serde(
488        default,
489        skip_serializing_if = "Option::is_none",
490        rename = "resourceVersion"
491    )]
492    pub resource_version: Option<String>,
493    /// UID of the referent.
494    /// More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids
495    #[serde(default, skip_serializing_if = "Option::is_none")]
496    pub uid: Option<String>,
497}
498
499/// MachineReadinessGate contains the type of a Machine condition to be used as a readiness gate.
500#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
501pub struct MachineDeploymentTemplateSpecReadinessGates {
502    /// conditionType refers to a positive polarity condition (status true means good) with matching type in the Machine's condition list.
503    /// If the conditions doesn't exist, it will be treated as unknown.
504    /// Note: Both Cluster API conditions or conditions added by 3rd party controllers can be used as readiness gates.
505    #[serde(rename = "conditionType")]
506    pub condition_type: String,
507}
508
509/// MachineDeploymentStatus defines the observed state of MachineDeployment.
510#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
511pub struct MachineDeploymentStatus {
512    /// Total number of available machines (ready for at least minReadySeconds)
513    /// targeted by this deployment.
514    #[serde(
515        default,
516        skip_serializing_if = "Option::is_none",
517        rename = "availableReplicas"
518    )]
519    pub available_replicas: Option<i32>,
520    /// conditions defines current service state of the MachineDeployment.
521    #[serde(default, skip_serializing_if = "Option::is_none")]
522    pub conditions: Option<Vec<Condition>>,
523    /// The generation observed by the deployment controller.
524    #[serde(
525        default,
526        skip_serializing_if = "Option::is_none",
527        rename = "observedGeneration"
528    )]
529    pub observed_generation: Option<i64>,
530    /// phase represents the current phase of a MachineDeployment (ScalingUp, ScalingDown, Running, Failed, or Unknown).
531    #[serde(default, skip_serializing_if = "Option::is_none")]
532    pub phase: Option<String>,
533    /// Total number of ready machines targeted by this deployment.
534    #[serde(
535        default,
536        skip_serializing_if = "Option::is_none",
537        rename = "readyReplicas"
538    )]
539    pub ready_replicas: Option<i32>,
540    /// Total number of non-terminated machines targeted by this deployment
541    /// (their labels match the selector).
542    #[serde(default, skip_serializing_if = "Option::is_none")]
543    pub replicas: Option<i32>,
544    /// selector is the same as the label selector but in the string format to avoid introspection
545    /// by clients. The string will be in the same format as the query-param syntax.
546    /// More info about label selectors: http://kubernetes.io/docs/user-guide/labels#label-selectors
547    #[serde(default, skip_serializing_if = "Option::is_none")]
548    pub selector: Option<String>,
549    /// Total number of unavailable machines targeted by this deployment.
550    /// This is the total number of machines that are still required for
551    /// the deployment to have 100% available capacity. They may either
552    /// be machines that are running but not yet available or machines
553    /// that still have not been created.
554    ///
555    /// Deprecated: This field is deprecated and is going to be removed in the next apiVersion. Please see https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more details.
556    #[serde(
557        default,
558        skip_serializing_if = "Option::is_none",
559        rename = "unavailableReplicas"
560    )]
561    pub unavailable_replicas: Option<i32>,
562    /// Total number of non-terminated machines targeted by this deployment
563    /// that have the desired template spec.
564    #[serde(
565        default,
566        skip_serializing_if = "Option::is_none",
567        rename = "updatedReplicas"
568    )]
569    pub updated_replicas: Option<i32>,
570    /// v1beta2 groups all the fields that will be added or modified in MachineDeployment's status with the V1Beta2 version.
571    #[serde(default, skip_serializing_if = "Option::is_none")]
572    pub v1beta2: Option<MachineDeploymentStatusV1beta2>,
573}
574
575/// v1beta2 groups all the fields that will be added or modified in MachineDeployment's status with the V1Beta2 version.
576#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
577pub struct MachineDeploymentStatusV1beta2 {
578    /// availableReplicas is the number of available replicas for this MachineDeployment. A machine is considered available when Machine's Available condition is true.
579    #[serde(
580        default,
581        skip_serializing_if = "Option::is_none",
582        rename = "availableReplicas"
583    )]
584    pub available_replicas: Option<i32>,
585    /// conditions represents the observations of a MachineDeployment's current state.
586    /// Known condition types are Available, MachinesReady, MachinesUpToDate, ScalingUp, ScalingDown, Remediating, Deleting, Paused.
587    #[serde(default, skip_serializing_if = "Option::is_none")]
588    pub conditions: Option<Vec<Condition>>,
589    /// readyReplicas is the number of ready replicas for this MachineDeployment. A machine is considered ready when Machine's Ready condition is true.
590    #[serde(
591        default,
592        skip_serializing_if = "Option::is_none",
593        rename = "readyReplicas"
594    )]
595    pub ready_replicas: Option<i32>,
596    /// upToDateReplicas is the number of up-to-date replicas targeted by this deployment. A machine is considered up-to-date when Machine's UpToDate condition is true.
597    #[serde(
598        default,
599        skip_serializing_if = "Option::is_none",
600        rename = "upToDateReplicas"
601    )]
602    pub up_to_date_replicas: Option<i32>,
603}