fleet_api_rs/api/fleet_cluster.rs
1// WARNING: generated by kopium - manual changes will be overwritten
2// kopium command: kopium -D Default -D PartialEq --no-condition -A -d -f -
3// kopium version: 0.22.5
4
5#[allow(unused_imports)]
6mod prelude {
7 pub use k8s_openapi::apimachinery::pkg::util::intstr::IntOrString;
8 pub use kube::CustomResource;
9 pub use schemars::JsonSchema;
10 pub use serde::{Deserialize, Serialize};
11 pub use std::collections::BTreeMap;
12}
13
14use self::prelude::*;
15
16#[derive(CustomResource, Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
17#[kube(
18 group = "fleet.cattle.io",
19 version = "v1alpha1",
20 kind = "Cluster",
21 plural = "clusters"
22)]
23#[kube(namespaced)]
24#[kube(status = "ClusterStatus")]
25#[kube(derive = "Default")]
26#[kube(derive = "PartialEq")]
27pub struct ClusterSpec {
28 /// AgentAffinity overrides the default affinity for the cluster's agent
29 /// deployment. If this value is nil the default affinity is used.
30 #[serde(
31 default,
32 skip_serializing_if = "Option::is_none",
33 rename = "agentAffinity"
34 )]
35 pub agent_affinity: Option<ClusterAgentAffinity>,
36 /// AgentEnvVars are extra environment variables to be added to the agent deployment.
37 #[serde(
38 default,
39 skip_serializing_if = "Option::is_none",
40 rename = "agentEnvVars"
41 )]
42 pub agent_env_vars: Option<Vec<ClusterAgentEnvVars>>,
43 /// AgentNamespace defaults to the system namespace, e.g. cattle-fleet-system.
44 #[serde(
45 default,
46 skip_serializing_if = "Option::is_none",
47 rename = "agentNamespace"
48 )]
49 pub agent_namespace: Option<String>,
50 /// AgentResources sets the resources for the cluster's agent deployment.
51 #[serde(
52 default,
53 skip_serializing_if = "Option::is_none",
54 rename = "agentResources"
55 )]
56 pub agent_resources: Option<ClusterAgentResources>,
57 #[serde(
58 default,
59 skip_serializing_if = "Option::is_none",
60 rename = "agentSchedulingCustomization"
61 )]
62 pub agent_scheduling_customization: Option<ClusterAgentSchedulingCustomization>,
63 /// AgentTolerations defines an extra set of Tolerations to be added to the Agent deployment.
64 #[serde(
65 default,
66 skip_serializing_if = "Option::is_none",
67 rename = "agentTolerations"
68 )]
69 pub agent_tolerations: Option<Vec<ClusterAgentTolerations>>,
70 /// ClientID is a unique string that will identify the cluster. It can
71 /// either be predefined, or generated when importing the cluster.
72 #[serde(default, skip_serializing_if = "Option::is_none", rename = "clientID")]
73 pub client_id: Option<String>,
74 /// HostNetwork sets the agent Deployment to use hostNetwork: true setting.
75 /// Allows for provisioning of network related bundles (CNI configuration).
76 #[serde(
77 default,
78 skip_serializing_if = "Option::is_none",
79 rename = "hostNetwork"
80 )]
81 pub host_network: Option<bool>,
82 /// KubeConfigSecret is the name of the secret containing the kubeconfig for the downstream cluster.
83 /// It can optionally contain a APIServerURL and CA to override the
84 /// values in the fleet-controller's configmap.
85 #[serde(
86 default,
87 skip_serializing_if = "Option::is_none",
88 rename = "kubeConfigSecret"
89 )]
90 pub kube_config_secret: Option<String>,
91 /// KubeConfigSecretNamespace is the namespace of the secret containing the kubeconfig for the downstream cluster.
92 /// If unset, it will be assumed the secret can be found in the namespace that the Cluster object resides within.
93 #[serde(
94 default,
95 skip_serializing_if = "Option::is_none",
96 rename = "kubeConfigSecretNamespace"
97 )]
98 pub kube_config_secret_namespace: Option<String>,
99 /// Paused if set to true, will stop any BundleDeployments from being updated.
100 #[serde(default, skip_serializing_if = "Option::is_none")]
101 pub paused: Option<bool>,
102 /// PrivateRepoURL prefixes the image name and overrides a global repo URL from the agents config.
103 #[serde(
104 default,
105 skip_serializing_if = "Option::is_none",
106 rename = "privateRepoURL"
107 )]
108 pub private_repo_url: Option<String>,
109 /// RedeployAgentGeneration can be used to force redeploying the agent.
110 #[serde(
111 default,
112 skip_serializing_if = "Option::is_none",
113 rename = "redeployAgentGeneration"
114 )]
115 pub redeploy_agent_generation: Option<i64>,
116 /// TemplateValues defines a cluster specific mapping of values to be sent to fleet.yaml values templating.
117 #[serde(
118 default,
119 skip_serializing_if = "Option::is_none",
120 rename = "templateValues"
121 )]
122 pub template_values: Option<BTreeMap<String, serde_json::Value>>,
123}
124
125/// AgentAffinity overrides the default affinity for the cluster's agent
126/// deployment. If this value is nil the default affinity is used.
127#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
128pub struct ClusterAgentAffinity {
129 /// Describes node affinity scheduling rules for the pod.
130 #[serde(
131 default,
132 skip_serializing_if = "Option::is_none",
133 rename = "nodeAffinity"
134 )]
135 pub node_affinity: Option<ClusterAgentAffinityNodeAffinity>,
136 /// Describes pod affinity scheduling rules (e.g. co-locate this pod in the same node, zone, etc. as some other pod(s)).
137 #[serde(
138 default,
139 skip_serializing_if = "Option::is_none",
140 rename = "podAffinity"
141 )]
142 pub pod_affinity: Option<ClusterAgentAffinityPodAffinity>,
143 /// Describes pod anti-affinity scheduling rules (e.g. avoid putting this pod in the same node, zone, etc. as some other pod(s)).
144 #[serde(
145 default,
146 skip_serializing_if = "Option::is_none",
147 rename = "podAntiAffinity"
148 )]
149 pub pod_anti_affinity: Option<ClusterAgentAffinityPodAntiAffinity>,
150}
151
152/// Describes node affinity scheduling rules for the pod.
153#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
154pub struct ClusterAgentAffinityNodeAffinity {
155 /// The scheduler will prefer to schedule pods to nodes that satisfy
156 /// the affinity expressions specified by this field, but it may choose
157 /// a node that violates one or more of the expressions. The node that is
158 /// most preferred is the one with the greatest sum of weights, i.e.
159 /// for each node that meets all of the scheduling requirements (resource
160 /// request, requiredDuringScheduling affinity expressions, etc.),
161 /// compute a sum by iterating through the elements of this field and adding
162 /// "weight" to the sum if the node matches the corresponding matchExpressions; the
163 /// node(s) with the highest sum are the most preferred.
164 #[serde(
165 default,
166 skip_serializing_if = "Option::is_none",
167 rename = "preferredDuringSchedulingIgnoredDuringExecution"
168 )]
169 pub preferred_during_scheduling_ignored_during_execution: Option<
170 Vec<ClusterAgentAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecution>,
171 >,
172 /// If the affinity requirements specified by this field are not met at
173 /// scheduling time, the pod will not be scheduled onto the node.
174 /// If the affinity requirements specified by this field cease to be met
175 /// at some point during pod execution (e.g. due to an update), the system
176 /// may or may not try to eventually evict the pod from its node.
177 #[serde(
178 default,
179 skip_serializing_if = "Option::is_none",
180 rename = "requiredDuringSchedulingIgnoredDuringExecution"
181 )]
182 pub required_during_scheduling_ignored_during_execution:
183 Option<ClusterAgentAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecution>,
184}
185
186/// An empty preferred scheduling term matches all objects with implicit weight 0
187/// (i.e. it's a no-op). A null preferred scheduling term matches no objects (i.e. is also a no-op).
188#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
189pub struct ClusterAgentAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecution {
190 /// A node selector term, associated with the corresponding weight.
191 pub preference:
192 ClusterAgentAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecutionPreference,
193 /// Weight associated with matching the corresponding nodeSelectorTerm, in the range 1-100.
194 pub weight: i32,
195}
196
197/// A node selector term, associated with the corresponding weight.
198#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
199pub struct ClusterAgentAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecutionPreference {
200 /// A list of node selector requirements by node's labels.
201 #[serde(default, skip_serializing_if = "Option::is_none", rename = "matchExpressions")]
202 pub match_expressions: Option<Vec<ClusterAgentAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecutionPreferenceMatchExpressions>>,
203 /// A list of node selector requirements by node's fields.
204 #[serde(default, skip_serializing_if = "Option::is_none", rename = "matchFields")]
205 pub match_fields: Option<Vec<ClusterAgentAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecutionPreferenceMatchFields>>,
206}
207
208/// A node selector requirement is a selector that contains values, a key, and an operator
209/// that relates the key and values.
210#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
211pub struct ClusterAgentAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecutionPreferenceMatchExpressions
212{
213 /// The label key that the selector applies to.
214 pub key: String,
215 /// Represents a key's relationship to a set of values.
216 /// Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt.
217 pub operator: String,
218 /// An array of string values. If the operator is In or NotIn,
219 /// the values array must be non-empty. If the operator is Exists or DoesNotExist,
220 /// the values array must be empty. If the operator is Gt or Lt, the values
221 /// array must have a single element, which will be interpreted as an integer.
222 /// This array is replaced during a strategic merge patch.
223 #[serde(default, skip_serializing_if = "Option::is_none")]
224 pub values: Option<Vec<String>>,
225}
226
227/// A node selector requirement is a selector that contains values, a key, and an operator
228/// that relates the key and values.
229#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
230pub struct ClusterAgentAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecutionPreferenceMatchFields
231{
232 /// The label key that the selector applies to.
233 pub key: String,
234 /// Represents a key's relationship to a set of values.
235 /// Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt.
236 pub operator: String,
237 /// An array of string values. If the operator is In or NotIn,
238 /// the values array must be non-empty. If the operator is Exists or DoesNotExist,
239 /// the values array must be empty. If the operator is Gt or Lt, the values
240 /// array must have a single element, which will be interpreted as an integer.
241 /// This array is replaced during a strategic merge patch.
242 #[serde(default, skip_serializing_if = "Option::is_none")]
243 pub values: Option<Vec<String>>,
244}
245
246/// If the affinity requirements specified by this field are not met at
247/// scheduling time, the pod will not be scheduled onto the node.
248/// If the affinity requirements specified by this field cease to be met
249/// at some point during pod execution (e.g. due to an update), the system
250/// may or may not try to eventually evict the pod from its node.
251#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
252pub struct ClusterAgentAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecution {
253 /// Required. A list of node selector terms. The terms are ORed.
254 #[serde(rename = "nodeSelectorTerms")]
255 pub node_selector_terms: Vec<ClusterAgentAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecutionNodeSelectorTerms>,
256}
257
258/// A null or empty node selector term matches no objects. The requirements of
259/// them are ANDed.
260/// The TopologySelectorTerm type implements a subset of the NodeSelectorTerm.
261#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
262pub struct ClusterAgentAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecutionNodeSelectorTerms {
263 /// A list of node selector requirements by node's labels.
264 #[serde(default, skip_serializing_if = "Option::is_none", rename = "matchExpressions")]
265 pub match_expressions: Option<Vec<ClusterAgentAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecutionNodeSelectorTermsMatchExpressions>>,
266 /// A list of node selector requirements by node's fields.
267 #[serde(default, skip_serializing_if = "Option::is_none", rename = "matchFields")]
268 pub match_fields: Option<Vec<ClusterAgentAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecutionNodeSelectorTermsMatchFields>>,
269}
270
271/// A node selector requirement is a selector that contains values, a key, and an operator
272/// that relates the key and values.
273#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
274pub struct ClusterAgentAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecutionNodeSelectorTermsMatchExpressions
275{
276 /// The label key that the selector applies to.
277 pub key: String,
278 /// Represents a key's relationship to a set of values.
279 /// Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt.
280 pub operator: String,
281 /// An array of string values. If the operator is In or NotIn,
282 /// the values array must be non-empty. If the operator is Exists or DoesNotExist,
283 /// the values array must be empty. If the operator is Gt or Lt, the values
284 /// array must have a single element, which will be interpreted as an integer.
285 /// This array is replaced during a strategic merge patch.
286 #[serde(default, skip_serializing_if = "Option::is_none")]
287 pub values: Option<Vec<String>>,
288}
289
290/// A node selector requirement is a selector that contains values, a key, and an operator
291/// that relates the key and values.
292#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
293pub struct ClusterAgentAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecutionNodeSelectorTermsMatchFields
294{
295 /// The label key that the selector applies to.
296 pub key: String,
297 /// Represents a key's relationship to a set of values.
298 /// Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt.
299 pub operator: String,
300 /// An array of string values. If the operator is In or NotIn,
301 /// the values array must be non-empty. If the operator is Exists or DoesNotExist,
302 /// the values array must be empty. If the operator is Gt or Lt, the values
303 /// array must have a single element, which will be interpreted as an integer.
304 /// This array is replaced during a strategic merge patch.
305 #[serde(default, skip_serializing_if = "Option::is_none")]
306 pub values: Option<Vec<String>>,
307}
308
309/// Describes pod affinity scheduling rules (e.g. co-locate this pod in the same node, zone, etc. as some other pod(s)).
310#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
311pub struct ClusterAgentAffinityPodAffinity {
312 /// The scheduler will prefer to schedule pods to nodes that satisfy
313 /// the affinity expressions specified by this field, but it may choose
314 /// a node that violates one or more of the expressions. The node that is
315 /// most preferred is the one with the greatest sum of weights, i.e.
316 /// for each node that meets all of the scheduling requirements (resource
317 /// request, requiredDuringScheduling affinity expressions, etc.),
318 /// compute a sum by iterating through the elements of this field and adding
319 /// "weight" to the sum if the node has pods which matches the corresponding podAffinityTerm; the
320 /// node(s) with the highest sum are the most preferred.
321 #[serde(
322 default,
323 skip_serializing_if = "Option::is_none",
324 rename = "preferredDuringSchedulingIgnoredDuringExecution"
325 )]
326 pub preferred_during_scheduling_ignored_during_execution:
327 Option<Vec<ClusterAgentAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecution>>,
328 /// If the affinity requirements specified by this field are not met at
329 /// scheduling time, the pod will not be scheduled onto the node.
330 /// If the affinity requirements specified by this field cease to be met
331 /// at some point during pod execution (e.g. due to a pod label update), the
332 /// system may or may not try to eventually evict the pod from its node.
333 /// When there are multiple elements, the lists of nodes corresponding to each
334 /// podAffinityTerm are intersected, i.e. all terms must be satisfied.
335 #[serde(
336 default,
337 skip_serializing_if = "Option::is_none",
338 rename = "requiredDuringSchedulingIgnoredDuringExecution"
339 )]
340 pub required_during_scheduling_ignored_during_execution:
341 Option<Vec<ClusterAgentAffinityPodAffinityRequiredDuringSchedulingIgnoredDuringExecution>>,
342}
343
344/// The weights of all of the matched WeightedPodAffinityTerm fields are added per-node to find the most preferred node(s)
345#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
346pub struct ClusterAgentAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecution {
347 /// Required. A pod affinity term, associated with the corresponding weight.
348 #[serde(rename = "podAffinityTerm")]
349 pub pod_affinity_term: ClusterAgentAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionPodAffinityTerm,
350 /// weight associated with matching the corresponding podAffinityTerm,
351 /// in the range 1-100.
352 pub weight: i32,
353}
354
355/// Required. A pod affinity term, associated with the corresponding weight.
356#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
357pub struct ClusterAgentAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionPodAffinityTerm {
358 /// A label query over a set of resources, in this case pods.
359 /// If it's null, this PodAffinityTerm matches with no Pods.
360 #[serde(default, skip_serializing_if = "Option::is_none", rename = "labelSelector")]
361 pub label_selector: Option<ClusterAgentAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionPodAffinityTermLabelSelector>,
362 /// MatchLabelKeys is a set of pod label keys to select which pods will
363 /// be taken into consideration. The keys are used to lookup values from the
364 /// incoming pod labels, those key-value labels are merged with `labelSelector` as `key in (value)`
365 /// to select the group of existing pods which pods will be taken into consideration
366 /// for the incoming pod's pod (anti) affinity. Keys that don't exist in the incoming
367 /// pod labels will be ignored. The default value is empty.
368 /// The same key is forbidden to exist in both matchLabelKeys and labelSelector.
369 /// Also, matchLabelKeys cannot be set when labelSelector isn't set.
370 #[serde(default, skip_serializing_if = "Option::is_none", rename = "matchLabelKeys")]
371 pub match_label_keys: Option<Vec<String>>,
372 /// MismatchLabelKeys is a set of pod label keys to select which pods will
373 /// be taken into consideration. The keys are used to lookup values from the
374 /// incoming pod labels, those key-value labels are merged with `labelSelector` as `key notin (value)`
375 /// to select the group of existing pods which pods will be taken into consideration
376 /// for the incoming pod's pod (anti) affinity. Keys that don't exist in the incoming
377 /// pod labels will be ignored. The default value is empty.
378 /// The same key is forbidden to exist in both mismatchLabelKeys and labelSelector.
379 /// Also, mismatchLabelKeys cannot be set when labelSelector isn't set.
380 #[serde(default, skip_serializing_if = "Option::is_none", rename = "mismatchLabelKeys")]
381 pub mismatch_label_keys: Option<Vec<String>>,
382 /// A label query over the set of namespaces that the term applies to.
383 /// The term is applied to the union of the namespaces selected by this field
384 /// and the ones listed in the namespaces field.
385 /// null selector and null or empty namespaces list means "this pod's namespace".
386 /// An empty selector ({}) matches all namespaces.
387 #[serde(default, skip_serializing_if = "Option::is_none", rename = "namespaceSelector")]
388 pub namespace_selector: Option<ClusterAgentAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionPodAffinityTermNamespaceSelector>,
389 /// namespaces specifies a static list of namespace names that the term applies to.
390 /// The term is applied to the union of the namespaces listed in this field
391 /// and the ones selected by namespaceSelector.
392 /// null or empty namespaces list and null namespaceSelector means "this pod's namespace".
393 #[serde(default, skip_serializing_if = "Option::is_none")]
394 pub namespaces: Option<Vec<String>>,
395 /// This pod should be co-located (affinity) or not co-located (anti-affinity) with the pods matching
396 /// the labelSelector in the specified namespaces, where co-located is defined as running on a node
397 /// whose value of the label with key topologyKey matches that of any node on which any of the
398 /// selected pods is running.
399 /// Empty topologyKey is not allowed.
400 #[serde(rename = "topologyKey")]
401 pub topology_key: String,
402}
403
404/// A label query over a set of resources, in this case pods.
405/// If it's null, this PodAffinityTerm matches with no Pods.
406#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
407pub struct ClusterAgentAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionPodAffinityTermLabelSelector {
408 /// matchExpressions is a list of label selector requirements. The requirements are ANDed.
409 #[serde(default, skip_serializing_if = "Option::is_none", rename = "matchExpressions")]
410 pub match_expressions: Option<Vec<ClusterAgentAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionPodAffinityTermLabelSelectorMatchExpressions>>,
411 /// matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
412 /// map is equivalent to an element of matchExpressions, whose key field is "key", the
413 /// operator is "In", and the values array contains only "value". The requirements are ANDed.
414 #[serde(default, skip_serializing_if = "Option::is_none", rename = "matchLabels")]
415 pub match_labels: Option<BTreeMap<String, String>>,
416}
417
418/// A label selector requirement is a selector that contains values, a key, and an operator that
419/// relates the key and values.
420#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
421pub struct ClusterAgentAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionPodAffinityTermLabelSelectorMatchExpressions
422{
423 /// key is the label key that the selector applies to.
424 pub key: String,
425 /// operator represents a key's relationship to a set of values.
426 /// Valid operators are In, NotIn, Exists and DoesNotExist.
427 pub operator: String,
428 /// values is an array of string values. If the operator is In or NotIn,
429 /// the values array must be non-empty. If the operator is Exists or DoesNotExist,
430 /// the values array must be empty. This array is replaced during a strategic
431 /// merge patch.
432 #[serde(default, skip_serializing_if = "Option::is_none")]
433 pub values: Option<Vec<String>>,
434}
435
436/// A label query over the set of namespaces that the term applies to.
437/// The term is applied to the union of the namespaces selected by this field
438/// and the ones listed in the namespaces field.
439/// null selector and null or empty namespaces list means "this pod's namespace".
440/// An empty selector ({}) matches all namespaces.
441#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
442pub struct ClusterAgentAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionPodAffinityTermNamespaceSelector {
443 /// matchExpressions is a list of label selector requirements. The requirements are ANDed.
444 #[serde(default, skip_serializing_if = "Option::is_none", rename = "matchExpressions")]
445 pub match_expressions: Option<Vec<ClusterAgentAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionPodAffinityTermNamespaceSelectorMatchExpressions>>,
446 /// matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
447 /// map is equivalent to an element of matchExpressions, whose key field is "key", the
448 /// operator is "In", and the values array contains only "value". The requirements are ANDed.
449 #[serde(default, skip_serializing_if = "Option::is_none", rename = "matchLabels")]
450 pub match_labels: Option<BTreeMap<String, String>>,
451}
452
453/// A label selector requirement is a selector that contains values, a key, and an operator that
454/// relates the key and values.
455#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
456pub struct ClusterAgentAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionPodAffinityTermNamespaceSelectorMatchExpressions
457{
458 /// key is the label key that the selector applies to.
459 pub key: String,
460 /// operator represents a key's relationship to a set of values.
461 /// Valid operators are In, NotIn, Exists and DoesNotExist.
462 pub operator: String,
463 /// values is an array of string values. If the operator is In or NotIn,
464 /// the values array must be non-empty. If the operator is Exists or DoesNotExist,
465 /// the values array must be empty. This array is replaced during a strategic
466 /// merge patch.
467 #[serde(default, skip_serializing_if = "Option::is_none")]
468 pub values: Option<Vec<String>>,
469}
470
471/// Defines a set of pods (namely those matching the labelSelector
472/// relative to the given namespace(s)) that this pod should be
473/// co-located (affinity) or not co-located (anti-affinity) with,
474/// where co-located is defined as running on a node whose value of
475/// the label with key <topologyKey> matches that of any node on which
476/// a pod of the set of pods is running
477#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
478pub struct ClusterAgentAffinityPodAffinityRequiredDuringSchedulingIgnoredDuringExecution {
479 /// A label query over a set of resources, in this case pods.
480 /// If it's null, this PodAffinityTerm matches with no Pods.
481 #[serde(default, skip_serializing_if = "Option::is_none", rename = "labelSelector")]
482 pub label_selector: Option<ClusterAgentAffinityPodAffinityRequiredDuringSchedulingIgnoredDuringExecutionLabelSelector>,
483 /// MatchLabelKeys is a set of pod label keys to select which pods will
484 /// be taken into consideration. The keys are used to lookup values from the
485 /// incoming pod labels, those key-value labels are merged with `labelSelector` as `key in (value)`
486 /// to select the group of existing pods which pods will be taken into consideration
487 /// for the incoming pod's pod (anti) affinity. Keys that don't exist in the incoming
488 /// pod labels will be ignored. The default value is empty.
489 /// The same key is forbidden to exist in both matchLabelKeys and labelSelector.
490 /// Also, matchLabelKeys cannot be set when labelSelector isn't set.
491 #[serde(default, skip_serializing_if = "Option::is_none", rename = "matchLabelKeys")]
492 pub match_label_keys: Option<Vec<String>>,
493 /// MismatchLabelKeys is a set of pod label keys to select which pods will
494 /// be taken into consideration. The keys are used to lookup values from the
495 /// incoming pod labels, those key-value labels are merged with `labelSelector` as `key notin (value)`
496 /// to select the group of existing pods which pods will be taken into consideration
497 /// for the incoming pod's pod (anti) affinity. Keys that don't exist in the incoming
498 /// pod labels will be ignored. The default value is empty.
499 /// The same key is forbidden to exist in both mismatchLabelKeys and labelSelector.
500 /// Also, mismatchLabelKeys cannot be set when labelSelector isn't set.
501 #[serde(default, skip_serializing_if = "Option::is_none", rename = "mismatchLabelKeys")]
502 pub mismatch_label_keys: Option<Vec<String>>,
503 /// A label query over the set of namespaces that the term applies to.
504 /// The term is applied to the union of the namespaces selected by this field
505 /// and the ones listed in the namespaces field.
506 /// null selector and null or empty namespaces list means "this pod's namespace".
507 /// An empty selector ({}) matches all namespaces.
508 #[serde(default, skip_serializing_if = "Option::is_none", rename = "namespaceSelector")]
509 pub namespace_selector: Option<ClusterAgentAffinityPodAffinityRequiredDuringSchedulingIgnoredDuringExecutionNamespaceSelector>,
510 /// namespaces specifies a static list of namespace names that the term applies to.
511 /// The term is applied to the union of the namespaces listed in this field
512 /// and the ones selected by namespaceSelector.
513 /// null or empty namespaces list and null namespaceSelector means "this pod's namespace".
514 #[serde(default, skip_serializing_if = "Option::is_none")]
515 pub namespaces: Option<Vec<String>>,
516 /// This pod should be co-located (affinity) or not co-located (anti-affinity) with the pods matching
517 /// the labelSelector in the specified namespaces, where co-located is defined as running on a node
518 /// whose value of the label with key topologyKey matches that of any node on which any of the
519 /// selected pods is running.
520 /// Empty topologyKey is not allowed.
521 #[serde(rename = "topologyKey")]
522 pub topology_key: String,
523}
524
525/// A label query over a set of resources, in this case pods.
526/// If it's null, this PodAffinityTerm matches with no Pods.
527#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
528pub struct ClusterAgentAffinityPodAffinityRequiredDuringSchedulingIgnoredDuringExecutionLabelSelector {
529 /// matchExpressions is a list of label selector requirements. The requirements are ANDed.
530 #[serde(default, skip_serializing_if = "Option::is_none", rename = "matchExpressions")]
531 pub match_expressions: Option<Vec<ClusterAgentAffinityPodAffinityRequiredDuringSchedulingIgnoredDuringExecutionLabelSelectorMatchExpressions>>,
532 /// matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
533 /// map is equivalent to an element of matchExpressions, whose key field is "key", the
534 /// operator is "In", and the values array contains only "value". The requirements are ANDed.
535 #[serde(default, skip_serializing_if = "Option::is_none", rename = "matchLabels")]
536 pub match_labels: Option<BTreeMap<String, String>>,
537}
538
539/// A label selector requirement is a selector that contains values, a key, and an operator that
540/// relates the key and values.
541#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
542pub struct ClusterAgentAffinityPodAffinityRequiredDuringSchedulingIgnoredDuringExecutionLabelSelectorMatchExpressions
543{
544 /// key is the label key that the selector applies to.
545 pub key: String,
546 /// operator represents a key's relationship to a set of values.
547 /// Valid operators are In, NotIn, Exists and DoesNotExist.
548 pub operator: String,
549 /// values is an array of string values. If the operator is In or NotIn,
550 /// the values array must be non-empty. If the operator is Exists or DoesNotExist,
551 /// the values array must be empty. This array is replaced during a strategic
552 /// merge patch.
553 #[serde(default, skip_serializing_if = "Option::is_none")]
554 pub values: Option<Vec<String>>,
555}
556
557/// A label query over the set of namespaces that the term applies to.
558/// The term is applied to the union of the namespaces selected by this field
559/// and the ones listed in the namespaces field.
560/// null selector and null or empty namespaces list means "this pod's namespace".
561/// An empty selector ({}) matches all namespaces.
562#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
563pub struct ClusterAgentAffinityPodAffinityRequiredDuringSchedulingIgnoredDuringExecutionNamespaceSelector {
564 /// matchExpressions is a list of label selector requirements. The requirements are ANDed.
565 #[serde(default, skip_serializing_if = "Option::is_none", rename = "matchExpressions")]
566 pub match_expressions: Option<Vec<ClusterAgentAffinityPodAffinityRequiredDuringSchedulingIgnoredDuringExecutionNamespaceSelectorMatchExpressions>>,
567 /// matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
568 /// map is equivalent to an element of matchExpressions, whose key field is "key", the
569 /// operator is "In", and the values array contains only "value". The requirements are ANDed.
570 #[serde(default, skip_serializing_if = "Option::is_none", rename = "matchLabels")]
571 pub match_labels: Option<BTreeMap<String, String>>,
572}
573
574/// A label selector requirement is a selector that contains values, a key, and an operator that
575/// relates the key and values.
576#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
577pub struct ClusterAgentAffinityPodAffinityRequiredDuringSchedulingIgnoredDuringExecutionNamespaceSelectorMatchExpressions
578{
579 /// key is the label key that the selector applies to.
580 pub key: String,
581 /// operator represents a key's relationship to a set of values.
582 /// Valid operators are In, NotIn, Exists and DoesNotExist.
583 pub operator: String,
584 /// values is an array of string values. If the operator is In or NotIn,
585 /// the values array must be non-empty. If the operator is Exists or DoesNotExist,
586 /// the values array must be empty. This array is replaced during a strategic
587 /// merge patch.
588 #[serde(default, skip_serializing_if = "Option::is_none")]
589 pub values: Option<Vec<String>>,
590}
591
592/// Describes pod anti-affinity scheduling rules (e.g. avoid putting this pod in the same node, zone, etc. as some other pod(s)).
593#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
594pub struct ClusterAgentAffinityPodAntiAffinity {
595 /// The scheduler will prefer to schedule pods to nodes that satisfy
596 /// the anti-affinity expressions specified by this field, but it may choose
597 /// a node that violates one or more of the expressions. The node that is
598 /// most preferred is the one with the greatest sum of weights, i.e.
599 /// for each node that meets all of the scheduling requirements (resource
600 /// request, requiredDuringScheduling anti-affinity expressions, etc.),
601 /// compute a sum by iterating through the elements of this field and subtracting
602 /// "weight" from the sum if the node has pods which matches the corresponding podAffinityTerm; the
603 /// node(s) with the highest sum are the most preferred.
604 #[serde(
605 default,
606 skip_serializing_if = "Option::is_none",
607 rename = "preferredDuringSchedulingIgnoredDuringExecution"
608 )]
609 pub preferred_during_scheduling_ignored_during_execution: Option<
610 Vec<ClusterAgentAffinityPodAntiAffinityPreferredDuringSchedulingIgnoredDuringExecution>,
611 >,
612 /// If the anti-affinity requirements specified by this field are not met at
613 /// scheduling time, the pod will not be scheduled onto the node.
614 /// If the anti-affinity requirements specified by this field cease to be met
615 /// at some point during pod execution (e.g. due to a pod label update), the
616 /// system may or may not try to eventually evict the pod from its node.
617 /// When there are multiple elements, the lists of nodes corresponding to each
618 /// podAffinityTerm are intersected, i.e. all terms must be satisfied.
619 #[serde(
620 default,
621 skip_serializing_if = "Option::is_none",
622 rename = "requiredDuringSchedulingIgnoredDuringExecution"
623 )]
624 pub required_during_scheduling_ignored_during_execution: Option<
625 Vec<ClusterAgentAffinityPodAntiAffinityRequiredDuringSchedulingIgnoredDuringExecution>,
626 >,
627}
628
629/// The weights of all of the matched WeightedPodAffinityTerm fields are added per-node to find the most preferred node(s)
630#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
631pub struct ClusterAgentAffinityPodAntiAffinityPreferredDuringSchedulingIgnoredDuringExecution {
632 /// Required. A pod affinity term, associated with the corresponding weight.
633 #[serde(rename = "podAffinityTerm")]
634 pub pod_affinity_term: ClusterAgentAffinityPodAntiAffinityPreferredDuringSchedulingIgnoredDuringExecutionPodAffinityTerm,
635 /// weight associated with matching the corresponding podAffinityTerm,
636 /// in the range 1-100.
637 pub weight: i32,
638}
639
640/// Required. A pod affinity term, associated with the corresponding weight.
641#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
642pub struct ClusterAgentAffinityPodAntiAffinityPreferredDuringSchedulingIgnoredDuringExecutionPodAffinityTerm {
643 /// A label query over a set of resources, in this case pods.
644 /// If it's null, this PodAffinityTerm matches with no Pods.
645 #[serde(default, skip_serializing_if = "Option::is_none", rename = "labelSelector")]
646 pub label_selector: Option<ClusterAgentAffinityPodAntiAffinityPreferredDuringSchedulingIgnoredDuringExecutionPodAffinityTermLabelSelector>,
647 /// MatchLabelKeys is a set of pod label keys to select which pods will
648 /// be taken into consideration. The keys are used to lookup values from the
649 /// incoming pod labels, those key-value labels are merged with `labelSelector` as `key in (value)`
650 /// to select the group of existing pods which pods will be taken into consideration
651 /// for the incoming pod's pod (anti) affinity. Keys that don't exist in the incoming
652 /// pod labels will be ignored. The default value is empty.
653 /// The same key is forbidden to exist in both matchLabelKeys and labelSelector.
654 /// Also, matchLabelKeys cannot be set when labelSelector isn't set.
655 #[serde(default, skip_serializing_if = "Option::is_none", rename = "matchLabelKeys")]
656 pub match_label_keys: Option<Vec<String>>,
657 /// MismatchLabelKeys is a set of pod label keys to select which pods will
658 /// be taken into consideration. The keys are used to lookup values from the
659 /// incoming pod labels, those key-value labels are merged with `labelSelector` as `key notin (value)`
660 /// to select the group of existing pods which pods will be taken into consideration
661 /// for the incoming pod's pod (anti) affinity. Keys that don't exist in the incoming
662 /// pod labels will be ignored. The default value is empty.
663 /// The same key is forbidden to exist in both mismatchLabelKeys and labelSelector.
664 /// Also, mismatchLabelKeys cannot be set when labelSelector isn't set.
665 #[serde(default, skip_serializing_if = "Option::is_none", rename = "mismatchLabelKeys")]
666 pub mismatch_label_keys: Option<Vec<String>>,
667 /// A label query over the set of namespaces that the term applies to.
668 /// The term is applied to the union of the namespaces selected by this field
669 /// and the ones listed in the namespaces field.
670 /// null selector and null or empty namespaces list means "this pod's namespace".
671 /// An empty selector ({}) matches all namespaces.
672 #[serde(default, skip_serializing_if = "Option::is_none", rename = "namespaceSelector")]
673 pub namespace_selector: Option<ClusterAgentAffinityPodAntiAffinityPreferredDuringSchedulingIgnoredDuringExecutionPodAffinityTermNamespaceSelector>,
674 /// namespaces specifies a static list of namespace names that the term applies to.
675 /// The term is applied to the union of the namespaces listed in this field
676 /// and the ones selected by namespaceSelector.
677 /// null or empty namespaces list and null namespaceSelector means "this pod's namespace".
678 #[serde(default, skip_serializing_if = "Option::is_none")]
679 pub namespaces: Option<Vec<String>>,
680 /// This pod should be co-located (affinity) or not co-located (anti-affinity) with the pods matching
681 /// the labelSelector in the specified namespaces, where co-located is defined as running on a node
682 /// whose value of the label with key topologyKey matches that of any node on which any of the
683 /// selected pods is running.
684 /// Empty topologyKey is not allowed.
685 #[serde(rename = "topologyKey")]
686 pub topology_key: String,
687}
688
689/// A label query over a set of resources, in this case pods.
690/// If it's null, this PodAffinityTerm matches with no Pods.
691#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
692pub struct ClusterAgentAffinityPodAntiAffinityPreferredDuringSchedulingIgnoredDuringExecutionPodAffinityTermLabelSelector {
693 /// matchExpressions is a list of label selector requirements. The requirements are ANDed.
694 #[serde(default, skip_serializing_if = "Option::is_none", rename = "matchExpressions")]
695 pub match_expressions: Option<Vec<ClusterAgentAffinityPodAntiAffinityPreferredDuringSchedulingIgnoredDuringExecutionPodAffinityTermLabelSelectorMatchExpressions>>,
696 /// matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
697 /// map is equivalent to an element of matchExpressions, whose key field is "key", the
698 /// operator is "In", and the values array contains only "value". The requirements are ANDed.
699 #[serde(default, skip_serializing_if = "Option::is_none", rename = "matchLabels")]
700 pub match_labels: Option<BTreeMap<String, String>>,
701}
702
703/// A label selector requirement is a selector that contains values, a key, and an operator that
704/// relates the key and values.
705#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
706pub struct ClusterAgentAffinityPodAntiAffinityPreferredDuringSchedulingIgnoredDuringExecutionPodAffinityTermLabelSelectorMatchExpressions
707{
708 /// key is the label key that the selector applies to.
709 pub key: String,
710 /// operator represents a key's relationship to a set of values.
711 /// Valid operators are In, NotIn, Exists and DoesNotExist.
712 pub operator: String,
713 /// values is an array of string values. If the operator is In or NotIn,
714 /// the values array must be non-empty. If the operator is Exists or DoesNotExist,
715 /// the values array must be empty. This array is replaced during a strategic
716 /// merge patch.
717 #[serde(default, skip_serializing_if = "Option::is_none")]
718 pub values: Option<Vec<String>>,
719}
720
721/// A label query over the set of namespaces that the term applies to.
722/// The term is applied to the union of the namespaces selected by this field
723/// and the ones listed in the namespaces field.
724/// null selector and null or empty namespaces list means "this pod's namespace".
725/// An empty selector ({}) matches all namespaces.
726#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
727pub struct ClusterAgentAffinityPodAntiAffinityPreferredDuringSchedulingIgnoredDuringExecutionPodAffinityTermNamespaceSelector {
728 /// matchExpressions is a list of label selector requirements. The requirements are ANDed.
729 #[serde(default, skip_serializing_if = "Option::is_none", rename = "matchExpressions")]
730 pub match_expressions: Option<Vec<ClusterAgentAffinityPodAntiAffinityPreferredDuringSchedulingIgnoredDuringExecutionPodAffinityTermNamespaceSelectorMatchExpressions>>,
731 /// matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
732 /// map is equivalent to an element of matchExpressions, whose key field is "key", the
733 /// operator is "In", and the values array contains only "value". The requirements are ANDed.
734 #[serde(default, skip_serializing_if = "Option::is_none", rename = "matchLabels")]
735 pub match_labels: Option<BTreeMap<String, String>>,
736}
737
738/// A label selector requirement is a selector that contains values, a key, and an operator that
739/// relates the key and values.
740#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
741pub struct ClusterAgentAffinityPodAntiAffinityPreferredDuringSchedulingIgnoredDuringExecutionPodAffinityTermNamespaceSelectorMatchExpressions
742{
743 /// key is the label key that the selector applies to.
744 pub key: String,
745 /// operator represents a key's relationship to a set of values.
746 /// Valid operators are In, NotIn, Exists and DoesNotExist.
747 pub operator: String,
748 /// values is an array of string values. If the operator is In or NotIn,
749 /// the values array must be non-empty. If the operator is Exists or DoesNotExist,
750 /// the values array must be empty. This array is replaced during a strategic
751 /// merge patch.
752 #[serde(default, skip_serializing_if = "Option::is_none")]
753 pub values: Option<Vec<String>>,
754}
755
756/// Defines a set of pods (namely those matching the labelSelector
757/// relative to the given namespace(s)) that this pod should be
758/// co-located (affinity) or not co-located (anti-affinity) with,
759/// where co-located is defined as running on a node whose value of
760/// the label with key <topologyKey> matches that of any node on which
761/// a pod of the set of pods is running
762#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
763pub struct ClusterAgentAffinityPodAntiAffinityRequiredDuringSchedulingIgnoredDuringExecution {
764 /// A label query over a set of resources, in this case pods.
765 /// If it's null, this PodAffinityTerm matches with no Pods.
766 #[serde(default, skip_serializing_if = "Option::is_none", rename = "labelSelector")]
767 pub label_selector: Option<ClusterAgentAffinityPodAntiAffinityRequiredDuringSchedulingIgnoredDuringExecutionLabelSelector>,
768 /// MatchLabelKeys is a set of pod label keys to select which pods will
769 /// be taken into consideration. The keys are used to lookup values from the
770 /// incoming pod labels, those key-value labels are merged with `labelSelector` as `key in (value)`
771 /// to select the group of existing pods which pods will be taken into consideration
772 /// for the incoming pod's pod (anti) affinity. Keys that don't exist in the incoming
773 /// pod labels will be ignored. The default value is empty.
774 /// The same key is forbidden to exist in both matchLabelKeys and labelSelector.
775 /// Also, matchLabelKeys cannot be set when labelSelector isn't set.
776 #[serde(default, skip_serializing_if = "Option::is_none", rename = "matchLabelKeys")]
777 pub match_label_keys: Option<Vec<String>>,
778 /// MismatchLabelKeys is a set of pod label keys to select which pods will
779 /// be taken into consideration. The keys are used to lookup values from the
780 /// incoming pod labels, those key-value labels are merged with `labelSelector` as `key notin (value)`
781 /// to select the group of existing pods which pods will be taken into consideration
782 /// for the incoming pod's pod (anti) affinity. Keys that don't exist in the incoming
783 /// pod labels will be ignored. The default value is empty.
784 /// The same key is forbidden to exist in both mismatchLabelKeys and labelSelector.
785 /// Also, mismatchLabelKeys cannot be set when labelSelector isn't set.
786 #[serde(default, skip_serializing_if = "Option::is_none", rename = "mismatchLabelKeys")]
787 pub mismatch_label_keys: Option<Vec<String>>,
788 /// A label query over the set of namespaces that the term applies to.
789 /// The term is applied to the union of the namespaces selected by this field
790 /// and the ones listed in the namespaces field.
791 /// null selector and null or empty namespaces list means "this pod's namespace".
792 /// An empty selector ({}) matches all namespaces.
793 #[serde(default, skip_serializing_if = "Option::is_none", rename = "namespaceSelector")]
794 pub namespace_selector: Option<ClusterAgentAffinityPodAntiAffinityRequiredDuringSchedulingIgnoredDuringExecutionNamespaceSelector>,
795 /// namespaces specifies a static list of namespace names that the term applies to.
796 /// The term is applied to the union of the namespaces listed in this field
797 /// and the ones selected by namespaceSelector.
798 /// null or empty namespaces list and null namespaceSelector means "this pod's namespace".
799 #[serde(default, skip_serializing_if = "Option::is_none")]
800 pub namespaces: Option<Vec<String>>,
801 /// This pod should be co-located (affinity) or not co-located (anti-affinity) with the pods matching
802 /// the labelSelector in the specified namespaces, where co-located is defined as running on a node
803 /// whose value of the label with key topologyKey matches that of any node on which any of the
804 /// selected pods is running.
805 /// Empty topologyKey is not allowed.
806 #[serde(rename = "topologyKey")]
807 pub topology_key: String,
808}
809
810/// A label query over a set of resources, in this case pods.
811/// If it's null, this PodAffinityTerm matches with no Pods.
812#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
813pub struct ClusterAgentAffinityPodAntiAffinityRequiredDuringSchedulingIgnoredDuringExecutionLabelSelector {
814 /// matchExpressions is a list of label selector requirements. The requirements are ANDed.
815 #[serde(default, skip_serializing_if = "Option::is_none", rename = "matchExpressions")]
816 pub match_expressions: Option<Vec<ClusterAgentAffinityPodAntiAffinityRequiredDuringSchedulingIgnoredDuringExecutionLabelSelectorMatchExpressions>>,
817 /// matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
818 /// map is equivalent to an element of matchExpressions, whose key field is "key", the
819 /// operator is "In", and the values array contains only "value". The requirements are ANDed.
820 #[serde(default, skip_serializing_if = "Option::is_none", rename = "matchLabels")]
821 pub match_labels: Option<BTreeMap<String, String>>,
822}
823
824/// A label selector requirement is a selector that contains values, a key, and an operator that
825/// relates the key and values.
826#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
827pub struct ClusterAgentAffinityPodAntiAffinityRequiredDuringSchedulingIgnoredDuringExecutionLabelSelectorMatchExpressions
828{
829 /// key is the label key that the selector applies to.
830 pub key: String,
831 /// operator represents a key's relationship to a set of values.
832 /// Valid operators are In, NotIn, Exists and DoesNotExist.
833 pub operator: String,
834 /// values is an array of string values. If the operator is In or NotIn,
835 /// the values array must be non-empty. If the operator is Exists or DoesNotExist,
836 /// the values array must be empty. This array is replaced during a strategic
837 /// merge patch.
838 #[serde(default, skip_serializing_if = "Option::is_none")]
839 pub values: Option<Vec<String>>,
840}
841
842/// A label query over the set of namespaces that the term applies to.
843/// The term is applied to the union of the namespaces selected by this field
844/// and the ones listed in the namespaces field.
845/// null selector and null or empty namespaces list means "this pod's namespace".
846/// An empty selector ({}) matches all namespaces.
847#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
848pub struct ClusterAgentAffinityPodAntiAffinityRequiredDuringSchedulingIgnoredDuringExecutionNamespaceSelector {
849 /// matchExpressions is a list of label selector requirements. The requirements are ANDed.
850 #[serde(default, skip_serializing_if = "Option::is_none", rename = "matchExpressions")]
851 pub match_expressions: Option<Vec<ClusterAgentAffinityPodAntiAffinityRequiredDuringSchedulingIgnoredDuringExecutionNamespaceSelectorMatchExpressions>>,
852 /// matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
853 /// map is equivalent to an element of matchExpressions, whose key field is "key", the
854 /// operator is "In", and the values array contains only "value". The requirements are ANDed.
855 #[serde(default, skip_serializing_if = "Option::is_none", rename = "matchLabels")]
856 pub match_labels: Option<BTreeMap<String, String>>,
857}
858
859/// A label selector requirement is a selector that contains values, a key, and an operator that
860/// relates the key and values.
861#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
862pub struct ClusterAgentAffinityPodAntiAffinityRequiredDuringSchedulingIgnoredDuringExecutionNamespaceSelectorMatchExpressions
863{
864 /// key is the label key that the selector applies to.
865 pub key: String,
866 /// operator represents a key's relationship to a set of values.
867 /// Valid operators are In, NotIn, Exists and DoesNotExist.
868 pub operator: String,
869 /// values is an array of string values. If the operator is In or NotIn,
870 /// the values array must be non-empty. If the operator is Exists or DoesNotExist,
871 /// the values array must be empty. This array is replaced during a strategic
872 /// merge patch.
873 #[serde(default, skip_serializing_if = "Option::is_none")]
874 pub values: Option<Vec<String>>,
875}
876
877/// EnvVar represents an environment variable present in a Container.
878#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
879pub struct ClusterAgentEnvVars {
880 /// Name of the environment variable.
881 /// May consist of any printable ASCII characters except '='.
882 pub name: String,
883 /// Variable references $(VAR_NAME) are expanded
884 /// using the previously defined environment variables in the container and
885 /// any service environment variables. If a variable cannot be resolved,
886 /// the reference in the input string will be unchanged. Double $$ are reduced
887 /// to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e.
888 /// "$$(VAR_NAME)" will produce the string literal "$(VAR_NAME)".
889 /// Escaped references will never be expanded, regardless of whether the variable
890 /// exists or not.
891 /// Defaults to "".
892 #[serde(default, skip_serializing_if = "Option::is_none")]
893 pub value: Option<String>,
894 /// Source for the environment variable's value. Cannot be used if value is not empty.
895 #[serde(default, skip_serializing_if = "Option::is_none", rename = "valueFrom")]
896 pub value_from: Option<ClusterAgentEnvVarsValueFrom>,
897}
898
899/// Source for the environment variable's value. Cannot be used if value is not empty.
900#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
901pub struct ClusterAgentEnvVarsValueFrom {
902 /// Selects a key of a ConfigMap.
903 #[serde(
904 default,
905 skip_serializing_if = "Option::is_none",
906 rename = "configMapKeyRef"
907 )]
908 pub config_map_key_ref: Option<ClusterAgentEnvVarsValueFromConfigMapKeyRef>,
909 /// Selects a field of the pod: supports metadata.name, metadata.namespace, `metadata.labels['<KEY>']`, `metadata.annotations['<KEY>']`,
910 /// spec.nodeName, spec.serviceAccountName, status.hostIP, status.podIP, status.podIPs.
911 #[serde(default, skip_serializing_if = "Option::is_none", rename = "fieldRef")]
912 pub field_ref: Option<ClusterAgentEnvVarsValueFromFieldRef>,
913 /// FileKeyRef selects a key of the env file.
914 /// Requires the EnvFiles feature gate to be enabled.
915 #[serde(
916 default,
917 skip_serializing_if = "Option::is_none",
918 rename = "fileKeyRef"
919 )]
920 pub file_key_ref: Option<ClusterAgentEnvVarsValueFromFileKeyRef>,
921 /// Selects a resource of the container: only resources limits and requests
922 /// (limits.cpu, limits.memory, limits.ephemeral-storage, requests.cpu, requests.memory and requests.ephemeral-storage) are currently supported.
923 #[serde(
924 default,
925 skip_serializing_if = "Option::is_none",
926 rename = "resourceFieldRef"
927 )]
928 pub resource_field_ref: Option<ClusterAgentEnvVarsValueFromResourceFieldRef>,
929 /// Selects a key of a secret in the pod's namespace
930 #[serde(
931 default,
932 skip_serializing_if = "Option::is_none",
933 rename = "secretKeyRef"
934 )]
935 pub secret_key_ref: Option<ClusterAgentEnvVarsValueFromSecretKeyRef>,
936}
937
938/// Selects a key of a ConfigMap.
939#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
940pub struct ClusterAgentEnvVarsValueFromConfigMapKeyRef {
941 /// The key to select.
942 pub key: String,
943 /// Name of the referent.
944 /// This field is effectively required, but due to backwards compatibility is
945 /// allowed to be empty. Instances of this type with an empty value here are
946 /// almost certainly wrong.
947 /// More info: <https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names>
948 #[serde(default, skip_serializing_if = "Option::is_none")]
949 pub name: Option<String>,
950 /// Specify whether the ConfigMap or its key must be defined
951 #[serde(default, skip_serializing_if = "Option::is_none")]
952 pub optional: Option<bool>,
953}
954
955/// Selects a field of the pod: supports metadata.name, metadata.namespace, `metadata.labels['<KEY>']`, `metadata.annotations['<KEY>']`,
956/// spec.nodeName, spec.serviceAccountName, status.hostIP, status.podIP, status.podIPs.
957#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
958pub struct ClusterAgentEnvVarsValueFromFieldRef {
959 /// Version of the schema the FieldPath is written in terms of, defaults to "v1".
960 #[serde(
961 default,
962 skip_serializing_if = "Option::is_none",
963 rename = "apiVersion"
964 )]
965 pub api_version: Option<String>,
966 /// Path of the field to select in the specified API version.
967 #[serde(rename = "fieldPath")]
968 pub field_path: String,
969}
970
971/// FileKeyRef selects a key of the env file.
972/// Requires the EnvFiles feature gate to be enabled.
973#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
974pub struct ClusterAgentEnvVarsValueFromFileKeyRef {
975 /// The key within the env file. An invalid key will prevent the pod from starting.
976 /// The keys defined within a source may consist of any printable ASCII characters except '='.
977 /// During Alpha stage of the EnvFiles feature gate, the key size is limited to 128 characters.
978 pub key: String,
979 /// Specify whether the file or its key must be defined. If the file or key
980 /// does not exist, then the env var is not published.
981 /// If optional is set to true and the specified key does not exist,
982 /// the environment variable will not be set in the Pod's containers.
983 ///
984 /// If optional is set to false and the specified key does not exist,
985 /// an error will be returned during Pod creation.
986 #[serde(default, skip_serializing_if = "Option::is_none")]
987 pub optional: Option<bool>,
988 /// The path within the volume from which to select the file.
989 /// Must be relative and may not contain the '..' path or start with '..'.
990 pub path: String,
991 /// The name of the volume mount containing the env file.
992 #[serde(rename = "volumeName")]
993 pub volume_name: String,
994}
995
996/// Selects a resource of the container: only resources limits and requests
997/// (limits.cpu, limits.memory, limits.ephemeral-storage, requests.cpu, requests.memory and requests.ephemeral-storage) are currently supported.
998#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
999pub struct ClusterAgentEnvVarsValueFromResourceFieldRef {
1000 /// Container name: required for volumes, optional for env vars
1001 #[serde(
1002 default,
1003 skip_serializing_if = "Option::is_none",
1004 rename = "containerName"
1005 )]
1006 pub container_name: Option<String>,
1007 /// Specifies the output format of the exposed resources, defaults to "1"
1008 #[serde(default, skip_serializing_if = "Option::is_none")]
1009 pub divisor: Option<IntOrString>,
1010 /// Required: resource to select
1011 pub resource: String,
1012}
1013
1014/// Selects a key of a secret in the pod's namespace
1015#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
1016pub struct ClusterAgentEnvVarsValueFromSecretKeyRef {
1017 /// The key of the secret to select from. Must be a valid secret key.
1018 pub key: String,
1019 /// Name of the referent.
1020 /// This field is effectively required, but due to backwards compatibility is
1021 /// allowed to be empty. Instances of this type with an empty value here are
1022 /// almost certainly wrong.
1023 /// More info: <https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names>
1024 #[serde(default, skip_serializing_if = "Option::is_none")]
1025 pub name: Option<String>,
1026 /// Specify whether the Secret or its key must be defined
1027 #[serde(default, skip_serializing_if = "Option::is_none")]
1028 pub optional: Option<bool>,
1029}
1030
1031/// AgentResources sets the resources for the cluster's agent deployment.
1032#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
1033pub struct ClusterAgentResources {
1034 /// Claims lists the names of resources, defined in spec.resourceClaims,
1035 /// that are used by this container.
1036 ///
1037 /// This field depends on the
1038 /// DynamicResourceAllocation feature gate.
1039 ///
1040 /// This field is immutable. It can only be set for containers.
1041 #[serde(default, skip_serializing_if = "Option::is_none")]
1042 pub claims: Option<Vec<ClusterAgentResourcesClaims>>,
1043 /// Limits describes the maximum amount of compute resources allowed.
1044 /// More info: <https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/>
1045 #[serde(default, skip_serializing_if = "Option::is_none")]
1046 pub limits: Option<BTreeMap<String, IntOrString>>,
1047 /// Requests describes the minimum amount of compute resources required.
1048 /// If Requests is omitted for a container, it defaults to Limits if that is explicitly specified,
1049 /// otherwise to an implementation-defined value. Requests cannot exceed Limits.
1050 /// More info: <https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/>
1051 #[serde(default, skip_serializing_if = "Option::is_none")]
1052 pub requests: Option<BTreeMap<String, IntOrString>>,
1053}
1054
1055/// ResourceClaim references one entry in PodSpec.ResourceClaims.
1056#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
1057pub struct ClusterAgentResourcesClaims {
1058 /// Name must match the name of one entry in pod.spec.resourceClaims of
1059 /// the Pod where this field is used. It makes that resource available
1060 /// inside a container.
1061 pub name: String,
1062 /// Request is the name chosen for a request in the referenced claim.
1063 /// If empty, everything from the claim is made available, otherwise
1064 /// only the result of this request.
1065 #[serde(default, skip_serializing_if = "Option::is_none")]
1066 pub request: Option<String>,
1067}
1068
1069#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
1070pub struct ClusterAgentSchedulingCustomization {
1071 #[serde(
1072 default,
1073 skip_serializing_if = "Option::is_none",
1074 rename = "podDisruptionBudget"
1075 )]
1076 pub pod_disruption_budget: Option<ClusterAgentSchedulingCustomizationPodDisruptionBudget>,
1077 #[serde(
1078 default,
1079 skip_serializing_if = "Option::is_none",
1080 rename = "priorityClass"
1081 )]
1082 pub priority_class: Option<ClusterAgentSchedulingCustomizationPriorityClass>,
1083}
1084
1085#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
1086pub struct ClusterAgentSchedulingCustomizationPodDisruptionBudget {
1087 #[serde(
1088 default,
1089 skip_serializing_if = "Option::is_none",
1090 rename = "maxUnavailable"
1091 )]
1092 pub max_unavailable: Option<String>,
1093 #[serde(
1094 default,
1095 skip_serializing_if = "Option::is_none",
1096 rename = "minAvailable"
1097 )]
1098 pub min_available: Option<String>,
1099}
1100
1101#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
1102pub struct ClusterAgentSchedulingCustomizationPriorityClass {
1103 /// PreemptionPolicy describes a policy for if/when to preempt a pod.
1104 #[serde(
1105 default,
1106 skip_serializing_if = "Option::is_none",
1107 rename = "preemptionPolicy"
1108 )]
1109 pub preemption_policy: Option<String>,
1110 #[serde(default, skip_serializing_if = "Option::is_none")]
1111 pub value: Option<i64>,
1112}
1113
1114/// The pod this Toleration is attached to tolerates any taint that matches
1115/// the triple <key,value,effect> using the matching operator <operator>.
1116#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
1117pub struct ClusterAgentTolerations {
1118 /// Effect indicates the taint effect to match. Empty means match all taint effects.
1119 /// When specified, allowed values are NoSchedule, PreferNoSchedule and NoExecute.
1120 #[serde(default, skip_serializing_if = "Option::is_none")]
1121 pub effect: Option<String>,
1122 /// Key is the taint key that the toleration applies to. Empty means match all taint keys.
1123 /// If the key is empty, operator must be Exists; this combination means to match all values and all keys.
1124 #[serde(default, skip_serializing_if = "Option::is_none")]
1125 pub key: Option<String>,
1126 /// Operator represents a key's relationship to the value.
1127 /// Valid operators are Exists and Equal. Defaults to Equal.
1128 /// Exists is equivalent to wildcard for value, so that a pod can
1129 /// tolerate all taints of a particular category.
1130 #[serde(default, skip_serializing_if = "Option::is_none")]
1131 pub operator: Option<String>,
1132 /// TolerationSeconds represents the period of time the toleration (which must be
1133 /// of effect NoExecute, otherwise this field is ignored) tolerates the taint. By default,
1134 /// it is not set, which means tolerate the taint forever (do not evict). Zero and
1135 /// negative values will be treated as 0 (evict immediately) by the system.
1136 #[serde(
1137 default,
1138 skip_serializing_if = "Option::is_none",
1139 rename = "tolerationSeconds"
1140 )]
1141 pub toleration_seconds: Option<i64>,
1142 /// Value is the taint value the toleration matches to.
1143 /// If the operator is Exists, the value should be empty, otherwise just a regular string.
1144 #[serde(default, skip_serializing_if = "Option::is_none")]
1145 pub value: Option<String>,
1146}
1147
1148#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
1149pub struct ClusterStatus {
1150 /// ActiveSchedule specifies if the cluster is in schedule, which means BundleDeployments can
1151 /// be updated and deployed. If ActiveSchedule is set to false and Scheduled is set to true
1152 /// BundleDeployments are not updated nor deployed.
1153 #[serde(
1154 default,
1155 skip_serializing_if = "Option::is_none",
1156 rename = "activeSchedule"
1157 )]
1158 pub active_schedule: Option<bool>,
1159 /// AgentStatus contains information about the agent.
1160 #[serde(default, skip_serializing_if = "Option::is_none")]
1161 pub agent: Option<ClusterStatusAgent>,
1162 /// AgentAffinityHash is a hash of the agent's affinity configuration,
1163 /// used to detect changes.
1164 #[serde(
1165 default,
1166 skip_serializing_if = "Option::is_none",
1167 rename = "agentAffinityHash"
1168 )]
1169 pub agent_affinity_hash: Option<String>,
1170 /// AgentConfigChanged is set to true if any of the agent configuration
1171 /// changed, like the API server URL or CA. Setting it to true will
1172 /// trigger a re-import of the cluster.
1173 #[serde(
1174 default,
1175 skip_serializing_if = "Option::is_none",
1176 rename = "agentConfigChanged"
1177 )]
1178 pub agent_config_changed: Option<bool>,
1179 /// AgentDeployedGeneration is the generation of the agent that is currently deployed.
1180 #[serde(
1181 default,
1182 skip_serializing_if = "Option::is_none",
1183 rename = "agentDeployedGeneration"
1184 )]
1185 pub agent_deployed_generation: Option<i64>,
1186 /// AgentEnvVarsHash is a hash of the agent's env vars, used to detect changes.
1187 #[serde(
1188 default,
1189 skip_serializing_if = "Option::is_none",
1190 rename = "agentEnvVarsHash"
1191 )]
1192 pub agent_env_vars_hash: Option<String>,
1193 /// AgentHostNetwork defines observed state of spec.hostNetwork setting that is currently used.
1194 #[serde(
1195 default,
1196 skip_serializing_if = "Option::is_none",
1197 rename = "agentHostNetwork"
1198 )]
1199 pub agent_host_network: Option<bool>,
1200 /// AgentMigrated is always set to true after importing a cluster. If
1201 /// false, it will trigger a migration. Old agents don't have
1202 /// this in their status.
1203 #[serde(
1204 default,
1205 skip_serializing_if = "Option::is_none",
1206 rename = "agentMigrated"
1207 )]
1208 pub agent_migrated: Option<bool>,
1209 /// AgentNamespaceMigrated is always set to true after importing a
1210 /// cluster. If false, it will trigger a migration. Old Fleet agents
1211 /// don't have this in their status.
1212 #[serde(
1213 default,
1214 skip_serializing_if = "Option::is_none",
1215 rename = "agentNamespaceMigrated"
1216 )]
1217 pub agent_namespace_migrated: Option<bool>,
1218 /// AgentPrivateRepoURL is the private repo URL for the agent that is currently used.
1219 #[serde(
1220 default,
1221 skip_serializing_if = "Option::is_none",
1222 rename = "agentPrivateRepoURL"
1223 )]
1224 pub agent_private_repo_url: Option<String>,
1225 /// AgentResourcesHash is a hash of the agent's resources configuration,
1226 /// used to detect changes.
1227 #[serde(
1228 default,
1229 skip_serializing_if = "Option::is_none",
1230 rename = "agentResourcesHash"
1231 )]
1232 pub agent_resources_hash: Option<String>,
1233 #[serde(
1234 default,
1235 skip_serializing_if = "Option::is_none",
1236 rename = "agentSchedulingCustomizationHash"
1237 )]
1238 pub agent_scheduling_customization_hash: Option<String>,
1239 /// AgentTLSMode supports two values: `system-store` and `strict`. If set to
1240 /// `system-store`, instructs the agent to trust CA bundles from the operating
1241 /// system's store. If set to `strict`, then the agent shall only connect to a
1242 /// server which uses the exact CA configured when creating/updating the agent.
1243 #[serde(
1244 default,
1245 skip_serializing_if = "Option::is_none",
1246 rename = "agentTLSMode"
1247 )]
1248 pub agent_tls_mode: Option<String>,
1249 /// AgentTolerationsHash is a hash of the agent's tolerations
1250 /// configuration, used to detect changes.
1251 #[serde(
1252 default,
1253 skip_serializing_if = "Option::is_none",
1254 rename = "agentTolerationsHash"
1255 )]
1256 pub agent_tolerations_hash: Option<String>,
1257 /// APIServerCAHash is a hash of the upstream API server CA, used to detect changes.
1258 #[serde(
1259 default,
1260 skip_serializing_if = "Option::is_none",
1261 rename = "apiServerCAHash"
1262 )]
1263 pub api_server_ca_hash: Option<String>,
1264 /// APIServerURL is the currently used URL of the API server that the
1265 /// cluster uses to connect to upstream.
1266 #[serde(
1267 default,
1268 skip_serializing_if = "Option::is_none",
1269 rename = "apiServerURL"
1270 )]
1271 pub api_server_url: Option<String>,
1272 /// CattleNamespaceMigrated is always set to true after importing a
1273 /// cluster. If false, it will trigger a migration. Old Fleet agents,
1274 /// don't have this in their status.
1275 #[serde(
1276 default,
1277 skip_serializing_if = "Option::is_none",
1278 rename = "cattleNamespaceMigrated"
1279 )]
1280 pub cattle_namespace_migrated: Option<bool>,
1281 #[serde(default, skip_serializing_if = "Option::is_none")]
1282 pub conditions: Option<Vec<ClusterStatusConditions>>,
1283 /// DesiredReadyGitRepos is the number of gitrepos for this cluster that
1284 /// are desired to be ready.
1285 #[serde(
1286 default,
1287 skip_serializing_if = "Option::is_none",
1288 rename = "desiredReadyGitRepos"
1289 )]
1290 pub desired_ready_git_repos: Option<i64>,
1291 /// DesiredReadyHelmOps is the number of helmop resources for this cluster that
1292 /// are desired to be ready.
1293 #[serde(
1294 default,
1295 skip_serializing_if = "Option::is_none",
1296 rename = "desiredReadyHelmOps"
1297 )]
1298 pub desired_ready_helm_ops: Option<i64>,
1299 /// Display contains the number of ready bundles, nodes and a summary state.
1300 #[serde(default, skip_serializing_if = "Option::is_none")]
1301 pub display: Option<ClusterStatusDisplay>,
1302 /// GarbageCollectionInterval determines how often agents clean up obsolete Helm releases.
1303 #[serde(
1304 default,
1305 skip_serializing_if = "Option::is_none",
1306 rename = "garbageCollectionInterval"
1307 )]
1308 pub garbage_collection_interval: Option<String>,
1309 /// Namespace is the cluster namespace, it contains the clusters service
1310 /// account as well as any bundledeployments. Example:
1311 /// "cluster-fleet-local-cluster-294db1acfa77-d9ccf852678f"
1312 #[serde(default, skip_serializing_if = "Option::is_none")]
1313 pub namespace: Option<String>,
1314 /// ReadyGitRepos is the number of gitrepos for this cluster that are ready.
1315 #[serde(
1316 default,
1317 skip_serializing_if = "Option::is_none",
1318 rename = "readyGitRepos"
1319 )]
1320 pub ready_git_repos: Option<i64>,
1321 /// ReadyHelmOps is the number of helmop resources for this cluster that are ready.
1322 #[serde(
1323 default,
1324 skip_serializing_if = "Option::is_none",
1325 rename = "readyHelmOps"
1326 )]
1327 pub ready_helm_ops: Option<i64>,
1328 /// ResourceCounts is an aggregate over the ResourceCounts.
1329 #[serde(
1330 default,
1331 skip_serializing_if = "Option::is_none",
1332 rename = "resourceCounts"
1333 )]
1334 pub resource_counts: Option<ClusterStatusResourceCounts>,
1335 /// Scheduled specifies if the cluster has been added to any Schedule.
1336 /// When set to true ActiveSchedule is taken into account to check if the deployment
1337 /// can be deployed.
1338 #[serde(default, skip_serializing_if = "Option::is_none")]
1339 pub scheduled: Option<bool>,
1340 /// Summary is a summary of the bundledeployments.
1341 #[serde(default, skip_serializing_if = "Option::is_none")]
1342 pub summary: Option<ClusterStatusSummary>,
1343}
1344
1345/// AgentStatus contains information about the agent.
1346#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
1347pub struct ClusterStatusAgent {
1348 /// LastSeen is the last time the agent checked in to update the status
1349 /// of the cluster resource.
1350 #[serde(default, skip_serializing_if = "Option::is_none", rename = "lastSeen")]
1351 pub last_seen: Option<String>,
1352 /// Namespace is the namespace of the agent deployment, e.g. "cattle-fleet-system".
1353 #[serde(default, skip_serializing_if = "Option::is_none")]
1354 pub namespace: Option<String>,
1355}
1356
1357#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
1358pub struct ClusterStatusConditions {
1359 /// Last time the condition transitioned from one status to another.
1360 #[serde(
1361 default,
1362 skip_serializing_if = "Option::is_none",
1363 rename = "lastTransitionTime"
1364 )]
1365 pub last_transition_time: Option<String>,
1366 /// The last time this condition was updated.
1367 #[serde(
1368 default,
1369 skip_serializing_if = "Option::is_none",
1370 rename = "lastUpdateTime"
1371 )]
1372 pub last_update_time: Option<String>,
1373 /// Human-readable message indicating details about last transition
1374 #[serde(default, skip_serializing_if = "Option::is_none")]
1375 pub message: Option<String>,
1376 /// The reason for the condition's last transition.
1377 #[serde(default, skip_serializing_if = "Option::is_none")]
1378 pub reason: Option<String>,
1379 /// Status of the condition, one of True, False, Unknown.
1380 pub status: String,
1381 /// Type of cluster condition.
1382 #[serde(rename = "type")]
1383 pub r#type: String,
1384}
1385
1386/// Display contains the number of ready bundles, nodes and a summary state.
1387#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
1388pub struct ClusterStatusDisplay {
1389 /// ReadyBundles is a string in the form "%d/%d", that describes the
1390 /// number of bundles that are ready vs. the number of bundles desired
1391 /// to be ready.
1392 #[serde(
1393 default,
1394 skip_serializing_if = "Option::is_none",
1395 rename = "readyBundles"
1396 )]
1397 pub ready_bundles: Option<String>,
1398 /// State of the cluster, either one of the bundle states, or "WaitCheckIn".
1399 #[serde(default, skip_serializing_if = "Option::is_none")]
1400 pub state: Option<String>,
1401}
1402
1403/// ResourceCounts is an aggregate over the ResourceCounts.
1404#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
1405pub struct ClusterStatusResourceCounts {
1406 /// DesiredReady is the number of resources that should be ready.
1407 #[serde(
1408 default,
1409 skip_serializing_if = "Option::is_none",
1410 rename = "desiredReady"
1411 )]
1412 pub desired_ready: Option<i64>,
1413 /// Missing is the number of missing resources.
1414 #[serde(default, skip_serializing_if = "Option::is_none")]
1415 pub missing: Option<i64>,
1416 /// Modified is the number of resources that have been modified.
1417 #[serde(default, skip_serializing_if = "Option::is_none")]
1418 pub modified: Option<i64>,
1419 /// NotReady is the number of not ready resources. Resources are not
1420 /// ready if they do not match any other state.
1421 #[serde(default, skip_serializing_if = "Option::is_none", rename = "notReady")]
1422 pub not_ready: Option<i64>,
1423 /// Orphaned is the number of orphaned resources.
1424 #[serde(default, skip_serializing_if = "Option::is_none")]
1425 pub orphaned: Option<i64>,
1426 /// Ready is the number of ready resources.
1427 #[serde(default, skip_serializing_if = "Option::is_none")]
1428 pub ready: Option<i64>,
1429 /// Unknown is the number of resources in an unknown state.
1430 #[serde(default, skip_serializing_if = "Option::is_none")]
1431 pub unknown: Option<i64>,
1432 /// WaitApplied is the number of resources that are waiting to be applied.
1433 #[serde(
1434 default,
1435 skip_serializing_if = "Option::is_none",
1436 rename = "waitApplied"
1437 )]
1438 pub wait_applied: Option<i64>,
1439}
1440
1441/// Summary is a summary of the bundledeployments.
1442#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
1443pub struct ClusterStatusSummary {
1444 /// DesiredReady is the number of bundle deployments that should be
1445 /// ready.
1446 #[serde(
1447 default,
1448 skip_serializing_if = "Option::is_none",
1449 rename = "desiredReady"
1450 )]
1451 pub desired_ready: Option<i64>,
1452 /// ErrApplied is the number of bundle deployments that have been synced
1453 /// from the Fleet controller and the downstream cluster, but with some
1454 /// errors when deploying the bundle.
1455 #[serde(
1456 default,
1457 skip_serializing_if = "Option::is_none",
1458 rename = "errApplied"
1459 )]
1460 pub err_applied: Option<i64>,
1461 /// Modified is the number of bundle deployments that have been deployed
1462 /// and for which all resources are ready, but where some changes from the
1463 /// Git repository have not yet been synced.
1464 #[serde(default, skip_serializing_if = "Option::is_none")]
1465 pub modified: Option<i64>,
1466 /// NonReadyClusters is a list of states, which is filled for a bundle
1467 /// that is not ready.
1468 #[serde(
1469 default,
1470 skip_serializing_if = "Option::is_none",
1471 rename = "nonReadyResources"
1472 )]
1473 pub non_ready_resources: Option<Vec<ClusterStatusSummaryNonReadyResources>>,
1474 /// NotReady is the number of bundle deployments that have been deployed
1475 /// where some resources are not ready.
1476 #[serde(default, skip_serializing_if = "Option::is_none", rename = "notReady")]
1477 pub not_ready: Option<i64>,
1478 /// OutOfSync is the number of bundle deployments that have been synced
1479 /// from Fleet controller, but not yet by the downstream agent.
1480 #[serde(default, skip_serializing_if = "Option::is_none", rename = "outOfSync")]
1481 pub out_of_sync: Option<i64>,
1482 /// Pending is the number of bundle deployments that are being processed
1483 /// by Fleet controller.
1484 #[serde(default, skip_serializing_if = "Option::is_none")]
1485 pub pending: Option<i64>,
1486 /// Ready is the number of bundle deployments that have been deployed
1487 /// where all resources are ready.
1488 #[serde(default, skip_serializing_if = "Option::is_none")]
1489 pub ready: Option<i64>,
1490 /// WaitApplied is the number of bundle deployments that have been
1491 /// synced from Fleet controller and downstream cluster, but are waiting
1492 /// to be deployed.
1493 #[serde(
1494 default,
1495 skip_serializing_if = "Option::is_none",
1496 rename = "waitApplied"
1497 )]
1498 pub wait_applied: Option<i64>,
1499}
1500
1501/// NonReadyResource contains information about a bundle that is not ready for a
1502/// given state like "ErrApplied". It contains a list of non-ready or modified
1503/// resources and their states.
1504#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
1505pub struct ClusterStatusSummaryNonReadyResources {
1506 /// State is the state of the resource, like e.g. "NotReady" or "ErrApplied".
1507 #[serde(
1508 default,
1509 skip_serializing_if = "Option::is_none",
1510 rename = "bundleState"
1511 )]
1512 pub bundle_state: Option<String>,
1513 /// Message contains information why the bundle is not ready.
1514 #[serde(default, skip_serializing_if = "Option::is_none")]
1515 pub message: Option<String>,
1516 /// ModifiedStatus lists the state for each modified resource.
1517 #[serde(
1518 default,
1519 skip_serializing_if = "Option::is_none",
1520 rename = "modifiedStatus"
1521 )]
1522 pub modified_status: Option<Vec<ClusterStatusSummaryNonReadyResourcesModifiedStatus>>,
1523 /// Name is the name of the resource.
1524 #[serde(default, skip_serializing_if = "Option::is_none")]
1525 pub name: Option<String>,
1526 /// NonReadyStatus lists the state for each non-ready resource.
1527 #[serde(
1528 default,
1529 skip_serializing_if = "Option::is_none",
1530 rename = "nonReadyStatus"
1531 )]
1532 pub non_ready_status: Option<Vec<ClusterStatusSummaryNonReadyResourcesNonReadyStatus>>,
1533}
1534
1535/// ModifiedStatus is used to report the status of a resource that is modified.
1536/// It indicates if the modification was a create, a delete or a patch.
1537#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
1538pub struct ClusterStatusSummaryNonReadyResourcesModifiedStatus {
1539 #[serde(
1540 default,
1541 skip_serializing_if = "Option::is_none",
1542 rename = "apiVersion"
1543 )]
1544 pub api_version: Option<String>,
1545 #[serde(default, skip_serializing_if = "Option::is_none")]
1546 pub delete: Option<bool>,
1547 /// Exist is true if the resource exists but is not owned by us. This can happen if a resource was adopted by another bundle whereas the first bundle still exists and due to that reports that it does not own it.
1548 #[serde(default, skip_serializing_if = "Option::is_none")]
1549 pub exist: Option<bool>,
1550 #[serde(default, skip_serializing_if = "Option::is_none")]
1551 pub kind: Option<String>,
1552 #[serde(default, skip_serializing_if = "Option::is_none")]
1553 pub missing: Option<bool>,
1554 #[serde(default, skip_serializing_if = "Option::is_none")]
1555 pub name: Option<String>,
1556 #[serde(default, skip_serializing_if = "Option::is_none")]
1557 pub namespace: Option<String>,
1558 #[serde(default, skip_serializing_if = "Option::is_none")]
1559 pub patch: Option<String>,
1560}
1561
1562/// NonReadyStatus is used to report the status of a resource that is not ready. It includes a summary.
1563#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
1564pub struct ClusterStatusSummaryNonReadyResourcesNonReadyStatus {
1565 #[serde(
1566 default,
1567 skip_serializing_if = "Option::is_none",
1568 rename = "apiVersion"
1569 )]
1570 pub api_version: Option<String>,
1571 #[serde(default, skip_serializing_if = "Option::is_none")]
1572 pub kind: Option<String>,
1573 #[serde(default, skip_serializing_if = "Option::is_none")]
1574 pub name: Option<String>,
1575 #[serde(default, skip_serializing_if = "Option::is_none")]
1576 pub namespace: Option<String>,
1577 #[serde(default, skip_serializing_if = "Option::is_none")]
1578 pub summary: Option<ClusterStatusSummaryNonReadyResourcesNonReadyStatusSummary>,
1579 /// UID is a type that holds unique ID values, including UUIDs. Because we
1580 /// don't ONLY use UUIDs, this is an alias to string. Being a type captures
1581 /// intent and helps make sure that UIDs and names do not get conflated.
1582 #[serde(default, skip_serializing_if = "Option::is_none")]
1583 pub uid: Option<String>,
1584}
1585
1586#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
1587pub struct ClusterStatusSummaryNonReadyResourcesNonReadyStatusSummary {
1588 #[serde(default, skip_serializing_if = "Option::is_none")]
1589 pub error: Option<bool>,
1590 #[serde(default, skip_serializing_if = "Option::is_none")]
1591 pub message: Option<Vec<String>>,
1592 #[serde(default, skip_serializing_if = "Option::is_none")]
1593 pub state: Option<String>,
1594 #[serde(default, skip_serializing_if = "Option::is_none")]
1595 pub transitioning: Option<bool>,
1596}