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