kcr_apps_kubeblocks_io/v1alpha1/componentdefinitions.rs
1// WARNING: generated by kopium - manual changes will be overwritten
2// kopium command: kopium --docs --derive=Default --derive=PartialEq --smart-derive-elision --filename crd-catalog/apecloud/kubeblocks/apps.kubeblocks.io/v1alpha1/componentdefinitions.yaml
3// kopium version: 0.23.0
4
5#[allow(unused_imports)]
6mod prelude {
7 pub use kube::CustomResource;
8 pub use serde::{Serialize, Deserialize};
9 pub use std::collections::BTreeMap;
10 pub use k8s_openapi::apimachinery::pkg::util::intstr::IntOrString;
11}
12
13use self::prelude::*;
14
15#[derive(CustomResource, Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
16#[kube(group = "apps.kubeblocks.io", version = "v1alpha1", kind = "ComponentDefinition", plural = "componentdefinitions")]
17#[kube(status = "ComponentDefinitionStatus")]
18#[kube(schema = "disabled")]
19#[kube(derive="Default")]
20#[kube(derive="PartialEq")]
21pub struct ComponentDefinitionSpec {
22 /// Specifies static annotations that will be patched to all Kubernetes resources created for the Component.
23 ///
24 /// Note: If an annotation key in the `annotations` field conflicts with any system annotations
25 /// or user-specified annotations, it will be silently ignored to avoid overriding higher-priority annotations.
26 ///
27 /// This field is immutable.
28 #[serde(default, skip_serializing_if = "Option::is_none")]
29 pub annotations: Option<BTreeMap<String, String>>,
30 /// Specifies the configuration file templates and volume mount parameters used by the Component.
31 /// It also includes descriptions of the parameters in the ConfigMaps, such as value range limitations.
32 ///
33 /// This field specifies a list of templates that will be rendered into Component containers' configuration files.
34 /// Each template is represented as a ConfigMap and may contain multiple configuration files,
35 /// with each file being a key in the ConfigMap.
36 ///
37 /// The rendered configuration files will be mounted into the Component's containers
38 /// according to the specified volume mount parameters.
39 ///
40 /// This field is immutable.
41 #[serde(default, skip_serializing_if = "Option::is_none")]
42 pub configs: Option<Vec<ComponentDefinitionConfigs>>,
43 /// Provides a brief and concise explanation of the Component's purpose, functionality, and any relevant details.
44 /// It serves as a quick reference for users to understand the Component's role and characteristics.
45 #[serde(default, skip_serializing_if = "Option::is_none")]
46 pub description: Option<String>,
47 /// Defines the built-in metrics exporter container.
48 #[serde(default, skip_serializing_if = "Option::is_none")]
49 pub exporter: Option<ComponentDefinitionExporter>,
50 /// Specifies the host network configuration for the Component.
51 ///
52 /// When `hostNetwork` option is enabled, the Pods share the host's network namespace and can directly access
53 /// the host's network interfaces.
54 /// This means that if multiple Pods need to use the same port, they cannot run on the same host simultaneously
55 /// due to port conflicts.
56 ///
57 /// The DNSPolicy field in the Pod spec determines how containers within the Pod perform DNS resolution.
58 /// When using hostNetwork, the operator will set the DNSPolicy to 'ClusterFirstWithHostNet'.
59 /// With this policy, DNS queries will first go through the K8s cluster's DNS service.
60 /// If the query fails, it will fall back to the host's DNS settings.
61 ///
62 /// If set, the DNS policy will be automatically set to "ClusterFirstWithHostNet".
63 ///
64 /// This field is immutable.
65 #[serde(default, skip_serializing_if = "Option::is_none", rename = "hostNetwork")]
66 pub host_network: Option<ComponentDefinitionHostNetwork>,
67 /// Specifies static labels that will be patched to all Kubernetes resources created for the Component.
68 ///
69 /// Note: If a label key in the `labels` field conflicts with any system labels or user-specified labels,
70 /// it will be silently ignored to avoid overriding higher-priority labels.
71 ///
72 /// This field is immutable.
73 #[serde(default, skip_serializing_if = "Option::is_none")]
74 pub labels: Option<BTreeMap<String, String>>,
75 /// Defines a set of hooks and procedures that customize the behavior of a Component throughout its lifecycle.
76 /// Actions are triggered at specific lifecycle stages:
77 ///
78 /// - `postProvision`: Defines the hook to be executed after the creation of a Component,
79 /// with `preCondition` specifying when the action should be fired relative to the Component's lifecycle stages:
80 /// `Immediately`, `RuntimeReady`, `ComponentReady`, and `ClusterReady`.
81 /// - `preTerminate`: Defines the hook to be executed before terminating a Component.
82 /// - `roleProbe`: Defines the procedure which is invoked regularly to assess the role of replicas.
83 /// - `switchover`: Defines the procedure for a controlled transition of leadership from the current leader to a new replica.
84 /// This approach aims to minimize downtime and maintain availability in systems with a leader-follower topology,
85 /// such as before planned maintenance or upgrades on the current leader node.
86 /// - `memberJoin`: Defines the procedure to add a new replica to the replication group.
87 /// - `memberLeave`: Defines the method to remove a replica from the replication group.
88 /// - `readOnly`: Defines the procedure to switch a replica into the read-only state.
89 /// - `readWrite`: transition a replica from the read-only state back to the read-write state.
90 /// - `dataDump`: Defines the procedure to export the data from a replica.
91 /// - `dataLoad`: Defines the procedure to import data into a replica.
92 /// - `reconfigure`: Defines the procedure that update a replica with new configuration file.
93 /// - `accountProvision`: Defines the procedure to generate a new database account.
94 ///
95 /// This field is immutable.
96 #[serde(default, skip_serializing_if = "Option::is_none", rename = "lifecycleActions")]
97 pub lifecycle_actions: Option<ComponentDefinitionLifecycleActions>,
98 /// Defines the types of logs generated by instances of the Component and their corresponding file paths.
99 /// These logs can be collected for further analysis and monitoring.
100 ///
101 /// The `logConfigs` field is an optional list of LogConfig objects, where each object represents
102 /// a specific log type and its configuration.
103 /// It allows you to specify multiple log types and their respective file paths for the Component.
104 ///
105 /// Examples:
106 ///
107 /// ```text
108 /// logConfigs:
109 /// - filePathPattern: /data/mysql/log/mysqld-error.log
110 /// name: error
111 /// - filePathPattern: /data/mysql/log/mysqld.log
112 /// name: general
113 /// - filePathPattern: /data/mysql/log/mysqld-slowquery.log
114 /// name: slow
115 /// ```
116 ///
117 /// This field is immutable.
118 #[serde(default, skip_serializing_if = "Option::is_none", rename = "logConfigs")]
119 pub log_configs: Option<Vec<ComponentDefinitionLogConfigs>>,
120 /// `minReadySeconds` is the minimum duration in seconds that a new Pod should remain in the ready
121 /// state without any of its containers crashing to be considered available.
122 /// This ensures the Pod's stability and readiness to serve requests.
123 ///
124 /// A default value of 0 seconds means the Pod is considered available as soon as it enters the ready state.
125 #[serde(default, skip_serializing_if = "Option::is_none", rename = "minReadySeconds")]
126 pub min_ready_seconds: Option<i32>,
127 /// Deprecated since v0.9
128 /// monitor is monitoring config which provided by provider.
129 #[serde(default, skip_serializing_if = "Option::is_none")]
130 pub monitor: Option<ComponentDefinitionMonitor>,
131 /// InstanceSet controls the creation of pods during initial scale up, replacement of pods on nodes, and scaling down.
132 ///
133 /// - `OrderedReady`: Creates pods in increasing order (pod-0, then pod-1, etc). The controller waits until each pod
134 /// is ready before continuing. Pods are removed in reverse order when scaling down.
135 /// - `Parallel`: Creates pods in parallel to match the desired scale without waiting. All pods are deleted at once
136 /// when scaling down.
137 #[serde(default, skip_serializing_if = "Option::is_none", rename = "podManagementPolicy")]
138 pub pod_management_policy: Option<String>,
139 /// Defines the namespaced policy rules required by the Component.
140 ///
141 /// The `policyRules` field is an array of `rbacv1.PolicyRule` objects that define the policy rules
142 /// needed by the Component to operate within a namespace.
143 /// These policy rules determine the permissions and verbs the Component is allowed to perform on
144 /// Kubernetes resources within the namespace.
145 ///
146 /// The purpose of this field is to automatically generate the necessary RBAC roles
147 /// for the Component based on the specified policy rules.
148 /// This ensures that the Pods in the Component has appropriate permissions to function.
149 ///
150 /// Note: This field is currently non-functional and is reserved for future implementation.
151 ///
152 /// This field is immutable.
153 #[serde(default, skip_serializing_if = "Option::is_none", rename = "policyRules")]
154 pub policy_rules: Option<Vec<ComponentDefinitionPolicyRules>>,
155 /// Specifies the name of the Component provider, typically the vendor or developer name.
156 /// It identifies the entity responsible for creating and maintaining the Component.
157 ///
158 /// When specifying the provider name, consider the following guidelines:
159 ///
160 /// - Keep the name concise and relevant to the Component.
161 /// - Use a consistent naming convention across Components from the same provider.
162 /// - Avoid using trademarked or copyrighted names without proper permission.
163 #[serde(default, skip_serializing_if = "Option::is_none")]
164 pub provider: Option<String>,
165 /// Defines the upper limit of the number of replicas supported by the Component.
166 ///
167 /// It defines the maximum number of replicas that can be created for the Component.
168 /// This field allows you to set a limit on the scalability of the Component, preventing it from exceeding a certain number of replicas.
169 ///
170 /// This field is immutable.
171 #[serde(default, skip_serializing_if = "Option::is_none", rename = "replicasLimit")]
172 pub replicas_limit: Option<ComponentDefinitionReplicasLimit>,
173 /// This field has been deprecated since v0.9.
174 /// This field is maintained for backward compatibility and its use is discouraged.
175 /// Existing usage should be updated to the current preferred approach to avoid compatibility issues in future releases.
176 ///
177 /// This field is immutable.
178 #[serde(default, skip_serializing_if = "Option::is_none", rename = "roleArbitrator")]
179 pub role_arbitrator: Option<ComponentDefinitionRoleArbitrator>,
180 /// Enumerate all possible roles assigned to each replica of the Component, influencing its behavior.
181 ///
182 /// A replica can have zero to multiple roles.
183 /// KubeBlocks operator determines the roles of each replica by invoking the `lifecycleActions.roleProbe` method.
184 /// This action returns a list of roles for each replica, and the returned roles must be predefined in the `roles` field.
185 ///
186 /// The roles assigned to a replica can influence various aspects of the Component's behavior, such as:
187 ///
188 /// - Service selection: The Component's exposed Services may target replicas based on their roles using `roleSelector`.
189 /// - Update order: The roles can determine the order in which replicas are updated during a Component update.
190 /// For instance, replicas with a "follower" role can be updated first, while the replica with the "leader"
191 /// role is updated last. This helps minimize the number of leader changes during the update process.
192 ///
193 /// This field is immutable.
194 #[serde(default, skip_serializing_if = "Option::is_none")]
195 pub roles: Option<Vec<ComponentDefinitionRoles>>,
196 /// Specifies the PodSpec template used in the Component.
197 /// It includes the following elements:
198 ///
199 /// - Init containers
200 /// - Containers
201 /// - Image
202 /// - Commands
203 /// - Args
204 /// - Envs
205 /// - Mounts
206 /// - Ports
207 /// - Security context
208 /// - Probes
209 /// - Lifecycle
210 /// - Volumes
211 ///
212 /// This field is intended to define static settings that remain consistent across all instantiated Components.
213 /// Dynamic settings such as CPU and memory resource limits, as well as scheduling settings (affinity,
214 /// toleration, priority), may vary among different instantiated Components.
215 /// They should be specified in the `cluster.spec.componentSpecs` (ClusterComponentSpec).
216 ///
217 /// Specific instances of a Component may override settings defined here, such as using a different container image
218 /// or modifying environment variable values.
219 /// These instance-specific overrides can be specified in `cluster.spec.componentSpecs[*].instances`.
220 ///
221 /// This field is immutable and cannot be updated once set.
222 pub runtime: ComponentDefinitionRuntime,
223 /// Specifies groups of scripts, each provided via a ConfigMap, to be mounted as volumes in the container.
224 /// These scripts can be executed during container startup or via specific actions.
225 ///
226 /// Each script group is encapsulated in a ComponentTemplateSpec that includes:
227 ///
228 /// - The ConfigMap containing the scripts.
229 /// - The mount point where the scripts will be mounted inside the container.
230 ///
231 /// This field is immutable.
232 #[serde(default, skip_serializing_if = "Option::is_none")]
233 pub scripts: Option<Vec<ComponentDefinitionScripts>>,
234 /// Defines the type of well-known service protocol that the Component provides.
235 /// It specifies the standard or widely recognized protocol used by the Component to offer its Services.
236 ///
237 /// The `serviceKind` field allows users to quickly identify the type of Service provided by the Component
238 /// based on common protocols or service types. This information helps in understanding the compatibility,
239 /// interoperability, and usage of the Component within a system.
240 ///
241 /// Some examples of well-known service protocols include:
242 ///
243 /// - "MySQL": Indicates that the Component provides a MySQL database service.
244 /// - "PostgreSQL": Indicates that the Component offers a PostgreSQL database service.
245 /// - "Redis": Signifies that the Component functions as a Redis key-value store.
246 /// - "ETCD": Denotes that the Component serves as an ETCD distributed key-value store.
247 ///
248 /// The `serviceKind` value is case-insensitive, allowing for flexibility in specifying the protocol name.
249 ///
250 /// When specifying the `serviceKind`, consider the following guidelines:
251 ///
252 /// - Use well-established and widely recognized protocol names or service types.
253 /// - Ensure that the `serviceKind` accurately represents the primary service type offered by the Component.
254 /// - If the Component provides multiple services, choose the most prominent or commonly used protocol.
255 /// - Limit the `serviceKind` to a maximum of 32 characters for conciseness and readability.
256 ///
257 /// Note: The `serviceKind` field is optional and can be left empty if the Component does not fit into a well-known
258 /// service category or if the protocol is not widely recognized. It is primarily used to convey information about
259 /// the Component's service type to users and facilitate discovery and integration.
260 ///
261 /// The `serviceKind` field is immutable and cannot be updated.
262 #[serde(default, skip_serializing_if = "Option::is_none", rename = "serviceKind")]
263 pub service_kind: Option<String>,
264 /// Lists external service dependencies of the Component, including services from other Clusters or outside the K8s environment.
265 ///
266 /// This field is immutable.
267 #[serde(default, skip_serializing_if = "Option::is_none", rename = "serviceRefDeclarations")]
268 pub service_ref_declarations: Option<Vec<ComponentDefinitionServiceRefDeclarations>>,
269 /// Specifies the version of the Service provided by the Component.
270 /// It follows the syntax and semantics of the "Semantic Versioning" specification (<http://semver.org/).>
271 ///
272 /// The Semantic Versioning specification defines a version number format of X.Y.Z (MAJOR.MINOR.PATCH), where:
273 ///
274 /// - X represents the major version and indicates incompatible API changes.
275 /// - Y represents the minor version and indicates added functionality in a backward-compatible manner.
276 /// - Z represents the patch version and indicates backward-compatible bug fixes.
277 ///
278 /// Additional labels for pre-release and build metadata are available as extensions to the X.Y.Z format:
279 ///
280 /// - Use pre-release labels (e.g., -alpha, -beta) for versions that are not yet stable or ready for production use.
281 /// - Use build metadata (e.g., +build.1) for additional version information if needed.
282 ///
283 /// Examples of valid ServiceVersion values:
284 ///
285 /// - "1.0.0"
286 /// - "2.3.1"
287 /// - "3.0.0-alpha.1"
288 /// - "4.5.2+build.1"
289 ///
290 /// The `serviceVersion` field is immutable and cannot be updated.
291 #[serde(default, skip_serializing_if = "Option::is_none", rename = "serviceVersion")]
292 pub service_version: Option<String>,
293 /// Defines additional Services to expose the Component's endpoints.
294 ///
295 /// A default headless Service, named `{cluster.name}-{component.name}-headless`, is automatically created
296 /// for internal Cluster communication.
297 ///
298 /// This field enables customization of additional Services to expose the Component's endpoints to
299 /// other Components within the same or different Clusters, and to external applications.
300 /// Each Service entry in this list can include properties such as ports, type, and selectors.
301 ///
302 /// - For intra-Cluster access, Components can reference Services using variables declared in
303 /// `componentDefinition.spec.vars[*].valueFrom.serviceVarRef`.
304 /// - For inter-Cluster access, reference Services use variables declared in
305 /// `componentDefinition.spec.vars[*].valueFrom.serviceRefVarRef`,
306 /// and bind Services at Cluster creation time with `clusterComponentSpec.ServiceRef[*].clusterServiceSelector`.
307 ///
308 /// This field is immutable.
309 #[serde(default, skip_serializing_if = "Option::is_none")]
310 pub services: Option<Vec<ComponentDefinitionServices>>,
311 /// An array of `SystemAccount` objects that define the system accounts needed
312 /// for the management operations of the Component.
313 ///
314 /// Each `SystemAccount` includes:
315 ///
316 /// - Account name.
317 /// - The SQL statement template: Used to create the system account.
318 /// - Password Source: Either generated based on certain rules or retrieved from a Secret.
319 ///
320 /// Use cases for system accounts typically involve tasks like system initialization, backups, monitoring,
321 /// health checks, replication, and other system-level operations.
322 ///
323 /// System accounts are distinct from user accounts, although both are database accounts.
324 ///
325 /// - **System Accounts**: Created during Cluster setup by the KubeBlocks operator,
326 /// these accounts have higher privileges for system management and are fully managed
327 /// through a declarative API by the operator.
328 /// - **User Accounts**: Managed by users or administrator.
329 /// User account permissions should follow the principle of least privilege,
330 /// granting only the necessary access rights to complete their required tasks.
331 ///
332 /// This field is immutable.
333 #[serde(default, skip_serializing_if = "Option::is_none", rename = "systemAccounts")]
334 pub system_accounts: Option<Vec<ComponentDefinitionSystemAccounts>>,
335 /// Specifies the concurrency strategy for updating multiple instances of the Component.
336 /// Available strategies:
337 ///
338 /// - `Serial`: Updates replicas one at a time, ensuring minimal downtime by waiting for each replica to become ready
339 /// before updating the next.
340 /// - `Parallel`: Updates all replicas simultaneously, optimizing for speed but potentially reducing availability
341 /// during the update.
342 /// - `BestEffortParallel`: Updates replicas concurrently with a limit on simultaneous updates to ensure a minimum
343 /// number of operational replicas for maintaining quorum.
344 /// For example, in a 5-replica component, updating a maximum of 2 replicas simultaneously keeps
345 /// at least 3 operational for quorum.
346 ///
347 /// This field is immutable and defaults to 'Serial'.
348 #[serde(default, skip_serializing_if = "Option::is_none", rename = "updateStrategy")]
349 pub update_strategy: Option<ComponentDefinitionUpdateStrategy>,
350 /// Defines variables which are determined after Cluster instantiation and reflect
351 /// dynamic or runtime attributes of instantiated Clusters.
352 /// These variables serve as placeholders for setting environment variables in Pods and Actions,
353 /// or for rendering configuration and script templates before actual values are finalized.
354 ///
355 /// These variables are placed in front of the environment variables declared in the Pod if used as
356 /// environment variables.
357 ///
358 /// Variable values can be sourced from:
359 ///
360 /// - ConfigMap: Select and extract a value from a specific key within a ConfigMap.
361 /// - Secret: Select and extract a value from a specific key within a Secret.
362 /// - HostNetwork: Retrieves values (including ports) from host-network resources.
363 /// - Service: Retrieves values (including address, port, NodePort) from a selected Service.
364 /// Intended to obtain the address of a ComponentService within the same Cluster.
365 /// - Credential: Retrieves account name and password from a SystemAccount variable.
366 /// - ServiceRef: Retrieves address, port, account name and password from a selected ServiceRefDeclaration.
367 /// Designed to obtain the address bound to a ServiceRef, such as a ClusterService or
368 /// ComponentService of another cluster or an external service.
369 /// - Component: Retrieves values from a selected Component, including replicas and instance name list.
370 ///
371 /// This field is immutable.
372 #[serde(default, skip_serializing_if = "Option::is_none")]
373 pub vars: Option<Vec<ComponentDefinitionVars>>,
374 /// Defines the volumes used by the Component and some static attributes of the volumes.
375 /// After defining the volumes here, user can reference them in the
376 /// `cluster.spec.componentSpecs[*].volumeClaimTemplates` field to configure dynamic properties such as
377 /// volume capacity and storage class.
378 ///
379 /// This field allows you to specify the following:
380 ///
381 /// - Snapshot behavior: Determines whether a snapshot of the volume should be taken when performing
382 /// a snapshot backup of the Component.
383 /// - Disk high watermark: Sets the high watermark for the volume's disk usage.
384 /// When the disk usage reaches the specified threshold, it triggers an alert or action.
385 ///
386 /// By configuring these volume behaviors, you can control how the volumes are managed and monitored within the Component.
387 ///
388 /// This field is immutable.
389 #[serde(default, skip_serializing_if = "Option::is_none")]
390 pub volumes: Option<Vec<ComponentDefinitionVolumes>>,
391}
392
393#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
394pub struct ComponentDefinitionConfigs {
395 /// Specifies the containers to inject the ConfigMap parameters as environment variables.
396 ///
397 /// This is useful when application images accept parameters through environment variables and
398 /// generate the final configuration file in the startup script based on these variables.
399 ///
400 /// This field allows users to specify a list of container names, and KubeBlocks will inject the environment
401 /// variables converted from the ConfigMap into these designated containers. This provides a flexible way to
402 /// pass the configuration items from the ConfigMap to the container without modifying the image.
403 ///
404 /// Deprecated: `asEnvFrom` has been deprecated since 0.9.0 and will be removed in 0.10.0.
405 /// Use `injectEnvTo` instead.
406 #[serde(default, skip_serializing_if = "Option::is_none", rename = "asEnvFrom")]
407 pub as_env_from: Option<Vec<String>>,
408 /// Whether to store the final rendered parameters as a secret.
409 #[serde(default, skip_serializing_if = "Option::is_none", rename = "asSecret")]
410 pub as_secret: Option<bool>,
411 /// Specifies the name of the referenced configuration constraints object.
412 #[serde(default, skip_serializing_if = "Option::is_none", rename = "constraintRef")]
413 pub constraint_ref: Option<String>,
414 /// The operator attempts to set default file permissions for scripts (0555) and configurations (0444).
415 /// However, certain database engines may require different file permissions.
416 /// You can specify the desired file permissions here.
417 ///
418 /// Must be specified as an octal value between 0000 and 0777 (inclusive),
419 /// or as a decimal value between 0 and 511 (inclusive).
420 /// YAML supports both octal and decimal values for file permissions.
421 ///
422 /// Please note that this setting only affects the permissions of the files themselves.
423 /// Directories within the specified path are not impacted by this setting.
424 /// It's important to be aware that this setting might conflict with other options
425 /// that influence the file mode, such as fsGroup.
426 /// In such cases, the resulting file mode may have additional bits set.
427 /// Refers to documents of k8s.ConfigMapVolumeSource.defaultMode for more information.
428 #[serde(default, skip_serializing_if = "Option::is_none", rename = "defaultMode")]
429 pub default_mode: Option<i32>,
430 /// Specifies the containers to inject the ConfigMap parameters as environment variables.
431 ///
432 /// This is useful when application images accept parameters through environment variables and
433 /// generate the final configuration file in the startup script based on these variables.
434 ///
435 /// This field allows users to specify a list of container names, and KubeBlocks will inject the environment
436 /// variables converted from the ConfigMap into these designated containers. This provides a flexible way to
437 /// pass the configuration items from the ConfigMap to the container without modifying the image.
438 #[serde(default, skip_serializing_if = "Option::is_none", rename = "injectEnvTo")]
439 pub inject_env_to: Option<Vec<String>>,
440 /// Specifies the configuration files within the ConfigMap that support dynamic updates.
441 ///
442 /// A configuration template (provided in the form of a ConfigMap) may contain templates for multiple
443 /// configuration files.
444 /// Each configuration file corresponds to a key in the ConfigMap.
445 /// Some of these configuration files may support dynamic modification and reloading without requiring
446 /// a pod restart.
447 ///
448 /// If empty or omitted, all configuration files in the ConfigMap are assumed to support dynamic updates,
449 /// and ConfigConstraint applies to all keys.
450 #[serde(default, skip_serializing_if = "Option::is_none")]
451 pub keys: Option<Vec<String>>,
452 /// Specifies the secondary rendered config spec for pod-specific customization.
453 ///
454 /// The template is rendered inside the pod (by the "config-manager" sidecar container) and merged with the main
455 /// template's render result to generate the final configuration file.
456 ///
457 /// This field is intended to handle scenarios where different pods within the same Component have
458 /// varying configurations. It allows for pod-specific customization of the configuration.
459 ///
460 /// Note: This field will be deprecated in future versions, and the functionality will be moved to
461 /// `cluster.spec.componentSpecs[*].instances[*]`.
462 #[serde(default, skip_serializing_if = "Option::is_none", rename = "legacyRenderedConfigSpec")]
463 pub legacy_rendered_config_spec: Option<ComponentDefinitionConfigsLegacyRenderedConfigSpec>,
464 /// Specifies the name of the configuration template.
465 pub name: String,
466 /// Specifies the namespace of the referenced configuration template ConfigMap object.
467 /// An empty namespace is equivalent to the "default" namespace.
468 #[serde(default, skip_serializing_if = "Option::is_none")]
469 pub namespace: Option<String>,
470 /// Specifies whether the configuration needs to be re-rendered after v-scale or h-scale operations to reflect changes.
471 ///
472 /// In some scenarios, the configuration may need to be updated to reflect the changes in resource allocation
473 /// or cluster topology. Examples:
474 ///
475 /// - Redis: adjust maxmemory after v-scale operation.
476 /// - MySQL: increase max connections after v-scale operation.
477 /// - Zookeeper: update zoo.cfg with new node addresses after h-scale operation.
478 #[serde(default, skip_serializing_if = "Option::is_none", rename = "reRenderResourceTypes")]
479 pub re_render_resource_types: Option<Vec<String>>,
480 /// Specifies the name of the referenced configuration template ConfigMap object.
481 #[serde(default, skip_serializing_if = "Option::is_none", rename = "templateRef")]
482 pub template_ref: Option<String>,
483 /// Refers to the volume name of PodTemplate. The configuration file produced through the configuration
484 /// template will be mounted to the corresponding volume. Must be a DNS_LABEL name.
485 /// The volume name must be defined in podSpec.containers[*].volumeMounts.
486 #[serde(default, skip_serializing_if = "Option::is_none", rename = "volumeName")]
487 pub volume_name: Option<String>,
488}
489
490/// Specifies the secondary rendered config spec for pod-specific customization.
491///
492/// The template is rendered inside the pod (by the "config-manager" sidecar container) and merged with the main
493/// template's render result to generate the final configuration file.
494///
495/// This field is intended to handle scenarios where different pods within the same Component have
496/// varying configurations. It allows for pod-specific customization of the configuration.
497///
498/// Note: This field will be deprecated in future versions, and the functionality will be moved to
499/// `cluster.spec.componentSpecs[*].instances[*]`.
500#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
501pub struct ComponentDefinitionConfigsLegacyRenderedConfigSpec {
502 /// Specifies the namespace of the referenced configuration template ConfigMap object.
503 /// An empty namespace is equivalent to the "default" namespace.
504 #[serde(default, skip_serializing_if = "Option::is_none")]
505 pub namespace: Option<String>,
506 /// Defines the strategy for merging externally imported templates into component templates.
507 #[serde(default, skip_serializing_if = "Option::is_none")]
508 pub policy: Option<ComponentDefinitionConfigsLegacyRenderedConfigSpecPolicy>,
509 /// Specifies the name of the referenced configuration template ConfigMap object.
510 #[serde(rename = "templateRef")]
511 pub template_ref: String,
512}
513
514/// Specifies the secondary rendered config spec for pod-specific customization.
515///
516/// The template is rendered inside the pod (by the "config-manager" sidecar container) and merged with the main
517/// template's render result to generate the final configuration file.
518///
519/// This field is intended to handle scenarios where different pods within the same Component have
520/// varying configurations. It allows for pod-specific customization of the configuration.
521///
522/// Note: This field will be deprecated in future versions, and the functionality will be moved to
523/// `cluster.spec.componentSpecs[*].instances[*]`.
524#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
525pub enum ComponentDefinitionConfigsLegacyRenderedConfigSpecPolicy {
526 #[serde(rename = "patch")]
527 Patch,
528 #[serde(rename = "replace")]
529 Replace,
530 #[serde(rename = "none")]
531 None,
532}
533
534/// Defines the built-in metrics exporter container.
535#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
536pub struct ComponentDefinitionExporter {
537 /// Specifies the name of the built-in metrics exporter container.
538 #[serde(default, skip_serializing_if = "Option::is_none", rename = "containerName")]
539 pub container_name: Option<String>,
540 /// Specifies the http/https url path to scrape for metrics.
541 /// If empty, Prometheus uses the default value (e.g. `/metrics`).
542 #[serde(default, skip_serializing_if = "Option::is_none", rename = "scrapePath")]
543 pub scrape_path: Option<String>,
544 /// Specifies the port name to scrape for metrics.
545 #[serde(default, skip_serializing_if = "Option::is_none", rename = "scrapePort")]
546 pub scrape_port: Option<String>,
547 /// Specifies the schema to use for scraping.
548 /// `http` and `https` are the expected values unless you rewrite the `__scheme__` label via relabeling.
549 /// If empty, Prometheus uses the default value `http`.
550 #[serde(default, skip_serializing_if = "Option::is_none", rename = "scrapeScheme")]
551 pub scrape_scheme: Option<ComponentDefinitionExporterScrapeScheme>,
552}
553
554/// Defines the built-in metrics exporter container.
555#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
556pub enum ComponentDefinitionExporterScrapeScheme {
557 #[serde(rename = "http")]
558 Http,
559 #[serde(rename = "https")]
560 Https,
561}
562
563/// Specifies the host network configuration for the Component.
564///
565/// When `hostNetwork` option is enabled, the Pods share the host's network namespace and can directly access
566/// the host's network interfaces.
567/// This means that if multiple Pods need to use the same port, they cannot run on the same host simultaneously
568/// due to port conflicts.
569///
570/// The DNSPolicy field in the Pod spec determines how containers within the Pod perform DNS resolution.
571/// When using hostNetwork, the operator will set the DNSPolicy to 'ClusterFirstWithHostNet'.
572/// With this policy, DNS queries will first go through the K8s cluster's DNS service.
573/// If the query fails, it will fall back to the host's DNS settings.
574///
575/// If set, the DNS policy will be automatically set to "ClusterFirstWithHostNet".
576///
577/// This field is immutable.
578#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
579pub struct ComponentDefinitionHostNetwork {
580 /// The list of container ports that are required by the component.
581 #[serde(default, skip_serializing_if = "Option::is_none", rename = "containerPorts")]
582 pub container_ports: Option<Vec<ComponentDefinitionHostNetworkContainerPorts>>,
583}
584
585#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
586pub struct ComponentDefinitionHostNetworkContainerPorts {
587 /// Container specifies the target container within the Pod.
588 pub container: String,
589 /// Ports are named container ports within the specified container.
590 /// These container ports must be defined in the container for proper port allocation.
591 pub ports: Vec<String>,
592}
593
594/// Defines a set of hooks and procedures that customize the behavior of a Component throughout its lifecycle.
595/// Actions are triggered at specific lifecycle stages:
596///
597/// - `postProvision`: Defines the hook to be executed after the creation of a Component,
598/// with `preCondition` specifying when the action should be fired relative to the Component's lifecycle stages:
599/// `Immediately`, `RuntimeReady`, `ComponentReady`, and `ClusterReady`.
600/// - `preTerminate`: Defines the hook to be executed before terminating a Component.
601/// - `roleProbe`: Defines the procedure which is invoked regularly to assess the role of replicas.
602/// - `switchover`: Defines the procedure for a controlled transition of leadership from the current leader to a new replica.
603/// This approach aims to minimize downtime and maintain availability in systems with a leader-follower topology,
604/// such as before planned maintenance or upgrades on the current leader node.
605/// - `memberJoin`: Defines the procedure to add a new replica to the replication group.
606/// - `memberLeave`: Defines the method to remove a replica from the replication group.
607/// - `readOnly`: Defines the procedure to switch a replica into the read-only state.
608/// - `readWrite`: transition a replica from the read-only state back to the read-write state.
609/// - `dataDump`: Defines the procedure to export the data from a replica.
610/// - `dataLoad`: Defines the procedure to import data into a replica.
611/// - `reconfigure`: Defines the procedure that update a replica with new configuration file.
612/// - `accountProvision`: Defines the procedure to generate a new database account.
613///
614/// This field is immutable.
615#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
616pub struct ComponentDefinitionLifecycleActions {
617 /// Defines the procedure to generate a new database account.
618 ///
619 /// Use Case:
620 /// This action is designed to create system accounts that are utilized for replication, monitoring, backup,
621 /// and other administrative tasks.
622 ///
623 /// Note: This field is immutable once it has been set.
624 #[serde(default, skip_serializing_if = "Option::is_none", rename = "accountProvision")]
625 pub account_provision: Option<ComponentDefinitionLifecycleActionsAccountProvision>,
626 /// Defines the procedure for exporting the data from a replica.
627 ///
628 /// Use Case:
629 /// This action is intended for initializing a newly created replica with data. It involves exporting data
630 /// from an existing replica and importing it into the new, empty replica. This is essential for synchronizing
631 /// the state of replicas across the system.
632 ///
633 /// Applicability:
634 /// Some database engines or associated sidecar applications (e.g., Patroni) may already provide this functionality.
635 /// In such cases, this action may not be required.
636 ///
637 /// The output should be a valid data dump streamed to stdout. It must exclude any irrelevant information to ensure
638 /// that only the necessary data is exported for import into the new replica.
639 ///
640 /// Note: This field is immutable once it has been set.
641 #[serde(default, skip_serializing_if = "Option::is_none", rename = "dataDump")]
642 pub data_dump: Option<ComponentDefinitionLifecycleActionsDataDump>,
643 /// Defines the procedure for importing data into a replica.
644 ///
645 /// Use Case:
646 /// This action is intended for initializing a newly created replica with data. It involves exporting data
647 /// from an existing replica and importing it into the new, empty replica. This is essential for synchronizing
648 /// the state of replicas across the system.
649 ///
650 /// Some database engines or associated sidecar applications (e.g., Patroni) may already provide this functionality.
651 /// In such cases, this action may not be required.
652 ///
653 /// Data should be received through stdin. If any error occurs during the process,
654 /// the action must be able to guarantee idempotence to allow for retries from the beginning.
655 ///
656 /// Note: This field is immutable once it has been set.
657 #[serde(default, skip_serializing_if = "Option::is_none", rename = "dataLoad")]
658 pub data_load: Option<ComponentDefinitionLifecycleActionsDataLoad>,
659 /// Defines the procedure to add a new replica to the replication group.
660 ///
661 /// This action is initiated after a replica pod becomes ready.
662 ///
663 /// The role of the replica (e.g., primary, secondary) will be determined and assigned as part of the action command
664 /// implementation, or automatically by the database kernel or a sidecar utility like Patroni that implements
665 /// a consensus algorithm.
666 ///
667 /// The container executing this action has access to following environment variables:
668 ///
669 /// - KB_SERVICE_PORT: The port used by the database service.
670 /// - KB_SERVICE_USER: The username with the necessary permissions to interact with the database service.
671 /// - KB_SERVICE_PASSWORD: The corresponding password for KB_SERVICE_USER to authenticate with the database service.
672 /// - KB_PRIMARY_POD_FQDN: The FQDN of the primary Pod within the replication group.
673 /// - KB_MEMBER_ADDRESSES: A comma-separated list of Pod addresses for all replicas in the group.
674 /// - KB_NEW_MEMBER_POD_NAME: The pod name of the replica being added to the group.
675 /// - KB_NEW_MEMBER_POD_IP: The IP address of the replica being added to the group.
676 ///
677 /// Expected action output:
678 /// - On Failure: An error message detailing the reason for any failure encountered
679 /// during the addition of the new member.
680 ///
681 /// For example, to add a new OBServer to an OceanBase Cluster in 'zone1', the following command may be used:
682 ///
683 /// ```text
684 /// command:
685 /// - bash
686 /// - -c
687 /// - |
688 /// ADDRESS=$(KB_MEMBER_ADDRESSES%%,*)
689 /// HOST=$(echo $ADDRESS | cut -d ':' -f 1)
690 /// PORT=$(echo $ADDRESS | cut -d ':' -f 2)
691 /// CLIENT="mysql -u $KB_SERVICE_USER -p$KB_SERVICE_PASSWORD -P $PORT -h $HOST -e"
692 /// $CLIENT "ALTER SYSTEM ADD SERVER '$KB_NEW_MEMBER_POD_IP:$KB_SERVICE_PORT' ZONE 'zone1'"
693 /// ```
694 ///
695 /// Note: This field is immutable once it has been set.
696 #[serde(default, skip_serializing_if = "Option::is_none", rename = "memberJoin")]
697 pub member_join: Option<ComponentDefinitionLifecycleActionsMemberJoin>,
698 /// Defines the procedure to remove a replica from the replication group.
699 ///
700 /// This action is initiated before remove a replica from the group.
701 /// The operator will wait for MemberLeave to complete successfully before releasing the replica and cleaning up
702 /// related Kubernetes resources.
703 ///
704 /// The process typically includes updating configurations and informing other group members about the removal.
705 /// Data migration is generally not part of this action and should be handled separately if needed.
706 ///
707 /// The container executing this action has access to following environment variables:
708 ///
709 /// - KB_SERVICE_PORT: The port used by the database service.
710 /// - KB_SERVICE_USER: The username with the necessary permissions to interact with the database service.
711 /// - KB_SERVICE_PASSWORD: The corresponding password for KB_SERVICE_USER to authenticate with the database service.
712 /// - KB_PRIMARY_POD_FQDN: The FQDN of the primary Pod within the replication group.
713 /// - KB_MEMBER_ADDRESSES: A comma-separated list of Pod addresses for all replicas in the group.
714 /// - KB_LEAVE_MEMBER_POD_NAME: The pod name of the replica being removed from the group.
715 /// - KB_LEAVE_MEMBER_POD_IP: The IP address of the replica being removed from the group.
716 ///
717 /// Expected action output:
718 /// - On Failure: An error message, if applicable, indicating why the action failed.
719 ///
720 /// For example, to remove an OBServer from an OceanBase Cluster in 'zone1', the following command can be executed:
721 ///
722 /// ```text
723 /// command:
724 /// - bash
725 /// - -c
726 /// - |
727 /// ADDRESS=$(KB_MEMBER_ADDRESSES%%,*)
728 /// HOST=$(echo $ADDRESS | cut -d ':' -f 1)
729 /// PORT=$(echo $ADDRESS | cut -d ':' -f 2)
730 /// CLIENT="mysql -u $KB_SERVICE_USER -p$KB_SERVICE_PASSWORD -P $PORT -h $HOST -e"
731 /// $CLIENT "ALTER SYSTEM DELETE SERVER '$KB_LEAVE_MEMBER_POD_IP:$KB_SERVICE_PORT' ZONE 'zone1'"
732 /// ```
733 ///
734 /// Note: This field is immutable once it has been set.
735 #[serde(default, skip_serializing_if = "Option::is_none", rename = "memberLeave")]
736 pub member_leave: Option<ComponentDefinitionLifecycleActionsMemberLeave>,
737 /// Specifies the hook to be executed after a component's creation.
738 ///
739 /// By setting `postProvision.customHandler.preCondition`, you can determine the specific lifecycle stage
740 /// at which the action should trigger: `Immediately`, `RuntimeReady`, `ComponentReady`, and `ClusterReady`.
741 /// with `ComponentReady` being the default.
742 ///
743 /// The PostProvision Action is intended to run only once.
744 ///
745 /// The container executing this action has access to following environment variables:
746 ///
747 /// - KB_CLUSTER_POD_IP_LIST: Comma-separated list of the cluster's pod IP addresses (e.g., "podIp1,podIp2").
748 /// - KB_CLUSTER_POD_NAME_LIST: Comma-separated list of the cluster's pod names (e.g., "pod1,pod2").
749 /// - KB_CLUSTER_POD_HOST_NAME_LIST: Comma-separated list of host names, each corresponding to a pod in
750 /// KB_CLUSTER_POD_NAME_LIST (e.g., "hostName1,hostName2").
751 /// - KB_CLUSTER_POD_HOST_IP_LIST: Comma-separated list of host IP addresses, each corresponding to a pod in
752 /// KB_CLUSTER_POD_NAME_LIST (e.g., "hostIp1,hostIp2").
753 ///
754 /// - KB_CLUSTER_COMPONENT_POD_NAME_LIST: Comma-separated list of all pod names within the component
755 /// (e.g., "pod1,pod2").
756 /// - KB_CLUSTER_COMPONENT_POD_IP_LIST: Comma-separated list of pod IP addresses,
757 /// matching the order of pods in KB_CLUSTER_COMPONENT_POD_NAME_LIST (e.g., "podIp1,podIp2").
758 /// - KB_CLUSTER_COMPONENT_POD_HOST_NAME_LIST: Comma-separated list of host names for each pod,
759 /// matching the order of pods in KB_CLUSTER_COMPONENT_POD_NAME_LIST (e.g., "hostName1,hostName2").
760 /// - KB_CLUSTER_COMPONENT_POD_HOST_IP_LIST: Comma-separated list of host IP addresses for each pod,
761 /// matching the order of pods in KB_CLUSTER_COMPONENT_POD_NAME_LIST (e.g., "hostIp1,hostIp2").
762 ///
763 /// - KB_CLUSTER_COMPONENT_LIST: Comma-separated list of all cluster components (e.g., "comp1,comp2").
764 /// - KB_CLUSTER_COMPONENT_DELETING_LIST: Comma-separated list of components that are currently being deleted
765 /// (e.g., "comp1,comp2").
766 /// - KB_CLUSTER_COMPONENT_UNDELETED_LIST: Comma-separated list of components that are not being deleted
767 /// (e.g., "comp1,comp2").
768 ///
769 /// Note: This field is immutable once it has been set.
770 #[serde(default, skip_serializing_if = "Option::is_none", rename = "postProvision")]
771 pub post_provision: Option<ComponentDefinitionLifecycleActionsPostProvision>,
772 /// Specifies the hook to be executed prior to terminating a component.
773 ///
774 /// The PreTerminate Action is intended to run only once.
775 ///
776 /// This action is executed immediately when a scale-down operation for the Component is initiated.
777 /// The actual termination and cleanup of the Component and its associated resources will not proceed
778 /// until the PreTerminate action has completed successfully.
779 ///
780 /// The container executing this action has access to following environment variables:
781 ///
782 /// - KB_CLUSTER_POD_IP_LIST: Comma-separated list of the cluster's pod IP addresses (e.g., "podIp1,podIp2").
783 /// - KB_CLUSTER_POD_NAME_LIST: Comma-separated list of the cluster's pod names (e.g., "pod1,pod2").
784 /// - KB_CLUSTER_POD_HOST_NAME_LIST: Comma-separated list of host names, each corresponding to a pod in
785 /// KB_CLUSTER_POD_NAME_LIST (e.g., "hostName1,hostName2").
786 /// - KB_CLUSTER_POD_HOST_IP_LIST: Comma-separated list of host IP addresses, each corresponding to a pod in
787 /// KB_CLUSTER_POD_NAME_LIST (e.g., "hostIp1,hostIp2").
788 ///
789 /// - KB_CLUSTER_COMPONENT_POD_NAME_LIST: Comma-separated list of all pod names within the component
790 /// (e.g., "pod1,pod2").
791 /// - KB_CLUSTER_COMPONENT_POD_IP_LIST: Comma-separated list of pod IP addresses,
792 /// matching the order of pods in KB_CLUSTER_COMPONENT_POD_NAME_LIST (e.g., "podIp1,podIp2").
793 /// - KB_CLUSTER_COMPONENT_POD_HOST_NAME_LIST: Comma-separated list of host names for each pod,
794 /// matching the order of pods in KB_CLUSTER_COMPONENT_POD_NAME_LIST (e.g., "hostName1,hostName2").
795 /// - KB_CLUSTER_COMPONENT_POD_HOST_IP_LIST: Comma-separated list of host IP addresses for each pod,
796 /// matching the order of pods in KB_CLUSTER_COMPONENT_POD_NAME_LIST (e.g., "hostIp1,hostIp2").
797 ///
798 /// - KB_CLUSTER_COMPONENT_LIST: Comma-separated list of all cluster components (e.g., "comp1,comp2").
799 /// - KB_CLUSTER_COMPONENT_DELETING_LIST: Comma-separated list of components that are currently being deleted
800 /// (e.g., "comp1,comp2").
801 /// - KB_CLUSTER_COMPONENT_UNDELETED_LIST: Comma-separated list of components that are not being deleted
802 /// (e.g., "comp1,comp2").
803 ///
804 /// - KB_CLUSTER_COMPONENT_IS_SCALING_IN: Indicates whether the component is currently scaling in.
805 /// If this variable is present and set to "true", it denotes that the component is undergoing a scale-in operation.
806 /// During scale-in, data rebalancing is necessary to maintain cluster integrity.
807 /// Contrast this with a cluster deletion scenario where data rebalancing is not required as the entire cluster
808 /// is being cleaned up.
809 ///
810 /// Note: This field is immutable once it has been set.
811 #[serde(default, skip_serializing_if = "Option::is_none", rename = "preTerminate")]
812 pub pre_terminate: Option<ComponentDefinitionLifecycleActionsPreTerminate>,
813 /// Defines the procedure to switch a replica into the read-only state.
814 ///
815 /// Use Case:
816 /// This action is invoked when the database's volume capacity nears its upper limit and space is about to be exhausted.
817 ///
818 /// The container executing this action has access to following environment variables:
819 ///
820 /// - KB_POD_FQDN: The FQDN of the replica pod whose role is being checked.
821 /// - KB_SERVICE_PORT: The port used by the database service.
822 /// - KB_SERVICE_USER: The username with the necessary permissions to interact with the database service.
823 /// - KB_SERVICE_PASSWORD: The corresponding password for KB_SERVICE_USER to authenticate with the database service.
824 ///
825 /// Expected action output:
826 /// - On Failure: An error message, if applicable, indicating why the action failed.
827 ///
828 /// Note: This field is immutable once it has been set.
829 #[serde(default, skip_serializing_if = "Option::is_none")]
830 pub readonly: Option<ComponentDefinitionLifecycleActionsReadonly>,
831 /// Defines the procedure to transition a replica from the read-only state back to the read-write state.
832 ///
833 /// Use Case:
834 /// This action is used to bring back a replica that was previously in a read-only state,
835 /// which restricted write operations, to its normal operational state where it can handle
836 /// both read and write operations.
837 ///
838 /// The container executing this action has access to following environment variables:
839 ///
840 /// - KB_POD_FQDN: The FQDN of the replica pod whose role is being checked.
841 /// - KB_SERVICE_PORT: The port used by the database service.
842 /// - KB_SERVICE_USER: The username with the necessary permissions to interact with the database service.
843 /// - KB_SERVICE_PASSWORD: The corresponding password for KB_SERVICE_USER to authenticate with the database service.
844 ///
845 /// Expected action output:
846 /// - On Failure: An error message, if applicable, indicating why the action failed.
847 ///
848 /// Note: This field is immutable once it has been set.
849 #[serde(default, skip_serializing_if = "Option::is_none")]
850 pub readwrite: Option<ComponentDefinitionLifecycleActionsReadwrite>,
851 /// Defines the procedure that update a replica with new configuration.
852 ///
853 /// Note: This field is immutable once it has been set.
854 ///
855 /// This Action is reserved for future versions.
856 #[serde(default, skip_serializing_if = "Option::is_none")]
857 pub reconfigure: Option<ComponentDefinitionLifecycleActionsReconfigure>,
858 /// Defines the procedure which is invoked regularly to assess the role of replicas.
859 ///
860 /// This action is periodically triggered by Lorry at the specified interval to determine the role of each replica.
861 /// Upon successful execution, the action's output designates the role of the replica,
862 /// which should match one of the predefined role names within `componentDefinition.spec.roles`.
863 /// The output is then compared with the previous successful execution result.
864 /// If a role change is detected, an event is generated to inform the controller,
865 /// which initiates an update of the replica's role.
866 ///
867 /// Defining a RoleProbe Action for a Component is required if roles are defined for the Component.
868 /// It ensures replicas are correctly labeled with their respective roles.
869 /// Without this, services that rely on roleSelectors might improperly direct traffic to wrong replicas.
870 ///
871 /// The container executing this action has access to following environment variables:
872 ///
873 /// - KB_POD_FQDN: The FQDN of the Pod whose role is being assessed.
874 /// - KB_SERVICE_PORT: The port used by the database service.
875 /// - KB_SERVICE_USER: The username with the necessary permissions to interact with the database service.
876 /// - KB_SERVICE_PASSWORD: The corresponding password for KB_SERVICE_USER to authenticate with the database service.
877 ///
878 /// Expected output of this action:
879 /// - On Success: The determined role of the replica, which must align with one of the roles specified
880 /// in the component definition.
881 /// - On Failure: An error message, if applicable, indicating why the action failed.
882 ///
883 /// Note: This field is immutable once it has been set.
884 #[serde(default, skip_serializing_if = "Option::is_none", rename = "roleProbe")]
885 pub role_probe: Option<ComponentDefinitionLifecycleActionsRoleProbe>,
886 /// Defines the procedure for a controlled transition of leadership from the current leader to a new replica.
887 /// This approach aims to minimize downtime and maintain availability in systems with a leader-follower topology,
888 /// during events such as planned maintenance or when performing stop, shutdown, restart, or upgrade operations
889 /// involving the current leader node.
890 ///
891 /// The container executing this action has access to following environment variables:
892 ///
893 /// - KB_SWITCHOVER_CANDIDATE_NAME: The name of the pod for the new leader candidate, which may not be specified (empty).
894 /// - KB_SWITCHOVER_CANDIDATE_FQDN: The FQDN of the new leader candidate's pod, which may not be specified (empty).
895 /// - KB_LEADER_POD_IP: The IP address of the current leader's pod prior to the switchover.
896 /// - KB_LEADER_POD_NAME: The name of the current leader's pod prior to the switchover.
897 /// - KB_LEADER_POD_FQDN: The FQDN of the current leader's pod prior to the switchover.
898 ///
899 /// The environment variables with the following prefixes are deprecated and will be removed in future releases:
900 ///
901 /// - KB_REPLICATION_PRIMARY_POD_
902 /// - KB_CONSENSUS_LEADER_POD_
903 ///
904 /// Note: This field is immutable once it has been set.
905 #[serde(default, skip_serializing_if = "Option::is_none")]
906 pub switchover: Option<ComponentDefinitionLifecycleActionsSwitchover>,
907}
908
909/// Defines the procedure to generate a new database account.
910///
911/// Use Case:
912/// This action is designed to create system accounts that are utilized for replication, monitoring, backup,
913/// and other administrative tasks.
914///
915/// Note: This field is immutable once it has been set.
916#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
917pub struct ComponentDefinitionLifecycleActionsAccountProvision {
918 /// Specifies the name of the predefined action handler to be invoked for lifecycle actions.
919 ///
920 /// Lorry, as a sidecar agent co-located with the database container in the same Pod,
921 /// includes a suite of built-in action implementations that are tailored to different database engines.
922 /// These are known as "builtin" handlers, includes: `mysql`, `redis`, `mongodb`, `etcd`,
923 /// `postgresql`, `vanilla-postgresql`, `apecloud-postgresql`, `wesql`, `oceanbase`, `polardbx`.
924 ///
925 /// If the `builtinHandler` field is specified, it instructs Lorry to utilize its internal built-in action handler
926 /// to execute the specified lifecycle actions.
927 ///
928 /// The `builtinHandler` field is of type `BuiltinActionHandlerType`,
929 /// which represents the name of the built-in handler.
930 /// The `builtinHandler` specified within the same `ComponentLifecycleActions` should be consistent across all
931 /// actions.
932 /// This means that if you specify a built-in handler for one action, you should use the same handler
933 /// for all other actions throughout the entire `ComponentLifecycleActions` collection.
934 ///
935 /// If you need to define lifecycle actions for database engines not covered by the existing built-in support,
936 /// or when the pre-existing built-in handlers do not meet your specific needs,
937 /// you can use the `customHandler` field to define your own action implementation.
938 ///
939 /// Deprecation Notice:
940 ///
941 /// - In the future, the `builtinHandler` field will be deprecated in favor of using the `customHandler` field
942 /// for configuring all lifecycle actions.
943 /// - Instead of using a name to indicate the built-in action implementations in Lorry,
944 /// the recommended approach will be to explicitly invoke the desired action implementation through
945 /// a gRPC interface exposed by the sidecar agent.
946 /// - Developers will have the flexibility to either use the built-in action implementations provided by Lorry
947 /// or develop their own sidecar agent to implement custom actions and expose them via gRPC interfaces.
948 /// - This change will allow for greater customization and extensibility of lifecycle actions,
949 /// as developers can create their own "builtin" implementations tailored to their specific requirements.
950 #[serde(default, skip_serializing_if = "Option::is_none", rename = "builtinHandler")]
951 pub builtin_handler: Option<String>,
952 /// Specifies a user-defined hook or procedure that is called to perform the specific lifecycle action.
953 /// It offers a flexible and expandable approach for customizing the behavior of a Component by leveraging
954 /// tailored actions.
955 ///
956 /// An Action can be implemented as either an ExecAction or an HTTPAction, with future versions planning
957 /// to support GRPCAction,
958 /// thereby accommodating unique logic for different database systems within the Action's framework.
959 ///
960 /// In future iterations, all built-in handlers are expected to transition to GRPCAction.
961 /// This change means that Lorry or other sidecar agents will expose the implementation of actions
962 /// through a GRPC interface for external invocation.
963 /// Then the controller will interact with these actions via GRPCAction calls.
964 #[serde(default, skip_serializing_if = "Option::is_none", rename = "customHandler")]
965 pub custom_handler: Option<ComponentDefinitionLifecycleActionsAccountProvisionCustomHandler>,
966}
967
968/// Specifies a user-defined hook or procedure that is called to perform the specific lifecycle action.
969/// It offers a flexible and expandable approach for customizing the behavior of a Component by leveraging
970/// tailored actions.
971///
972/// An Action can be implemented as either an ExecAction or an HTTPAction, with future versions planning
973/// to support GRPCAction,
974/// thereby accommodating unique logic for different database systems within the Action's framework.
975///
976/// In future iterations, all built-in handlers are expected to transition to GRPCAction.
977/// This change means that Lorry or other sidecar agents will expose the implementation of actions
978/// through a GRPC interface for external invocation.
979/// Then the controller will interact with these actions via GRPCAction calls.
980#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
981pub struct ComponentDefinitionLifecycleActionsAccountProvisionCustomHandler {
982 /// Defines the name of the container within the target Pod where the action will be executed.
983 ///
984 /// This name must correspond to one of the containers defined in `componentDefinition.spec.runtime`.
985 /// If this field is not specified, the default behavior is to use the first container listed in
986 /// `componentDefinition.spec.runtime`.
987 ///
988 /// This field cannot be updated.
989 ///
990 /// Note: This field is reserved for future use and is not currently active.
991 #[serde(default, skip_serializing_if = "Option::is_none")]
992 pub container: Option<String>,
993 /// Represents a list of environment variables that will be injected into the container.
994 /// These variables enable the container to adapt its behavior based on the environment it's running in.
995 ///
996 /// This field cannot be updated.
997 #[serde(default, skip_serializing_if = "Option::is_none")]
998 pub env: Option<Vec<ComponentDefinitionLifecycleActionsAccountProvisionCustomHandlerEnv>>,
999 /// Defines the command to run.
1000 ///
1001 /// This field cannot be updated.
1002 #[serde(default, skip_serializing_if = "Option::is_none")]
1003 pub exec: Option<ComponentDefinitionLifecycleActionsAccountProvisionCustomHandlerExec>,
1004 /// Specifies the HTTP request to perform.
1005 ///
1006 /// This field cannot be updated.
1007 ///
1008 /// Note: HTTPAction is to be implemented in future version.
1009 #[serde(default, skip_serializing_if = "Option::is_none")]
1010 pub http: Option<ComponentDefinitionLifecycleActionsAccountProvisionCustomHandlerHttp>,
1011 /// Specifies the container image to be used for running the Action.
1012 ///
1013 /// When specified, a dedicated container will be created using this image to execute the Action.
1014 /// This field is mutually exclusive with the `container` field; only one of them should be provided.
1015 ///
1016 /// This field cannot be updated.
1017 #[serde(default, skip_serializing_if = "Option::is_none")]
1018 pub image: Option<String>,
1019 /// Used in conjunction with the `targetPodSelector` field to refine the selection of target pod(s) for Action execution.
1020 /// The impact of this field depends on the `targetPodSelector` value:
1021 ///
1022 /// - When `targetPodSelector` is set to `Any` or `All`, this field will be ignored.
1023 /// - When `targetPodSelector` is set to `Role`, only those replicas whose role matches the `matchingKey`
1024 /// will be selected for the Action.
1025 ///
1026 /// This field cannot be updated.
1027 ///
1028 /// Note: This field is reserved for future use and is not currently active.
1029 #[serde(default, skip_serializing_if = "Option::is_none", rename = "matchingKey")]
1030 pub matching_key: Option<String>,
1031 /// Specifies the state that the cluster must reach before the Action is executed.
1032 /// Currently, this is only applicable to the `postProvision` action.
1033 ///
1034 /// The conditions are as follows:
1035 ///
1036 /// - `Immediately`: Executed right after the Component object is created.
1037 /// The readiness of the Component and its resources is not guaranteed at this stage.
1038 /// - `RuntimeReady`: The Action is triggered after the Component object has been created and all associated
1039 /// runtime resources (e.g. Pods) are in a ready state.
1040 /// - `ComponentReady`: The Action is triggered after the Component itself is in a ready state.
1041 /// This process does not affect the readiness state of the Component or the Cluster.
1042 /// - `ClusterReady`: The Action is executed after the Cluster is in a ready state.
1043 /// This execution does not alter the Component or the Cluster's state of readiness.
1044 ///
1045 /// This field cannot be updated.
1046 #[serde(default, skip_serializing_if = "Option::is_none", rename = "preCondition")]
1047 pub pre_condition: Option<String>,
1048 /// Defines the strategy to be taken when retrying the Action after a failure.
1049 ///
1050 /// It specifies the conditions under which the Action should be retried and the limits to apply,
1051 /// such as the maximum number of retries and backoff strategy.
1052 ///
1053 /// This field cannot be updated.
1054 #[serde(default, skip_serializing_if = "Option::is_none", rename = "retryPolicy")]
1055 pub retry_policy: Option<ComponentDefinitionLifecycleActionsAccountProvisionCustomHandlerRetryPolicy>,
1056 /// Defines the criteria used to select the target Pod(s) for executing the Action.
1057 /// This is useful when there is no default target replica identified.
1058 /// It allows for precise control over which Pod(s) the Action should run in.
1059 ///
1060 /// This field cannot be updated.
1061 ///
1062 /// Note: This field is reserved for future use and is not currently active.
1063 #[serde(default, skip_serializing_if = "Option::is_none", rename = "targetPodSelector")]
1064 pub target_pod_selector: Option<ComponentDefinitionLifecycleActionsAccountProvisionCustomHandlerTargetPodSelector>,
1065 /// Specifies the maximum duration in seconds that the Action is allowed to run.
1066 ///
1067 /// If the Action does not complete within this time frame, it will be terminated.
1068 ///
1069 /// This field cannot be updated.
1070 #[serde(default, skip_serializing_if = "Option::is_none", rename = "timeoutSeconds")]
1071 pub timeout_seconds: Option<i32>,
1072}
1073
1074/// EnvVar represents an environment variable present in a Container.
1075#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
1076pub struct ComponentDefinitionLifecycleActionsAccountProvisionCustomHandlerEnv {
1077 /// Name of the environment variable. Must be a C_IDENTIFIER.
1078 pub name: String,
1079 /// Variable references $(VAR_NAME) are expanded
1080 /// using the previously defined environment variables in the container and
1081 /// any service environment variables. If a variable cannot be resolved,
1082 /// the reference in the input string will be unchanged. Double $$ are reduced
1083 /// to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e.
1084 /// "$$(VAR_NAME)" will produce the string literal "$(VAR_NAME)".
1085 /// Escaped references will never be expanded, regardless of whether the variable
1086 /// exists or not.
1087 /// Defaults to "".
1088 #[serde(default, skip_serializing_if = "Option::is_none")]
1089 pub value: Option<String>,
1090 /// Source for the environment variable's value. Cannot be used if value is not empty.
1091 #[serde(default, skip_serializing_if = "Option::is_none", rename = "valueFrom")]
1092 pub value_from: Option<ComponentDefinitionLifecycleActionsAccountProvisionCustomHandlerEnvValueFrom>,
1093}
1094
1095/// Source for the environment variable's value. Cannot be used if value is not empty.
1096#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
1097pub struct ComponentDefinitionLifecycleActionsAccountProvisionCustomHandlerEnvValueFrom {
1098 /// Selects a key of a ConfigMap.
1099 #[serde(default, skip_serializing_if = "Option::is_none", rename = "configMapKeyRef")]
1100 pub config_map_key_ref: Option<ComponentDefinitionLifecycleActionsAccountProvisionCustomHandlerEnvValueFromConfigMapKeyRef>,
1101 /// Selects a field of the pod: supports metadata.name, metadata.namespace, `metadata.labels['<KEY>']`, `metadata.annotations['<KEY>']`,
1102 /// spec.nodeName, spec.serviceAccountName, status.hostIP, status.podIP, status.podIPs.
1103 #[serde(default, skip_serializing_if = "Option::is_none", rename = "fieldRef")]
1104 pub field_ref: Option<ComponentDefinitionLifecycleActionsAccountProvisionCustomHandlerEnvValueFromFieldRef>,
1105 /// Selects a resource of the container: only resources limits and requests
1106 /// (limits.cpu, limits.memory, limits.ephemeral-storage, requests.cpu, requests.memory and requests.ephemeral-storage) are currently supported.
1107 #[serde(default, skip_serializing_if = "Option::is_none", rename = "resourceFieldRef")]
1108 pub resource_field_ref: Option<ComponentDefinitionLifecycleActionsAccountProvisionCustomHandlerEnvValueFromResourceFieldRef>,
1109 /// Selects a key of a secret in the pod's namespace
1110 #[serde(default, skip_serializing_if = "Option::is_none", rename = "secretKeyRef")]
1111 pub secret_key_ref: Option<ComponentDefinitionLifecycleActionsAccountProvisionCustomHandlerEnvValueFromSecretKeyRef>,
1112}
1113
1114/// Selects a key of a ConfigMap.
1115#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
1116pub struct ComponentDefinitionLifecycleActionsAccountProvisionCustomHandlerEnvValueFromConfigMapKeyRef {
1117 /// The key to select.
1118 pub key: String,
1119 /// Name of the referent.
1120 /// More info: <https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names>
1121 #[serde(default, skip_serializing_if = "Option::is_none")]
1122 pub name: Option<String>,
1123 /// Specify whether the ConfigMap or its key must be defined
1124 #[serde(default, skip_serializing_if = "Option::is_none")]
1125 pub optional: Option<bool>,
1126}
1127
1128/// Selects a field of the pod: supports metadata.name, metadata.namespace, `metadata.labels['<KEY>']`, `metadata.annotations['<KEY>']`,
1129/// spec.nodeName, spec.serviceAccountName, status.hostIP, status.podIP, status.podIPs.
1130#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
1131pub struct ComponentDefinitionLifecycleActionsAccountProvisionCustomHandlerEnvValueFromFieldRef {
1132 /// Version of the schema the FieldPath is written in terms of, defaults to "v1".
1133 #[serde(default, skip_serializing_if = "Option::is_none", rename = "apiVersion")]
1134 pub api_version: Option<String>,
1135 /// Path of the field to select in the specified API version.
1136 #[serde(rename = "fieldPath")]
1137 pub field_path: String,
1138}
1139
1140/// Selects a resource of the container: only resources limits and requests
1141/// (limits.cpu, limits.memory, limits.ephemeral-storage, requests.cpu, requests.memory and requests.ephemeral-storage) are currently supported.
1142#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
1143pub struct ComponentDefinitionLifecycleActionsAccountProvisionCustomHandlerEnvValueFromResourceFieldRef {
1144 /// Container name: required for volumes, optional for env vars
1145 #[serde(default, skip_serializing_if = "Option::is_none", rename = "containerName")]
1146 pub container_name: Option<String>,
1147 /// Specifies the output format of the exposed resources, defaults to "1"
1148 #[serde(default, skip_serializing_if = "Option::is_none")]
1149 pub divisor: Option<IntOrString>,
1150 /// Required: resource to select
1151 pub resource: String,
1152}
1153
1154/// Selects a key of a secret in the pod's namespace
1155#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
1156pub struct ComponentDefinitionLifecycleActionsAccountProvisionCustomHandlerEnvValueFromSecretKeyRef {
1157 /// The key of the secret to select from. Must be a valid secret key.
1158 pub key: String,
1159 /// Name of the referent.
1160 /// More info: <https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names>
1161 #[serde(default, skip_serializing_if = "Option::is_none")]
1162 pub name: Option<String>,
1163 /// Specify whether the Secret or its key must be defined
1164 #[serde(default, skip_serializing_if = "Option::is_none")]
1165 pub optional: Option<bool>,
1166}
1167
1168/// Defines the command to run.
1169///
1170/// This field cannot be updated.
1171#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
1172pub struct ComponentDefinitionLifecycleActionsAccountProvisionCustomHandlerExec {
1173 /// Args represents the arguments that are passed to the `command` for execution.
1174 #[serde(default, skip_serializing_if = "Option::is_none")]
1175 pub args: Option<Vec<String>>,
1176 /// Specifies the command to be executed inside the container.
1177 /// The working directory for this command is the container's root directory('/').
1178 /// Commands are executed directly without a shell environment, meaning shell-specific syntax ('|', etc.) is not supported.
1179 /// If the shell is required, it must be explicitly invoked in the command.
1180 ///
1181 /// A successful execution is indicated by an exit status of 0; any non-zero status signifies a failure.
1182 #[serde(default, skip_serializing_if = "Option::is_none")]
1183 pub command: Option<Vec<String>>,
1184}
1185
1186/// Specifies the HTTP request to perform.
1187///
1188/// This field cannot be updated.
1189///
1190/// Note: HTTPAction is to be implemented in future version.
1191#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
1192pub struct ComponentDefinitionLifecycleActionsAccountProvisionCustomHandlerHttp {
1193 /// Indicates the server's domain name or IP address. Defaults to the Pod's IP.
1194 /// Prefer setting the "Host" header in httpHeaders when needed.
1195 #[serde(default, skip_serializing_if = "Option::is_none")]
1196 pub host: Option<String>,
1197 /// Allows for the inclusion of custom headers in the request.
1198 /// HTTP permits the use of repeated headers.
1199 #[serde(default, skip_serializing_if = "Option::is_none", rename = "httpHeaders")]
1200 pub http_headers: Option<Vec<ComponentDefinitionLifecycleActionsAccountProvisionCustomHandlerHttpHttpHeaders>>,
1201 /// Represents the type of HTTP request to be made, such as "GET," "POST," "PUT," etc.
1202 /// If not specified, "GET" is the default method.
1203 #[serde(default, skip_serializing_if = "Option::is_none")]
1204 pub method: Option<String>,
1205 /// Specifies the endpoint to be requested on the HTTP server.
1206 #[serde(default, skip_serializing_if = "Option::is_none")]
1207 pub path: Option<String>,
1208 /// Specifies the target port for the HTTP request.
1209 /// It can be specified either as a numeric value in the range of 1 to 65535,
1210 /// or as a named port that meets the IANA_SVC_NAME specification.
1211 pub port: IntOrString,
1212 /// Designates the protocol used to make the request, such as HTTP or HTTPS.
1213 /// If not specified, HTTP is used by default.
1214 #[serde(default, skip_serializing_if = "Option::is_none")]
1215 pub scheme: Option<String>,
1216}
1217
1218/// HTTPHeader describes a custom header to be used in HTTP probes
1219#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
1220pub struct ComponentDefinitionLifecycleActionsAccountProvisionCustomHandlerHttpHttpHeaders {
1221 /// The header field name.
1222 /// This will be canonicalized upon output, so case-variant names will be understood as the same header.
1223 pub name: String,
1224 /// The header field value
1225 pub value: String,
1226}
1227
1228/// Defines the strategy to be taken when retrying the Action after a failure.
1229///
1230/// It specifies the conditions under which the Action should be retried and the limits to apply,
1231/// such as the maximum number of retries and backoff strategy.
1232///
1233/// This field cannot be updated.
1234#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
1235pub struct ComponentDefinitionLifecycleActionsAccountProvisionCustomHandlerRetryPolicy {
1236 /// Defines the maximum number of retry attempts that should be made for a given Action.
1237 /// This value is set to 0 by default, indicating that no retries will be made.
1238 #[serde(default, skip_serializing_if = "Option::is_none", rename = "maxRetries")]
1239 pub max_retries: Option<i64>,
1240 /// Indicates the duration of time to wait between each retry attempt.
1241 /// This value is set to 0 by default, indicating that there will be no delay between retry attempts.
1242 #[serde(default, skip_serializing_if = "Option::is_none", rename = "retryInterval")]
1243 pub retry_interval: Option<i64>,
1244}
1245
1246/// Specifies a user-defined hook or procedure that is called to perform the specific lifecycle action.
1247/// It offers a flexible and expandable approach for customizing the behavior of a Component by leveraging
1248/// tailored actions.
1249///
1250/// An Action can be implemented as either an ExecAction or an HTTPAction, with future versions planning
1251/// to support GRPCAction,
1252/// thereby accommodating unique logic for different database systems within the Action's framework.
1253///
1254/// In future iterations, all built-in handlers are expected to transition to GRPCAction.
1255/// This change means that Lorry or other sidecar agents will expose the implementation of actions
1256/// through a GRPC interface for external invocation.
1257/// Then the controller will interact with these actions via GRPCAction calls.
1258#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
1259pub enum ComponentDefinitionLifecycleActionsAccountProvisionCustomHandlerTargetPodSelector {
1260 Any,
1261 All,
1262 Role,
1263 Ordinal,
1264}
1265
1266/// Defines the procedure for exporting the data from a replica.
1267///
1268/// Use Case:
1269/// This action is intended for initializing a newly created replica with data. It involves exporting data
1270/// from an existing replica and importing it into the new, empty replica. This is essential for synchronizing
1271/// the state of replicas across the system.
1272///
1273/// Applicability:
1274/// Some database engines or associated sidecar applications (e.g., Patroni) may already provide this functionality.
1275/// In such cases, this action may not be required.
1276///
1277/// The output should be a valid data dump streamed to stdout. It must exclude any irrelevant information to ensure
1278/// that only the necessary data is exported for import into the new replica.
1279///
1280/// Note: This field is immutable once it has been set.
1281#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
1282pub struct ComponentDefinitionLifecycleActionsDataDump {
1283 /// Specifies the name of the predefined action handler to be invoked for lifecycle actions.
1284 ///
1285 /// Lorry, as a sidecar agent co-located with the database container in the same Pod,
1286 /// includes a suite of built-in action implementations that are tailored to different database engines.
1287 /// These are known as "builtin" handlers, includes: `mysql`, `redis`, `mongodb`, `etcd`,
1288 /// `postgresql`, `vanilla-postgresql`, `apecloud-postgresql`, `wesql`, `oceanbase`, `polardbx`.
1289 ///
1290 /// If the `builtinHandler` field is specified, it instructs Lorry to utilize its internal built-in action handler
1291 /// to execute the specified lifecycle actions.
1292 ///
1293 /// The `builtinHandler` field is of type `BuiltinActionHandlerType`,
1294 /// which represents the name of the built-in handler.
1295 /// The `builtinHandler` specified within the same `ComponentLifecycleActions` should be consistent across all
1296 /// actions.
1297 /// This means that if you specify a built-in handler for one action, you should use the same handler
1298 /// for all other actions throughout the entire `ComponentLifecycleActions` collection.
1299 ///
1300 /// If you need to define lifecycle actions for database engines not covered by the existing built-in support,
1301 /// or when the pre-existing built-in handlers do not meet your specific needs,
1302 /// you can use the `customHandler` field to define your own action implementation.
1303 ///
1304 /// Deprecation Notice:
1305 ///
1306 /// - In the future, the `builtinHandler` field will be deprecated in favor of using the `customHandler` field
1307 /// for configuring all lifecycle actions.
1308 /// - Instead of using a name to indicate the built-in action implementations in Lorry,
1309 /// the recommended approach will be to explicitly invoke the desired action implementation through
1310 /// a gRPC interface exposed by the sidecar agent.
1311 /// - Developers will have the flexibility to either use the built-in action implementations provided by Lorry
1312 /// or develop their own sidecar agent to implement custom actions and expose them via gRPC interfaces.
1313 /// - This change will allow for greater customization and extensibility of lifecycle actions,
1314 /// as developers can create their own "builtin" implementations tailored to their specific requirements.
1315 #[serde(default, skip_serializing_if = "Option::is_none", rename = "builtinHandler")]
1316 pub builtin_handler: Option<String>,
1317 /// Specifies a user-defined hook or procedure that is called to perform the specific lifecycle action.
1318 /// It offers a flexible and expandable approach for customizing the behavior of a Component by leveraging
1319 /// tailored actions.
1320 ///
1321 /// An Action can be implemented as either an ExecAction or an HTTPAction, with future versions planning
1322 /// to support GRPCAction,
1323 /// thereby accommodating unique logic for different database systems within the Action's framework.
1324 ///
1325 /// In future iterations, all built-in handlers are expected to transition to GRPCAction.
1326 /// This change means that Lorry or other sidecar agents will expose the implementation of actions
1327 /// through a GRPC interface for external invocation.
1328 /// Then the controller will interact with these actions via GRPCAction calls.
1329 #[serde(default, skip_serializing_if = "Option::is_none", rename = "customHandler")]
1330 pub custom_handler: Option<ComponentDefinitionLifecycleActionsDataDumpCustomHandler>,
1331}
1332
1333/// Specifies a user-defined hook or procedure that is called to perform the specific lifecycle action.
1334/// It offers a flexible and expandable approach for customizing the behavior of a Component by leveraging
1335/// tailored actions.
1336///
1337/// An Action can be implemented as either an ExecAction or an HTTPAction, with future versions planning
1338/// to support GRPCAction,
1339/// thereby accommodating unique logic for different database systems within the Action's framework.
1340///
1341/// In future iterations, all built-in handlers are expected to transition to GRPCAction.
1342/// This change means that Lorry or other sidecar agents will expose the implementation of actions
1343/// through a GRPC interface for external invocation.
1344/// Then the controller will interact with these actions via GRPCAction calls.
1345#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
1346pub struct ComponentDefinitionLifecycleActionsDataDumpCustomHandler {
1347 /// Defines the name of the container within the target Pod where the action will be executed.
1348 ///
1349 /// This name must correspond to one of the containers defined in `componentDefinition.spec.runtime`.
1350 /// If this field is not specified, the default behavior is to use the first container listed in
1351 /// `componentDefinition.spec.runtime`.
1352 ///
1353 /// This field cannot be updated.
1354 ///
1355 /// Note: This field is reserved for future use and is not currently active.
1356 #[serde(default, skip_serializing_if = "Option::is_none")]
1357 pub container: Option<String>,
1358 /// Represents a list of environment variables that will be injected into the container.
1359 /// These variables enable the container to adapt its behavior based on the environment it's running in.
1360 ///
1361 /// This field cannot be updated.
1362 #[serde(default, skip_serializing_if = "Option::is_none")]
1363 pub env: Option<Vec<ComponentDefinitionLifecycleActionsDataDumpCustomHandlerEnv>>,
1364 /// Defines the command to run.
1365 ///
1366 /// This field cannot be updated.
1367 #[serde(default, skip_serializing_if = "Option::is_none")]
1368 pub exec: Option<ComponentDefinitionLifecycleActionsDataDumpCustomHandlerExec>,
1369 /// Specifies the HTTP request to perform.
1370 ///
1371 /// This field cannot be updated.
1372 ///
1373 /// Note: HTTPAction is to be implemented in future version.
1374 #[serde(default, skip_serializing_if = "Option::is_none")]
1375 pub http: Option<ComponentDefinitionLifecycleActionsDataDumpCustomHandlerHttp>,
1376 /// Specifies the container image to be used for running the Action.
1377 ///
1378 /// When specified, a dedicated container will be created using this image to execute the Action.
1379 /// This field is mutually exclusive with the `container` field; only one of them should be provided.
1380 ///
1381 /// This field cannot be updated.
1382 #[serde(default, skip_serializing_if = "Option::is_none")]
1383 pub image: Option<String>,
1384 /// Used in conjunction with the `targetPodSelector` field to refine the selection of target pod(s) for Action execution.
1385 /// The impact of this field depends on the `targetPodSelector` value:
1386 ///
1387 /// - When `targetPodSelector` is set to `Any` or `All`, this field will be ignored.
1388 /// - When `targetPodSelector` is set to `Role`, only those replicas whose role matches the `matchingKey`
1389 /// will be selected for the Action.
1390 ///
1391 /// This field cannot be updated.
1392 ///
1393 /// Note: This field is reserved for future use and is not currently active.
1394 #[serde(default, skip_serializing_if = "Option::is_none", rename = "matchingKey")]
1395 pub matching_key: Option<String>,
1396 /// Specifies the state that the cluster must reach before the Action is executed.
1397 /// Currently, this is only applicable to the `postProvision` action.
1398 ///
1399 /// The conditions are as follows:
1400 ///
1401 /// - `Immediately`: Executed right after the Component object is created.
1402 /// The readiness of the Component and its resources is not guaranteed at this stage.
1403 /// - `RuntimeReady`: The Action is triggered after the Component object has been created and all associated
1404 /// runtime resources (e.g. Pods) are in a ready state.
1405 /// - `ComponentReady`: The Action is triggered after the Component itself is in a ready state.
1406 /// This process does not affect the readiness state of the Component or the Cluster.
1407 /// - `ClusterReady`: The Action is executed after the Cluster is in a ready state.
1408 /// This execution does not alter the Component or the Cluster's state of readiness.
1409 ///
1410 /// This field cannot be updated.
1411 #[serde(default, skip_serializing_if = "Option::is_none", rename = "preCondition")]
1412 pub pre_condition: Option<String>,
1413 /// Defines the strategy to be taken when retrying the Action after a failure.
1414 ///
1415 /// It specifies the conditions under which the Action should be retried and the limits to apply,
1416 /// such as the maximum number of retries and backoff strategy.
1417 ///
1418 /// This field cannot be updated.
1419 #[serde(default, skip_serializing_if = "Option::is_none", rename = "retryPolicy")]
1420 pub retry_policy: Option<ComponentDefinitionLifecycleActionsDataDumpCustomHandlerRetryPolicy>,
1421 /// Defines the criteria used to select the target Pod(s) for executing the Action.
1422 /// This is useful when there is no default target replica identified.
1423 /// It allows for precise control over which Pod(s) the Action should run in.
1424 ///
1425 /// This field cannot be updated.
1426 ///
1427 /// Note: This field is reserved for future use and is not currently active.
1428 #[serde(default, skip_serializing_if = "Option::is_none", rename = "targetPodSelector")]
1429 pub target_pod_selector: Option<ComponentDefinitionLifecycleActionsDataDumpCustomHandlerTargetPodSelector>,
1430 /// Specifies the maximum duration in seconds that the Action is allowed to run.
1431 ///
1432 /// If the Action does not complete within this time frame, it will be terminated.
1433 ///
1434 /// This field cannot be updated.
1435 #[serde(default, skip_serializing_if = "Option::is_none", rename = "timeoutSeconds")]
1436 pub timeout_seconds: Option<i32>,
1437}
1438
1439/// EnvVar represents an environment variable present in a Container.
1440#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
1441pub struct ComponentDefinitionLifecycleActionsDataDumpCustomHandlerEnv {
1442 /// Name of the environment variable. Must be a C_IDENTIFIER.
1443 pub name: String,
1444 /// Variable references $(VAR_NAME) are expanded
1445 /// using the previously defined environment variables in the container and
1446 /// any service environment variables. If a variable cannot be resolved,
1447 /// the reference in the input string will be unchanged. Double $$ are reduced
1448 /// to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e.
1449 /// "$$(VAR_NAME)" will produce the string literal "$(VAR_NAME)".
1450 /// Escaped references will never be expanded, regardless of whether the variable
1451 /// exists or not.
1452 /// Defaults to "".
1453 #[serde(default, skip_serializing_if = "Option::is_none")]
1454 pub value: Option<String>,
1455 /// Source for the environment variable's value. Cannot be used if value is not empty.
1456 #[serde(default, skip_serializing_if = "Option::is_none", rename = "valueFrom")]
1457 pub value_from: Option<ComponentDefinitionLifecycleActionsDataDumpCustomHandlerEnvValueFrom>,
1458}
1459
1460/// Source for the environment variable's value. Cannot be used if value is not empty.
1461#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
1462pub struct ComponentDefinitionLifecycleActionsDataDumpCustomHandlerEnvValueFrom {
1463 /// Selects a key of a ConfigMap.
1464 #[serde(default, skip_serializing_if = "Option::is_none", rename = "configMapKeyRef")]
1465 pub config_map_key_ref: Option<ComponentDefinitionLifecycleActionsDataDumpCustomHandlerEnvValueFromConfigMapKeyRef>,
1466 /// Selects a field of the pod: supports metadata.name, metadata.namespace, `metadata.labels['<KEY>']`, `metadata.annotations['<KEY>']`,
1467 /// spec.nodeName, spec.serviceAccountName, status.hostIP, status.podIP, status.podIPs.
1468 #[serde(default, skip_serializing_if = "Option::is_none", rename = "fieldRef")]
1469 pub field_ref: Option<ComponentDefinitionLifecycleActionsDataDumpCustomHandlerEnvValueFromFieldRef>,
1470 /// Selects a resource of the container: only resources limits and requests
1471 /// (limits.cpu, limits.memory, limits.ephemeral-storage, requests.cpu, requests.memory and requests.ephemeral-storage) are currently supported.
1472 #[serde(default, skip_serializing_if = "Option::is_none", rename = "resourceFieldRef")]
1473 pub resource_field_ref: Option<ComponentDefinitionLifecycleActionsDataDumpCustomHandlerEnvValueFromResourceFieldRef>,
1474 /// Selects a key of a secret in the pod's namespace
1475 #[serde(default, skip_serializing_if = "Option::is_none", rename = "secretKeyRef")]
1476 pub secret_key_ref: Option<ComponentDefinitionLifecycleActionsDataDumpCustomHandlerEnvValueFromSecretKeyRef>,
1477}
1478
1479/// Selects a key of a ConfigMap.
1480#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
1481pub struct ComponentDefinitionLifecycleActionsDataDumpCustomHandlerEnvValueFromConfigMapKeyRef {
1482 /// The key to select.
1483 pub key: String,
1484 /// Name of the referent.
1485 /// More info: <https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names>
1486 #[serde(default, skip_serializing_if = "Option::is_none")]
1487 pub name: Option<String>,
1488 /// Specify whether the ConfigMap or its key must be defined
1489 #[serde(default, skip_serializing_if = "Option::is_none")]
1490 pub optional: Option<bool>,
1491}
1492
1493/// Selects a field of the pod: supports metadata.name, metadata.namespace, `metadata.labels['<KEY>']`, `metadata.annotations['<KEY>']`,
1494/// spec.nodeName, spec.serviceAccountName, status.hostIP, status.podIP, status.podIPs.
1495#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
1496pub struct ComponentDefinitionLifecycleActionsDataDumpCustomHandlerEnvValueFromFieldRef {
1497 /// Version of the schema the FieldPath is written in terms of, defaults to "v1".
1498 #[serde(default, skip_serializing_if = "Option::is_none", rename = "apiVersion")]
1499 pub api_version: Option<String>,
1500 /// Path of the field to select in the specified API version.
1501 #[serde(rename = "fieldPath")]
1502 pub field_path: String,
1503}
1504
1505/// Selects a resource of the container: only resources limits and requests
1506/// (limits.cpu, limits.memory, limits.ephemeral-storage, requests.cpu, requests.memory and requests.ephemeral-storage) are currently supported.
1507#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
1508pub struct ComponentDefinitionLifecycleActionsDataDumpCustomHandlerEnvValueFromResourceFieldRef {
1509 /// Container name: required for volumes, optional for env vars
1510 #[serde(default, skip_serializing_if = "Option::is_none", rename = "containerName")]
1511 pub container_name: Option<String>,
1512 /// Specifies the output format of the exposed resources, defaults to "1"
1513 #[serde(default, skip_serializing_if = "Option::is_none")]
1514 pub divisor: Option<IntOrString>,
1515 /// Required: resource to select
1516 pub resource: String,
1517}
1518
1519/// Selects a key of a secret in the pod's namespace
1520#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
1521pub struct ComponentDefinitionLifecycleActionsDataDumpCustomHandlerEnvValueFromSecretKeyRef {
1522 /// The key of the secret to select from. Must be a valid secret key.
1523 pub key: String,
1524 /// Name of the referent.
1525 /// More info: <https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names>
1526 #[serde(default, skip_serializing_if = "Option::is_none")]
1527 pub name: Option<String>,
1528 /// Specify whether the Secret or its key must be defined
1529 #[serde(default, skip_serializing_if = "Option::is_none")]
1530 pub optional: Option<bool>,
1531}
1532
1533/// Defines the command to run.
1534///
1535/// This field cannot be updated.
1536#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
1537pub struct ComponentDefinitionLifecycleActionsDataDumpCustomHandlerExec {
1538 /// Args represents the arguments that are passed to the `command` for execution.
1539 #[serde(default, skip_serializing_if = "Option::is_none")]
1540 pub args: Option<Vec<String>>,
1541 /// Specifies the command to be executed inside the container.
1542 /// The working directory for this command is the container's root directory('/').
1543 /// Commands are executed directly without a shell environment, meaning shell-specific syntax ('|', etc.) is not supported.
1544 /// If the shell is required, it must be explicitly invoked in the command.
1545 ///
1546 /// A successful execution is indicated by an exit status of 0; any non-zero status signifies a failure.
1547 #[serde(default, skip_serializing_if = "Option::is_none")]
1548 pub command: Option<Vec<String>>,
1549}
1550
1551/// Specifies the HTTP request to perform.
1552///
1553/// This field cannot be updated.
1554///
1555/// Note: HTTPAction is to be implemented in future version.
1556#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
1557pub struct ComponentDefinitionLifecycleActionsDataDumpCustomHandlerHttp {
1558 /// Indicates the server's domain name or IP address. Defaults to the Pod's IP.
1559 /// Prefer setting the "Host" header in httpHeaders when needed.
1560 #[serde(default, skip_serializing_if = "Option::is_none")]
1561 pub host: Option<String>,
1562 /// Allows for the inclusion of custom headers in the request.
1563 /// HTTP permits the use of repeated headers.
1564 #[serde(default, skip_serializing_if = "Option::is_none", rename = "httpHeaders")]
1565 pub http_headers: Option<Vec<ComponentDefinitionLifecycleActionsDataDumpCustomHandlerHttpHttpHeaders>>,
1566 /// Represents the type of HTTP request to be made, such as "GET," "POST," "PUT," etc.
1567 /// If not specified, "GET" is the default method.
1568 #[serde(default, skip_serializing_if = "Option::is_none")]
1569 pub method: Option<String>,
1570 /// Specifies the endpoint to be requested on the HTTP server.
1571 #[serde(default, skip_serializing_if = "Option::is_none")]
1572 pub path: Option<String>,
1573 /// Specifies the target port for the HTTP request.
1574 /// It can be specified either as a numeric value in the range of 1 to 65535,
1575 /// or as a named port that meets the IANA_SVC_NAME specification.
1576 pub port: IntOrString,
1577 /// Designates the protocol used to make the request, such as HTTP or HTTPS.
1578 /// If not specified, HTTP is used by default.
1579 #[serde(default, skip_serializing_if = "Option::is_none")]
1580 pub scheme: Option<String>,
1581}
1582
1583/// HTTPHeader describes a custom header to be used in HTTP probes
1584#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
1585pub struct ComponentDefinitionLifecycleActionsDataDumpCustomHandlerHttpHttpHeaders {
1586 /// The header field name.
1587 /// This will be canonicalized upon output, so case-variant names will be understood as the same header.
1588 pub name: String,
1589 /// The header field value
1590 pub value: String,
1591}
1592
1593/// Defines the strategy to be taken when retrying the Action after a failure.
1594///
1595/// It specifies the conditions under which the Action should be retried and the limits to apply,
1596/// such as the maximum number of retries and backoff strategy.
1597///
1598/// This field cannot be updated.
1599#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
1600pub struct ComponentDefinitionLifecycleActionsDataDumpCustomHandlerRetryPolicy {
1601 /// Defines the maximum number of retry attempts that should be made for a given Action.
1602 /// This value is set to 0 by default, indicating that no retries will be made.
1603 #[serde(default, skip_serializing_if = "Option::is_none", rename = "maxRetries")]
1604 pub max_retries: Option<i64>,
1605 /// Indicates the duration of time to wait between each retry attempt.
1606 /// This value is set to 0 by default, indicating that there will be no delay between retry attempts.
1607 #[serde(default, skip_serializing_if = "Option::is_none", rename = "retryInterval")]
1608 pub retry_interval: Option<i64>,
1609}
1610
1611/// Specifies a user-defined hook or procedure that is called to perform the specific lifecycle action.
1612/// It offers a flexible and expandable approach for customizing the behavior of a Component by leveraging
1613/// tailored actions.
1614///
1615/// An Action can be implemented as either an ExecAction or an HTTPAction, with future versions planning
1616/// to support GRPCAction,
1617/// thereby accommodating unique logic for different database systems within the Action's framework.
1618///
1619/// In future iterations, all built-in handlers are expected to transition to GRPCAction.
1620/// This change means that Lorry or other sidecar agents will expose the implementation of actions
1621/// through a GRPC interface for external invocation.
1622/// Then the controller will interact with these actions via GRPCAction calls.
1623#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
1624pub enum ComponentDefinitionLifecycleActionsDataDumpCustomHandlerTargetPodSelector {
1625 Any,
1626 All,
1627 Role,
1628 Ordinal,
1629}
1630
1631/// Defines the procedure for importing data into a replica.
1632///
1633/// Use Case:
1634/// This action is intended for initializing a newly created replica with data. It involves exporting data
1635/// from an existing replica and importing it into the new, empty replica. This is essential for synchronizing
1636/// the state of replicas across the system.
1637///
1638/// Some database engines or associated sidecar applications (e.g., Patroni) may already provide this functionality.
1639/// In such cases, this action may not be required.
1640///
1641/// Data should be received through stdin. If any error occurs during the process,
1642/// the action must be able to guarantee idempotence to allow for retries from the beginning.
1643///
1644/// Note: This field is immutable once it has been set.
1645#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
1646pub struct ComponentDefinitionLifecycleActionsDataLoad {
1647 /// Specifies the name of the predefined action handler to be invoked for lifecycle actions.
1648 ///
1649 /// Lorry, as a sidecar agent co-located with the database container in the same Pod,
1650 /// includes a suite of built-in action implementations that are tailored to different database engines.
1651 /// These are known as "builtin" handlers, includes: `mysql`, `redis`, `mongodb`, `etcd`,
1652 /// `postgresql`, `vanilla-postgresql`, `apecloud-postgresql`, `wesql`, `oceanbase`, `polardbx`.
1653 ///
1654 /// If the `builtinHandler` field is specified, it instructs Lorry to utilize its internal built-in action handler
1655 /// to execute the specified lifecycle actions.
1656 ///
1657 /// The `builtinHandler` field is of type `BuiltinActionHandlerType`,
1658 /// which represents the name of the built-in handler.
1659 /// The `builtinHandler` specified within the same `ComponentLifecycleActions` should be consistent across all
1660 /// actions.
1661 /// This means that if you specify a built-in handler for one action, you should use the same handler
1662 /// for all other actions throughout the entire `ComponentLifecycleActions` collection.
1663 ///
1664 /// If you need to define lifecycle actions for database engines not covered by the existing built-in support,
1665 /// or when the pre-existing built-in handlers do not meet your specific needs,
1666 /// you can use the `customHandler` field to define your own action implementation.
1667 ///
1668 /// Deprecation Notice:
1669 ///
1670 /// - In the future, the `builtinHandler` field will be deprecated in favor of using the `customHandler` field
1671 /// for configuring all lifecycle actions.
1672 /// - Instead of using a name to indicate the built-in action implementations in Lorry,
1673 /// the recommended approach will be to explicitly invoke the desired action implementation through
1674 /// a gRPC interface exposed by the sidecar agent.
1675 /// - Developers will have the flexibility to either use the built-in action implementations provided by Lorry
1676 /// or develop their own sidecar agent to implement custom actions and expose them via gRPC interfaces.
1677 /// - This change will allow for greater customization and extensibility of lifecycle actions,
1678 /// as developers can create their own "builtin" implementations tailored to their specific requirements.
1679 #[serde(default, skip_serializing_if = "Option::is_none", rename = "builtinHandler")]
1680 pub builtin_handler: Option<String>,
1681 /// Specifies a user-defined hook or procedure that is called to perform the specific lifecycle action.
1682 /// It offers a flexible and expandable approach for customizing the behavior of a Component by leveraging
1683 /// tailored actions.
1684 ///
1685 /// An Action can be implemented as either an ExecAction or an HTTPAction, with future versions planning
1686 /// to support GRPCAction,
1687 /// thereby accommodating unique logic for different database systems within the Action's framework.
1688 ///
1689 /// In future iterations, all built-in handlers are expected to transition to GRPCAction.
1690 /// This change means that Lorry or other sidecar agents will expose the implementation of actions
1691 /// through a GRPC interface for external invocation.
1692 /// Then the controller will interact with these actions via GRPCAction calls.
1693 #[serde(default, skip_serializing_if = "Option::is_none", rename = "customHandler")]
1694 pub custom_handler: Option<ComponentDefinitionLifecycleActionsDataLoadCustomHandler>,
1695}
1696
1697/// Specifies a user-defined hook or procedure that is called to perform the specific lifecycle action.
1698/// It offers a flexible and expandable approach for customizing the behavior of a Component by leveraging
1699/// tailored actions.
1700///
1701/// An Action can be implemented as either an ExecAction or an HTTPAction, with future versions planning
1702/// to support GRPCAction,
1703/// thereby accommodating unique logic for different database systems within the Action's framework.
1704///
1705/// In future iterations, all built-in handlers are expected to transition to GRPCAction.
1706/// This change means that Lorry or other sidecar agents will expose the implementation of actions
1707/// through a GRPC interface for external invocation.
1708/// Then the controller will interact with these actions via GRPCAction calls.
1709#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
1710pub struct ComponentDefinitionLifecycleActionsDataLoadCustomHandler {
1711 /// Defines the name of the container within the target Pod where the action will be executed.
1712 ///
1713 /// This name must correspond to one of the containers defined in `componentDefinition.spec.runtime`.
1714 /// If this field is not specified, the default behavior is to use the first container listed in
1715 /// `componentDefinition.spec.runtime`.
1716 ///
1717 /// This field cannot be updated.
1718 ///
1719 /// Note: This field is reserved for future use and is not currently active.
1720 #[serde(default, skip_serializing_if = "Option::is_none")]
1721 pub container: Option<String>,
1722 /// Represents a list of environment variables that will be injected into the container.
1723 /// These variables enable the container to adapt its behavior based on the environment it's running in.
1724 ///
1725 /// This field cannot be updated.
1726 #[serde(default, skip_serializing_if = "Option::is_none")]
1727 pub env: Option<Vec<ComponentDefinitionLifecycleActionsDataLoadCustomHandlerEnv>>,
1728 /// Defines the command to run.
1729 ///
1730 /// This field cannot be updated.
1731 #[serde(default, skip_serializing_if = "Option::is_none")]
1732 pub exec: Option<ComponentDefinitionLifecycleActionsDataLoadCustomHandlerExec>,
1733 /// Specifies the HTTP request to perform.
1734 ///
1735 /// This field cannot be updated.
1736 ///
1737 /// Note: HTTPAction is to be implemented in future version.
1738 #[serde(default, skip_serializing_if = "Option::is_none")]
1739 pub http: Option<ComponentDefinitionLifecycleActionsDataLoadCustomHandlerHttp>,
1740 /// Specifies the container image to be used for running the Action.
1741 ///
1742 /// When specified, a dedicated container will be created using this image to execute the Action.
1743 /// This field is mutually exclusive with the `container` field; only one of them should be provided.
1744 ///
1745 /// This field cannot be updated.
1746 #[serde(default, skip_serializing_if = "Option::is_none")]
1747 pub image: Option<String>,
1748 /// Used in conjunction with the `targetPodSelector` field to refine the selection of target pod(s) for Action execution.
1749 /// The impact of this field depends on the `targetPodSelector` value:
1750 ///
1751 /// - When `targetPodSelector` is set to `Any` or `All`, this field will be ignored.
1752 /// - When `targetPodSelector` is set to `Role`, only those replicas whose role matches the `matchingKey`
1753 /// will be selected for the Action.
1754 ///
1755 /// This field cannot be updated.
1756 ///
1757 /// Note: This field is reserved for future use and is not currently active.
1758 #[serde(default, skip_serializing_if = "Option::is_none", rename = "matchingKey")]
1759 pub matching_key: Option<String>,
1760 /// Specifies the state that the cluster must reach before the Action is executed.
1761 /// Currently, this is only applicable to the `postProvision` action.
1762 ///
1763 /// The conditions are as follows:
1764 ///
1765 /// - `Immediately`: Executed right after the Component object is created.
1766 /// The readiness of the Component and its resources is not guaranteed at this stage.
1767 /// - `RuntimeReady`: The Action is triggered after the Component object has been created and all associated
1768 /// runtime resources (e.g. Pods) are in a ready state.
1769 /// - `ComponentReady`: The Action is triggered after the Component itself is in a ready state.
1770 /// This process does not affect the readiness state of the Component or the Cluster.
1771 /// - `ClusterReady`: The Action is executed after the Cluster is in a ready state.
1772 /// This execution does not alter the Component or the Cluster's state of readiness.
1773 ///
1774 /// This field cannot be updated.
1775 #[serde(default, skip_serializing_if = "Option::is_none", rename = "preCondition")]
1776 pub pre_condition: Option<String>,
1777 /// Defines the strategy to be taken when retrying the Action after a failure.
1778 ///
1779 /// It specifies the conditions under which the Action should be retried and the limits to apply,
1780 /// such as the maximum number of retries and backoff strategy.
1781 ///
1782 /// This field cannot be updated.
1783 #[serde(default, skip_serializing_if = "Option::is_none", rename = "retryPolicy")]
1784 pub retry_policy: Option<ComponentDefinitionLifecycleActionsDataLoadCustomHandlerRetryPolicy>,
1785 /// Defines the criteria used to select the target Pod(s) for executing the Action.
1786 /// This is useful when there is no default target replica identified.
1787 /// It allows for precise control over which Pod(s) the Action should run in.
1788 ///
1789 /// This field cannot be updated.
1790 ///
1791 /// Note: This field is reserved for future use and is not currently active.
1792 #[serde(default, skip_serializing_if = "Option::is_none", rename = "targetPodSelector")]
1793 pub target_pod_selector: Option<ComponentDefinitionLifecycleActionsDataLoadCustomHandlerTargetPodSelector>,
1794 /// Specifies the maximum duration in seconds that the Action is allowed to run.
1795 ///
1796 /// If the Action does not complete within this time frame, it will be terminated.
1797 ///
1798 /// This field cannot be updated.
1799 #[serde(default, skip_serializing_if = "Option::is_none", rename = "timeoutSeconds")]
1800 pub timeout_seconds: Option<i32>,
1801}
1802
1803/// EnvVar represents an environment variable present in a Container.
1804#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
1805pub struct ComponentDefinitionLifecycleActionsDataLoadCustomHandlerEnv {
1806 /// Name of the environment variable. Must be a C_IDENTIFIER.
1807 pub name: String,
1808 /// Variable references $(VAR_NAME) are expanded
1809 /// using the previously defined environment variables in the container and
1810 /// any service environment variables. If a variable cannot be resolved,
1811 /// the reference in the input string will be unchanged. Double $$ are reduced
1812 /// to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e.
1813 /// "$$(VAR_NAME)" will produce the string literal "$(VAR_NAME)".
1814 /// Escaped references will never be expanded, regardless of whether the variable
1815 /// exists or not.
1816 /// Defaults to "".
1817 #[serde(default, skip_serializing_if = "Option::is_none")]
1818 pub value: Option<String>,
1819 /// Source for the environment variable's value. Cannot be used if value is not empty.
1820 #[serde(default, skip_serializing_if = "Option::is_none", rename = "valueFrom")]
1821 pub value_from: Option<ComponentDefinitionLifecycleActionsDataLoadCustomHandlerEnvValueFrom>,
1822}
1823
1824/// Source for the environment variable's value. Cannot be used if value is not empty.
1825#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
1826pub struct ComponentDefinitionLifecycleActionsDataLoadCustomHandlerEnvValueFrom {
1827 /// Selects a key of a ConfigMap.
1828 #[serde(default, skip_serializing_if = "Option::is_none", rename = "configMapKeyRef")]
1829 pub config_map_key_ref: Option<ComponentDefinitionLifecycleActionsDataLoadCustomHandlerEnvValueFromConfigMapKeyRef>,
1830 /// Selects a field of the pod: supports metadata.name, metadata.namespace, `metadata.labels['<KEY>']`, `metadata.annotations['<KEY>']`,
1831 /// spec.nodeName, spec.serviceAccountName, status.hostIP, status.podIP, status.podIPs.
1832 #[serde(default, skip_serializing_if = "Option::is_none", rename = "fieldRef")]
1833 pub field_ref: Option<ComponentDefinitionLifecycleActionsDataLoadCustomHandlerEnvValueFromFieldRef>,
1834 /// Selects a resource of the container: only resources limits and requests
1835 /// (limits.cpu, limits.memory, limits.ephemeral-storage, requests.cpu, requests.memory and requests.ephemeral-storage) are currently supported.
1836 #[serde(default, skip_serializing_if = "Option::is_none", rename = "resourceFieldRef")]
1837 pub resource_field_ref: Option<ComponentDefinitionLifecycleActionsDataLoadCustomHandlerEnvValueFromResourceFieldRef>,
1838 /// Selects a key of a secret in the pod's namespace
1839 #[serde(default, skip_serializing_if = "Option::is_none", rename = "secretKeyRef")]
1840 pub secret_key_ref: Option<ComponentDefinitionLifecycleActionsDataLoadCustomHandlerEnvValueFromSecretKeyRef>,
1841}
1842
1843/// Selects a key of a ConfigMap.
1844#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
1845pub struct ComponentDefinitionLifecycleActionsDataLoadCustomHandlerEnvValueFromConfigMapKeyRef {
1846 /// The key to select.
1847 pub key: String,
1848 /// Name of the referent.
1849 /// More info: <https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names>
1850 #[serde(default, skip_serializing_if = "Option::is_none")]
1851 pub name: Option<String>,
1852 /// Specify whether the ConfigMap or its key must be defined
1853 #[serde(default, skip_serializing_if = "Option::is_none")]
1854 pub optional: Option<bool>,
1855}
1856
1857/// Selects a field of the pod: supports metadata.name, metadata.namespace, `metadata.labels['<KEY>']`, `metadata.annotations['<KEY>']`,
1858/// spec.nodeName, spec.serviceAccountName, status.hostIP, status.podIP, status.podIPs.
1859#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
1860pub struct ComponentDefinitionLifecycleActionsDataLoadCustomHandlerEnvValueFromFieldRef {
1861 /// Version of the schema the FieldPath is written in terms of, defaults to "v1".
1862 #[serde(default, skip_serializing_if = "Option::is_none", rename = "apiVersion")]
1863 pub api_version: Option<String>,
1864 /// Path of the field to select in the specified API version.
1865 #[serde(rename = "fieldPath")]
1866 pub field_path: String,
1867}
1868
1869/// Selects a resource of the container: only resources limits and requests
1870/// (limits.cpu, limits.memory, limits.ephemeral-storage, requests.cpu, requests.memory and requests.ephemeral-storage) are currently supported.
1871#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
1872pub struct ComponentDefinitionLifecycleActionsDataLoadCustomHandlerEnvValueFromResourceFieldRef {
1873 /// Container name: required for volumes, optional for env vars
1874 #[serde(default, skip_serializing_if = "Option::is_none", rename = "containerName")]
1875 pub container_name: Option<String>,
1876 /// Specifies the output format of the exposed resources, defaults to "1"
1877 #[serde(default, skip_serializing_if = "Option::is_none")]
1878 pub divisor: Option<IntOrString>,
1879 /// Required: resource to select
1880 pub resource: String,
1881}
1882
1883/// Selects a key of a secret in the pod's namespace
1884#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
1885pub struct ComponentDefinitionLifecycleActionsDataLoadCustomHandlerEnvValueFromSecretKeyRef {
1886 /// The key of the secret to select from. Must be a valid secret key.
1887 pub key: String,
1888 /// Name of the referent.
1889 /// More info: <https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names>
1890 #[serde(default, skip_serializing_if = "Option::is_none")]
1891 pub name: Option<String>,
1892 /// Specify whether the Secret or its key must be defined
1893 #[serde(default, skip_serializing_if = "Option::is_none")]
1894 pub optional: Option<bool>,
1895}
1896
1897/// Defines the command to run.
1898///
1899/// This field cannot be updated.
1900#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
1901pub struct ComponentDefinitionLifecycleActionsDataLoadCustomHandlerExec {
1902 /// Args represents the arguments that are passed to the `command` for execution.
1903 #[serde(default, skip_serializing_if = "Option::is_none")]
1904 pub args: Option<Vec<String>>,
1905 /// Specifies the command to be executed inside the container.
1906 /// The working directory for this command is the container's root directory('/').
1907 /// Commands are executed directly without a shell environment, meaning shell-specific syntax ('|', etc.) is not supported.
1908 /// If the shell is required, it must be explicitly invoked in the command.
1909 ///
1910 /// A successful execution is indicated by an exit status of 0; any non-zero status signifies a failure.
1911 #[serde(default, skip_serializing_if = "Option::is_none")]
1912 pub command: Option<Vec<String>>,
1913}
1914
1915/// Specifies the HTTP request to perform.
1916///
1917/// This field cannot be updated.
1918///
1919/// Note: HTTPAction is to be implemented in future version.
1920#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
1921pub struct ComponentDefinitionLifecycleActionsDataLoadCustomHandlerHttp {
1922 /// Indicates the server's domain name or IP address. Defaults to the Pod's IP.
1923 /// Prefer setting the "Host" header in httpHeaders when needed.
1924 #[serde(default, skip_serializing_if = "Option::is_none")]
1925 pub host: Option<String>,
1926 /// Allows for the inclusion of custom headers in the request.
1927 /// HTTP permits the use of repeated headers.
1928 #[serde(default, skip_serializing_if = "Option::is_none", rename = "httpHeaders")]
1929 pub http_headers: Option<Vec<ComponentDefinitionLifecycleActionsDataLoadCustomHandlerHttpHttpHeaders>>,
1930 /// Represents the type of HTTP request to be made, such as "GET," "POST," "PUT," etc.
1931 /// If not specified, "GET" is the default method.
1932 #[serde(default, skip_serializing_if = "Option::is_none")]
1933 pub method: Option<String>,
1934 /// Specifies the endpoint to be requested on the HTTP server.
1935 #[serde(default, skip_serializing_if = "Option::is_none")]
1936 pub path: Option<String>,
1937 /// Specifies the target port for the HTTP request.
1938 /// It can be specified either as a numeric value in the range of 1 to 65535,
1939 /// or as a named port that meets the IANA_SVC_NAME specification.
1940 pub port: IntOrString,
1941 /// Designates the protocol used to make the request, such as HTTP or HTTPS.
1942 /// If not specified, HTTP is used by default.
1943 #[serde(default, skip_serializing_if = "Option::is_none")]
1944 pub scheme: Option<String>,
1945}
1946
1947/// HTTPHeader describes a custom header to be used in HTTP probes
1948#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
1949pub struct ComponentDefinitionLifecycleActionsDataLoadCustomHandlerHttpHttpHeaders {
1950 /// The header field name.
1951 /// This will be canonicalized upon output, so case-variant names will be understood as the same header.
1952 pub name: String,
1953 /// The header field value
1954 pub value: String,
1955}
1956
1957/// Defines the strategy to be taken when retrying the Action after a failure.
1958///
1959/// It specifies the conditions under which the Action should be retried and the limits to apply,
1960/// such as the maximum number of retries and backoff strategy.
1961///
1962/// This field cannot be updated.
1963#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
1964pub struct ComponentDefinitionLifecycleActionsDataLoadCustomHandlerRetryPolicy {
1965 /// Defines the maximum number of retry attempts that should be made for a given Action.
1966 /// This value is set to 0 by default, indicating that no retries will be made.
1967 #[serde(default, skip_serializing_if = "Option::is_none", rename = "maxRetries")]
1968 pub max_retries: Option<i64>,
1969 /// Indicates the duration of time to wait between each retry attempt.
1970 /// This value is set to 0 by default, indicating that there will be no delay between retry attempts.
1971 #[serde(default, skip_serializing_if = "Option::is_none", rename = "retryInterval")]
1972 pub retry_interval: Option<i64>,
1973}
1974
1975/// Specifies a user-defined hook or procedure that is called to perform the specific lifecycle action.
1976/// It offers a flexible and expandable approach for customizing the behavior of a Component by leveraging
1977/// tailored actions.
1978///
1979/// An Action can be implemented as either an ExecAction or an HTTPAction, with future versions planning
1980/// to support GRPCAction,
1981/// thereby accommodating unique logic for different database systems within the Action's framework.
1982///
1983/// In future iterations, all built-in handlers are expected to transition to GRPCAction.
1984/// This change means that Lorry or other sidecar agents will expose the implementation of actions
1985/// through a GRPC interface for external invocation.
1986/// Then the controller will interact with these actions via GRPCAction calls.
1987#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
1988pub enum ComponentDefinitionLifecycleActionsDataLoadCustomHandlerTargetPodSelector {
1989 Any,
1990 All,
1991 Role,
1992 Ordinal,
1993}
1994
1995/// Defines the procedure to add a new replica to the replication group.
1996///
1997/// This action is initiated after a replica pod becomes ready.
1998///
1999/// The role of the replica (e.g., primary, secondary) will be determined and assigned as part of the action command
2000/// implementation, or automatically by the database kernel or a sidecar utility like Patroni that implements
2001/// a consensus algorithm.
2002///
2003/// The container executing this action has access to following environment variables:
2004///
2005/// - KB_SERVICE_PORT: The port used by the database service.
2006/// - KB_SERVICE_USER: The username with the necessary permissions to interact with the database service.
2007/// - KB_SERVICE_PASSWORD: The corresponding password for KB_SERVICE_USER to authenticate with the database service.
2008/// - KB_PRIMARY_POD_FQDN: The FQDN of the primary Pod within the replication group.
2009/// - KB_MEMBER_ADDRESSES: A comma-separated list of Pod addresses for all replicas in the group.
2010/// - KB_NEW_MEMBER_POD_NAME: The pod name of the replica being added to the group.
2011/// - KB_NEW_MEMBER_POD_IP: The IP address of the replica being added to the group.
2012///
2013/// Expected action output:
2014/// - On Failure: An error message detailing the reason for any failure encountered
2015/// during the addition of the new member.
2016///
2017/// For example, to add a new OBServer to an OceanBase Cluster in 'zone1', the following command may be used:
2018///
2019/// ```text
2020/// command:
2021/// - bash
2022/// - -c
2023/// - |
2024/// ADDRESS=$(KB_MEMBER_ADDRESSES%%,*)
2025/// HOST=$(echo $ADDRESS | cut -d ':' -f 1)
2026/// PORT=$(echo $ADDRESS | cut -d ':' -f 2)
2027/// CLIENT="mysql -u $KB_SERVICE_USER -p$KB_SERVICE_PASSWORD -P $PORT -h $HOST -e"
2028/// $CLIENT "ALTER SYSTEM ADD SERVER '$KB_NEW_MEMBER_POD_IP:$KB_SERVICE_PORT' ZONE 'zone1'"
2029/// ```
2030///
2031/// Note: This field is immutable once it has been set.
2032#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
2033pub struct ComponentDefinitionLifecycleActionsMemberJoin {
2034 /// Specifies the name of the predefined action handler to be invoked for lifecycle actions.
2035 ///
2036 /// Lorry, as a sidecar agent co-located with the database container in the same Pod,
2037 /// includes a suite of built-in action implementations that are tailored to different database engines.
2038 /// These are known as "builtin" handlers, includes: `mysql`, `redis`, `mongodb`, `etcd`,
2039 /// `postgresql`, `vanilla-postgresql`, `apecloud-postgresql`, `wesql`, `oceanbase`, `polardbx`.
2040 ///
2041 /// If the `builtinHandler` field is specified, it instructs Lorry to utilize its internal built-in action handler
2042 /// to execute the specified lifecycle actions.
2043 ///
2044 /// The `builtinHandler` field is of type `BuiltinActionHandlerType`,
2045 /// which represents the name of the built-in handler.
2046 /// The `builtinHandler` specified within the same `ComponentLifecycleActions` should be consistent across all
2047 /// actions.
2048 /// This means that if you specify a built-in handler for one action, you should use the same handler
2049 /// for all other actions throughout the entire `ComponentLifecycleActions` collection.
2050 ///
2051 /// If you need to define lifecycle actions for database engines not covered by the existing built-in support,
2052 /// or when the pre-existing built-in handlers do not meet your specific needs,
2053 /// you can use the `customHandler` field to define your own action implementation.
2054 ///
2055 /// Deprecation Notice:
2056 ///
2057 /// - In the future, the `builtinHandler` field will be deprecated in favor of using the `customHandler` field
2058 /// for configuring all lifecycle actions.
2059 /// - Instead of using a name to indicate the built-in action implementations in Lorry,
2060 /// the recommended approach will be to explicitly invoke the desired action implementation through
2061 /// a gRPC interface exposed by the sidecar agent.
2062 /// - Developers will have the flexibility to either use the built-in action implementations provided by Lorry
2063 /// or develop their own sidecar agent to implement custom actions and expose them via gRPC interfaces.
2064 /// - This change will allow for greater customization and extensibility of lifecycle actions,
2065 /// as developers can create their own "builtin" implementations tailored to their specific requirements.
2066 #[serde(default, skip_serializing_if = "Option::is_none", rename = "builtinHandler")]
2067 pub builtin_handler: Option<String>,
2068 /// Specifies a user-defined hook or procedure that is called to perform the specific lifecycle action.
2069 /// It offers a flexible and expandable approach for customizing the behavior of a Component by leveraging
2070 /// tailored actions.
2071 ///
2072 /// An Action can be implemented as either an ExecAction or an HTTPAction, with future versions planning
2073 /// to support GRPCAction,
2074 /// thereby accommodating unique logic for different database systems within the Action's framework.
2075 ///
2076 /// In future iterations, all built-in handlers are expected to transition to GRPCAction.
2077 /// This change means that Lorry or other sidecar agents will expose the implementation of actions
2078 /// through a GRPC interface for external invocation.
2079 /// Then the controller will interact with these actions via GRPCAction calls.
2080 #[serde(default, skip_serializing_if = "Option::is_none", rename = "customHandler")]
2081 pub custom_handler: Option<ComponentDefinitionLifecycleActionsMemberJoinCustomHandler>,
2082}
2083
2084/// Specifies a user-defined hook or procedure that is called to perform the specific lifecycle action.
2085/// It offers a flexible and expandable approach for customizing the behavior of a Component by leveraging
2086/// tailored actions.
2087///
2088/// An Action can be implemented as either an ExecAction or an HTTPAction, with future versions planning
2089/// to support GRPCAction,
2090/// thereby accommodating unique logic for different database systems within the Action's framework.
2091///
2092/// In future iterations, all built-in handlers are expected to transition to GRPCAction.
2093/// This change means that Lorry or other sidecar agents will expose the implementation of actions
2094/// through a GRPC interface for external invocation.
2095/// Then the controller will interact with these actions via GRPCAction calls.
2096#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
2097pub struct ComponentDefinitionLifecycleActionsMemberJoinCustomHandler {
2098 /// Defines the name of the container within the target Pod where the action will be executed.
2099 ///
2100 /// This name must correspond to one of the containers defined in `componentDefinition.spec.runtime`.
2101 /// If this field is not specified, the default behavior is to use the first container listed in
2102 /// `componentDefinition.spec.runtime`.
2103 ///
2104 /// This field cannot be updated.
2105 ///
2106 /// Note: This field is reserved for future use and is not currently active.
2107 #[serde(default, skip_serializing_if = "Option::is_none")]
2108 pub container: Option<String>,
2109 /// Represents a list of environment variables that will be injected into the container.
2110 /// These variables enable the container to adapt its behavior based on the environment it's running in.
2111 ///
2112 /// This field cannot be updated.
2113 #[serde(default, skip_serializing_if = "Option::is_none")]
2114 pub env: Option<Vec<ComponentDefinitionLifecycleActionsMemberJoinCustomHandlerEnv>>,
2115 /// Defines the command to run.
2116 ///
2117 /// This field cannot be updated.
2118 #[serde(default, skip_serializing_if = "Option::is_none")]
2119 pub exec: Option<ComponentDefinitionLifecycleActionsMemberJoinCustomHandlerExec>,
2120 /// Specifies the HTTP request to perform.
2121 ///
2122 /// This field cannot be updated.
2123 ///
2124 /// Note: HTTPAction is to be implemented in future version.
2125 #[serde(default, skip_serializing_if = "Option::is_none")]
2126 pub http: Option<ComponentDefinitionLifecycleActionsMemberJoinCustomHandlerHttp>,
2127 /// Specifies the container image to be used for running the Action.
2128 ///
2129 /// When specified, a dedicated container will be created using this image to execute the Action.
2130 /// This field is mutually exclusive with the `container` field; only one of them should be provided.
2131 ///
2132 /// This field cannot be updated.
2133 #[serde(default, skip_serializing_if = "Option::is_none")]
2134 pub image: Option<String>,
2135 /// Used in conjunction with the `targetPodSelector` field to refine the selection of target pod(s) for Action execution.
2136 /// The impact of this field depends on the `targetPodSelector` value:
2137 ///
2138 /// - When `targetPodSelector` is set to `Any` or `All`, this field will be ignored.
2139 /// - When `targetPodSelector` is set to `Role`, only those replicas whose role matches the `matchingKey`
2140 /// will be selected for the Action.
2141 ///
2142 /// This field cannot be updated.
2143 ///
2144 /// Note: This field is reserved for future use and is not currently active.
2145 #[serde(default, skip_serializing_if = "Option::is_none", rename = "matchingKey")]
2146 pub matching_key: Option<String>,
2147 /// Specifies the state that the cluster must reach before the Action is executed.
2148 /// Currently, this is only applicable to the `postProvision` action.
2149 ///
2150 /// The conditions are as follows:
2151 ///
2152 /// - `Immediately`: Executed right after the Component object is created.
2153 /// The readiness of the Component and its resources is not guaranteed at this stage.
2154 /// - `RuntimeReady`: The Action is triggered after the Component object has been created and all associated
2155 /// runtime resources (e.g. Pods) are in a ready state.
2156 /// - `ComponentReady`: The Action is triggered after the Component itself is in a ready state.
2157 /// This process does not affect the readiness state of the Component or the Cluster.
2158 /// - `ClusterReady`: The Action is executed after the Cluster is in a ready state.
2159 /// This execution does not alter the Component or the Cluster's state of readiness.
2160 ///
2161 /// This field cannot be updated.
2162 #[serde(default, skip_serializing_if = "Option::is_none", rename = "preCondition")]
2163 pub pre_condition: Option<String>,
2164 /// Defines the strategy to be taken when retrying the Action after a failure.
2165 ///
2166 /// It specifies the conditions under which the Action should be retried and the limits to apply,
2167 /// such as the maximum number of retries and backoff strategy.
2168 ///
2169 /// This field cannot be updated.
2170 #[serde(default, skip_serializing_if = "Option::is_none", rename = "retryPolicy")]
2171 pub retry_policy: Option<ComponentDefinitionLifecycleActionsMemberJoinCustomHandlerRetryPolicy>,
2172 /// Defines the criteria used to select the target Pod(s) for executing the Action.
2173 /// This is useful when there is no default target replica identified.
2174 /// It allows for precise control over which Pod(s) the Action should run in.
2175 ///
2176 /// This field cannot be updated.
2177 ///
2178 /// Note: This field is reserved for future use and is not currently active.
2179 #[serde(default, skip_serializing_if = "Option::is_none", rename = "targetPodSelector")]
2180 pub target_pod_selector: Option<ComponentDefinitionLifecycleActionsMemberJoinCustomHandlerTargetPodSelector>,
2181 /// Specifies the maximum duration in seconds that the Action is allowed to run.
2182 ///
2183 /// If the Action does not complete within this time frame, it will be terminated.
2184 ///
2185 /// This field cannot be updated.
2186 #[serde(default, skip_serializing_if = "Option::is_none", rename = "timeoutSeconds")]
2187 pub timeout_seconds: Option<i32>,
2188}
2189
2190/// EnvVar represents an environment variable present in a Container.
2191#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
2192pub struct ComponentDefinitionLifecycleActionsMemberJoinCustomHandlerEnv {
2193 /// Name of the environment variable. Must be a C_IDENTIFIER.
2194 pub name: String,
2195 /// Variable references $(VAR_NAME) are expanded
2196 /// using the previously defined environment variables in the container and
2197 /// any service environment variables. If a variable cannot be resolved,
2198 /// the reference in the input string will be unchanged. Double $$ are reduced
2199 /// to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e.
2200 /// "$$(VAR_NAME)" will produce the string literal "$(VAR_NAME)".
2201 /// Escaped references will never be expanded, regardless of whether the variable
2202 /// exists or not.
2203 /// Defaults to "".
2204 #[serde(default, skip_serializing_if = "Option::is_none")]
2205 pub value: Option<String>,
2206 /// Source for the environment variable's value. Cannot be used if value is not empty.
2207 #[serde(default, skip_serializing_if = "Option::is_none", rename = "valueFrom")]
2208 pub value_from: Option<ComponentDefinitionLifecycleActionsMemberJoinCustomHandlerEnvValueFrom>,
2209}
2210
2211/// Source for the environment variable's value. Cannot be used if value is not empty.
2212#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
2213pub struct ComponentDefinitionLifecycleActionsMemberJoinCustomHandlerEnvValueFrom {
2214 /// Selects a key of a ConfigMap.
2215 #[serde(default, skip_serializing_if = "Option::is_none", rename = "configMapKeyRef")]
2216 pub config_map_key_ref: Option<ComponentDefinitionLifecycleActionsMemberJoinCustomHandlerEnvValueFromConfigMapKeyRef>,
2217 /// Selects a field of the pod: supports metadata.name, metadata.namespace, `metadata.labels['<KEY>']`, `metadata.annotations['<KEY>']`,
2218 /// spec.nodeName, spec.serviceAccountName, status.hostIP, status.podIP, status.podIPs.
2219 #[serde(default, skip_serializing_if = "Option::is_none", rename = "fieldRef")]
2220 pub field_ref: Option<ComponentDefinitionLifecycleActionsMemberJoinCustomHandlerEnvValueFromFieldRef>,
2221 /// Selects a resource of the container: only resources limits and requests
2222 /// (limits.cpu, limits.memory, limits.ephemeral-storage, requests.cpu, requests.memory and requests.ephemeral-storage) are currently supported.
2223 #[serde(default, skip_serializing_if = "Option::is_none", rename = "resourceFieldRef")]
2224 pub resource_field_ref: Option<ComponentDefinitionLifecycleActionsMemberJoinCustomHandlerEnvValueFromResourceFieldRef>,
2225 /// Selects a key of a secret in the pod's namespace
2226 #[serde(default, skip_serializing_if = "Option::is_none", rename = "secretKeyRef")]
2227 pub secret_key_ref: Option<ComponentDefinitionLifecycleActionsMemberJoinCustomHandlerEnvValueFromSecretKeyRef>,
2228}
2229
2230/// Selects a key of a ConfigMap.
2231#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
2232pub struct ComponentDefinitionLifecycleActionsMemberJoinCustomHandlerEnvValueFromConfigMapKeyRef {
2233 /// The key to select.
2234 pub key: String,
2235 /// Name of the referent.
2236 /// More info: <https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names>
2237 #[serde(default, skip_serializing_if = "Option::is_none")]
2238 pub name: Option<String>,
2239 /// Specify whether the ConfigMap or its key must be defined
2240 #[serde(default, skip_serializing_if = "Option::is_none")]
2241 pub optional: Option<bool>,
2242}
2243
2244/// Selects a field of the pod: supports metadata.name, metadata.namespace, `metadata.labels['<KEY>']`, `metadata.annotations['<KEY>']`,
2245/// spec.nodeName, spec.serviceAccountName, status.hostIP, status.podIP, status.podIPs.
2246#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
2247pub struct ComponentDefinitionLifecycleActionsMemberJoinCustomHandlerEnvValueFromFieldRef {
2248 /// Version of the schema the FieldPath is written in terms of, defaults to "v1".
2249 #[serde(default, skip_serializing_if = "Option::is_none", rename = "apiVersion")]
2250 pub api_version: Option<String>,
2251 /// Path of the field to select in the specified API version.
2252 #[serde(rename = "fieldPath")]
2253 pub field_path: String,
2254}
2255
2256/// Selects a resource of the container: only resources limits and requests
2257/// (limits.cpu, limits.memory, limits.ephemeral-storage, requests.cpu, requests.memory and requests.ephemeral-storage) are currently supported.
2258#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
2259pub struct ComponentDefinitionLifecycleActionsMemberJoinCustomHandlerEnvValueFromResourceFieldRef {
2260 /// Container name: required for volumes, optional for env vars
2261 #[serde(default, skip_serializing_if = "Option::is_none", rename = "containerName")]
2262 pub container_name: Option<String>,
2263 /// Specifies the output format of the exposed resources, defaults to "1"
2264 #[serde(default, skip_serializing_if = "Option::is_none")]
2265 pub divisor: Option<IntOrString>,
2266 /// Required: resource to select
2267 pub resource: String,
2268}
2269
2270/// Selects a key of a secret in the pod's namespace
2271#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
2272pub struct ComponentDefinitionLifecycleActionsMemberJoinCustomHandlerEnvValueFromSecretKeyRef {
2273 /// The key of the secret to select from. Must be a valid secret key.
2274 pub key: String,
2275 /// Name of the referent.
2276 /// More info: <https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names>
2277 #[serde(default, skip_serializing_if = "Option::is_none")]
2278 pub name: Option<String>,
2279 /// Specify whether the Secret or its key must be defined
2280 #[serde(default, skip_serializing_if = "Option::is_none")]
2281 pub optional: Option<bool>,
2282}
2283
2284/// Defines the command to run.
2285///
2286/// This field cannot be updated.
2287#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
2288pub struct ComponentDefinitionLifecycleActionsMemberJoinCustomHandlerExec {
2289 /// Args represents the arguments that are passed to the `command` for execution.
2290 #[serde(default, skip_serializing_if = "Option::is_none")]
2291 pub args: Option<Vec<String>>,
2292 /// Specifies the command to be executed inside the container.
2293 /// The working directory for this command is the container's root directory('/').
2294 /// Commands are executed directly without a shell environment, meaning shell-specific syntax ('|', etc.) is not supported.
2295 /// If the shell is required, it must be explicitly invoked in the command.
2296 ///
2297 /// A successful execution is indicated by an exit status of 0; any non-zero status signifies a failure.
2298 #[serde(default, skip_serializing_if = "Option::is_none")]
2299 pub command: Option<Vec<String>>,
2300}
2301
2302/// Specifies the HTTP request to perform.
2303///
2304/// This field cannot be updated.
2305///
2306/// Note: HTTPAction is to be implemented in future version.
2307#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
2308pub struct ComponentDefinitionLifecycleActionsMemberJoinCustomHandlerHttp {
2309 /// Indicates the server's domain name or IP address. Defaults to the Pod's IP.
2310 /// Prefer setting the "Host" header in httpHeaders when needed.
2311 #[serde(default, skip_serializing_if = "Option::is_none")]
2312 pub host: Option<String>,
2313 /// Allows for the inclusion of custom headers in the request.
2314 /// HTTP permits the use of repeated headers.
2315 #[serde(default, skip_serializing_if = "Option::is_none", rename = "httpHeaders")]
2316 pub http_headers: Option<Vec<ComponentDefinitionLifecycleActionsMemberJoinCustomHandlerHttpHttpHeaders>>,
2317 /// Represents the type of HTTP request to be made, such as "GET," "POST," "PUT," etc.
2318 /// If not specified, "GET" is the default method.
2319 #[serde(default, skip_serializing_if = "Option::is_none")]
2320 pub method: Option<String>,
2321 /// Specifies the endpoint to be requested on the HTTP server.
2322 #[serde(default, skip_serializing_if = "Option::is_none")]
2323 pub path: Option<String>,
2324 /// Specifies the target port for the HTTP request.
2325 /// It can be specified either as a numeric value in the range of 1 to 65535,
2326 /// or as a named port that meets the IANA_SVC_NAME specification.
2327 pub port: IntOrString,
2328 /// Designates the protocol used to make the request, such as HTTP or HTTPS.
2329 /// If not specified, HTTP is used by default.
2330 #[serde(default, skip_serializing_if = "Option::is_none")]
2331 pub scheme: Option<String>,
2332}
2333
2334/// HTTPHeader describes a custom header to be used in HTTP probes
2335#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
2336pub struct ComponentDefinitionLifecycleActionsMemberJoinCustomHandlerHttpHttpHeaders {
2337 /// The header field name.
2338 /// This will be canonicalized upon output, so case-variant names will be understood as the same header.
2339 pub name: String,
2340 /// The header field value
2341 pub value: String,
2342}
2343
2344/// Defines the strategy to be taken when retrying the Action after a failure.
2345///
2346/// It specifies the conditions under which the Action should be retried and the limits to apply,
2347/// such as the maximum number of retries and backoff strategy.
2348///
2349/// This field cannot be updated.
2350#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
2351pub struct ComponentDefinitionLifecycleActionsMemberJoinCustomHandlerRetryPolicy {
2352 /// Defines the maximum number of retry attempts that should be made for a given Action.
2353 /// This value is set to 0 by default, indicating that no retries will be made.
2354 #[serde(default, skip_serializing_if = "Option::is_none", rename = "maxRetries")]
2355 pub max_retries: Option<i64>,
2356 /// Indicates the duration of time to wait between each retry attempt.
2357 /// This value is set to 0 by default, indicating that there will be no delay between retry attempts.
2358 #[serde(default, skip_serializing_if = "Option::is_none", rename = "retryInterval")]
2359 pub retry_interval: Option<i64>,
2360}
2361
2362/// Specifies a user-defined hook or procedure that is called to perform the specific lifecycle action.
2363/// It offers a flexible and expandable approach for customizing the behavior of a Component by leveraging
2364/// tailored actions.
2365///
2366/// An Action can be implemented as either an ExecAction or an HTTPAction, with future versions planning
2367/// to support GRPCAction,
2368/// thereby accommodating unique logic for different database systems within the Action's framework.
2369///
2370/// In future iterations, all built-in handlers are expected to transition to GRPCAction.
2371/// This change means that Lorry or other sidecar agents will expose the implementation of actions
2372/// through a GRPC interface for external invocation.
2373/// Then the controller will interact with these actions via GRPCAction calls.
2374#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
2375pub enum ComponentDefinitionLifecycleActionsMemberJoinCustomHandlerTargetPodSelector {
2376 Any,
2377 All,
2378 Role,
2379 Ordinal,
2380}
2381
2382/// Defines the procedure to remove a replica from the replication group.
2383///
2384/// This action is initiated before remove a replica from the group.
2385/// The operator will wait for MemberLeave to complete successfully before releasing the replica and cleaning up
2386/// related Kubernetes resources.
2387///
2388/// The process typically includes updating configurations and informing other group members about the removal.
2389/// Data migration is generally not part of this action and should be handled separately if needed.
2390///
2391/// The container executing this action has access to following environment variables:
2392///
2393/// - KB_SERVICE_PORT: The port used by the database service.
2394/// - KB_SERVICE_USER: The username with the necessary permissions to interact with the database service.
2395/// - KB_SERVICE_PASSWORD: The corresponding password for KB_SERVICE_USER to authenticate with the database service.
2396/// - KB_PRIMARY_POD_FQDN: The FQDN of the primary Pod within the replication group.
2397/// - KB_MEMBER_ADDRESSES: A comma-separated list of Pod addresses for all replicas in the group.
2398/// - KB_LEAVE_MEMBER_POD_NAME: The pod name of the replica being removed from the group.
2399/// - KB_LEAVE_MEMBER_POD_IP: The IP address of the replica being removed from the group.
2400///
2401/// Expected action output:
2402/// - On Failure: An error message, if applicable, indicating why the action failed.
2403///
2404/// For example, to remove an OBServer from an OceanBase Cluster in 'zone1', the following command can be executed:
2405///
2406/// ```text
2407/// command:
2408/// - bash
2409/// - -c
2410/// - |
2411/// ADDRESS=$(KB_MEMBER_ADDRESSES%%,*)
2412/// HOST=$(echo $ADDRESS | cut -d ':' -f 1)
2413/// PORT=$(echo $ADDRESS | cut -d ':' -f 2)
2414/// CLIENT="mysql -u $KB_SERVICE_USER -p$KB_SERVICE_PASSWORD -P $PORT -h $HOST -e"
2415/// $CLIENT "ALTER SYSTEM DELETE SERVER '$KB_LEAVE_MEMBER_POD_IP:$KB_SERVICE_PORT' ZONE 'zone1'"
2416/// ```
2417///
2418/// Note: This field is immutable once it has been set.
2419#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
2420pub struct ComponentDefinitionLifecycleActionsMemberLeave {
2421 /// Specifies the name of the predefined action handler to be invoked for lifecycle actions.
2422 ///
2423 /// Lorry, as a sidecar agent co-located with the database container in the same Pod,
2424 /// includes a suite of built-in action implementations that are tailored to different database engines.
2425 /// These are known as "builtin" handlers, includes: `mysql`, `redis`, `mongodb`, `etcd`,
2426 /// `postgresql`, `vanilla-postgresql`, `apecloud-postgresql`, `wesql`, `oceanbase`, `polardbx`.
2427 ///
2428 /// If the `builtinHandler` field is specified, it instructs Lorry to utilize its internal built-in action handler
2429 /// to execute the specified lifecycle actions.
2430 ///
2431 /// The `builtinHandler` field is of type `BuiltinActionHandlerType`,
2432 /// which represents the name of the built-in handler.
2433 /// The `builtinHandler` specified within the same `ComponentLifecycleActions` should be consistent across all
2434 /// actions.
2435 /// This means that if you specify a built-in handler for one action, you should use the same handler
2436 /// for all other actions throughout the entire `ComponentLifecycleActions` collection.
2437 ///
2438 /// If you need to define lifecycle actions for database engines not covered by the existing built-in support,
2439 /// or when the pre-existing built-in handlers do not meet your specific needs,
2440 /// you can use the `customHandler` field to define your own action implementation.
2441 ///
2442 /// Deprecation Notice:
2443 ///
2444 /// - In the future, the `builtinHandler` field will be deprecated in favor of using the `customHandler` field
2445 /// for configuring all lifecycle actions.
2446 /// - Instead of using a name to indicate the built-in action implementations in Lorry,
2447 /// the recommended approach will be to explicitly invoke the desired action implementation through
2448 /// a gRPC interface exposed by the sidecar agent.
2449 /// - Developers will have the flexibility to either use the built-in action implementations provided by Lorry
2450 /// or develop their own sidecar agent to implement custom actions and expose them via gRPC interfaces.
2451 /// - This change will allow for greater customization and extensibility of lifecycle actions,
2452 /// as developers can create their own "builtin" implementations tailored to their specific requirements.
2453 #[serde(default, skip_serializing_if = "Option::is_none", rename = "builtinHandler")]
2454 pub builtin_handler: Option<String>,
2455 /// Specifies a user-defined hook or procedure that is called to perform the specific lifecycle action.
2456 /// It offers a flexible and expandable approach for customizing the behavior of a Component by leveraging
2457 /// tailored actions.
2458 ///
2459 /// An Action can be implemented as either an ExecAction or an HTTPAction, with future versions planning
2460 /// to support GRPCAction,
2461 /// thereby accommodating unique logic for different database systems within the Action's framework.
2462 ///
2463 /// In future iterations, all built-in handlers are expected to transition to GRPCAction.
2464 /// This change means that Lorry or other sidecar agents will expose the implementation of actions
2465 /// through a GRPC interface for external invocation.
2466 /// Then the controller will interact with these actions via GRPCAction calls.
2467 #[serde(default, skip_serializing_if = "Option::is_none", rename = "customHandler")]
2468 pub custom_handler: Option<ComponentDefinitionLifecycleActionsMemberLeaveCustomHandler>,
2469}
2470
2471/// Specifies a user-defined hook or procedure that is called to perform the specific lifecycle action.
2472/// It offers a flexible and expandable approach for customizing the behavior of a Component by leveraging
2473/// tailored actions.
2474///
2475/// An Action can be implemented as either an ExecAction or an HTTPAction, with future versions planning
2476/// to support GRPCAction,
2477/// thereby accommodating unique logic for different database systems within the Action's framework.
2478///
2479/// In future iterations, all built-in handlers are expected to transition to GRPCAction.
2480/// This change means that Lorry or other sidecar agents will expose the implementation of actions
2481/// through a GRPC interface for external invocation.
2482/// Then the controller will interact with these actions via GRPCAction calls.
2483#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
2484pub struct ComponentDefinitionLifecycleActionsMemberLeaveCustomHandler {
2485 /// Defines the name of the container within the target Pod where the action will be executed.
2486 ///
2487 /// This name must correspond to one of the containers defined in `componentDefinition.spec.runtime`.
2488 /// If this field is not specified, the default behavior is to use the first container listed in
2489 /// `componentDefinition.spec.runtime`.
2490 ///
2491 /// This field cannot be updated.
2492 ///
2493 /// Note: This field is reserved for future use and is not currently active.
2494 #[serde(default, skip_serializing_if = "Option::is_none")]
2495 pub container: Option<String>,
2496 /// Represents a list of environment variables that will be injected into the container.
2497 /// These variables enable the container to adapt its behavior based on the environment it's running in.
2498 ///
2499 /// This field cannot be updated.
2500 #[serde(default, skip_serializing_if = "Option::is_none")]
2501 pub env: Option<Vec<ComponentDefinitionLifecycleActionsMemberLeaveCustomHandlerEnv>>,
2502 /// Defines the command to run.
2503 ///
2504 /// This field cannot be updated.
2505 #[serde(default, skip_serializing_if = "Option::is_none")]
2506 pub exec: Option<ComponentDefinitionLifecycleActionsMemberLeaveCustomHandlerExec>,
2507 /// Specifies the HTTP request to perform.
2508 ///
2509 /// This field cannot be updated.
2510 ///
2511 /// Note: HTTPAction is to be implemented in future version.
2512 #[serde(default, skip_serializing_if = "Option::is_none")]
2513 pub http: Option<ComponentDefinitionLifecycleActionsMemberLeaveCustomHandlerHttp>,
2514 /// Specifies the container image to be used for running the Action.
2515 ///
2516 /// When specified, a dedicated container will be created using this image to execute the Action.
2517 /// This field is mutually exclusive with the `container` field; only one of them should be provided.
2518 ///
2519 /// This field cannot be updated.
2520 #[serde(default, skip_serializing_if = "Option::is_none")]
2521 pub image: Option<String>,
2522 /// Used in conjunction with the `targetPodSelector` field to refine the selection of target pod(s) for Action execution.
2523 /// The impact of this field depends on the `targetPodSelector` value:
2524 ///
2525 /// - When `targetPodSelector` is set to `Any` or `All`, this field will be ignored.
2526 /// - When `targetPodSelector` is set to `Role`, only those replicas whose role matches the `matchingKey`
2527 /// will be selected for the Action.
2528 ///
2529 /// This field cannot be updated.
2530 ///
2531 /// Note: This field is reserved for future use and is not currently active.
2532 #[serde(default, skip_serializing_if = "Option::is_none", rename = "matchingKey")]
2533 pub matching_key: Option<String>,
2534 /// Specifies the state that the cluster must reach before the Action is executed.
2535 /// Currently, this is only applicable to the `postProvision` action.
2536 ///
2537 /// The conditions are as follows:
2538 ///
2539 /// - `Immediately`: Executed right after the Component object is created.
2540 /// The readiness of the Component and its resources is not guaranteed at this stage.
2541 /// - `RuntimeReady`: The Action is triggered after the Component object has been created and all associated
2542 /// runtime resources (e.g. Pods) are in a ready state.
2543 /// - `ComponentReady`: The Action is triggered after the Component itself is in a ready state.
2544 /// This process does not affect the readiness state of the Component or the Cluster.
2545 /// - `ClusterReady`: The Action is executed after the Cluster is in a ready state.
2546 /// This execution does not alter the Component or the Cluster's state of readiness.
2547 ///
2548 /// This field cannot be updated.
2549 #[serde(default, skip_serializing_if = "Option::is_none", rename = "preCondition")]
2550 pub pre_condition: Option<String>,
2551 /// Defines the strategy to be taken when retrying the Action after a failure.
2552 ///
2553 /// It specifies the conditions under which the Action should be retried and the limits to apply,
2554 /// such as the maximum number of retries and backoff strategy.
2555 ///
2556 /// This field cannot be updated.
2557 #[serde(default, skip_serializing_if = "Option::is_none", rename = "retryPolicy")]
2558 pub retry_policy: Option<ComponentDefinitionLifecycleActionsMemberLeaveCustomHandlerRetryPolicy>,
2559 /// Defines the criteria used to select the target Pod(s) for executing the Action.
2560 /// This is useful when there is no default target replica identified.
2561 /// It allows for precise control over which Pod(s) the Action should run in.
2562 ///
2563 /// This field cannot be updated.
2564 ///
2565 /// Note: This field is reserved for future use and is not currently active.
2566 #[serde(default, skip_serializing_if = "Option::is_none", rename = "targetPodSelector")]
2567 pub target_pod_selector: Option<ComponentDefinitionLifecycleActionsMemberLeaveCustomHandlerTargetPodSelector>,
2568 /// Specifies the maximum duration in seconds that the Action is allowed to run.
2569 ///
2570 /// If the Action does not complete within this time frame, it will be terminated.
2571 ///
2572 /// This field cannot be updated.
2573 #[serde(default, skip_serializing_if = "Option::is_none", rename = "timeoutSeconds")]
2574 pub timeout_seconds: Option<i32>,
2575}
2576
2577/// EnvVar represents an environment variable present in a Container.
2578#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
2579pub struct ComponentDefinitionLifecycleActionsMemberLeaveCustomHandlerEnv {
2580 /// Name of the environment variable. Must be a C_IDENTIFIER.
2581 pub name: String,
2582 /// Variable references $(VAR_NAME) are expanded
2583 /// using the previously defined environment variables in the container and
2584 /// any service environment variables. If a variable cannot be resolved,
2585 /// the reference in the input string will be unchanged. Double $$ are reduced
2586 /// to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e.
2587 /// "$$(VAR_NAME)" will produce the string literal "$(VAR_NAME)".
2588 /// Escaped references will never be expanded, regardless of whether the variable
2589 /// exists or not.
2590 /// Defaults to "".
2591 #[serde(default, skip_serializing_if = "Option::is_none")]
2592 pub value: Option<String>,
2593 /// Source for the environment variable's value. Cannot be used if value is not empty.
2594 #[serde(default, skip_serializing_if = "Option::is_none", rename = "valueFrom")]
2595 pub value_from: Option<ComponentDefinitionLifecycleActionsMemberLeaveCustomHandlerEnvValueFrom>,
2596}
2597
2598/// Source for the environment variable's value. Cannot be used if value is not empty.
2599#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
2600pub struct ComponentDefinitionLifecycleActionsMemberLeaveCustomHandlerEnvValueFrom {
2601 /// Selects a key of a ConfigMap.
2602 #[serde(default, skip_serializing_if = "Option::is_none", rename = "configMapKeyRef")]
2603 pub config_map_key_ref: Option<ComponentDefinitionLifecycleActionsMemberLeaveCustomHandlerEnvValueFromConfigMapKeyRef>,
2604 /// Selects a field of the pod: supports metadata.name, metadata.namespace, `metadata.labels['<KEY>']`, `metadata.annotations['<KEY>']`,
2605 /// spec.nodeName, spec.serviceAccountName, status.hostIP, status.podIP, status.podIPs.
2606 #[serde(default, skip_serializing_if = "Option::is_none", rename = "fieldRef")]
2607 pub field_ref: Option<ComponentDefinitionLifecycleActionsMemberLeaveCustomHandlerEnvValueFromFieldRef>,
2608 /// Selects a resource of the container: only resources limits and requests
2609 /// (limits.cpu, limits.memory, limits.ephemeral-storage, requests.cpu, requests.memory and requests.ephemeral-storage) are currently supported.
2610 #[serde(default, skip_serializing_if = "Option::is_none", rename = "resourceFieldRef")]
2611 pub resource_field_ref: Option<ComponentDefinitionLifecycleActionsMemberLeaveCustomHandlerEnvValueFromResourceFieldRef>,
2612 /// Selects a key of a secret in the pod's namespace
2613 #[serde(default, skip_serializing_if = "Option::is_none", rename = "secretKeyRef")]
2614 pub secret_key_ref: Option<ComponentDefinitionLifecycleActionsMemberLeaveCustomHandlerEnvValueFromSecretKeyRef>,
2615}
2616
2617/// Selects a key of a ConfigMap.
2618#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
2619pub struct ComponentDefinitionLifecycleActionsMemberLeaveCustomHandlerEnvValueFromConfigMapKeyRef {
2620 /// The key to select.
2621 pub key: String,
2622 /// Name of the referent.
2623 /// More info: <https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names>
2624 #[serde(default, skip_serializing_if = "Option::is_none")]
2625 pub name: Option<String>,
2626 /// Specify whether the ConfigMap or its key must be defined
2627 #[serde(default, skip_serializing_if = "Option::is_none")]
2628 pub optional: Option<bool>,
2629}
2630
2631/// Selects a field of the pod: supports metadata.name, metadata.namespace, `metadata.labels['<KEY>']`, `metadata.annotations['<KEY>']`,
2632/// spec.nodeName, spec.serviceAccountName, status.hostIP, status.podIP, status.podIPs.
2633#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
2634pub struct ComponentDefinitionLifecycleActionsMemberLeaveCustomHandlerEnvValueFromFieldRef {
2635 /// Version of the schema the FieldPath is written in terms of, defaults to "v1".
2636 #[serde(default, skip_serializing_if = "Option::is_none", rename = "apiVersion")]
2637 pub api_version: Option<String>,
2638 /// Path of the field to select in the specified API version.
2639 #[serde(rename = "fieldPath")]
2640 pub field_path: String,
2641}
2642
2643/// Selects a resource of the container: only resources limits and requests
2644/// (limits.cpu, limits.memory, limits.ephemeral-storage, requests.cpu, requests.memory and requests.ephemeral-storage) are currently supported.
2645#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
2646pub struct ComponentDefinitionLifecycleActionsMemberLeaveCustomHandlerEnvValueFromResourceFieldRef {
2647 /// Container name: required for volumes, optional for env vars
2648 #[serde(default, skip_serializing_if = "Option::is_none", rename = "containerName")]
2649 pub container_name: Option<String>,
2650 /// Specifies the output format of the exposed resources, defaults to "1"
2651 #[serde(default, skip_serializing_if = "Option::is_none")]
2652 pub divisor: Option<IntOrString>,
2653 /// Required: resource to select
2654 pub resource: String,
2655}
2656
2657/// Selects a key of a secret in the pod's namespace
2658#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
2659pub struct ComponentDefinitionLifecycleActionsMemberLeaveCustomHandlerEnvValueFromSecretKeyRef {
2660 /// The key of the secret to select from. Must be a valid secret key.
2661 pub key: String,
2662 /// Name of the referent.
2663 /// More info: <https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names>
2664 #[serde(default, skip_serializing_if = "Option::is_none")]
2665 pub name: Option<String>,
2666 /// Specify whether the Secret or its key must be defined
2667 #[serde(default, skip_serializing_if = "Option::is_none")]
2668 pub optional: Option<bool>,
2669}
2670
2671/// Defines the command to run.
2672///
2673/// This field cannot be updated.
2674#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
2675pub struct ComponentDefinitionLifecycleActionsMemberLeaveCustomHandlerExec {
2676 /// Args represents the arguments that are passed to the `command` for execution.
2677 #[serde(default, skip_serializing_if = "Option::is_none")]
2678 pub args: Option<Vec<String>>,
2679 /// Specifies the command to be executed inside the container.
2680 /// The working directory for this command is the container's root directory('/').
2681 /// Commands are executed directly without a shell environment, meaning shell-specific syntax ('|', etc.) is not supported.
2682 /// If the shell is required, it must be explicitly invoked in the command.
2683 ///
2684 /// A successful execution is indicated by an exit status of 0; any non-zero status signifies a failure.
2685 #[serde(default, skip_serializing_if = "Option::is_none")]
2686 pub command: Option<Vec<String>>,
2687}
2688
2689/// Specifies the HTTP request to perform.
2690///
2691/// This field cannot be updated.
2692///
2693/// Note: HTTPAction is to be implemented in future version.
2694#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
2695pub struct ComponentDefinitionLifecycleActionsMemberLeaveCustomHandlerHttp {
2696 /// Indicates the server's domain name or IP address. Defaults to the Pod's IP.
2697 /// Prefer setting the "Host" header in httpHeaders when needed.
2698 #[serde(default, skip_serializing_if = "Option::is_none")]
2699 pub host: Option<String>,
2700 /// Allows for the inclusion of custom headers in the request.
2701 /// HTTP permits the use of repeated headers.
2702 #[serde(default, skip_serializing_if = "Option::is_none", rename = "httpHeaders")]
2703 pub http_headers: Option<Vec<ComponentDefinitionLifecycleActionsMemberLeaveCustomHandlerHttpHttpHeaders>>,
2704 /// Represents the type of HTTP request to be made, such as "GET," "POST," "PUT," etc.
2705 /// If not specified, "GET" is the default method.
2706 #[serde(default, skip_serializing_if = "Option::is_none")]
2707 pub method: Option<String>,
2708 /// Specifies the endpoint to be requested on the HTTP server.
2709 #[serde(default, skip_serializing_if = "Option::is_none")]
2710 pub path: Option<String>,
2711 /// Specifies the target port for the HTTP request.
2712 /// It can be specified either as a numeric value in the range of 1 to 65535,
2713 /// or as a named port that meets the IANA_SVC_NAME specification.
2714 pub port: IntOrString,
2715 /// Designates the protocol used to make the request, such as HTTP or HTTPS.
2716 /// If not specified, HTTP is used by default.
2717 #[serde(default, skip_serializing_if = "Option::is_none")]
2718 pub scheme: Option<String>,
2719}
2720
2721/// HTTPHeader describes a custom header to be used in HTTP probes
2722#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
2723pub struct ComponentDefinitionLifecycleActionsMemberLeaveCustomHandlerHttpHttpHeaders {
2724 /// The header field name.
2725 /// This will be canonicalized upon output, so case-variant names will be understood as the same header.
2726 pub name: String,
2727 /// The header field value
2728 pub value: String,
2729}
2730
2731/// Defines the strategy to be taken when retrying the Action after a failure.
2732///
2733/// It specifies the conditions under which the Action should be retried and the limits to apply,
2734/// such as the maximum number of retries and backoff strategy.
2735///
2736/// This field cannot be updated.
2737#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
2738pub struct ComponentDefinitionLifecycleActionsMemberLeaveCustomHandlerRetryPolicy {
2739 /// Defines the maximum number of retry attempts that should be made for a given Action.
2740 /// This value is set to 0 by default, indicating that no retries will be made.
2741 #[serde(default, skip_serializing_if = "Option::is_none", rename = "maxRetries")]
2742 pub max_retries: Option<i64>,
2743 /// Indicates the duration of time to wait between each retry attempt.
2744 /// This value is set to 0 by default, indicating that there will be no delay between retry attempts.
2745 #[serde(default, skip_serializing_if = "Option::is_none", rename = "retryInterval")]
2746 pub retry_interval: Option<i64>,
2747}
2748
2749/// Specifies a user-defined hook or procedure that is called to perform the specific lifecycle action.
2750/// It offers a flexible and expandable approach for customizing the behavior of a Component by leveraging
2751/// tailored actions.
2752///
2753/// An Action can be implemented as either an ExecAction or an HTTPAction, with future versions planning
2754/// to support GRPCAction,
2755/// thereby accommodating unique logic for different database systems within the Action's framework.
2756///
2757/// In future iterations, all built-in handlers are expected to transition to GRPCAction.
2758/// This change means that Lorry or other sidecar agents will expose the implementation of actions
2759/// through a GRPC interface for external invocation.
2760/// Then the controller will interact with these actions via GRPCAction calls.
2761#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
2762pub enum ComponentDefinitionLifecycleActionsMemberLeaveCustomHandlerTargetPodSelector {
2763 Any,
2764 All,
2765 Role,
2766 Ordinal,
2767}
2768
2769/// Specifies the hook to be executed after a component's creation.
2770///
2771/// By setting `postProvision.customHandler.preCondition`, you can determine the specific lifecycle stage
2772/// at which the action should trigger: `Immediately`, `RuntimeReady`, `ComponentReady`, and `ClusterReady`.
2773/// with `ComponentReady` being the default.
2774///
2775/// The PostProvision Action is intended to run only once.
2776///
2777/// The container executing this action has access to following environment variables:
2778///
2779/// - KB_CLUSTER_POD_IP_LIST: Comma-separated list of the cluster's pod IP addresses (e.g., "podIp1,podIp2").
2780/// - KB_CLUSTER_POD_NAME_LIST: Comma-separated list of the cluster's pod names (e.g., "pod1,pod2").
2781/// - KB_CLUSTER_POD_HOST_NAME_LIST: Comma-separated list of host names, each corresponding to a pod in
2782/// KB_CLUSTER_POD_NAME_LIST (e.g., "hostName1,hostName2").
2783/// - KB_CLUSTER_POD_HOST_IP_LIST: Comma-separated list of host IP addresses, each corresponding to a pod in
2784/// KB_CLUSTER_POD_NAME_LIST (e.g., "hostIp1,hostIp2").
2785///
2786/// - KB_CLUSTER_COMPONENT_POD_NAME_LIST: Comma-separated list of all pod names within the component
2787/// (e.g., "pod1,pod2").
2788/// - KB_CLUSTER_COMPONENT_POD_IP_LIST: Comma-separated list of pod IP addresses,
2789/// matching the order of pods in KB_CLUSTER_COMPONENT_POD_NAME_LIST (e.g., "podIp1,podIp2").
2790/// - KB_CLUSTER_COMPONENT_POD_HOST_NAME_LIST: Comma-separated list of host names for each pod,
2791/// matching the order of pods in KB_CLUSTER_COMPONENT_POD_NAME_LIST (e.g., "hostName1,hostName2").
2792/// - KB_CLUSTER_COMPONENT_POD_HOST_IP_LIST: Comma-separated list of host IP addresses for each pod,
2793/// matching the order of pods in KB_CLUSTER_COMPONENT_POD_NAME_LIST (e.g., "hostIp1,hostIp2").
2794///
2795/// - KB_CLUSTER_COMPONENT_LIST: Comma-separated list of all cluster components (e.g., "comp1,comp2").
2796/// - KB_CLUSTER_COMPONENT_DELETING_LIST: Comma-separated list of components that are currently being deleted
2797/// (e.g., "comp1,comp2").
2798/// - KB_CLUSTER_COMPONENT_UNDELETED_LIST: Comma-separated list of components that are not being deleted
2799/// (e.g., "comp1,comp2").
2800///
2801/// Note: This field is immutable once it has been set.
2802#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
2803pub struct ComponentDefinitionLifecycleActionsPostProvision {
2804 /// Specifies the name of the predefined action handler to be invoked for lifecycle actions.
2805 ///
2806 /// Lorry, as a sidecar agent co-located with the database container in the same Pod,
2807 /// includes a suite of built-in action implementations that are tailored to different database engines.
2808 /// These are known as "builtin" handlers, includes: `mysql`, `redis`, `mongodb`, `etcd`,
2809 /// `postgresql`, `vanilla-postgresql`, `apecloud-postgresql`, `wesql`, `oceanbase`, `polardbx`.
2810 ///
2811 /// If the `builtinHandler` field is specified, it instructs Lorry to utilize its internal built-in action handler
2812 /// to execute the specified lifecycle actions.
2813 ///
2814 /// The `builtinHandler` field is of type `BuiltinActionHandlerType`,
2815 /// which represents the name of the built-in handler.
2816 /// The `builtinHandler` specified within the same `ComponentLifecycleActions` should be consistent across all
2817 /// actions.
2818 /// This means that if you specify a built-in handler for one action, you should use the same handler
2819 /// for all other actions throughout the entire `ComponentLifecycleActions` collection.
2820 ///
2821 /// If you need to define lifecycle actions for database engines not covered by the existing built-in support,
2822 /// or when the pre-existing built-in handlers do not meet your specific needs,
2823 /// you can use the `customHandler` field to define your own action implementation.
2824 ///
2825 /// Deprecation Notice:
2826 ///
2827 /// - In the future, the `builtinHandler` field will be deprecated in favor of using the `customHandler` field
2828 /// for configuring all lifecycle actions.
2829 /// - Instead of using a name to indicate the built-in action implementations in Lorry,
2830 /// the recommended approach will be to explicitly invoke the desired action implementation through
2831 /// a gRPC interface exposed by the sidecar agent.
2832 /// - Developers will have the flexibility to either use the built-in action implementations provided by Lorry
2833 /// or develop their own sidecar agent to implement custom actions and expose them via gRPC interfaces.
2834 /// - This change will allow for greater customization and extensibility of lifecycle actions,
2835 /// as developers can create their own "builtin" implementations tailored to their specific requirements.
2836 #[serde(default, skip_serializing_if = "Option::is_none", rename = "builtinHandler")]
2837 pub builtin_handler: Option<String>,
2838 /// Specifies a user-defined hook or procedure that is called to perform the specific lifecycle action.
2839 /// It offers a flexible and expandable approach for customizing the behavior of a Component by leveraging
2840 /// tailored actions.
2841 ///
2842 /// An Action can be implemented as either an ExecAction or an HTTPAction, with future versions planning
2843 /// to support GRPCAction,
2844 /// thereby accommodating unique logic for different database systems within the Action's framework.
2845 ///
2846 /// In future iterations, all built-in handlers are expected to transition to GRPCAction.
2847 /// This change means that Lorry or other sidecar agents will expose the implementation of actions
2848 /// through a GRPC interface for external invocation.
2849 /// Then the controller will interact with these actions via GRPCAction calls.
2850 #[serde(default, skip_serializing_if = "Option::is_none", rename = "customHandler")]
2851 pub custom_handler: Option<ComponentDefinitionLifecycleActionsPostProvisionCustomHandler>,
2852}
2853
2854/// Specifies a user-defined hook or procedure that is called to perform the specific lifecycle action.
2855/// It offers a flexible and expandable approach for customizing the behavior of a Component by leveraging
2856/// tailored actions.
2857///
2858/// An Action can be implemented as either an ExecAction or an HTTPAction, with future versions planning
2859/// to support GRPCAction,
2860/// thereby accommodating unique logic for different database systems within the Action's framework.
2861///
2862/// In future iterations, all built-in handlers are expected to transition to GRPCAction.
2863/// This change means that Lorry or other sidecar agents will expose the implementation of actions
2864/// through a GRPC interface for external invocation.
2865/// Then the controller will interact with these actions via GRPCAction calls.
2866#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
2867pub struct ComponentDefinitionLifecycleActionsPostProvisionCustomHandler {
2868 /// Defines the name of the container within the target Pod where the action will be executed.
2869 ///
2870 /// This name must correspond to one of the containers defined in `componentDefinition.spec.runtime`.
2871 /// If this field is not specified, the default behavior is to use the first container listed in
2872 /// `componentDefinition.spec.runtime`.
2873 ///
2874 /// This field cannot be updated.
2875 ///
2876 /// Note: This field is reserved for future use and is not currently active.
2877 #[serde(default, skip_serializing_if = "Option::is_none")]
2878 pub container: Option<String>,
2879 /// Represents a list of environment variables that will be injected into the container.
2880 /// These variables enable the container to adapt its behavior based on the environment it's running in.
2881 ///
2882 /// This field cannot be updated.
2883 #[serde(default, skip_serializing_if = "Option::is_none")]
2884 pub env: Option<Vec<ComponentDefinitionLifecycleActionsPostProvisionCustomHandlerEnv>>,
2885 /// Defines the command to run.
2886 ///
2887 /// This field cannot be updated.
2888 #[serde(default, skip_serializing_if = "Option::is_none")]
2889 pub exec: Option<ComponentDefinitionLifecycleActionsPostProvisionCustomHandlerExec>,
2890 /// Specifies the HTTP request to perform.
2891 ///
2892 /// This field cannot be updated.
2893 ///
2894 /// Note: HTTPAction is to be implemented in future version.
2895 #[serde(default, skip_serializing_if = "Option::is_none")]
2896 pub http: Option<ComponentDefinitionLifecycleActionsPostProvisionCustomHandlerHttp>,
2897 /// Specifies the container image to be used for running the Action.
2898 ///
2899 /// When specified, a dedicated container will be created using this image to execute the Action.
2900 /// This field is mutually exclusive with the `container` field; only one of them should be provided.
2901 ///
2902 /// This field cannot be updated.
2903 #[serde(default, skip_serializing_if = "Option::is_none")]
2904 pub image: Option<String>,
2905 /// Used in conjunction with the `targetPodSelector` field to refine the selection of target pod(s) for Action execution.
2906 /// The impact of this field depends on the `targetPodSelector` value:
2907 ///
2908 /// - When `targetPodSelector` is set to `Any` or `All`, this field will be ignored.
2909 /// - When `targetPodSelector` is set to `Role`, only those replicas whose role matches the `matchingKey`
2910 /// will be selected for the Action.
2911 ///
2912 /// This field cannot be updated.
2913 ///
2914 /// Note: This field is reserved for future use and is not currently active.
2915 #[serde(default, skip_serializing_if = "Option::is_none", rename = "matchingKey")]
2916 pub matching_key: Option<String>,
2917 /// Specifies the state that the cluster must reach before the Action is executed.
2918 /// Currently, this is only applicable to the `postProvision` action.
2919 ///
2920 /// The conditions are as follows:
2921 ///
2922 /// - `Immediately`: Executed right after the Component object is created.
2923 /// The readiness of the Component and its resources is not guaranteed at this stage.
2924 /// - `RuntimeReady`: The Action is triggered after the Component object has been created and all associated
2925 /// runtime resources (e.g. Pods) are in a ready state.
2926 /// - `ComponentReady`: The Action is triggered after the Component itself is in a ready state.
2927 /// This process does not affect the readiness state of the Component or the Cluster.
2928 /// - `ClusterReady`: The Action is executed after the Cluster is in a ready state.
2929 /// This execution does not alter the Component or the Cluster's state of readiness.
2930 ///
2931 /// This field cannot be updated.
2932 #[serde(default, skip_serializing_if = "Option::is_none", rename = "preCondition")]
2933 pub pre_condition: Option<String>,
2934 /// Defines the strategy to be taken when retrying the Action after a failure.
2935 ///
2936 /// It specifies the conditions under which the Action should be retried and the limits to apply,
2937 /// such as the maximum number of retries and backoff strategy.
2938 ///
2939 /// This field cannot be updated.
2940 #[serde(default, skip_serializing_if = "Option::is_none", rename = "retryPolicy")]
2941 pub retry_policy: Option<ComponentDefinitionLifecycleActionsPostProvisionCustomHandlerRetryPolicy>,
2942 /// Defines the criteria used to select the target Pod(s) for executing the Action.
2943 /// This is useful when there is no default target replica identified.
2944 /// It allows for precise control over which Pod(s) the Action should run in.
2945 ///
2946 /// This field cannot be updated.
2947 ///
2948 /// Note: This field is reserved for future use and is not currently active.
2949 #[serde(default, skip_serializing_if = "Option::is_none", rename = "targetPodSelector")]
2950 pub target_pod_selector: Option<ComponentDefinitionLifecycleActionsPostProvisionCustomHandlerTargetPodSelector>,
2951 /// Specifies the maximum duration in seconds that the Action is allowed to run.
2952 ///
2953 /// If the Action does not complete within this time frame, it will be terminated.
2954 ///
2955 /// This field cannot be updated.
2956 #[serde(default, skip_serializing_if = "Option::is_none", rename = "timeoutSeconds")]
2957 pub timeout_seconds: Option<i32>,
2958}
2959
2960/// EnvVar represents an environment variable present in a Container.
2961#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
2962pub struct ComponentDefinitionLifecycleActionsPostProvisionCustomHandlerEnv {
2963 /// Name of the environment variable. Must be a C_IDENTIFIER.
2964 pub name: String,
2965 /// Variable references $(VAR_NAME) are expanded
2966 /// using the previously defined environment variables in the container and
2967 /// any service environment variables. If a variable cannot be resolved,
2968 /// the reference in the input string will be unchanged. Double $$ are reduced
2969 /// to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e.
2970 /// "$$(VAR_NAME)" will produce the string literal "$(VAR_NAME)".
2971 /// Escaped references will never be expanded, regardless of whether the variable
2972 /// exists or not.
2973 /// Defaults to "".
2974 #[serde(default, skip_serializing_if = "Option::is_none")]
2975 pub value: Option<String>,
2976 /// Source for the environment variable's value. Cannot be used if value is not empty.
2977 #[serde(default, skip_serializing_if = "Option::is_none", rename = "valueFrom")]
2978 pub value_from: Option<ComponentDefinitionLifecycleActionsPostProvisionCustomHandlerEnvValueFrom>,
2979}
2980
2981/// Source for the environment variable's value. Cannot be used if value is not empty.
2982#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
2983pub struct ComponentDefinitionLifecycleActionsPostProvisionCustomHandlerEnvValueFrom {
2984 /// Selects a key of a ConfigMap.
2985 #[serde(default, skip_serializing_if = "Option::is_none", rename = "configMapKeyRef")]
2986 pub config_map_key_ref: Option<ComponentDefinitionLifecycleActionsPostProvisionCustomHandlerEnvValueFromConfigMapKeyRef>,
2987 /// Selects a field of the pod: supports metadata.name, metadata.namespace, `metadata.labels['<KEY>']`, `metadata.annotations['<KEY>']`,
2988 /// spec.nodeName, spec.serviceAccountName, status.hostIP, status.podIP, status.podIPs.
2989 #[serde(default, skip_serializing_if = "Option::is_none", rename = "fieldRef")]
2990 pub field_ref: Option<ComponentDefinitionLifecycleActionsPostProvisionCustomHandlerEnvValueFromFieldRef>,
2991 /// Selects a resource of the container: only resources limits and requests
2992 /// (limits.cpu, limits.memory, limits.ephemeral-storage, requests.cpu, requests.memory and requests.ephemeral-storage) are currently supported.
2993 #[serde(default, skip_serializing_if = "Option::is_none", rename = "resourceFieldRef")]
2994 pub resource_field_ref: Option<ComponentDefinitionLifecycleActionsPostProvisionCustomHandlerEnvValueFromResourceFieldRef>,
2995 /// Selects a key of a secret in the pod's namespace
2996 #[serde(default, skip_serializing_if = "Option::is_none", rename = "secretKeyRef")]
2997 pub secret_key_ref: Option<ComponentDefinitionLifecycleActionsPostProvisionCustomHandlerEnvValueFromSecretKeyRef>,
2998}
2999
3000/// Selects a key of a ConfigMap.
3001#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
3002pub struct ComponentDefinitionLifecycleActionsPostProvisionCustomHandlerEnvValueFromConfigMapKeyRef {
3003 /// The key to select.
3004 pub key: String,
3005 /// Name of the referent.
3006 /// More info: <https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names>
3007 #[serde(default, skip_serializing_if = "Option::is_none")]
3008 pub name: Option<String>,
3009 /// Specify whether the ConfigMap or its key must be defined
3010 #[serde(default, skip_serializing_if = "Option::is_none")]
3011 pub optional: Option<bool>,
3012}
3013
3014/// Selects a field of the pod: supports metadata.name, metadata.namespace, `metadata.labels['<KEY>']`, `metadata.annotations['<KEY>']`,
3015/// spec.nodeName, spec.serviceAccountName, status.hostIP, status.podIP, status.podIPs.
3016#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
3017pub struct ComponentDefinitionLifecycleActionsPostProvisionCustomHandlerEnvValueFromFieldRef {
3018 /// Version of the schema the FieldPath is written in terms of, defaults to "v1".
3019 #[serde(default, skip_serializing_if = "Option::is_none", rename = "apiVersion")]
3020 pub api_version: Option<String>,
3021 /// Path of the field to select in the specified API version.
3022 #[serde(rename = "fieldPath")]
3023 pub field_path: String,
3024}
3025
3026/// Selects a resource of the container: only resources limits and requests
3027/// (limits.cpu, limits.memory, limits.ephemeral-storage, requests.cpu, requests.memory and requests.ephemeral-storage) are currently supported.
3028#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
3029pub struct ComponentDefinitionLifecycleActionsPostProvisionCustomHandlerEnvValueFromResourceFieldRef {
3030 /// Container name: required for volumes, optional for env vars
3031 #[serde(default, skip_serializing_if = "Option::is_none", rename = "containerName")]
3032 pub container_name: Option<String>,
3033 /// Specifies the output format of the exposed resources, defaults to "1"
3034 #[serde(default, skip_serializing_if = "Option::is_none")]
3035 pub divisor: Option<IntOrString>,
3036 /// Required: resource to select
3037 pub resource: String,
3038}
3039
3040/// Selects a key of a secret in the pod's namespace
3041#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
3042pub struct ComponentDefinitionLifecycleActionsPostProvisionCustomHandlerEnvValueFromSecretKeyRef {
3043 /// The key of the secret to select from. Must be a valid secret key.
3044 pub key: String,
3045 /// Name of the referent.
3046 /// More info: <https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names>
3047 #[serde(default, skip_serializing_if = "Option::is_none")]
3048 pub name: Option<String>,
3049 /// Specify whether the Secret or its key must be defined
3050 #[serde(default, skip_serializing_if = "Option::is_none")]
3051 pub optional: Option<bool>,
3052}
3053
3054/// Defines the command to run.
3055///
3056/// This field cannot be updated.
3057#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
3058pub struct ComponentDefinitionLifecycleActionsPostProvisionCustomHandlerExec {
3059 /// Args represents the arguments that are passed to the `command` for execution.
3060 #[serde(default, skip_serializing_if = "Option::is_none")]
3061 pub args: Option<Vec<String>>,
3062 /// Specifies the command to be executed inside the container.
3063 /// The working directory for this command is the container's root directory('/').
3064 /// Commands are executed directly without a shell environment, meaning shell-specific syntax ('|', etc.) is not supported.
3065 /// If the shell is required, it must be explicitly invoked in the command.
3066 ///
3067 /// A successful execution is indicated by an exit status of 0; any non-zero status signifies a failure.
3068 #[serde(default, skip_serializing_if = "Option::is_none")]
3069 pub command: Option<Vec<String>>,
3070}
3071
3072/// Specifies the HTTP request to perform.
3073///
3074/// This field cannot be updated.
3075///
3076/// Note: HTTPAction is to be implemented in future version.
3077#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
3078pub struct ComponentDefinitionLifecycleActionsPostProvisionCustomHandlerHttp {
3079 /// Indicates the server's domain name or IP address. Defaults to the Pod's IP.
3080 /// Prefer setting the "Host" header in httpHeaders when needed.
3081 #[serde(default, skip_serializing_if = "Option::is_none")]
3082 pub host: Option<String>,
3083 /// Allows for the inclusion of custom headers in the request.
3084 /// HTTP permits the use of repeated headers.
3085 #[serde(default, skip_serializing_if = "Option::is_none", rename = "httpHeaders")]
3086 pub http_headers: Option<Vec<ComponentDefinitionLifecycleActionsPostProvisionCustomHandlerHttpHttpHeaders>>,
3087 /// Represents the type of HTTP request to be made, such as "GET," "POST," "PUT," etc.
3088 /// If not specified, "GET" is the default method.
3089 #[serde(default, skip_serializing_if = "Option::is_none")]
3090 pub method: Option<String>,
3091 /// Specifies the endpoint to be requested on the HTTP server.
3092 #[serde(default, skip_serializing_if = "Option::is_none")]
3093 pub path: Option<String>,
3094 /// Specifies the target port for the HTTP request.
3095 /// It can be specified either as a numeric value in the range of 1 to 65535,
3096 /// or as a named port that meets the IANA_SVC_NAME specification.
3097 pub port: IntOrString,
3098 /// Designates the protocol used to make the request, such as HTTP or HTTPS.
3099 /// If not specified, HTTP is used by default.
3100 #[serde(default, skip_serializing_if = "Option::is_none")]
3101 pub scheme: Option<String>,
3102}
3103
3104/// HTTPHeader describes a custom header to be used in HTTP probes
3105#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
3106pub struct ComponentDefinitionLifecycleActionsPostProvisionCustomHandlerHttpHttpHeaders {
3107 /// The header field name.
3108 /// This will be canonicalized upon output, so case-variant names will be understood as the same header.
3109 pub name: String,
3110 /// The header field value
3111 pub value: String,
3112}
3113
3114/// Defines the strategy to be taken when retrying the Action after a failure.
3115///
3116/// It specifies the conditions under which the Action should be retried and the limits to apply,
3117/// such as the maximum number of retries and backoff strategy.
3118///
3119/// This field cannot be updated.
3120#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
3121pub struct ComponentDefinitionLifecycleActionsPostProvisionCustomHandlerRetryPolicy {
3122 /// Defines the maximum number of retry attempts that should be made for a given Action.
3123 /// This value is set to 0 by default, indicating that no retries will be made.
3124 #[serde(default, skip_serializing_if = "Option::is_none", rename = "maxRetries")]
3125 pub max_retries: Option<i64>,
3126 /// Indicates the duration of time to wait between each retry attempt.
3127 /// This value is set to 0 by default, indicating that there will be no delay between retry attempts.
3128 #[serde(default, skip_serializing_if = "Option::is_none", rename = "retryInterval")]
3129 pub retry_interval: Option<i64>,
3130}
3131
3132/// Specifies a user-defined hook or procedure that is called to perform the specific lifecycle action.
3133/// It offers a flexible and expandable approach for customizing the behavior of a Component by leveraging
3134/// tailored actions.
3135///
3136/// An Action can be implemented as either an ExecAction or an HTTPAction, with future versions planning
3137/// to support GRPCAction,
3138/// thereby accommodating unique logic for different database systems within the Action's framework.
3139///
3140/// In future iterations, all built-in handlers are expected to transition to GRPCAction.
3141/// This change means that Lorry or other sidecar agents will expose the implementation of actions
3142/// through a GRPC interface for external invocation.
3143/// Then the controller will interact with these actions via GRPCAction calls.
3144#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
3145pub enum ComponentDefinitionLifecycleActionsPostProvisionCustomHandlerTargetPodSelector {
3146 Any,
3147 All,
3148 Role,
3149 Ordinal,
3150}
3151
3152/// Specifies the hook to be executed prior to terminating a component.
3153///
3154/// The PreTerminate Action is intended to run only once.
3155///
3156/// This action is executed immediately when a scale-down operation for the Component is initiated.
3157/// The actual termination and cleanup of the Component and its associated resources will not proceed
3158/// until the PreTerminate action has completed successfully.
3159///
3160/// The container executing this action has access to following environment variables:
3161///
3162/// - KB_CLUSTER_POD_IP_LIST: Comma-separated list of the cluster's pod IP addresses (e.g., "podIp1,podIp2").
3163/// - KB_CLUSTER_POD_NAME_LIST: Comma-separated list of the cluster's pod names (e.g., "pod1,pod2").
3164/// - KB_CLUSTER_POD_HOST_NAME_LIST: Comma-separated list of host names, each corresponding to a pod in
3165/// KB_CLUSTER_POD_NAME_LIST (e.g., "hostName1,hostName2").
3166/// - KB_CLUSTER_POD_HOST_IP_LIST: Comma-separated list of host IP addresses, each corresponding to a pod in
3167/// KB_CLUSTER_POD_NAME_LIST (e.g., "hostIp1,hostIp2").
3168///
3169/// - KB_CLUSTER_COMPONENT_POD_NAME_LIST: Comma-separated list of all pod names within the component
3170/// (e.g., "pod1,pod2").
3171/// - KB_CLUSTER_COMPONENT_POD_IP_LIST: Comma-separated list of pod IP addresses,
3172/// matching the order of pods in KB_CLUSTER_COMPONENT_POD_NAME_LIST (e.g., "podIp1,podIp2").
3173/// - KB_CLUSTER_COMPONENT_POD_HOST_NAME_LIST: Comma-separated list of host names for each pod,
3174/// matching the order of pods in KB_CLUSTER_COMPONENT_POD_NAME_LIST (e.g., "hostName1,hostName2").
3175/// - KB_CLUSTER_COMPONENT_POD_HOST_IP_LIST: Comma-separated list of host IP addresses for each pod,
3176/// matching the order of pods in KB_CLUSTER_COMPONENT_POD_NAME_LIST (e.g., "hostIp1,hostIp2").
3177///
3178/// - KB_CLUSTER_COMPONENT_LIST: Comma-separated list of all cluster components (e.g., "comp1,comp2").
3179/// - KB_CLUSTER_COMPONENT_DELETING_LIST: Comma-separated list of components that are currently being deleted
3180/// (e.g., "comp1,comp2").
3181/// - KB_CLUSTER_COMPONENT_UNDELETED_LIST: Comma-separated list of components that are not being deleted
3182/// (e.g., "comp1,comp2").
3183///
3184/// - KB_CLUSTER_COMPONENT_IS_SCALING_IN: Indicates whether the component is currently scaling in.
3185/// If this variable is present and set to "true", it denotes that the component is undergoing a scale-in operation.
3186/// During scale-in, data rebalancing is necessary to maintain cluster integrity.
3187/// Contrast this with a cluster deletion scenario where data rebalancing is not required as the entire cluster
3188/// is being cleaned up.
3189///
3190/// Note: This field is immutable once it has been set.
3191#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
3192pub struct ComponentDefinitionLifecycleActionsPreTerminate {
3193 /// Specifies the name of the predefined action handler to be invoked for lifecycle actions.
3194 ///
3195 /// Lorry, as a sidecar agent co-located with the database container in the same Pod,
3196 /// includes a suite of built-in action implementations that are tailored to different database engines.
3197 /// These are known as "builtin" handlers, includes: `mysql`, `redis`, `mongodb`, `etcd`,
3198 /// `postgresql`, `vanilla-postgresql`, `apecloud-postgresql`, `wesql`, `oceanbase`, `polardbx`.
3199 ///
3200 /// If the `builtinHandler` field is specified, it instructs Lorry to utilize its internal built-in action handler
3201 /// to execute the specified lifecycle actions.
3202 ///
3203 /// The `builtinHandler` field is of type `BuiltinActionHandlerType`,
3204 /// which represents the name of the built-in handler.
3205 /// The `builtinHandler` specified within the same `ComponentLifecycleActions` should be consistent across all
3206 /// actions.
3207 /// This means that if you specify a built-in handler for one action, you should use the same handler
3208 /// for all other actions throughout the entire `ComponentLifecycleActions` collection.
3209 ///
3210 /// If you need to define lifecycle actions for database engines not covered by the existing built-in support,
3211 /// or when the pre-existing built-in handlers do not meet your specific needs,
3212 /// you can use the `customHandler` field to define your own action implementation.
3213 ///
3214 /// Deprecation Notice:
3215 ///
3216 /// - In the future, the `builtinHandler` field will be deprecated in favor of using the `customHandler` field
3217 /// for configuring all lifecycle actions.
3218 /// - Instead of using a name to indicate the built-in action implementations in Lorry,
3219 /// the recommended approach will be to explicitly invoke the desired action implementation through
3220 /// a gRPC interface exposed by the sidecar agent.
3221 /// - Developers will have the flexibility to either use the built-in action implementations provided by Lorry
3222 /// or develop their own sidecar agent to implement custom actions and expose them via gRPC interfaces.
3223 /// - This change will allow for greater customization and extensibility of lifecycle actions,
3224 /// as developers can create their own "builtin" implementations tailored to their specific requirements.
3225 #[serde(default, skip_serializing_if = "Option::is_none", rename = "builtinHandler")]
3226 pub builtin_handler: Option<String>,
3227 /// Specifies a user-defined hook or procedure that is called to perform the specific lifecycle action.
3228 /// It offers a flexible and expandable approach for customizing the behavior of a Component by leveraging
3229 /// tailored actions.
3230 ///
3231 /// An Action can be implemented as either an ExecAction or an HTTPAction, with future versions planning
3232 /// to support GRPCAction,
3233 /// thereby accommodating unique logic for different database systems within the Action's framework.
3234 ///
3235 /// In future iterations, all built-in handlers are expected to transition to GRPCAction.
3236 /// This change means that Lorry or other sidecar agents will expose the implementation of actions
3237 /// through a GRPC interface for external invocation.
3238 /// Then the controller will interact with these actions via GRPCAction calls.
3239 #[serde(default, skip_serializing_if = "Option::is_none", rename = "customHandler")]
3240 pub custom_handler: Option<ComponentDefinitionLifecycleActionsPreTerminateCustomHandler>,
3241}
3242
3243/// Specifies a user-defined hook or procedure that is called to perform the specific lifecycle action.
3244/// It offers a flexible and expandable approach for customizing the behavior of a Component by leveraging
3245/// tailored actions.
3246///
3247/// An Action can be implemented as either an ExecAction or an HTTPAction, with future versions planning
3248/// to support GRPCAction,
3249/// thereby accommodating unique logic for different database systems within the Action's framework.
3250///
3251/// In future iterations, all built-in handlers are expected to transition to GRPCAction.
3252/// This change means that Lorry or other sidecar agents will expose the implementation of actions
3253/// through a GRPC interface for external invocation.
3254/// Then the controller will interact with these actions via GRPCAction calls.
3255#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
3256pub struct ComponentDefinitionLifecycleActionsPreTerminateCustomHandler {
3257 /// Defines the name of the container within the target Pod where the action will be executed.
3258 ///
3259 /// This name must correspond to one of the containers defined in `componentDefinition.spec.runtime`.
3260 /// If this field is not specified, the default behavior is to use the first container listed in
3261 /// `componentDefinition.spec.runtime`.
3262 ///
3263 /// This field cannot be updated.
3264 ///
3265 /// Note: This field is reserved for future use and is not currently active.
3266 #[serde(default, skip_serializing_if = "Option::is_none")]
3267 pub container: Option<String>,
3268 /// Represents a list of environment variables that will be injected into the container.
3269 /// These variables enable the container to adapt its behavior based on the environment it's running in.
3270 ///
3271 /// This field cannot be updated.
3272 #[serde(default, skip_serializing_if = "Option::is_none")]
3273 pub env: Option<Vec<ComponentDefinitionLifecycleActionsPreTerminateCustomHandlerEnv>>,
3274 /// Defines the command to run.
3275 ///
3276 /// This field cannot be updated.
3277 #[serde(default, skip_serializing_if = "Option::is_none")]
3278 pub exec: Option<ComponentDefinitionLifecycleActionsPreTerminateCustomHandlerExec>,
3279 /// Specifies the HTTP request to perform.
3280 ///
3281 /// This field cannot be updated.
3282 ///
3283 /// Note: HTTPAction is to be implemented in future version.
3284 #[serde(default, skip_serializing_if = "Option::is_none")]
3285 pub http: Option<ComponentDefinitionLifecycleActionsPreTerminateCustomHandlerHttp>,
3286 /// Specifies the container image to be used for running the Action.
3287 ///
3288 /// When specified, a dedicated container will be created using this image to execute the Action.
3289 /// This field is mutually exclusive with the `container` field; only one of them should be provided.
3290 ///
3291 /// This field cannot be updated.
3292 #[serde(default, skip_serializing_if = "Option::is_none")]
3293 pub image: Option<String>,
3294 /// Used in conjunction with the `targetPodSelector` field to refine the selection of target pod(s) for Action execution.
3295 /// The impact of this field depends on the `targetPodSelector` value:
3296 ///
3297 /// - When `targetPodSelector` is set to `Any` or `All`, this field will be ignored.
3298 /// - When `targetPodSelector` is set to `Role`, only those replicas whose role matches the `matchingKey`
3299 /// will be selected for the Action.
3300 ///
3301 /// This field cannot be updated.
3302 ///
3303 /// Note: This field is reserved for future use and is not currently active.
3304 #[serde(default, skip_serializing_if = "Option::is_none", rename = "matchingKey")]
3305 pub matching_key: Option<String>,
3306 /// Specifies the state that the cluster must reach before the Action is executed.
3307 /// Currently, this is only applicable to the `postProvision` action.
3308 ///
3309 /// The conditions are as follows:
3310 ///
3311 /// - `Immediately`: Executed right after the Component object is created.
3312 /// The readiness of the Component and its resources is not guaranteed at this stage.
3313 /// - `RuntimeReady`: The Action is triggered after the Component object has been created and all associated
3314 /// runtime resources (e.g. Pods) are in a ready state.
3315 /// - `ComponentReady`: The Action is triggered after the Component itself is in a ready state.
3316 /// This process does not affect the readiness state of the Component or the Cluster.
3317 /// - `ClusterReady`: The Action is executed after the Cluster is in a ready state.
3318 /// This execution does not alter the Component or the Cluster's state of readiness.
3319 ///
3320 /// This field cannot be updated.
3321 #[serde(default, skip_serializing_if = "Option::is_none", rename = "preCondition")]
3322 pub pre_condition: Option<String>,
3323 /// Defines the strategy to be taken when retrying the Action after a failure.
3324 ///
3325 /// It specifies the conditions under which the Action should be retried and the limits to apply,
3326 /// such as the maximum number of retries and backoff strategy.
3327 ///
3328 /// This field cannot be updated.
3329 #[serde(default, skip_serializing_if = "Option::is_none", rename = "retryPolicy")]
3330 pub retry_policy: Option<ComponentDefinitionLifecycleActionsPreTerminateCustomHandlerRetryPolicy>,
3331 /// Defines the criteria used to select the target Pod(s) for executing the Action.
3332 /// This is useful when there is no default target replica identified.
3333 /// It allows for precise control over which Pod(s) the Action should run in.
3334 ///
3335 /// This field cannot be updated.
3336 ///
3337 /// Note: This field is reserved for future use and is not currently active.
3338 #[serde(default, skip_serializing_if = "Option::is_none", rename = "targetPodSelector")]
3339 pub target_pod_selector: Option<ComponentDefinitionLifecycleActionsPreTerminateCustomHandlerTargetPodSelector>,
3340 /// Specifies the maximum duration in seconds that the Action is allowed to run.
3341 ///
3342 /// If the Action does not complete within this time frame, it will be terminated.
3343 ///
3344 /// This field cannot be updated.
3345 #[serde(default, skip_serializing_if = "Option::is_none", rename = "timeoutSeconds")]
3346 pub timeout_seconds: Option<i32>,
3347}
3348
3349/// EnvVar represents an environment variable present in a Container.
3350#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
3351pub struct ComponentDefinitionLifecycleActionsPreTerminateCustomHandlerEnv {
3352 /// Name of the environment variable. Must be a C_IDENTIFIER.
3353 pub name: String,
3354 /// Variable references $(VAR_NAME) are expanded
3355 /// using the previously defined environment variables in the container and
3356 /// any service environment variables. If a variable cannot be resolved,
3357 /// the reference in the input string will be unchanged. Double $$ are reduced
3358 /// to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e.
3359 /// "$$(VAR_NAME)" will produce the string literal "$(VAR_NAME)".
3360 /// Escaped references will never be expanded, regardless of whether the variable
3361 /// exists or not.
3362 /// Defaults to "".
3363 #[serde(default, skip_serializing_if = "Option::is_none")]
3364 pub value: Option<String>,
3365 /// Source for the environment variable's value. Cannot be used if value is not empty.
3366 #[serde(default, skip_serializing_if = "Option::is_none", rename = "valueFrom")]
3367 pub value_from: Option<ComponentDefinitionLifecycleActionsPreTerminateCustomHandlerEnvValueFrom>,
3368}
3369
3370/// Source for the environment variable's value. Cannot be used if value is not empty.
3371#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
3372pub struct ComponentDefinitionLifecycleActionsPreTerminateCustomHandlerEnvValueFrom {
3373 /// Selects a key of a ConfigMap.
3374 #[serde(default, skip_serializing_if = "Option::is_none", rename = "configMapKeyRef")]
3375 pub config_map_key_ref: Option<ComponentDefinitionLifecycleActionsPreTerminateCustomHandlerEnvValueFromConfigMapKeyRef>,
3376 /// Selects a field of the pod: supports metadata.name, metadata.namespace, `metadata.labels['<KEY>']`, `metadata.annotations['<KEY>']`,
3377 /// spec.nodeName, spec.serviceAccountName, status.hostIP, status.podIP, status.podIPs.
3378 #[serde(default, skip_serializing_if = "Option::is_none", rename = "fieldRef")]
3379 pub field_ref: Option<ComponentDefinitionLifecycleActionsPreTerminateCustomHandlerEnvValueFromFieldRef>,
3380 /// Selects a resource of the container: only resources limits and requests
3381 /// (limits.cpu, limits.memory, limits.ephemeral-storage, requests.cpu, requests.memory and requests.ephemeral-storage) are currently supported.
3382 #[serde(default, skip_serializing_if = "Option::is_none", rename = "resourceFieldRef")]
3383 pub resource_field_ref: Option<ComponentDefinitionLifecycleActionsPreTerminateCustomHandlerEnvValueFromResourceFieldRef>,
3384 /// Selects a key of a secret in the pod's namespace
3385 #[serde(default, skip_serializing_if = "Option::is_none", rename = "secretKeyRef")]
3386 pub secret_key_ref: Option<ComponentDefinitionLifecycleActionsPreTerminateCustomHandlerEnvValueFromSecretKeyRef>,
3387}
3388
3389/// Selects a key of a ConfigMap.
3390#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
3391pub struct ComponentDefinitionLifecycleActionsPreTerminateCustomHandlerEnvValueFromConfigMapKeyRef {
3392 /// The key to select.
3393 pub key: String,
3394 /// Name of the referent.
3395 /// More info: <https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names>
3396 #[serde(default, skip_serializing_if = "Option::is_none")]
3397 pub name: Option<String>,
3398 /// Specify whether the ConfigMap or its key must be defined
3399 #[serde(default, skip_serializing_if = "Option::is_none")]
3400 pub optional: Option<bool>,
3401}
3402
3403/// Selects a field of the pod: supports metadata.name, metadata.namespace, `metadata.labels['<KEY>']`, `metadata.annotations['<KEY>']`,
3404/// spec.nodeName, spec.serviceAccountName, status.hostIP, status.podIP, status.podIPs.
3405#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
3406pub struct ComponentDefinitionLifecycleActionsPreTerminateCustomHandlerEnvValueFromFieldRef {
3407 /// Version of the schema the FieldPath is written in terms of, defaults to "v1".
3408 #[serde(default, skip_serializing_if = "Option::is_none", rename = "apiVersion")]
3409 pub api_version: Option<String>,
3410 /// Path of the field to select in the specified API version.
3411 #[serde(rename = "fieldPath")]
3412 pub field_path: String,
3413}
3414
3415/// Selects a resource of the container: only resources limits and requests
3416/// (limits.cpu, limits.memory, limits.ephemeral-storage, requests.cpu, requests.memory and requests.ephemeral-storage) are currently supported.
3417#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
3418pub struct ComponentDefinitionLifecycleActionsPreTerminateCustomHandlerEnvValueFromResourceFieldRef {
3419 /// Container name: required for volumes, optional for env vars
3420 #[serde(default, skip_serializing_if = "Option::is_none", rename = "containerName")]
3421 pub container_name: Option<String>,
3422 /// Specifies the output format of the exposed resources, defaults to "1"
3423 #[serde(default, skip_serializing_if = "Option::is_none")]
3424 pub divisor: Option<IntOrString>,
3425 /// Required: resource to select
3426 pub resource: String,
3427}
3428
3429/// Selects a key of a secret in the pod's namespace
3430#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
3431pub struct ComponentDefinitionLifecycleActionsPreTerminateCustomHandlerEnvValueFromSecretKeyRef {
3432 /// The key of the secret to select from. Must be a valid secret key.
3433 pub key: String,
3434 /// Name of the referent.
3435 /// More info: <https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names>
3436 #[serde(default, skip_serializing_if = "Option::is_none")]
3437 pub name: Option<String>,
3438 /// Specify whether the Secret or its key must be defined
3439 #[serde(default, skip_serializing_if = "Option::is_none")]
3440 pub optional: Option<bool>,
3441}
3442
3443/// Defines the command to run.
3444///
3445/// This field cannot be updated.
3446#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
3447pub struct ComponentDefinitionLifecycleActionsPreTerminateCustomHandlerExec {
3448 /// Args represents the arguments that are passed to the `command` for execution.
3449 #[serde(default, skip_serializing_if = "Option::is_none")]
3450 pub args: Option<Vec<String>>,
3451 /// Specifies the command to be executed inside the container.
3452 /// The working directory for this command is the container's root directory('/').
3453 /// Commands are executed directly without a shell environment, meaning shell-specific syntax ('|', etc.) is not supported.
3454 /// If the shell is required, it must be explicitly invoked in the command.
3455 ///
3456 /// A successful execution is indicated by an exit status of 0; any non-zero status signifies a failure.
3457 #[serde(default, skip_serializing_if = "Option::is_none")]
3458 pub command: Option<Vec<String>>,
3459}
3460
3461/// Specifies the HTTP request to perform.
3462///
3463/// This field cannot be updated.
3464///
3465/// Note: HTTPAction is to be implemented in future version.
3466#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
3467pub struct ComponentDefinitionLifecycleActionsPreTerminateCustomHandlerHttp {
3468 /// Indicates the server's domain name or IP address. Defaults to the Pod's IP.
3469 /// Prefer setting the "Host" header in httpHeaders when needed.
3470 #[serde(default, skip_serializing_if = "Option::is_none")]
3471 pub host: Option<String>,
3472 /// Allows for the inclusion of custom headers in the request.
3473 /// HTTP permits the use of repeated headers.
3474 #[serde(default, skip_serializing_if = "Option::is_none", rename = "httpHeaders")]
3475 pub http_headers: Option<Vec<ComponentDefinitionLifecycleActionsPreTerminateCustomHandlerHttpHttpHeaders>>,
3476 /// Represents the type of HTTP request to be made, such as "GET," "POST," "PUT," etc.
3477 /// If not specified, "GET" is the default method.
3478 #[serde(default, skip_serializing_if = "Option::is_none")]
3479 pub method: Option<String>,
3480 /// Specifies the endpoint to be requested on the HTTP server.
3481 #[serde(default, skip_serializing_if = "Option::is_none")]
3482 pub path: Option<String>,
3483 /// Specifies the target port for the HTTP request.
3484 /// It can be specified either as a numeric value in the range of 1 to 65535,
3485 /// or as a named port that meets the IANA_SVC_NAME specification.
3486 pub port: IntOrString,
3487 /// Designates the protocol used to make the request, such as HTTP or HTTPS.
3488 /// If not specified, HTTP is used by default.
3489 #[serde(default, skip_serializing_if = "Option::is_none")]
3490 pub scheme: Option<String>,
3491}
3492
3493/// HTTPHeader describes a custom header to be used in HTTP probes
3494#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
3495pub struct ComponentDefinitionLifecycleActionsPreTerminateCustomHandlerHttpHttpHeaders {
3496 /// The header field name.
3497 /// This will be canonicalized upon output, so case-variant names will be understood as the same header.
3498 pub name: String,
3499 /// The header field value
3500 pub value: String,
3501}
3502
3503/// Defines the strategy to be taken when retrying the Action after a failure.
3504///
3505/// It specifies the conditions under which the Action should be retried and the limits to apply,
3506/// such as the maximum number of retries and backoff strategy.
3507///
3508/// This field cannot be updated.
3509#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
3510pub struct ComponentDefinitionLifecycleActionsPreTerminateCustomHandlerRetryPolicy {
3511 /// Defines the maximum number of retry attempts that should be made for a given Action.
3512 /// This value is set to 0 by default, indicating that no retries will be made.
3513 #[serde(default, skip_serializing_if = "Option::is_none", rename = "maxRetries")]
3514 pub max_retries: Option<i64>,
3515 /// Indicates the duration of time to wait between each retry attempt.
3516 /// This value is set to 0 by default, indicating that there will be no delay between retry attempts.
3517 #[serde(default, skip_serializing_if = "Option::is_none", rename = "retryInterval")]
3518 pub retry_interval: Option<i64>,
3519}
3520
3521/// Specifies a user-defined hook or procedure that is called to perform the specific lifecycle action.
3522/// It offers a flexible and expandable approach for customizing the behavior of a Component by leveraging
3523/// tailored actions.
3524///
3525/// An Action can be implemented as either an ExecAction or an HTTPAction, with future versions planning
3526/// to support GRPCAction,
3527/// thereby accommodating unique logic for different database systems within the Action's framework.
3528///
3529/// In future iterations, all built-in handlers are expected to transition to GRPCAction.
3530/// This change means that Lorry or other sidecar agents will expose the implementation of actions
3531/// through a GRPC interface for external invocation.
3532/// Then the controller will interact with these actions via GRPCAction calls.
3533#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
3534pub enum ComponentDefinitionLifecycleActionsPreTerminateCustomHandlerTargetPodSelector {
3535 Any,
3536 All,
3537 Role,
3538 Ordinal,
3539}
3540
3541/// Defines the procedure to switch a replica into the read-only state.
3542///
3543/// Use Case:
3544/// This action is invoked when the database's volume capacity nears its upper limit and space is about to be exhausted.
3545///
3546/// The container executing this action has access to following environment variables:
3547///
3548/// - KB_POD_FQDN: The FQDN of the replica pod whose role is being checked.
3549/// - KB_SERVICE_PORT: The port used by the database service.
3550/// - KB_SERVICE_USER: The username with the necessary permissions to interact with the database service.
3551/// - KB_SERVICE_PASSWORD: The corresponding password for KB_SERVICE_USER to authenticate with the database service.
3552///
3553/// Expected action output:
3554/// - On Failure: An error message, if applicable, indicating why the action failed.
3555///
3556/// Note: This field is immutable once it has been set.
3557#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
3558pub struct ComponentDefinitionLifecycleActionsReadonly {
3559 /// Specifies the name of the predefined action handler to be invoked for lifecycle actions.
3560 ///
3561 /// Lorry, as a sidecar agent co-located with the database container in the same Pod,
3562 /// includes a suite of built-in action implementations that are tailored to different database engines.
3563 /// These are known as "builtin" handlers, includes: `mysql`, `redis`, `mongodb`, `etcd`,
3564 /// `postgresql`, `vanilla-postgresql`, `apecloud-postgresql`, `wesql`, `oceanbase`, `polardbx`.
3565 ///
3566 /// If the `builtinHandler` field is specified, it instructs Lorry to utilize its internal built-in action handler
3567 /// to execute the specified lifecycle actions.
3568 ///
3569 /// The `builtinHandler` field is of type `BuiltinActionHandlerType`,
3570 /// which represents the name of the built-in handler.
3571 /// The `builtinHandler` specified within the same `ComponentLifecycleActions` should be consistent across all
3572 /// actions.
3573 /// This means that if you specify a built-in handler for one action, you should use the same handler
3574 /// for all other actions throughout the entire `ComponentLifecycleActions` collection.
3575 ///
3576 /// If you need to define lifecycle actions for database engines not covered by the existing built-in support,
3577 /// or when the pre-existing built-in handlers do not meet your specific needs,
3578 /// you can use the `customHandler` field to define your own action implementation.
3579 ///
3580 /// Deprecation Notice:
3581 ///
3582 /// - In the future, the `builtinHandler` field will be deprecated in favor of using the `customHandler` field
3583 /// for configuring all lifecycle actions.
3584 /// - Instead of using a name to indicate the built-in action implementations in Lorry,
3585 /// the recommended approach will be to explicitly invoke the desired action implementation through
3586 /// a gRPC interface exposed by the sidecar agent.
3587 /// - Developers will have the flexibility to either use the built-in action implementations provided by Lorry
3588 /// or develop their own sidecar agent to implement custom actions and expose them via gRPC interfaces.
3589 /// - This change will allow for greater customization and extensibility of lifecycle actions,
3590 /// as developers can create their own "builtin" implementations tailored to their specific requirements.
3591 #[serde(default, skip_serializing_if = "Option::is_none", rename = "builtinHandler")]
3592 pub builtin_handler: Option<String>,
3593 /// Specifies a user-defined hook or procedure that is called to perform the specific lifecycle action.
3594 /// It offers a flexible and expandable approach for customizing the behavior of a Component by leveraging
3595 /// tailored actions.
3596 ///
3597 /// An Action can be implemented as either an ExecAction or an HTTPAction, with future versions planning
3598 /// to support GRPCAction,
3599 /// thereby accommodating unique logic for different database systems within the Action's framework.
3600 ///
3601 /// In future iterations, all built-in handlers are expected to transition to GRPCAction.
3602 /// This change means that Lorry or other sidecar agents will expose the implementation of actions
3603 /// through a GRPC interface for external invocation.
3604 /// Then the controller will interact with these actions via GRPCAction calls.
3605 #[serde(default, skip_serializing_if = "Option::is_none", rename = "customHandler")]
3606 pub custom_handler: Option<ComponentDefinitionLifecycleActionsReadonlyCustomHandler>,
3607}
3608
3609/// Specifies a user-defined hook or procedure that is called to perform the specific lifecycle action.
3610/// It offers a flexible and expandable approach for customizing the behavior of a Component by leveraging
3611/// tailored actions.
3612///
3613/// An Action can be implemented as either an ExecAction or an HTTPAction, with future versions planning
3614/// to support GRPCAction,
3615/// thereby accommodating unique logic for different database systems within the Action's framework.
3616///
3617/// In future iterations, all built-in handlers are expected to transition to GRPCAction.
3618/// This change means that Lorry or other sidecar agents will expose the implementation of actions
3619/// through a GRPC interface for external invocation.
3620/// Then the controller will interact with these actions via GRPCAction calls.
3621#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
3622pub struct ComponentDefinitionLifecycleActionsReadonlyCustomHandler {
3623 /// Defines the name of the container within the target Pod where the action will be executed.
3624 ///
3625 /// This name must correspond to one of the containers defined in `componentDefinition.spec.runtime`.
3626 /// If this field is not specified, the default behavior is to use the first container listed in
3627 /// `componentDefinition.spec.runtime`.
3628 ///
3629 /// This field cannot be updated.
3630 ///
3631 /// Note: This field is reserved for future use and is not currently active.
3632 #[serde(default, skip_serializing_if = "Option::is_none")]
3633 pub container: Option<String>,
3634 /// Represents a list of environment variables that will be injected into the container.
3635 /// These variables enable the container to adapt its behavior based on the environment it's running in.
3636 ///
3637 /// This field cannot be updated.
3638 #[serde(default, skip_serializing_if = "Option::is_none")]
3639 pub env: Option<Vec<ComponentDefinitionLifecycleActionsReadonlyCustomHandlerEnv>>,
3640 /// Defines the command to run.
3641 ///
3642 /// This field cannot be updated.
3643 #[serde(default, skip_serializing_if = "Option::is_none")]
3644 pub exec: Option<ComponentDefinitionLifecycleActionsReadonlyCustomHandlerExec>,
3645 /// Specifies the HTTP request to perform.
3646 ///
3647 /// This field cannot be updated.
3648 ///
3649 /// Note: HTTPAction is to be implemented in future version.
3650 #[serde(default, skip_serializing_if = "Option::is_none")]
3651 pub http: Option<ComponentDefinitionLifecycleActionsReadonlyCustomHandlerHttp>,
3652 /// Specifies the container image to be used for running the Action.
3653 ///
3654 /// When specified, a dedicated container will be created using this image to execute the Action.
3655 /// This field is mutually exclusive with the `container` field; only one of them should be provided.
3656 ///
3657 /// This field cannot be updated.
3658 #[serde(default, skip_serializing_if = "Option::is_none")]
3659 pub image: Option<String>,
3660 /// Used in conjunction with the `targetPodSelector` field to refine the selection of target pod(s) for Action execution.
3661 /// The impact of this field depends on the `targetPodSelector` value:
3662 ///
3663 /// - When `targetPodSelector` is set to `Any` or `All`, this field will be ignored.
3664 /// - When `targetPodSelector` is set to `Role`, only those replicas whose role matches the `matchingKey`
3665 /// will be selected for the Action.
3666 ///
3667 /// This field cannot be updated.
3668 ///
3669 /// Note: This field is reserved for future use and is not currently active.
3670 #[serde(default, skip_serializing_if = "Option::is_none", rename = "matchingKey")]
3671 pub matching_key: Option<String>,
3672 /// Specifies the state that the cluster must reach before the Action is executed.
3673 /// Currently, this is only applicable to the `postProvision` action.
3674 ///
3675 /// The conditions are as follows:
3676 ///
3677 /// - `Immediately`: Executed right after the Component object is created.
3678 /// The readiness of the Component and its resources is not guaranteed at this stage.
3679 /// - `RuntimeReady`: The Action is triggered after the Component object has been created and all associated
3680 /// runtime resources (e.g. Pods) are in a ready state.
3681 /// - `ComponentReady`: The Action is triggered after the Component itself is in a ready state.
3682 /// This process does not affect the readiness state of the Component or the Cluster.
3683 /// - `ClusterReady`: The Action is executed after the Cluster is in a ready state.
3684 /// This execution does not alter the Component or the Cluster's state of readiness.
3685 ///
3686 /// This field cannot be updated.
3687 #[serde(default, skip_serializing_if = "Option::is_none", rename = "preCondition")]
3688 pub pre_condition: Option<String>,
3689 /// Defines the strategy to be taken when retrying the Action after a failure.
3690 ///
3691 /// It specifies the conditions under which the Action should be retried and the limits to apply,
3692 /// such as the maximum number of retries and backoff strategy.
3693 ///
3694 /// This field cannot be updated.
3695 #[serde(default, skip_serializing_if = "Option::is_none", rename = "retryPolicy")]
3696 pub retry_policy: Option<ComponentDefinitionLifecycleActionsReadonlyCustomHandlerRetryPolicy>,
3697 /// Defines the criteria used to select the target Pod(s) for executing the Action.
3698 /// This is useful when there is no default target replica identified.
3699 /// It allows for precise control over which Pod(s) the Action should run in.
3700 ///
3701 /// This field cannot be updated.
3702 ///
3703 /// Note: This field is reserved for future use and is not currently active.
3704 #[serde(default, skip_serializing_if = "Option::is_none", rename = "targetPodSelector")]
3705 pub target_pod_selector: Option<ComponentDefinitionLifecycleActionsReadonlyCustomHandlerTargetPodSelector>,
3706 /// Specifies the maximum duration in seconds that the Action is allowed to run.
3707 ///
3708 /// If the Action does not complete within this time frame, it will be terminated.
3709 ///
3710 /// This field cannot be updated.
3711 #[serde(default, skip_serializing_if = "Option::is_none", rename = "timeoutSeconds")]
3712 pub timeout_seconds: Option<i32>,
3713}
3714
3715/// EnvVar represents an environment variable present in a Container.
3716#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
3717pub struct ComponentDefinitionLifecycleActionsReadonlyCustomHandlerEnv {
3718 /// Name of the environment variable. Must be a C_IDENTIFIER.
3719 pub name: String,
3720 /// Variable references $(VAR_NAME) are expanded
3721 /// using the previously defined environment variables in the container and
3722 /// any service environment variables. If a variable cannot be resolved,
3723 /// the reference in the input string will be unchanged. Double $$ are reduced
3724 /// to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e.
3725 /// "$$(VAR_NAME)" will produce the string literal "$(VAR_NAME)".
3726 /// Escaped references will never be expanded, regardless of whether the variable
3727 /// exists or not.
3728 /// Defaults to "".
3729 #[serde(default, skip_serializing_if = "Option::is_none")]
3730 pub value: Option<String>,
3731 /// Source for the environment variable's value. Cannot be used if value is not empty.
3732 #[serde(default, skip_serializing_if = "Option::is_none", rename = "valueFrom")]
3733 pub value_from: Option<ComponentDefinitionLifecycleActionsReadonlyCustomHandlerEnvValueFrom>,
3734}
3735
3736/// Source for the environment variable's value. Cannot be used if value is not empty.
3737#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
3738pub struct ComponentDefinitionLifecycleActionsReadonlyCustomHandlerEnvValueFrom {
3739 /// Selects a key of a ConfigMap.
3740 #[serde(default, skip_serializing_if = "Option::is_none", rename = "configMapKeyRef")]
3741 pub config_map_key_ref: Option<ComponentDefinitionLifecycleActionsReadonlyCustomHandlerEnvValueFromConfigMapKeyRef>,
3742 /// Selects a field of the pod: supports metadata.name, metadata.namespace, `metadata.labels['<KEY>']`, `metadata.annotations['<KEY>']`,
3743 /// spec.nodeName, spec.serviceAccountName, status.hostIP, status.podIP, status.podIPs.
3744 #[serde(default, skip_serializing_if = "Option::is_none", rename = "fieldRef")]
3745 pub field_ref: Option<ComponentDefinitionLifecycleActionsReadonlyCustomHandlerEnvValueFromFieldRef>,
3746 /// Selects a resource of the container: only resources limits and requests
3747 /// (limits.cpu, limits.memory, limits.ephemeral-storage, requests.cpu, requests.memory and requests.ephemeral-storage) are currently supported.
3748 #[serde(default, skip_serializing_if = "Option::is_none", rename = "resourceFieldRef")]
3749 pub resource_field_ref: Option<ComponentDefinitionLifecycleActionsReadonlyCustomHandlerEnvValueFromResourceFieldRef>,
3750 /// Selects a key of a secret in the pod's namespace
3751 #[serde(default, skip_serializing_if = "Option::is_none", rename = "secretKeyRef")]
3752 pub secret_key_ref: Option<ComponentDefinitionLifecycleActionsReadonlyCustomHandlerEnvValueFromSecretKeyRef>,
3753}
3754
3755/// Selects a key of a ConfigMap.
3756#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
3757pub struct ComponentDefinitionLifecycleActionsReadonlyCustomHandlerEnvValueFromConfigMapKeyRef {
3758 /// The key to select.
3759 pub key: String,
3760 /// Name of the referent.
3761 /// More info: <https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names>
3762 #[serde(default, skip_serializing_if = "Option::is_none")]
3763 pub name: Option<String>,
3764 /// Specify whether the ConfigMap or its key must be defined
3765 #[serde(default, skip_serializing_if = "Option::is_none")]
3766 pub optional: Option<bool>,
3767}
3768
3769/// Selects a field of the pod: supports metadata.name, metadata.namespace, `metadata.labels['<KEY>']`, `metadata.annotations['<KEY>']`,
3770/// spec.nodeName, spec.serviceAccountName, status.hostIP, status.podIP, status.podIPs.
3771#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
3772pub struct ComponentDefinitionLifecycleActionsReadonlyCustomHandlerEnvValueFromFieldRef {
3773 /// Version of the schema the FieldPath is written in terms of, defaults to "v1".
3774 #[serde(default, skip_serializing_if = "Option::is_none", rename = "apiVersion")]
3775 pub api_version: Option<String>,
3776 /// Path of the field to select in the specified API version.
3777 #[serde(rename = "fieldPath")]
3778 pub field_path: String,
3779}
3780
3781/// Selects a resource of the container: only resources limits and requests
3782/// (limits.cpu, limits.memory, limits.ephemeral-storage, requests.cpu, requests.memory and requests.ephemeral-storage) are currently supported.
3783#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
3784pub struct ComponentDefinitionLifecycleActionsReadonlyCustomHandlerEnvValueFromResourceFieldRef {
3785 /// Container name: required for volumes, optional for env vars
3786 #[serde(default, skip_serializing_if = "Option::is_none", rename = "containerName")]
3787 pub container_name: Option<String>,
3788 /// Specifies the output format of the exposed resources, defaults to "1"
3789 #[serde(default, skip_serializing_if = "Option::is_none")]
3790 pub divisor: Option<IntOrString>,
3791 /// Required: resource to select
3792 pub resource: String,
3793}
3794
3795/// Selects a key of a secret in the pod's namespace
3796#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
3797pub struct ComponentDefinitionLifecycleActionsReadonlyCustomHandlerEnvValueFromSecretKeyRef {
3798 /// The key of the secret to select from. Must be a valid secret key.
3799 pub key: String,
3800 /// Name of the referent.
3801 /// More info: <https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names>
3802 #[serde(default, skip_serializing_if = "Option::is_none")]
3803 pub name: Option<String>,
3804 /// Specify whether the Secret or its key must be defined
3805 #[serde(default, skip_serializing_if = "Option::is_none")]
3806 pub optional: Option<bool>,
3807}
3808
3809/// Defines the command to run.
3810///
3811/// This field cannot be updated.
3812#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
3813pub struct ComponentDefinitionLifecycleActionsReadonlyCustomHandlerExec {
3814 /// Args represents the arguments that are passed to the `command` for execution.
3815 #[serde(default, skip_serializing_if = "Option::is_none")]
3816 pub args: Option<Vec<String>>,
3817 /// Specifies the command to be executed inside the container.
3818 /// The working directory for this command is the container's root directory('/').
3819 /// Commands are executed directly without a shell environment, meaning shell-specific syntax ('|', etc.) is not supported.
3820 /// If the shell is required, it must be explicitly invoked in the command.
3821 ///
3822 /// A successful execution is indicated by an exit status of 0; any non-zero status signifies a failure.
3823 #[serde(default, skip_serializing_if = "Option::is_none")]
3824 pub command: Option<Vec<String>>,
3825}
3826
3827/// Specifies the HTTP request to perform.
3828///
3829/// This field cannot be updated.
3830///
3831/// Note: HTTPAction is to be implemented in future version.
3832#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
3833pub struct ComponentDefinitionLifecycleActionsReadonlyCustomHandlerHttp {
3834 /// Indicates the server's domain name or IP address. Defaults to the Pod's IP.
3835 /// Prefer setting the "Host" header in httpHeaders when needed.
3836 #[serde(default, skip_serializing_if = "Option::is_none")]
3837 pub host: Option<String>,
3838 /// Allows for the inclusion of custom headers in the request.
3839 /// HTTP permits the use of repeated headers.
3840 #[serde(default, skip_serializing_if = "Option::is_none", rename = "httpHeaders")]
3841 pub http_headers: Option<Vec<ComponentDefinitionLifecycleActionsReadonlyCustomHandlerHttpHttpHeaders>>,
3842 /// Represents the type of HTTP request to be made, such as "GET," "POST," "PUT," etc.
3843 /// If not specified, "GET" is the default method.
3844 #[serde(default, skip_serializing_if = "Option::is_none")]
3845 pub method: Option<String>,
3846 /// Specifies the endpoint to be requested on the HTTP server.
3847 #[serde(default, skip_serializing_if = "Option::is_none")]
3848 pub path: Option<String>,
3849 /// Specifies the target port for the HTTP request.
3850 /// It can be specified either as a numeric value in the range of 1 to 65535,
3851 /// or as a named port that meets the IANA_SVC_NAME specification.
3852 pub port: IntOrString,
3853 /// Designates the protocol used to make the request, such as HTTP or HTTPS.
3854 /// If not specified, HTTP is used by default.
3855 #[serde(default, skip_serializing_if = "Option::is_none")]
3856 pub scheme: Option<String>,
3857}
3858
3859/// HTTPHeader describes a custom header to be used in HTTP probes
3860#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
3861pub struct ComponentDefinitionLifecycleActionsReadonlyCustomHandlerHttpHttpHeaders {
3862 /// The header field name.
3863 /// This will be canonicalized upon output, so case-variant names will be understood as the same header.
3864 pub name: String,
3865 /// The header field value
3866 pub value: String,
3867}
3868
3869/// Defines the strategy to be taken when retrying the Action after a failure.
3870///
3871/// It specifies the conditions under which the Action should be retried and the limits to apply,
3872/// such as the maximum number of retries and backoff strategy.
3873///
3874/// This field cannot be updated.
3875#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
3876pub struct ComponentDefinitionLifecycleActionsReadonlyCustomHandlerRetryPolicy {
3877 /// Defines the maximum number of retry attempts that should be made for a given Action.
3878 /// This value is set to 0 by default, indicating that no retries will be made.
3879 #[serde(default, skip_serializing_if = "Option::is_none", rename = "maxRetries")]
3880 pub max_retries: Option<i64>,
3881 /// Indicates the duration of time to wait between each retry attempt.
3882 /// This value is set to 0 by default, indicating that there will be no delay between retry attempts.
3883 #[serde(default, skip_serializing_if = "Option::is_none", rename = "retryInterval")]
3884 pub retry_interval: Option<i64>,
3885}
3886
3887/// Specifies a user-defined hook or procedure that is called to perform the specific lifecycle action.
3888/// It offers a flexible and expandable approach for customizing the behavior of a Component by leveraging
3889/// tailored actions.
3890///
3891/// An Action can be implemented as either an ExecAction or an HTTPAction, with future versions planning
3892/// to support GRPCAction,
3893/// thereby accommodating unique logic for different database systems within the Action's framework.
3894///
3895/// In future iterations, all built-in handlers are expected to transition to GRPCAction.
3896/// This change means that Lorry or other sidecar agents will expose the implementation of actions
3897/// through a GRPC interface for external invocation.
3898/// Then the controller will interact with these actions via GRPCAction calls.
3899#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
3900pub enum ComponentDefinitionLifecycleActionsReadonlyCustomHandlerTargetPodSelector {
3901 Any,
3902 All,
3903 Role,
3904 Ordinal,
3905}
3906
3907/// Defines the procedure to transition a replica from the read-only state back to the read-write state.
3908///
3909/// Use Case:
3910/// This action is used to bring back a replica that was previously in a read-only state,
3911/// which restricted write operations, to its normal operational state where it can handle
3912/// both read and write operations.
3913///
3914/// The container executing this action has access to following environment variables:
3915///
3916/// - KB_POD_FQDN: The FQDN of the replica pod whose role is being checked.
3917/// - KB_SERVICE_PORT: The port used by the database service.
3918/// - KB_SERVICE_USER: The username with the necessary permissions to interact with the database service.
3919/// - KB_SERVICE_PASSWORD: The corresponding password for KB_SERVICE_USER to authenticate with the database service.
3920///
3921/// Expected action output:
3922/// - On Failure: An error message, if applicable, indicating why the action failed.
3923///
3924/// Note: This field is immutable once it has been set.
3925#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
3926pub struct ComponentDefinitionLifecycleActionsReadwrite {
3927 /// Specifies the name of the predefined action handler to be invoked for lifecycle actions.
3928 ///
3929 /// Lorry, as a sidecar agent co-located with the database container in the same Pod,
3930 /// includes a suite of built-in action implementations that are tailored to different database engines.
3931 /// These are known as "builtin" handlers, includes: `mysql`, `redis`, `mongodb`, `etcd`,
3932 /// `postgresql`, `vanilla-postgresql`, `apecloud-postgresql`, `wesql`, `oceanbase`, `polardbx`.
3933 ///
3934 /// If the `builtinHandler` field is specified, it instructs Lorry to utilize its internal built-in action handler
3935 /// to execute the specified lifecycle actions.
3936 ///
3937 /// The `builtinHandler` field is of type `BuiltinActionHandlerType`,
3938 /// which represents the name of the built-in handler.
3939 /// The `builtinHandler` specified within the same `ComponentLifecycleActions` should be consistent across all
3940 /// actions.
3941 /// This means that if you specify a built-in handler for one action, you should use the same handler
3942 /// for all other actions throughout the entire `ComponentLifecycleActions` collection.
3943 ///
3944 /// If you need to define lifecycle actions for database engines not covered by the existing built-in support,
3945 /// or when the pre-existing built-in handlers do not meet your specific needs,
3946 /// you can use the `customHandler` field to define your own action implementation.
3947 ///
3948 /// Deprecation Notice:
3949 ///
3950 /// - In the future, the `builtinHandler` field will be deprecated in favor of using the `customHandler` field
3951 /// for configuring all lifecycle actions.
3952 /// - Instead of using a name to indicate the built-in action implementations in Lorry,
3953 /// the recommended approach will be to explicitly invoke the desired action implementation through
3954 /// a gRPC interface exposed by the sidecar agent.
3955 /// - Developers will have the flexibility to either use the built-in action implementations provided by Lorry
3956 /// or develop their own sidecar agent to implement custom actions and expose them via gRPC interfaces.
3957 /// - This change will allow for greater customization and extensibility of lifecycle actions,
3958 /// as developers can create their own "builtin" implementations tailored to their specific requirements.
3959 #[serde(default, skip_serializing_if = "Option::is_none", rename = "builtinHandler")]
3960 pub builtin_handler: Option<String>,
3961 /// Specifies a user-defined hook or procedure that is called to perform the specific lifecycle action.
3962 /// It offers a flexible and expandable approach for customizing the behavior of a Component by leveraging
3963 /// tailored actions.
3964 ///
3965 /// An Action can be implemented as either an ExecAction or an HTTPAction, with future versions planning
3966 /// to support GRPCAction,
3967 /// thereby accommodating unique logic for different database systems within the Action's framework.
3968 ///
3969 /// In future iterations, all built-in handlers are expected to transition to GRPCAction.
3970 /// This change means that Lorry or other sidecar agents will expose the implementation of actions
3971 /// through a GRPC interface for external invocation.
3972 /// Then the controller will interact with these actions via GRPCAction calls.
3973 #[serde(default, skip_serializing_if = "Option::is_none", rename = "customHandler")]
3974 pub custom_handler: Option<ComponentDefinitionLifecycleActionsReadwriteCustomHandler>,
3975}
3976
3977/// Specifies a user-defined hook or procedure that is called to perform the specific lifecycle action.
3978/// It offers a flexible and expandable approach for customizing the behavior of a Component by leveraging
3979/// tailored actions.
3980///
3981/// An Action can be implemented as either an ExecAction or an HTTPAction, with future versions planning
3982/// to support GRPCAction,
3983/// thereby accommodating unique logic for different database systems within the Action's framework.
3984///
3985/// In future iterations, all built-in handlers are expected to transition to GRPCAction.
3986/// This change means that Lorry or other sidecar agents will expose the implementation of actions
3987/// through a GRPC interface for external invocation.
3988/// Then the controller will interact with these actions via GRPCAction calls.
3989#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
3990pub struct ComponentDefinitionLifecycleActionsReadwriteCustomHandler {
3991 /// Defines the name of the container within the target Pod where the action will be executed.
3992 ///
3993 /// This name must correspond to one of the containers defined in `componentDefinition.spec.runtime`.
3994 /// If this field is not specified, the default behavior is to use the first container listed in
3995 /// `componentDefinition.spec.runtime`.
3996 ///
3997 /// This field cannot be updated.
3998 ///
3999 /// Note: This field is reserved for future use and is not currently active.
4000 #[serde(default, skip_serializing_if = "Option::is_none")]
4001 pub container: Option<String>,
4002 /// Represents a list of environment variables that will be injected into the container.
4003 /// These variables enable the container to adapt its behavior based on the environment it's running in.
4004 ///
4005 /// This field cannot be updated.
4006 #[serde(default, skip_serializing_if = "Option::is_none")]
4007 pub env: Option<Vec<ComponentDefinitionLifecycleActionsReadwriteCustomHandlerEnv>>,
4008 /// Defines the command to run.
4009 ///
4010 /// This field cannot be updated.
4011 #[serde(default, skip_serializing_if = "Option::is_none")]
4012 pub exec: Option<ComponentDefinitionLifecycleActionsReadwriteCustomHandlerExec>,
4013 /// Specifies the HTTP request to perform.
4014 ///
4015 /// This field cannot be updated.
4016 ///
4017 /// Note: HTTPAction is to be implemented in future version.
4018 #[serde(default, skip_serializing_if = "Option::is_none")]
4019 pub http: Option<ComponentDefinitionLifecycleActionsReadwriteCustomHandlerHttp>,
4020 /// Specifies the container image to be used for running the Action.
4021 ///
4022 /// When specified, a dedicated container will be created using this image to execute the Action.
4023 /// This field is mutually exclusive with the `container` field; only one of them should be provided.
4024 ///
4025 /// This field cannot be updated.
4026 #[serde(default, skip_serializing_if = "Option::is_none")]
4027 pub image: Option<String>,
4028 /// Used in conjunction with the `targetPodSelector` field to refine the selection of target pod(s) for Action execution.
4029 /// The impact of this field depends on the `targetPodSelector` value:
4030 ///
4031 /// - When `targetPodSelector` is set to `Any` or `All`, this field will be ignored.
4032 /// - When `targetPodSelector` is set to `Role`, only those replicas whose role matches the `matchingKey`
4033 /// will be selected for the Action.
4034 ///
4035 /// This field cannot be updated.
4036 ///
4037 /// Note: This field is reserved for future use and is not currently active.
4038 #[serde(default, skip_serializing_if = "Option::is_none", rename = "matchingKey")]
4039 pub matching_key: Option<String>,
4040 /// Specifies the state that the cluster must reach before the Action is executed.
4041 /// Currently, this is only applicable to the `postProvision` action.
4042 ///
4043 /// The conditions are as follows:
4044 ///
4045 /// - `Immediately`: Executed right after the Component object is created.
4046 /// The readiness of the Component and its resources is not guaranteed at this stage.
4047 /// - `RuntimeReady`: The Action is triggered after the Component object has been created and all associated
4048 /// runtime resources (e.g. Pods) are in a ready state.
4049 /// - `ComponentReady`: The Action is triggered after the Component itself is in a ready state.
4050 /// This process does not affect the readiness state of the Component or the Cluster.
4051 /// - `ClusterReady`: The Action is executed after the Cluster is in a ready state.
4052 /// This execution does not alter the Component or the Cluster's state of readiness.
4053 ///
4054 /// This field cannot be updated.
4055 #[serde(default, skip_serializing_if = "Option::is_none", rename = "preCondition")]
4056 pub pre_condition: Option<String>,
4057 /// Defines the strategy to be taken when retrying the Action after a failure.
4058 ///
4059 /// It specifies the conditions under which the Action should be retried and the limits to apply,
4060 /// such as the maximum number of retries and backoff strategy.
4061 ///
4062 /// This field cannot be updated.
4063 #[serde(default, skip_serializing_if = "Option::is_none", rename = "retryPolicy")]
4064 pub retry_policy: Option<ComponentDefinitionLifecycleActionsReadwriteCustomHandlerRetryPolicy>,
4065 /// Defines the criteria used to select the target Pod(s) for executing the Action.
4066 /// This is useful when there is no default target replica identified.
4067 /// It allows for precise control over which Pod(s) the Action should run in.
4068 ///
4069 /// This field cannot be updated.
4070 ///
4071 /// Note: This field is reserved for future use and is not currently active.
4072 #[serde(default, skip_serializing_if = "Option::is_none", rename = "targetPodSelector")]
4073 pub target_pod_selector: Option<ComponentDefinitionLifecycleActionsReadwriteCustomHandlerTargetPodSelector>,
4074 /// Specifies the maximum duration in seconds that the Action is allowed to run.
4075 ///
4076 /// If the Action does not complete within this time frame, it will be terminated.
4077 ///
4078 /// This field cannot be updated.
4079 #[serde(default, skip_serializing_if = "Option::is_none", rename = "timeoutSeconds")]
4080 pub timeout_seconds: Option<i32>,
4081}
4082
4083/// EnvVar represents an environment variable present in a Container.
4084#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
4085pub struct ComponentDefinitionLifecycleActionsReadwriteCustomHandlerEnv {
4086 /// Name of the environment variable. Must be a C_IDENTIFIER.
4087 pub name: String,
4088 /// Variable references $(VAR_NAME) are expanded
4089 /// using the previously defined environment variables in the container and
4090 /// any service environment variables. If a variable cannot be resolved,
4091 /// the reference in the input string will be unchanged. Double $$ are reduced
4092 /// to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e.
4093 /// "$$(VAR_NAME)" will produce the string literal "$(VAR_NAME)".
4094 /// Escaped references will never be expanded, regardless of whether the variable
4095 /// exists or not.
4096 /// Defaults to "".
4097 #[serde(default, skip_serializing_if = "Option::is_none")]
4098 pub value: Option<String>,
4099 /// Source for the environment variable's value. Cannot be used if value is not empty.
4100 #[serde(default, skip_serializing_if = "Option::is_none", rename = "valueFrom")]
4101 pub value_from: Option<ComponentDefinitionLifecycleActionsReadwriteCustomHandlerEnvValueFrom>,
4102}
4103
4104/// Source for the environment variable's value. Cannot be used if value is not empty.
4105#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
4106pub struct ComponentDefinitionLifecycleActionsReadwriteCustomHandlerEnvValueFrom {
4107 /// Selects a key of a ConfigMap.
4108 #[serde(default, skip_serializing_if = "Option::is_none", rename = "configMapKeyRef")]
4109 pub config_map_key_ref: Option<ComponentDefinitionLifecycleActionsReadwriteCustomHandlerEnvValueFromConfigMapKeyRef>,
4110 /// Selects a field of the pod: supports metadata.name, metadata.namespace, `metadata.labels['<KEY>']`, `metadata.annotations['<KEY>']`,
4111 /// spec.nodeName, spec.serviceAccountName, status.hostIP, status.podIP, status.podIPs.
4112 #[serde(default, skip_serializing_if = "Option::is_none", rename = "fieldRef")]
4113 pub field_ref: Option<ComponentDefinitionLifecycleActionsReadwriteCustomHandlerEnvValueFromFieldRef>,
4114 /// Selects a resource of the container: only resources limits and requests
4115 /// (limits.cpu, limits.memory, limits.ephemeral-storage, requests.cpu, requests.memory and requests.ephemeral-storage) are currently supported.
4116 #[serde(default, skip_serializing_if = "Option::is_none", rename = "resourceFieldRef")]
4117 pub resource_field_ref: Option<ComponentDefinitionLifecycleActionsReadwriteCustomHandlerEnvValueFromResourceFieldRef>,
4118 /// Selects a key of a secret in the pod's namespace
4119 #[serde(default, skip_serializing_if = "Option::is_none", rename = "secretKeyRef")]
4120 pub secret_key_ref: Option<ComponentDefinitionLifecycleActionsReadwriteCustomHandlerEnvValueFromSecretKeyRef>,
4121}
4122
4123/// Selects a key of a ConfigMap.
4124#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
4125pub struct ComponentDefinitionLifecycleActionsReadwriteCustomHandlerEnvValueFromConfigMapKeyRef {
4126 /// The key to select.
4127 pub key: String,
4128 /// Name of the referent.
4129 /// More info: <https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names>
4130 #[serde(default, skip_serializing_if = "Option::is_none")]
4131 pub name: Option<String>,
4132 /// Specify whether the ConfigMap or its key must be defined
4133 #[serde(default, skip_serializing_if = "Option::is_none")]
4134 pub optional: Option<bool>,
4135}
4136
4137/// Selects a field of the pod: supports metadata.name, metadata.namespace, `metadata.labels['<KEY>']`, `metadata.annotations['<KEY>']`,
4138/// spec.nodeName, spec.serviceAccountName, status.hostIP, status.podIP, status.podIPs.
4139#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
4140pub struct ComponentDefinitionLifecycleActionsReadwriteCustomHandlerEnvValueFromFieldRef {
4141 /// Version of the schema the FieldPath is written in terms of, defaults to "v1".
4142 #[serde(default, skip_serializing_if = "Option::is_none", rename = "apiVersion")]
4143 pub api_version: Option<String>,
4144 /// Path of the field to select in the specified API version.
4145 #[serde(rename = "fieldPath")]
4146 pub field_path: String,
4147}
4148
4149/// Selects a resource of the container: only resources limits and requests
4150/// (limits.cpu, limits.memory, limits.ephemeral-storage, requests.cpu, requests.memory and requests.ephemeral-storage) are currently supported.
4151#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
4152pub struct ComponentDefinitionLifecycleActionsReadwriteCustomHandlerEnvValueFromResourceFieldRef {
4153 /// Container name: required for volumes, optional for env vars
4154 #[serde(default, skip_serializing_if = "Option::is_none", rename = "containerName")]
4155 pub container_name: Option<String>,
4156 /// Specifies the output format of the exposed resources, defaults to "1"
4157 #[serde(default, skip_serializing_if = "Option::is_none")]
4158 pub divisor: Option<IntOrString>,
4159 /// Required: resource to select
4160 pub resource: String,
4161}
4162
4163/// Selects a key of a secret in the pod's namespace
4164#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
4165pub struct ComponentDefinitionLifecycleActionsReadwriteCustomHandlerEnvValueFromSecretKeyRef {
4166 /// The key of the secret to select from. Must be a valid secret key.
4167 pub key: String,
4168 /// Name of the referent.
4169 /// More info: <https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names>
4170 #[serde(default, skip_serializing_if = "Option::is_none")]
4171 pub name: Option<String>,
4172 /// Specify whether the Secret or its key must be defined
4173 #[serde(default, skip_serializing_if = "Option::is_none")]
4174 pub optional: Option<bool>,
4175}
4176
4177/// Defines the command to run.
4178///
4179/// This field cannot be updated.
4180#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
4181pub struct ComponentDefinitionLifecycleActionsReadwriteCustomHandlerExec {
4182 /// Args represents the arguments that are passed to the `command` for execution.
4183 #[serde(default, skip_serializing_if = "Option::is_none")]
4184 pub args: Option<Vec<String>>,
4185 /// Specifies the command to be executed inside the container.
4186 /// The working directory for this command is the container's root directory('/').
4187 /// Commands are executed directly without a shell environment, meaning shell-specific syntax ('|', etc.) is not supported.
4188 /// If the shell is required, it must be explicitly invoked in the command.
4189 ///
4190 /// A successful execution is indicated by an exit status of 0; any non-zero status signifies a failure.
4191 #[serde(default, skip_serializing_if = "Option::is_none")]
4192 pub command: Option<Vec<String>>,
4193}
4194
4195/// Specifies the HTTP request to perform.
4196///
4197/// This field cannot be updated.
4198///
4199/// Note: HTTPAction is to be implemented in future version.
4200#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
4201pub struct ComponentDefinitionLifecycleActionsReadwriteCustomHandlerHttp {
4202 /// Indicates the server's domain name or IP address. Defaults to the Pod's IP.
4203 /// Prefer setting the "Host" header in httpHeaders when needed.
4204 #[serde(default, skip_serializing_if = "Option::is_none")]
4205 pub host: Option<String>,
4206 /// Allows for the inclusion of custom headers in the request.
4207 /// HTTP permits the use of repeated headers.
4208 #[serde(default, skip_serializing_if = "Option::is_none", rename = "httpHeaders")]
4209 pub http_headers: Option<Vec<ComponentDefinitionLifecycleActionsReadwriteCustomHandlerHttpHttpHeaders>>,
4210 /// Represents the type of HTTP request to be made, such as "GET," "POST," "PUT," etc.
4211 /// If not specified, "GET" is the default method.
4212 #[serde(default, skip_serializing_if = "Option::is_none")]
4213 pub method: Option<String>,
4214 /// Specifies the endpoint to be requested on the HTTP server.
4215 #[serde(default, skip_serializing_if = "Option::is_none")]
4216 pub path: Option<String>,
4217 /// Specifies the target port for the HTTP request.
4218 /// It can be specified either as a numeric value in the range of 1 to 65535,
4219 /// or as a named port that meets the IANA_SVC_NAME specification.
4220 pub port: IntOrString,
4221 /// Designates the protocol used to make the request, such as HTTP or HTTPS.
4222 /// If not specified, HTTP is used by default.
4223 #[serde(default, skip_serializing_if = "Option::is_none")]
4224 pub scheme: Option<String>,
4225}
4226
4227/// HTTPHeader describes a custom header to be used in HTTP probes
4228#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
4229pub struct ComponentDefinitionLifecycleActionsReadwriteCustomHandlerHttpHttpHeaders {
4230 /// The header field name.
4231 /// This will be canonicalized upon output, so case-variant names will be understood as the same header.
4232 pub name: String,
4233 /// The header field value
4234 pub value: String,
4235}
4236
4237/// Defines the strategy to be taken when retrying the Action after a failure.
4238///
4239/// It specifies the conditions under which the Action should be retried and the limits to apply,
4240/// such as the maximum number of retries and backoff strategy.
4241///
4242/// This field cannot be updated.
4243#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
4244pub struct ComponentDefinitionLifecycleActionsReadwriteCustomHandlerRetryPolicy {
4245 /// Defines the maximum number of retry attempts that should be made for a given Action.
4246 /// This value is set to 0 by default, indicating that no retries will be made.
4247 #[serde(default, skip_serializing_if = "Option::is_none", rename = "maxRetries")]
4248 pub max_retries: Option<i64>,
4249 /// Indicates the duration of time to wait between each retry attempt.
4250 /// This value is set to 0 by default, indicating that there will be no delay between retry attempts.
4251 #[serde(default, skip_serializing_if = "Option::is_none", rename = "retryInterval")]
4252 pub retry_interval: Option<i64>,
4253}
4254
4255/// Specifies a user-defined hook or procedure that is called to perform the specific lifecycle action.
4256/// It offers a flexible and expandable approach for customizing the behavior of a Component by leveraging
4257/// tailored actions.
4258///
4259/// An Action can be implemented as either an ExecAction or an HTTPAction, with future versions planning
4260/// to support GRPCAction,
4261/// thereby accommodating unique logic for different database systems within the Action's framework.
4262///
4263/// In future iterations, all built-in handlers are expected to transition to GRPCAction.
4264/// This change means that Lorry or other sidecar agents will expose the implementation of actions
4265/// through a GRPC interface for external invocation.
4266/// Then the controller will interact with these actions via GRPCAction calls.
4267#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
4268pub enum ComponentDefinitionLifecycleActionsReadwriteCustomHandlerTargetPodSelector {
4269 Any,
4270 All,
4271 Role,
4272 Ordinal,
4273}
4274
4275/// Defines the procedure that update a replica with new configuration.
4276///
4277/// Note: This field is immutable once it has been set.
4278///
4279/// This Action is reserved for future versions.
4280#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
4281pub struct ComponentDefinitionLifecycleActionsReconfigure {
4282 /// Specifies the name of the predefined action handler to be invoked for lifecycle actions.
4283 ///
4284 /// Lorry, as a sidecar agent co-located with the database container in the same Pod,
4285 /// includes a suite of built-in action implementations that are tailored to different database engines.
4286 /// These are known as "builtin" handlers, includes: `mysql`, `redis`, `mongodb`, `etcd`,
4287 /// `postgresql`, `vanilla-postgresql`, `apecloud-postgresql`, `wesql`, `oceanbase`, `polardbx`.
4288 ///
4289 /// If the `builtinHandler` field is specified, it instructs Lorry to utilize its internal built-in action handler
4290 /// to execute the specified lifecycle actions.
4291 ///
4292 /// The `builtinHandler` field is of type `BuiltinActionHandlerType`,
4293 /// which represents the name of the built-in handler.
4294 /// The `builtinHandler` specified within the same `ComponentLifecycleActions` should be consistent across all
4295 /// actions.
4296 /// This means that if you specify a built-in handler for one action, you should use the same handler
4297 /// for all other actions throughout the entire `ComponentLifecycleActions` collection.
4298 ///
4299 /// If you need to define lifecycle actions for database engines not covered by the existing built-in support,
4300 /// or when the pre-existing built-in handlers do not meet your specific needs,
4301 /// you can use the `customHandler` field to define your own action implementation.
4302 ///
4303 /// Deprecation Notice:
4304 ///
4305 /// - In the future, the `builtinHandler` field will be deprecated in favor of using the `customHandler` field
4306 /// for configuring all lifecycle actions.
4307 /// - Instead of using a name to indicate the built-in action implementations in Lorry,
4308 /// the recommended approach will be to explicitly invoke the desired action implementation through
4309 /// a gRPC interface exposed by the sidecar agent.
4310 /// - Developers will have the flexibility to either use the built-in action implementations provided by Lorry
4311 /// or develop their own sidecar agent to implement custom actions and expose them via gRPC interfaces.
4312 /// - This change will allow for greater customization and extensibility of lifecycle actions,
4313 /// as developers can create their own "builtin" implementations tailored to their specific requirements.
4314 #[serde(default, skip_serializing_if = "Option::is_none", rename = "builtinHandler")]
4315 pub builtin_handler: Option<String>,
4316 /// Specifies a user-defined hook or procedure that is called to perform the specific lifecycle action.
4317 /// It offers a flexible and expandable approach for customizing the behavior of a Component by leveraging
4318 /// tailored actions.
4319 ///
4320 /// An Action can be implemented as either an ExecAction or an HTTPAction, with future versions planning
4321 /// to support GRPCAction,
4322 /// thereby accommodating unique logic for different database systems within the Action's framework.
4323 ///
4324 /// In future iterations, all built-in handlers are expected to transition to GRPCAction.
4325 /// This change means that Lorry or other sidecar agents will expose the implementation of actions
4326 /// through a GRPC interface for external invocation.
4327 /// Then the controller will interact with these actions via GRPCAction calls.
4328 #[serde(default, skip_serializing_if = "Option::is_none", rename = "customHandler")]
4329 pub custom_handler: Option<ComponentDefinitionLifecycleActionsReconfigureCustomHandler>,
4330}
4331
4332/// Specifies a user-defined hook or procedure that is called to perform the specific lifecycle action.
4333/// It offers a flexible and expandable approach for customizing the behavior of a Component by leveraging
4334/// tailored actions.
4335///
4336/// An Action can be implemented as either an ExecAction or an HTTPAction, with future versions planning
4337/// to support GRPCAction,
4338/// thereby accommodating unique logic for different database systems within the Action's framework.
4339///
4340/// In future iterations, all built-in handlers are expected to transition to GRPCAction.
4341/// This change means that Lorry or other sidecar agents will expose the implementation of actions
4342/// through a GRPC interface for external invocation.
4343/// Then the controller will interact with these actions via GRPCAction calls.
4344#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
4345pub struct ComponentDefinitionLifecycleActionsReconfigureCustomHandler {
4346 /// Defines the name of the container within the target Pod where the action will be executed.
4347 ///
4348 /// This name must correspond to one of the containers defined in `componentDefinition.spec.runtime`.
4349 /// If this field is not specified, the default behavior is to use the first container listed in
4350 /// `componentDefinition.spec.runtime`.
4351 ///
4352 /// This field cannot be updated.
4353 ///
4354 /// Note: This field is reserved for future use and is not currently active.
4355 #[serde(default, skip_serializing_if = "Option::is_none")]
4356 pub container: Option<String>,
4357 /// Represents a list of environment variables that will be injected into the container.
4358 /// These variables enable the container to adapt its behavior based on the environment it's running in.
4359 ///
4360 /// This field cannot be updated.
4361 #[serde(default, skip_serializing_if = "Option::is_none")]
4362 pub env: Option<Vec<ComponentDefinitionLifecycleActionsReconfigureCustomHandlerEnv>>,
4363 /// Defines the command to run.
4364 ///
4365 /// This field cannot be updated.
4366 #[serde(default, skip_serializing_if = "Option::is_none")]
4367 pub exec: Option<ComponentDefinitionLifecycleActionsReconfigureCustomHandlerExec>,
4368 /// Specifies the HTTP request to perform.
4369 ///
4370 /// This field cannot be updated.
4371 ///
4372 /// Note: HTTPAction is to be implemented in future version.
4373 #[serde(default, skip_serializing_if = "Option::is_none")]
4374 pub http: Option<ComponentDefinitionLifecycleActionsReconfigureCustomHandlerHttp>,
4375 /// Specifies the container image to be used for running the Action.
4376 ///
4377 /// When specified, a dedicated container will be created using this image to execute the Action.
4378 /// This field is mutually exclusive with the `container` field; only one of them should be provided.
4379 ///
4380 /// This field cannot be updated.
4381 #[serde(default, skip_serializing_if = "Option::is_none")]
4382 pub image: Option<String>,
4383 /// Used in conjunction with the `targetPodSelector` field to refine the selection of target pod(s) for Action execution.
4384 /// The impact of this field depends on the `targetPodSelector` value:
4385 ///
4386 /// - When `targetPodSelector` is set to `Any` or `All`, this field will be ignored.
4387 /// - When `targetPodSelector` is set to `Role`, only those replicas whose role matches the `matchingKey`
4388 /// will be selected for the Action.
4389 ///
4390 /// This field cannot be updated.
4391 ///
4392 /// Note: This field is reserved for future use and is not currently active.
4393 #[serde(default, skip_serializing_if = "Option::is_none", rename = "matchingKey")]
4394 pub matching_key: Option<String>,
4395 /// Specifies the state that the cluster must reach before the Action is executed.
4396 /// Currently, this is only applicable to the `postProvision` action.
4397 ///
4398 /// The conditions are as follows:
4399 ///
4400 /// - `Immediately`: Executed right after the Component object is created.
4401 /// The readiness of the Component and its resources is not guaranteed at this stage.
4402 /// - `RuntimeReady`: The Action is triggered after the Component object has been created and all associated
4403 /// runtime resources (e.g. Pods) are in a ready state.
4404 /// - `ComponentReady`: The Action is triggered after the Component itself is in a ready state.
4405 /// This process does not affect the readiness state of the Component or the Cluster.
4406 /// - `ClusterReady`: The Action is executed after the Cluster is in a ready state.
4407 /// This execution does not alter the Component or the Cluster's state of readiness.
4408 ///
4409 /// This field cannot be updated.
4410 #[serde(default, skip_serializing_if = "Option::is_none", rename = "preCondition")]
4411 pub pre_condition: Option<String>,
4412 /// Defines the strategy to be taken when retrying the Action after a failure.
4413 ///
4414 /// It specifies the conditions under which the Action should be retried and the limits to apply,
4415 /// such as the maximum number of retries and backoff strategy.
4416 ///
4417 /// This field cannot be updated.
4418 #[serde(default, skip_serializing_if = "Option::is_none", rename = "retryPolicy")]
4419 pub retry_policy: Option<ComponentDefinitionLifecycleActionsReconfigureCustomHandlerRetryPolicy>,
4420 /// Defines the criteria used to select the target Pod(s) for executing the Action.
4421 /// This is useful when there is no default target replica identified.
4422 /// It allows for precise control over which Pod(s) the Action should run in.
4423 ///
4424 /// This field cannot be updated.
4425 ///
4426 /// Note: This field is reserved for future use and is not currently active.
4427 #[serde(default, skip_serializing_if = "Option::is_none", rename = "targetPodSelector")]
4428 pub target_pod_selector: Option<ComponentDefinitionLifecycleActionsReconfigureCustomHandlerTargetPodSelector>,
4429 /// Specifies the maximum duration in seconds that the Action is allowed to run.
4430 ///
4431 /// If the Action does not complete within this time frame, it will be terminated.
4432 ///
4433 /// This field cannot be updated.
4434 #[serde(default, skip_serializing_if = "Option::is_none", rename = "timeoutSeconds")]
4435 pub timeout_seconds: Option<i32>,
4436}
4437
4438/// EnvVar represents an environment variable present in a Container.
4439#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
4440pub struct ComponentDefinitionLifecycleActionsReconfigureCustomHandlerEnv {
4441 /// Name of the environment variable. Must be a C_IDENTIFIER.
4442 pub name: String,
4443 /// Variable references $(VAR_NAME) are expanded
4444 /// using the previously defined environment variables in the container and
4445 /// any service environment variables. If a variable cannot be resolved,
4446 /// the reference in the input string will be unchanged. Double $$ are reduced
4447 /// to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e.
4448 /// "$$(VAR_NAME)" will produce the string literal "$(VAR_NAME)".
4449 /// Escaped references will never be expanded, regardless of whether the variable
4450 /// exists or not.
4451 /// Defaults to "".
4452 #[serde(default, skip_serializing_if = "Option::is_none")]
4453 pub value: Option<String>,
4454 /// Source for the environment variable's value. Cannot be used if value is not empty.
4455 #[serde(default, skip_serializing_if = "Option::is_none", rename = "valueFrom")]
4456 pub value_from: Option<ComponentDefinitionLifecycleActionsReconfigureCustomHandlerEnvValueFrom>,
4457}
4458
4459/// Source for the environment variable's value. Cannot be used if value is not empty.
4460#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
4461pub struct ComponentDefinitionLifecycleActionsReconfigureCustomHandlerEnvValueFrom {
4462 /// Selects a key of a ConfigMap.
4463 #[serde(default, skip_serializing_if = "Option::is_none", rename = "configMapKeyRef")]
4464 pub config_map_key_ref: Option<ComponentDefinitionLifecycleActionsReconfigureCustomHandlerEnvValueFromConfigMapKeyRef>,
4465 /// Selects a field of the pod: supports metadata.name, metadata.namespace, `metadata.labels['<KEY>']`, `metadata.annotations['<KEY>']`,
4466 /// spec.nodeName, spec.serviceAccountName, status.hostIP, status.podIP, status.podIPs.
4467 #[serde(default, skip_serializing_if = "Option::is_none", rename = "fieldRef")]
4468 pub field_ref: Option<ComponentDefinitionLifecycleActionsReconfigureCustomHandlerEnvValueFromFieldRef>,
4469 /// Selects a resource of the container: only resources limits and requests
4470 /// (limits.cpu, limits.memory, limits.ephemeral-storage, requests.cpu, requests.memory and requests.ephemeral-storage) are currently supported.
4471 #[serde(default, skip_serializing_if = "Option::is_none", rename = "resourceFieldRef")]
4472 pub resource_field_ref: Option<ComponentDefinitionLifecycleActionsReconfigureCustomHandlerEnvValueFromResourceFieldRef>,
4473 /// Selects a key of a secret in the pod's namespace
4474 #[serde(default, skip_serializing_if = "Option::is_none", rename = "secretKeyRef")]
4475 pub secret_key_ref: Option<ComponentDefinitionLifecycleActionsReconfigureCustomHandlerEnvValueFromSecretKeyRef>,
4476}
4477
4478/// Selects a key of a ConfigMap.
4479#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
4480pub struct ComponentDefinitionLifecycleActionsReconfigureCustomHandlerEnvValueFromConfigMapKeyRef {
4481 /// The key to select.
4482 pub key: String,
4483 /// Name of the referent.
4484 /// More info: <https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names>
4485 #[serde(default, skip_serializing_if = "Option::is_none")]
4486 pub name: Option<String>,
4487 /// Specify whether the ConfigMap or its key must be defined
4488 #[serde(default, skip_serializing_if = "Option::is_none")]
4489 pub optional: Option<bool>,
4490}
4491
4492/// Selects a field of the pod: supports metadata.name, metadata.namespace, `metadata.labels['<KEY>']`, `metadata.annotations['<KEY>']`,
4493/// spec.nodeName, spec.serviceAccountName, status.hostIP, status.podIP, status.podIPs.
4494#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
4495pub struct ComponentDefinitionLifecycleActionsReconfigureCustomHandlerEnvValueFromFieldRef {
4496 /// Version of the schema the FieldPath is written in terms of, defaults to "v1".
4497 #[serde(default, skip_serializing_if = "Option::is_none", rename = "apiVersion")]
4498 pub api_version: Option<String>,
4499 /// Path of the field to select in the specified API version.
4500 #[serde(rename = "fieldPath")]
4501 pub field_path: String,
4502}
4503
4504/// Selects a resource of the container: only resources limits and requests
4505/// (limits.cpu, limits.memory, limits.ephemeral-storage, requests.cpu, requests.memory and requests.ephemeral-storage) are currently supported.
4506#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
4507pub struct ComponentDefinitionLifecycleActionsReconfigureCustomHandlerEnvValueFromResourceFieldRef {
4508 /// Container name: required for volumes, optional for env vars
4509 #[serde(default, skip_serializing_if = "Option::is_none", rename = "containerName")]
4510 pub container_name: Option<String>,
4511 /// Specifies the output format of the exposed resources, defaults to "1"
4512 #[serde(default, skip_serializing_if = "Option::is_none")]
4513 pub divisor: Option<IntOrString>,
4514 /// Required: resource to select
4515 pub resource: String,
4516}
4517
4518/// Selects a key of a secret in the pod's namespace
4519#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
4520pub struct ComponentDefinitionLifecycleActionsReconfigureCustomHandlerEnvValueFromSecretKeyRef {
4521 /// The key of the secret to select from. Must be a valid secret key.
4522 pub key: String,
4523 /// Name of the referent.
4524 /// More info: <https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names>
4525 #[serde(default, skip_serializing_if = "Option::is_none")]
4526 pub name: Option<String>,
4527 /// Specify whether the Secret or its key must be defined
4528 #[serde(default, skip_serializing_if = "Option::is_none")]
4529 pub optional: Option<bool>,
4530}
4531
4532/// Defines the command to run.
4533///
4534/// This field cannot be updated.
4535#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
4536pub struct ComponentDefinitionLifecycleActionsReconfigureCustomHandlerExec {
4537 /// Args represents the arguments that are passed to the `command` for execution.
4538 #[serde(default, skip_serializing_if = "Option::is_none")]
4539 pub args: Option<Vec<String>>,
4540 /// Specifies the command to be executed inside the container.
4541 /// The working directory for this command is the container's root directory('/').
4542 /// Commands are executed directly without a shell environment, meaning shell-specific syntax ('|', etc.) is not supported.
4543 /// If the shell is required, it must be explicitly invoked in the command.
4544 ///
4545 /// A successful execution is indicated by an exit status of 0; any non-zero status signifies a failure.
4546 #[serde(default, skip_serializing_if = "Option::is_none")]
4547 pub command: Option<Vec<String>>,
4548}
4549
4550/// Specifies the HTTP request to perform.
4551///
4552/// This field cannot be updated.
4553///
4554/// Note: HTTPAction is to be implemented in future version.
4555#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
4556pub struct ComponentDefinitionLifecycleActionsReconfigureCustomHandlerHttp {
4557 /// Indicates the server's domain name or IP address. Defaults to the Pod's IP.
4558 /// Prefer setting the "Host" header in httpHeaders when needed.
4559 #[serde(default, skip_serializing_if = "Option::is_none")]
4560 pub host: Option<String>,
4561 /// Allows for the inclusion of custom headers in the request.
4562 /// HTTP permits the use of repeated headers.
4563 #[serde(default, skip_serializing_if = "Option::is_none", rename = "httpHeaders")]
4564 pub http_headers: Option<Vec<ComponentDefinitionLifecycleActionsReconfigureCustomHandlerHttpHttpHeaders>>,
4565 /// Represents the type of HTTP request to be made, such as "GET," "POST," "PUT," etc.
4566 /// If not specified, "GET" is the default method.
4567 #[serde(default, skip_serializing_if = "Option::is_none")]
4568 pub method: Option<String>,
4569 /// Specifies the endpoint to be requested on the HTTP server.
4570 #[serde(default, skip_serializing_if = "Option::is_none")]
4571 pub path: Option<String>,
4572 /// Specifies the target port for the HTTP request.
4573 /// It can be specified either as a numeric value in the range of 1 to 65535,
4574 /// or as a named port that meets the IANA_SVC_NAME specification.
4575 pub port: IntOrString,
4576 /// Designates the protocol used to make the request, such as HTTP or HTTPS.
4577 /// If not specified, HTTP is used by default.
4578 #[serde(default, skip_serializing_if = "Option::is_none")]
4579 pub scheme: Option<String>,
4580}
4581
4582/// HTTPHeader describes a custom header to be used in HTTP probes
4583#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
4584pub struct ComponentDefinitionLifecycleActionsReconfigureCustomHandlerHttpHttpHeaders {
4585 /// The header field name.
4586 /// This will be canonicalized upon output, so case-variant names will be understood as the same header.
4587 pub name: String,
4588 /// The header field value
4589 pub value: String,
4590}
4591
4592/// Defines the strategy to be taken when retrying the Action after a failure.
4593///
4594/// It specifies the conditions under which the Action should be retried and the limits to apply,
4595/// such as the maximum number of retries and backoff strategy.
4596///
4597/// This field cannot be updated.
4598#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
4599pub struct ComponentDefinitionLifecycleActionsReconfigureCustomHandlerRetryPolicy {
4600 /// Defines the maximum number of retry attempts that should be made for a given Action.
4601 /// This value is set to 0 by default, indicating that no retries will be made.
4602 #[serde(default, skip_serializing_if = "Option::is_none", rename = "maxRetries")]
4603 pub max_retries: Option<i64>,
4604 /// Indicates the duration of time to wait between each retry attempt.
4605 /// This value is set to 0 by default, indicating that there will be no delay between retry attempts.
4606 #[serde(default, skip_serializing_if = "Option::is_none", rename = "retryInterval")]
4607 pub retry_interval: Option<i64>,
4608}
4609
4610/// Specifies a user-defined hook or procedure that is called to perform the specific lifecycle action.
4611/// It offers a flexible and expandable approach for customizing the behavior of a Component by leveraging
4612/// tailored actions.
4613///
4614/// An Action can be implemented as either an ExecAction or an HTTPAction, with future versions planning
4615/// to support GRPCAction,
4616/// thereby accommodating unique logic for different database systems within the Action's framework.
4617///
4618/// In future iterations, all built-in handlers are expected to transition to GRPCAction.
4619/// This change means that Lorry or other sidecar agents will expose the implementation of actions
4620/// through a GRPC interface for external invocation.
4621/// Then the controller will interact with these actions via GRPCAction calls.
4622#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
4623pub enum ComponentDefinitionLifecycleActionsReconfigureCustomHandlerTargetPodSelector {
4624 Any,
4625 All,
4626 Role,
4627 Ordinal,
4628}
4629
4630/// Defines the procedure which is invoked regularly to assess the role of replicas.
4631///
4632/// This action is periodically triggered by Lorry at the specified interval to determine the role of each replica.
4633/// Upon successful execution, the action's output designates the role of the replica,
4634/// which should match one of the predefined role names within `componentDefinition.spec.roles`.
4635/// The output is then compared with the previous successful execution result.
4636/// If a role change is detected, an event is generated to inform the controller,
4637/// which initiates an update of the replica's role.
4638///
4639/// Defining a RoleProbe Action for a Component is required if roles are defined for the Component.
4640/// It ensures replicas are correctly labeled with their respective roles.
4641/// Without this, services that rely on roleSelectors might improperly direct traffic to wrong replicas.
4642///
4643/// The container executing this action has access to following environment variables:
4644///
4645/// - KB_POD_FQDN: The FQDN of the Pod whose role is being assessed.
4646/// - KB_SERVICE_PORT: The port used by the database service.
4647/// - KB_SERVICE_USER: The username with the necessary permissions to interact with the database service.
4648/// - KB_SERVICE_PASSWORD: The corresponding password for KB_SERVICE_USER to authenticate with the database service.
4649///
4650/// Expected output of this action:
4651/// - On Success: The determined role of the replica, which must align with one of the roles specified
4652/// in the component definition.
4653/// - On Failure: An error message, if applicable, indicating why the action failed.
4654///
4655/// Note: This field is immutable once it has been set.
4656#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
4657pub struct ComponentDefinitionLifecycleActionsRoleProbe {
4658 /// Specifies the name of the predefined action handler to be invoked for lifecycle actions.
4659 ///
4660 /// Lorry, as a sidecar agent co-located with the database container in the same Pod,
4661 /// includes a suite of built-in action implementations that are tailored to different database engines.
4662 /// These are known as "builtin" handlers, includes: `mysql`, `redis`, `mongodb`, `etcd`,
4663 /// `postgresql`, `vanilla-postgresql`, `apecloud-postgresql`, `wesql`, `oceanbase`, `polardbx`.
4664 ///
4665 /// If the `builtinHandler` field is specified, it instructs Lorry to utilize its internal built-in action handler
4666 /// to execute the specified lifecycle actions.
4667 ///
4668 /// The `builtinHandler` field is of type `BuiltinActionHandlerType`,
4669 /// which represents the name of the built-in handler.
4670 /// The `builtinHandler` specified within the same `ComponentLifecycleActions` should be consistent across all
4671 /// actions.
4672 /// This means that if you specify a built-in handler for one action, you should use the same handler
4673 /// for all other actions throughout the entire `ComponentLifecycleActions` collection.
4674 ///
4675 /// If you need to define lifecycle actions for database engines not covered by the existing built-in support,
4676 /// or when the pre-existing built-in handlers do not meet your specific needs,
4677 /// you can use the `customHandler` field to define your own action implementation.
4678 ///
4679 /// Deprecation Notice:
4680 ///
4681 /// - In the future, the `builtinHandler` field will be deprecated in favor of using the `customHandler` field
4682 /// for configuring all lifecycle actions.
4683 /// - Instead of using a name to indicate the built-in action implementations in Lorry,
4684 /// the recommended approach will be to explicitly invoke the desired action implementation through
4685 /// a gRPC interface exposed by the sidecar agent.
4686 /// - Developers will have the flexibility to either use the built-in action implementations provided by Lorry
4687 /// or develop their own sidecar agent to implement custom actions and expose them via gRPC interfaces.
4688 /// - This change will allow for greater customization and extensibility of lifecycle actions,
4689 /// as developers can create their own "builtin" implementations tailored to their specific requirements.
4690 #[serde(default, skip_serializing_if = "Option::is_none", rename = "builtinHandler")]
4691 pub builtin_handler: Option<String>,
4692 /// Specifies a user-defined hook or procedure that is called to perform the specific lifecycle action.
4693 /// It offers a flexible and expandable approach for customizing the behavior of a Component by leveraging
4694 /// tailored actions.
4695 ///
4696 /// An Action can be implemented as either an ExecAction or an HTTPAction, with future versions planning
4697 /// to support GRPCAction,
4698 /// thereby accommodating unique logic for different database systems within the Action's framework.
4699 ///
4700 /// In future iterations, all built-in handlers are expected to transition to GRPCAction.
4701 /// This change means that Lorry or other sidecar agents will expose the implementation of actions
4702 /// through a GRPC interface for external invocation.
4703 /// Then the controller will interact with these actions via GRPCAction calls.
4704 #[serde(default, skip_serializing_if = "Option::is_none", rename = "customHandler")]
4705 pub custom_handler: Option<ComponentDefinitionLifecycleActionsRoleProbeCustomHandler>,
4706 /// Specifies the number of seconds to wait after the container has started before the RoleProbe
4707 /// begins to detect the container's role.
4708 #[serde(default, skip_serializing_if = "Option::is_none", rename = "initialDelaySeconds")]
4709 pub initial_delay_seconds: Option<i32>,
4710 /// Specifies the frequency at which the probe is conducted. This value is expressed in seconds.
4711 /// Default to 10 seconds. Minimum value is 1.
4712 #[serde(default, skip_serializing_if = "Option::is_none", rename = "periodSeconds")]
4713 pub period_seconds: Option<i32>,
4714 /// Specifies the number of seconds after which the probe times out.
4715 /// Defaults to 1 second. Minimum value is 1.
4716 #[serde(default, skip_serializing_if = "Option::is_none", rename = "timeoutSeconds")]
4717 pub timeout_seconds: Option<i32>,
4718}
4719
4720/// Specifies a user-defined hook or procedure that is called to perform the specific lifecycle action.
4721/// It offers a flexible and expandable approach for customizing the behavior of a Component by leveraging
4722/// tailored actions.
4723///
4724/// An Action can be implemented as either an ExecAction or an HTTPAction, with future versions planning
4725/// to support GRPCAction,
4726/// thereby accommodating unique logic for different database systems within the Action's framework.
4727///
4728/// In future iterations, all built-in handlers are expected to transition to GRPCAction.
4729/// This change means that Lorry or other sidecar agents will expose the implementation of actions
4730/// through a GRPC interface for external invocation.
4731/// Then the controller will interact with these actions via GRPCAction calls.
4732#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
4733pub struct ComponentDefinitionLifecycleActionsRoleProbeCustomHandler {
4734 /// Defines the name of the container within the target Pod where the action will be executed.
4735 ///
4736 /// This name must correspond to one of the containers defined in `componentDefinition.spec.runtime`.
4737 /// If this field is not specified, the default behavior is to use the first container listed in
4738 /// `componentDefinition.spec.runtime`.
4739 ///
4740 /// This field cannot be updated.
4741 ///
4742 /// Note: This field is reserved for future use and is not currently active.
4743 #[serde(default, skip_serializing_if = "Option::is_none")]
4744 pub container: Option<String>,
4745 /// Represents a list of environment variables that will be injected into the container.
4746 /// These variables enable the container to adapt its behavior based on the environment it's running in.
4747 ///
4748 /// This field cannot be updated.
4749 #[serde(default, skip_serializing_if = "Option::is_none")]
4750 pub env: Option<Vec<ComponentDefinitionLifecycleActionsRoleProbeCustomHandlerEnv>>,
4751 /// Defines the command to run.
4752 ///
4753 /// This field cannot be updated.
4754 #[serde(default, skip_serializing_if = "Option::is_none")]
4755 pub exec: Option<ComponentDefinitionLifecycleActionsRoleProbeCustomHandlerExec>,
4756 /// Specifies the HTTP request to perform.
4757 ///
4758 /// This field cannot be updated.
4759 ///
4760 /// Note: HTTPAction is to be implemented in future version.
4761 #[serde(default, skip_serializing_if = "Option::is_none")]
4762 pub http: Option<ComponentDefinitionLifecycleActionsRoleProbeCustomHandlerHttp>,
4763 /// Specifies the container image to be used for running the Action.
4764 ///
4765 /// When specified, a dedicated container will be created using this image to execute the Action.
4766 /// This field is mutually exclusive with the `container` field; only one of them should be provided.
4767 ///
4768 /// This field cannot be updated.
4769 #[serde(default, skip_serializing_if = "Option::is_none")]
4770 pub image: Option<String>,
4771 /// Used in conjunction with the `targetPodSelector` field to refine the selection of target pod(s) for Action execution.
4772 /// The impact of this field depends on the `targetPodSelector` value:
4773 ///
4774 /// - When `targetPodSelector` is set to `Any` or `All`, this field will be ignored.
4775 /// - When `targetPodSelector` is set to `Role`, only those replicas whose role matches the `matchingKey`
4776 /// will be selected for the Action.
4777 ///
4778 /// This field cannot be updated.
4779 ///
4780 /// Note: This field is reserved for future use and is not currently active.
4781 #[serde(default, skip_serializing_if = "Option::is_none", rename = "matchingKey")]
4782 pub matching_key: Option<String>,
4783 /// Specifies the state that the cluster must reach before the Action is executed.
4784 /// Currently, this is only applicable to the `postProvision` action.
4785 ///
4786 /// The conditions are as follows:
4787 ///
4788 /// - `Immediately`: Executed right after the Component object is created.
4789 /// The readiness of the Component and its resources is not guaranteed at this stage.
4790 /// - `RuntimeReady`: The Action is triggered after the Component object has been created and all associated
4791 /// runtime resources (e.g. Pods) are in a ready state.
4792 /// - `ComponentReady`: The Action is triggered after the Component itself is in a ready state.
4793 /// This process does not affect the readiness state of the Component or the Cluster.
4794 /// - `ClusterReady`: The Action is executed after the Cluster is in a ready state.
4795 /// This execution does not alter the Component or the Cluster's state of readiness.
4796 ///
4797 /// This field cannot be updated.
4798 #[serde(default, skip_serializing_if = "Option::is_none", rename = "preCondition")]
4799 pub pre_condition: Option<String>,
4800 /// Defines the strategy to be taken when retrying the Action after a failure.
4801 ///
4802 /// It specifies the conditions under which the Action should be retried and the limits to apply,
4803 /// such as the maximum number of retries and backoff strategy.
4804 ///
4805 /// This field cannot be updated.
4806 #[serde(default, skip_serializing_if = "Option::is_none", rename = "retryPolicy")]
4807 pub retry_policy: Option<ComponentDefinitionLifecycleActionsRoleProbeCustomHandlerRetryPolicy>,
4808 /// Defines the criteria used to select the target Pod(s) for executing the Action.
4809 /// This is useful when there is no default target replica identified.
4810 /// It allows for precise control over which Pod(s) the Action should run in.
4811 ///
4812 /// This field cannot be updated.
4813 ///
4814 /// Note: This field is reserved for future use and is not currently active.
4815 #[serde(default, skip_serializing_if = "Option::is_none", rename = "targetPodSelector")]
4816 pub target_pod_selector: Option<ComponentDefinitionLifecycleActionsRoleProbeCustomHandlerTargetPodSelector>,
4817 /// Specifies the maximum duration in seconds that the Action is allowed to run.
4818 ///
4819 /// If the Action does not complete within this time frame, it will be terminated.
4820 ///
4821 /// This field cannot be updated.
4822 #[serde(default, skip_serializing_if = "Option::is_none", rename = "timeoutSeconds")]
4823 pub timeout_seconds: Option<i32>,
4824}
4825
4826/// EnvVar represents an environment variable present in a Container.
4827#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
4828pub struct ComponentDefinitionLifecycleActionsRoleProbeCustomHandlerEnv {
4829 /// Name of the environment variable. Must be a C_IDENTIFIER.
4830 pub name: String,
4831 /// Variable references $(VAR_NAME) are expanded
4832 /// using the previously defined environment variables in the container and
4833 /// any service environment variables. If a variable cannot be resolved,
4834 /// the reference in the input string will be unchanged. Double $$ are reduced
4835 /// to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e.
4836 /// "$$(VAR_NAME)" will produce the string literal "$(VAR_NAME)".
4837 /// Escaped references will never be expanded, regardless of whether the variable
4838 /// exists or not.
4839 /// Defaults to "".
4840 #[serde(default, skip_serializing_if = "Option::is_none")]
4841 pub value: Option<String>,
4842 /// Source for the environment variable's value. Cannot be used if value is not empty.
4843 #[serde(default, skip_serializing_if = "Option::is_none", rename = "valueFrom")]
4844 pub value_from: Option<ComponentDefinitionLifecycleActionsRoleProbeCustomHandlerEnvValueFrom>,
4845}
4846
4847/// Source for the environment variable's value. Cannot be used if value is not empty.
4848#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
4849pub struct ComponentDefinitionLifecycleActionsRoleProbeCustomHandlerEnvValueFrom {
4850 /// Selects a key of a ConfigMap.
4851 #[serde(default, skip_serializing_if = "Option::is_none", rename = "configMapKeyRef")]
4852 pub config_map_key_ref: Option<ComponentDefinitionLifecycleActionsRoleProbeCustomHandlerEnvValueFromConfigMapKeyRef>,
4853 /// Selects a field of the pod: supports metadata.name, metadata.namespace, `metadata.labels['<KEY>']`, `metadata.annotations['<KEY>']`,
4854 /// spec.nodeName, spec.serviceAccountName, status.hostIP, status.podIP, status.podIPs.
4855 #[serde(default, skip_serializing_if = "Option::is_none", rename = "fieldRef")]
4856 pub field_ref: Option<ComponentDefinitionLifecycleActionsRoleProbeCustomHandlerEnvValueFromFieldRef>,
4857 /// Selects a resource of the container: only resources limits and requests
4858 /// (limits.cpu, limits.memory, limits.ephemeral-storage, requests.cpu, requests.memory and requests.ephemeral-storage) are currently supported.
4859 #[serde(default, skip_serializing_if = "Option::is_none", rename = "resourceFieldRef")]
4860 pub resource_field_ref: Option<ComponentDefinitionLifecycleActionsRoleProbeCustomHandlerEnvValueFromResourceFieldRef>,
4861 /// Selects a key of a secret in the pod's namespace
4862 #[serde(default, skip_serializing_if = "Option::is_none", rename = "secretKeyRef")]
4863 pub secret_key_ref: Option<ComponentDefinitionLifecycleActionsRoleProbeCustomHandlerEnvValueFromSecretKeyRef>,
4864}
4865
4866/// Selects a key of a ConfigMap.
4867#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
4868pub struct ComponentDefinitionLifecycleActionsRoleProbeCustomHandlerEnvValueFromConfigMapKeyRef {
4869 /// The key to select.
4870 pub key: String,
4871 /// Name of the referent.
4872 /// More info: <https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names>
4873 #[serde(default, skip_serializing_if = "Option::is_none")]
4874 pub name: Option<String>,
4875 /// Specify whether the ConfigMap or its key must be defined
4876 #[serde(default, skip_serializing_if = "Option::is_none")]
4877 pub optional: Option<bool>,
4878}
4879
4880/// Selects a field of the pod: supports metadata.name, metadata.namespace, `metadata.labels['<KEY>']`, `metadata.annotations['<KEY>']`,
4881/// spec.nodeName, spec.serviceAccountName, status.hostIP, status.podIP, status.podIPs.
4882#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
4883pub struct ComponentDefinitionLifecycleActionsRoleProbeCustomHandlerEnvValueFromFieldRef {
4884 /// Version of the schema the FieldPath is written in terms of, defaults to "v1".
4885 #[serde(default, skip_serializing_if = "Option::is_none", rename = "apiVersion")]
4886 pub api_version: Option<String>,
4887 /// Path of the field to select in the specified API version.
4888 #[serde(rename = "fieldPath")]
4889 pub field_path: String,
4890}
4891
4892/// Selects a resource of the container: only resources limits and requests
4893/// (limits.cpu, limits.memory, limits.ephemeral-storage, requests.cpu, requests.memory and requests.ephemeral-storage) are currently supported.
4894#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
4895pub struct ComponentDefinitionLifecycleActionsRoleProbeCustomHandlerEnvValueFromResourceFieldRef {
4896 /// Container name: required for volumes, optional for env vars
4897 #[serde(default, skip_serializing_if = "Option::is_none", rename = "containerName")]
4898 pub container_name: Option<String>,
4899 /// Specifies the output format of the exposed resources, defaults to "1"
4900 #[serde(default, skip_serializing_if = "Option::is_none")]
4901 pub divisor: Option<IntOrString>,
4902 /// Required: resource to select
4903 pub resource: String,
4904}
4905
4906/// Selects a key of a secret in the pod's namespace
4907#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
4908pub struct ComponentDefinitionLifecycleActionsRoleProbeCustomHandlerEnvValueFromSecretKeyRef {
4909 /// The key of the secret to select from. Must be a valid secret key.
4910 pub key: String,
4911 /// Name of the referent.
4912 /// More info: <https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names>
4913 #[serde(default, skip_serializing_if = "Option::is_none")]
4914 pub name: Option<String>,
4915 /// Specify whether the Secret or its key must be defined
4916 #[serde(default, skip_serializing_if = "Option::is_none")]
4917 pub optional: Option<bool>,
4918}
4919
4920/// Defines the command to run.
4921///
4922/// This field cannot be updated.
4923#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
4924pub struct ComponentDefinitionLifecycleActionsRoleProbeCustomHandlerExec {
4925 /// Args represents the arguments that are passed to the `command` for execution.
4926 #[serde(default, skip_serializing_if = "Option::is_none")]
4927 pub args: Option<Vec<String>>,
4928 /// Specifies the command to be executed inside the container.
4929 /// The working directory for this command is the container's root directory('/').
4930 /// Commands are executed directly without a shell environment, meaning shell-specific syntax ('|', etc.) is not supported.
4931 /// If the shell is required, it must be explicitly invoked in the command.
4932 ///
4933 /// A successful execution is indicated by an exit status of 0; any non-zero status signifies a failure.
4934 #[serde(default, skip_serializing_if = "Option::is_none")]
4935 pub command: Option<Vec<String>>,
4936}
4937
4938/// Specifies the HTTP request to perform.
4939///
4940/// This field cannot be updated.
4941///
4942/// Note: HTTPAction is to be implemented in future version.
4943#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
4944pub struct ComponentDefinitionLifecycleActionsRoleProbeCustomHandlerHttp {
4945 /// Indicates the server's domain name or IP address. Defaults to the Pod's IP.
4946 /// Prefer setting the "Host" header in httpHeaders when needed.
4947 #[serde(default, skip_serializing_if = "Option::is_none")]
4948 pub host: Option<String>,
4949 /// Allows for the inclusion of custom headers in the request.
4950 /// HTTP permits the use of repeated headers.
4951 #[serde(default, skip_serializing_if = "Option::is_none", rename = "httpHeaders")]
4952 pub http_headers: Option<Vec<ComponentDefinitionLifecycleActionsRoleProbeCustomHandlerHttpHttpHeaders>>,
4953 /// Represents the type of HTTP request to be made, such as "GET," "POST," "PUT," etc.
4954 /// If not specified, "GET" is the default method.
4955 #[serde(default, skip_serializing_if = "Option::is_none")]
4956 pub method: Option<String>,
4957 /// Specifies the endpoint to be requested on the HTTP server.
4958 #[serde(default, skip_serializing_if = "Option::is_none")]
4959 pub path: Option<String>,
4960 /// Specifies the target port for the HTTP request.
4961 /// It can be specified either as a numeric value in the range of 1 to 65535,
4962 /// or as a named port that meets the IANA_SVC_NAME specification.
4963 pub port: IntOrString,
4964 /// Designates the protocol used to make the request, such as HTTP or HTTPS.
4965 /// If not specified, HTTP is used by default.
4966 #[serde(default, skip_serializing_if = "Option::is_none")]
4967 pub scheme: Option<String>,
4968}
4969
4970/// HTTPHeader describes a custom header to be used in HTTP probes
4971#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
4972pub struct ComponentDefinitionLifecycleActionsRoleProbeCustomHandlerHttpHttpHeaders {
4973 /// The header field name.
4974 /// This will be canonicalized upon output, so case-variant names will be understood as the same header.
4975 pub name: String,
4976 /// The header field value
4977 pub value: String,
4978}
4979
4980/// Defines the strategy to be taken when retrying the Action after a failure.
4981///
4982/// It specifies the conditions under which the Action should be retried and the limits to apply,
4983/// such as the maximum number of retries and backoff strategy.
4984///
4985/// This field cannot be updated.
4986#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
4987pub struct ComponentDefinitionLifecycleActionsRoleProbeCustomHandlerRetryPolicy {
4988 /// Defines the maximum number of retry attempts that should be made for a given Action.
4989 /// This value is set to 0 by default, indicating that no retries will be made.
4990 #[serde(default, skip_serializing_if = "Option::is_none", rename = "maxRetries")]
4991 pub max_retries: Option<i64>,
4992 /// Indicates the duration of time to wait between each retry attempt.
4993 /// This value is set to 0 by default, indicating that there will be no delay between retry attempts.
4994 #[serde(default, skip_serializing_if = "Option::is_none", rename = "retryInterval")]
4995 pub retry_interval: Option<i64>,
4996}
4997
4998/// Specifies a user-defined hook or procedure that is called to perform the specific lifecycle action.
4999/// It offers a flexible and expandable approach for customizing the behavior of a Component by leveraging
5000/// tailored actions.
5001///
5002/// An Action can be implemented as either an ExecAction or an HTTPAction, with future versions planning
5003/// to support GRPCAction,
5004/// thereby accommodating unique logic for different database systems within the Action's framework.
5005///
5006/// In future iterations, all built-in handlers are expected to transition to GRPCAction.
5007/// This change means that Lorry or other sidecar agents will expose the implementation of actions
5008/// through a GRPC interface for external invocation.
5009/// Then the controller will interact with these actions via GRPCAction calls.
5010#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
5011pub enum ComponentDefinitionLifecycleActionsRoleProbeCustomHandlerTargetPodSelector {
5012 Any,
5013 All,
5014 Role,
5015 Ordinal,
5016}
5017
5018/// Defines the procedure for a controlled transition of leadership from the current leader to a new replica.
5019/// This approach aims to minimize downtime and maintain availability in systems with a leader-follower topology,
5020/// during events such as planned maintenance or when performing stop, shutdown, restart, or upgrade operations
5021/// involving the current leader node.
5022///
5023/// The container executing this action has access to following environment variables:
5024///
5025/// - KB_SWITCHOVER_CANDIDATE_NAME: The name of the pod for the new leader candidate, which may not be specified (empty).
5026/// - KB_SWITCHOVER_CANDIDATE_FQDN: The FQDN of the new leader candidate's pod, which may not be specified (empty).
5027/// - KB_LEADER_POD_IP: The IP address of the current leader's pod prior to the switchover.
5028/// - KB_LEADER_POD_NAME: The name of the current leader's pod prior to the switchover.
5029/// - KB_LEADER_POD_FQDN: The FQDN of the current leader's pod prior to the switchover.
5030///
5031/// The environment variables with the following prefixes are deprecated and will be removed in future releases:
5032///
5033/// - KB_REPLICATION_PRIMARY_POD_
5034/// - KB_CONSENSUS_LEADER_POD_
5035///
5036/// Note: This field is immutable once it has been set.
5037#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
5038pub struct ComponentDefinitionLifecycleActionsSwitchover {
5039 /// Used to define the selectors for the scriptSpecs that need to be referenced.
5040 /// If this field is set, the scripts defined under the 'scripts' field can be invoked or referenced within an Action.
5041 ///
5042 /// This field is deprecated from v0.9.
5043 /// This field is maintained for backward compatibility and its use is discouraged.
5044 /// Existing usage should be updated to the current preferred approach to avoid compatibility issues in future releases.
5045 #[serde(default, skip_serializing_if = "Option::is_none", rename = "scriptSpecSelectors")]
5046 pub script_spec_selectors: Option<Vec<ComponentDefinitionLifecycleActionsSwitchoverScriptSpecSelectors>>,
5047 /// Represents the switchover process for a specified candidate primary or leader instance.
5048 /// Note that only Action.Exec is currently supported, while Action.HTTP is not.
5049 #[serde(default, skip_serializing_if = "Option::is_none", rename = "withCandidate")]
5050 pub with_candidate: Option<ComponentDefinitionLifecycleActionsSwitchoverWithCandidate>,
5051 /// Represents a switchover process that does not involve a specific candidate primary or leader instance.
5052 /// As with the previous field, only Action.Exec is currently supported, not Action.HTTP.
5053 #[serde(default, skip_serializing_if = "Option::is_none", rename = "withoutCandidate")]
5054 pub without_candidate: Option<ComponentDefinitionLifecycleActionsSwitchoverWithoutCandidate>,
5055}
5056
5057#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
5058pub struct ComponentDefinitionLifecycleActionsSwitchoverScriptSpecSelectors {
5059 /// Represents the name of the ScriptSpec referent.
5060 pub name: String,
5061}
5062
5063/// Represents the switchover process for a specified candidate primary or leader instance.
5064/// Note that only Action.Exec is currently supported, while Action.HTTP is not.
5065#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
5066pub struct ComponentDefinitionLifecycleActionsSwitchoverWithCandidate {
5067 /// Defines the name of the container within the target Pod where the action will be executed.
5068 ///
5069 /// This name must correspond to one of the containers defined in `componentDefinition.spec.runtime`.
5070 /// If this field is not specified, the default behavior is to use the first container listed in
5071 /// `componentDefinition.spec.runtime`.
5072 ///
5073 /// This field cannot be updated.
5074 ///
5075 /// Note: This field is reserved for future use and is not currently active.
5076 #[serde(default, skip_serializing_if = "Option::is_none")]
5077 pub container: Option<String>,
5078 /// Represents a list of environment variables that will be injected into the container.
5079 /// These variables enable the container to adapt its behavior based on the environment it's running in.
5080 ///
5081 /// This field cannot be updated.
5082 #[serde(default, skip_serializing_if = "Option::is_none")]
5083 pub env: Option<Vec<ComponentDefinitionLifecycleActionsSwitchoverWithCandidateEnv>>,
5084 /// Defines the command to run.
5085 ///
5086 /// This field cannot be updated.
5087 #[serde(default, skip_serializing_if = "Option::is_none")]
5088 pub exec: Option<ComponentDefinitionLifecycleActionsSwitchoverWithCandidateExec>,
5089 /// Specifies the HTTP request to perform.
5090 ///
5091 /// This field cannot be updated.
5092 ///
5093 /// Note: HTTPAction is to be implemented in future version.
5094 #[serde(default, skip_serializing_if = "Option::is_none")]
5095 pub http: Option<ComponentDefinitionLifecycleActionsSwitchoverWithCandidateHttp>,
5096 /// Specifies the container image to be used for running the Action.
5097 ///
5098 /// When specified, a dedicated container will be created using this image to execute the Action.
5099 /// This field is mutually exclusive with the `container` field; only one of them should be provided.
5100 ///
5101 /// This field cannot be updated.
5102 #[serde(default, skip_serializing_if = "Option::is_none")]
5103 pub image: Option<String>,
5104 /// Used in conjunction with the `targetPodSelector` field to refine the selection of target pod(s) for Action execution.
5105 /// The impact of this field depends on the `targetPodSelector` value:
5106 ///
5107 /// - When `targetPodSelector` is set to `Any` or `All`, this field will be ignored.
5108 /// - When `targetPodSelector` is set to `Role`, only those replicas whose role matches the `matchingKey`
5109 /// will be selected for the Action.
5110 ///
5111 /// This field cannot be updated.
5112 ///
5113 /// Note: This field is reserved for future use and is not currently active.
5114 #[serde(default, skip_serializing_if = "Option::is_none", rename = "matchingKey")]
5115 pub matching_key: Option<String>,
5116 /// Specifies the state that the cluster must reach before the Action is executed.
5117 /// Currently, this is only applicable to the `postProvision` action.
5118 ///
5119 /// The conditions are as follows:
5120 ///
5121 /// - `Immediately`: Executed right after the Component object is created.
5122 /// The readiness of the Component and its resources is not guaranteed at this stage.
5123 /// - `RuntimeReady`: The Action is triggered after the Component object has been created and all associated
5124 /// runtime resources (e.g. Pods) are in a ready state.
5125 /// - `ComponentReady`: The Action is triggered after the Component itself is in a ready state.
5126 /// This process does not affect the readiness state of the Component or the Cluster.
5127 /// - `ClusterReady`: The Action is executed after the Cluster is in a ready state.
5128 /// This execution does not alter the Component or the Cluster's state of readiness.
5129 ///
5130 /// This field cannot be updated.
5131 #[serde(default, skip_serializing_if = "Option::is_none", rename = "preCondition")]
5132 pub pre_condition: Option<String>,
5133 /// Defines the strategy to be taken when retrying the Action after a failure.
5134 ///
5135 /// It specifies the conditions under which the Action should be retried and the limits to apply,
5136 /// such as the maximum number of retries and backoff strategy.
5137 ///
5138 /// This field cannot be updated.
5139 #[serde(default, skip_serializing_if = "Option::is_none", rename = "retryPolicy")]
5140 pub retry_policy: Option<ComponentDefinitionLifecycleActionsSwitchoverWithCandidateRetryPolicy>,
5141 /// Defines the criteria used to select the target Pod(s) for executing the Action.
5142 /// This is useful when there is no default target replica identified.
5143 /// It allows for precise control over which Pod(s) the Action should run in.
5144 ///
5145 /// This field cannot be updated.
5146 ///
5147 /// Note: This field is reserved for future use and is not currently active.
5148 #[serde(default, skip_serializing_if = "Option::is_none", rename = "targetPodSelector")]
5149 pub target_pod_selector: Option<ComponentDefinitionLifecycleActionsSwitchoverWithCandidateTargetPodSelector>,
5150 /// Specifies the maximum duration in seconds that the Action is allowed to run.
5151 ///
5152 /// If the Action does not complete within this time frame, it will be terminated.
5153 ///
5154 /// This field cannot be updated.
5155 #[serde(default, skip_serializing_if = "Option::is_none", rename = "timeoutSeconds")]
5156 pub timeout_seconds: Option<i32>,
5157}
5158
5159/// EnvVar represents an environment variable present in a Container.
5160#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
5161pub struct ComponentDefinitionLifecycleActionsSwitchoverWithCandidateEnv {
5162 /// Name of the environment variable. Must be a C_IDENTIFIER.
5163 pub name: String,
5164 /// Variable references $(VAR_NAME) are expanded
5165 /// using the previously defined environment variables in the container and
5166 /// any service environment variables. If a variable cannot be resolved,
5167 /// the reference in the input string will be unchanged. Double $$ are reduced
5168 /// to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e.
5169 /// "$$(VAR_NAME)" will produce the string literal "$(VAR_NAME)".
5170 /// Escaped references will never be expanded, regardless of whether the variable
5171 /// exists or not.
5172 /// Defaults to "".
5173 #[serde(default, skip_serializing_if = "Option::is_none")]
5174 pub value: Option<String>,
5175 /// Source for the environment variable's value. Cannot be used if value is not empty.
5176 #[serde(default, skip_serializing_if = "Option::is_none", rename = "valueFrom")]
5177 pub value_from: Option<ComponentDefinitionLifecycleActionsSwitchoverWithCandidateEnvValueFrom>,
5178}
5179
5180/// Source for the environment variable's value. Cannot be used if value is not empty.
5181#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
5182pub struct ComponentDefinitionLifecycleActionsSwitchoverWithCandidateEnvValueFrom {
5183 /// Selects a key of a ConfigMap.
5184 #[serde(default, skip_serializing_if = "Option::is_none", rename = "configMapKeyRef")]
5185 pub config_map_key_ref: Option<ComponentDefinitionLifecycleActionsSwitchoverWithCandidateEnvValueFromConfigMapKeyRef>,
5186 /// Selects a field of the pod: supports metadata.name, metadata.namespace, `metadata.labels['<KEY>']`, `metadata.annotations['<KEY>']`,
5187 /// spec.nodeName, spec.serviceAccountName, status.hostIP, status.podIP, status.podIPs.
5188 #[serde(default, skip_serializing_if = "Option::is_none", rename = "fieldRef")]
5189 pub field_ref: Option<ComponentDefinitionLifecycleActionsSwitchoverWithCandidateEnvValueFromFieldRef>,
5190 /// Selects a resource of the container: only resources limits and requests
5191 /// (limits.cpu, limits.memory, limits.ephemeral-storage, requests.cpu, requests.memory and requests.ephemeral-storage) are currently supported.
5192 #[serde(default, skip_serializing_if = "Option::is_none", rename = "resourceFieldRef")]
5193 pub resource_field_ref: Option<ComponentDefinitionLifecycleActionsSwitchoverWithCandidateEnvValueFromResourceFieldRef>,
5194 /// Selects a key of a secret in the pod's namespace
5195 #[serde(default, skip_serializing_if = "Option::is_none", rename = "secretKeyRef")]
5196 pub secret_key_ref: Option<ComponentDefinitionLifecycleActionsSwitchoverWithCandidateEnvValueFromSecretKeyRef>,
5197}
5198
5199/// Selects a key of a ConfigMap.
5200#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
5201pub struct ComponentDefinitionLifecycleActionsSwitchoverWithCandidateEnvValueFromConfigMapKeyRef {
5202 /// The key to select.
5203 pub key: String,
5204 /// Name of the referent.
5205 /// More info: <https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names>
5206 #[serde(default, skip_serializing_if = "Option::is_none")]
5207 pub name: Option<String>,
5208 /// Specify whether the ConfigMap or its key must be defined
5209 #[serde(default, skip_serializing_if = "Option::is_none")]
5210 pub optional: Option<bool>,
5211}
5212
5213/// Selects a field of the pod: supports metadata.name, metadata.namespace, `metadata.labels['<KEY>']`, `metadata.annotations['<KEY>']`,
5214/// spec.nodeName, spec.serviceAccountName, status.hostIP, status.podIP, status.podIPs.
5215#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
5216pub struct ComponentDefinitionLifecycleActionsSwitchoverWithCandidateEnvValueFromFieldRef {
5217 /// Version of the schema the FieldPath is written in terms of, defaults to "v1".
5218 #[serde(default, skip_serializing_if = "Option::is_none", rename = "apiVersion")]
5219 pub api_version: Option<String>,
5220 /// Path of the field to select in the specified API version.
5221 #[serde(rename = "fieldPath")]
5222 pub field_path: String,
5223}
5224
5225/// Selects a resource of the container: only resources limits and requests
5226/// (limits.cpu, limits.memory, limits.ephemeral-storage, requests.cpu, requests.memory and requests.ephemeral-storage) are currently supported.
5227#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
5228pub struct ComponentDefinitionLifecycleActionsSwitchoverWithCandidateEnvValueFromResourceFieldRef {
5229 /// Container name: required for volumes, optional for env vars
5230 #[serde(default, skip_serializing_if = "Option::is_none", rename = "containerName")]
5231 pub container_name: Option<String>,
5232 /// Specifies the output format of the exposed resources, defaults to "1"
5233 #[serde(default, skip_serializing_if = "Option::is_none")]
5234 pub divisor: Option<IntOrString>,
5235 /// Required: resource to select
5236 pub resource: String,
5237}
5238
5239/// Selects a key of a secret in the pod's namespace
5240#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
5241pub struct ComponentDefinitionLifecycleActionsSwitchoverWithCandidateEnvValueFromSecretKeyRef {
5242 /// The key of the secret to select from. Must be a valid secret key.
5243 pub key: String,
5244 /// Name of the referent.
5245 /// More info: <https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names>
5246 #[serde(default, skip_serializing_if = "Option::is_none")]
5247 pub name: Option<String>,
5248 /// Specify whether the Secret or its key must be defined
5249 #[serde(default, skip_serializing_if = "Option::is_none")]
5250 pub optional: Option<bool>,
5251}
5252
5253/// Defines the command to run.
5254///
5255/// This field cannot be updated.
5256#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
5257pub struct ComponentDefinitionLifecycleActionsSwitchoverWithCandidateExec {
5258 /// Args represents the arguments that are passed to the `command` for execution.
5259 #[serde(default, skip_serializing_if = "Option::is_none")]
5260 pub args: Option<Vec<String>>,
5261 /// Specifies the command to be executed inside the container.
5262 /// The working directory for this command is the container's root directory('/').
5263 /// Commands are executed directly without a shell environment, meaning shell-specific syntax ('|', etc.) is not supported.
5264 /// If the shell is required, it must be explicitly invoked in the command.
5265 ///
5266 /// A successful execution is indicated by an exit status of 0; any non-zero status signifies a failure.
5267 #[serde(default, skip_serializing_if = "Option::is_none")]
5268 pub command: Option<Vec<String>>,
5269}
5270
5271/// Specifies the HTTP request to perform.
5272///
5273/// This field cannot be updated.
5274///
5275/// Note: HTTPAction is to be implemented in future version.
5276#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
5277pub struct ComponentDefinitionLifecycleActionsSwitchoverWithCandidateHttp {
5278 /// Indicates the server's domain name or IP address. Defaults to the Pod's IP.
5279 /// Prefer setting the "Host" header in httpHeaders when needed.
5280 #[serde(default, skip_serializing_if = "Option::is_none")]
5281 pub host: Option<String>,
5282 /// Allows for the inclusion of custom headers in the request.
5283 /// HTTP permits the use of repeated headers.
5284 #[serde(default, skip_serializing_if = "Option::is_none", rename = "httpHeaders")]
5285 pub http_headers: Option<Vec<ComponentDefinitionLifecycleActionsSwitchoverWithCandidateHttpHttpHeaders>>,
5286 /// Represents the type of HTTP request to be made, such as "GET," "POST," "PUT," etc.
5287 /// If not specified, "GET" is the default method.
5288 #[serde(default, skip_serializing_if = "Option::is_none")]
5289 pub method: Option<String>,
5290 /// Specifies the endpoint to be requested on the HTTP server.
5291 #[serde(default, skip_serializing_if = "Option::is_none")]
5292 pub path: Option<String>,
5293 /// Specifies the target port for the HTTP request.
5294 /// It can be specified either as a numeric value in the range of 1 to 65535,
5295 /// or as a named port that meets the IANA_SVC_NAME specification.
5296 pub port: IntOrString,
5297 /// Designates the protocol used to make the request, such as HTTP or HTTPS.
5298 /// If not specified, HTTP is used by default.
5299 #[serde(default, skip_serializing_if = "Option::is_none")]
5300 pub scheme: Option<String>,
5301}
5302
5303/// HTTPHeader describes a custom header to be used in HTTP probes
5304#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
5305pub struct ComponentDefinitionLifecycleActionsSwitchoverWithCandidateHttpHttpHeaders {
5306 /// The header field name.
5307 /// This will be canonicalized upon output, so case-variant names will be understood as the same header.
5308 pub name: String,
5309 /// The header field value
5310 pub value: String,
5311}
5312
5313/// Defines the strategy to be taken when retrying the Action after a failure.
5314///
5315/// It specifies the conditions under which the Action should be retried and the limits to apply,
5316/// such as the maximum number of retries and backoff strategy.
5317///
5318/// This field cannot be updated.
5319#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
5320pub struct ComponentDefinitionLifecycleActionsSwitchoverWithCandidateRetryPolicy {
5321 /// Defines the maximum number of retry attempts that should be made for a given Action.
5322 /// This value is set to 0 by default, indicating that no retries will be made.
5323 #[serde(default, skip_serializing_if = "Option::is_none", rename = "maxRetries")]
5324 pub max_retries: Option<i64>,
5325 /// Indicates the duration of time to wait between each retry attempt.
5326 /// This value is set to 0 by default, indicating that there will be no delay between retry attempts.
5327 #[serde(default, skip_serializing_if = "Option::is_none", rename = "retryInterval")]
5328 pub retry_interval: Option<i64>,
5329}
5330
5331/// Represents the switchover process for a specified candidate primary or leader instance.
5332/// Note that only Action.Exec is currently supported, while Action.HTTP is not.
5333#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
5334pub enum ComponentDefinitionLifecycleActionsSwitchoverWithCandidateTargetPodSelector {
5335 Any,
5336 All,
5337 Role,
5338 Ordinal,
5339}
5340
5341/// Represents a switchover process that does not involve a specific candidate primary or leader instance.
5342/// As with the previous field, only Action.Exec is currently supported, not Action.HTTP.
5343#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
5344pub struct ComponentDefinitionLifecycleActionsSwitchoverWithoutCandidate {
5345 /// Defines the name of the container within the target Pod where the action will be executed.
5346 ///
5347 /// This name must correspond to one of the containers defined in `componentDefinition.spec.runtime`.
5348 /// If this field is not specified, the default behavior is to use the first container listed in
5349 /// `componentDefinition.spec.runtime`.
5350 ///
5351 /// This field cannot be updated.
5352 ///
5353 /// Note: This field is reserved for future use and is not currently active.
5354 #[serde(default, skip_serializing_if = "Option::is_none")]
5355 pub container: Option<String>,
5356 /// Represents a list of environment variables that will be injected into the container.
5357 /// These variables enable the container to adapt its behavior based on the environment it's running in.
5358 ///
5359 /// This field cannot be updated.
5360 #[serde(default, skip_serializing_if = "Option::is_none")]
5361 pub env: Option<Vec<ComponentDefinitionLifecycleActionsSwitchoverWithoutCandidateEnv>>,
5362 /// Defines the command to run.
5363 ///
5364 /// This field cannot be updated.
5365 #[serde(default, skip_serializing_if = "Option::is_none")]
5366 pub exec: Option<ComponentDefinitionLifecycleActionsSwitchoverWithoutCandidateExec>,
5367 /// Specifies the HTTP request to perform.
5368 ///
5369 /// This field cannot be updated.
5370 ///
5371 /// Note: HTTPAction is to be implemented in future version.
5372 #[serde(default, skip_serializing_if = "Option::is_none")]
5373 pub http: Option<ComponentDefinitionLifecycleActionsSwitchoverWithoutCandidateHttp>,
5374 /// Specifies the container image to be used for running the Action.
5375 ///
5376 /// When specified, a dedicated container will be created using this image to execute the Action.
5377 /// This field is mutually exclusive with the `container` field; only one of them should be provided.
5378 ///
5379 /// This field cannot be updated.
5380 #[serde(default, skip_serializing_if = "Option::is_none")]
5381 pub image: Option<String>,
5382 /// Used in conjunction with the `targetPodSelector` field to refine the selection of target pod(s) for Action execution.
5383 /// The impact of this field depends on the `targetPodSelector` value:
5384 ///
5385 /// - When `targetPodSelector` is set to `Any` or `All`, this field will be ignored.
5386 /// - When `targetPodSelector` is set to `Role`, only those replicas whose role matches the `matchingKey`
5387 /// will be selected for the Action.
5388 ///
5389 /// This field cannot be updated.
5390 ///
5391 /// Note: This field is reserved for future use and is not currently active.
5392 #[serde(default, skip_serializing_if = "Option::is_none", rename = "matchingKey")]
5393 pub matching_key: Option<String>,
5394 /// Specifies the state that the cluster must reach before the Action is executed.
5395 /// Currently, this is only applicable to the `postProvision` action.
5396 ///
5397 /// The conditions are as follows:
5398 ///
5399 /// - `Immediately`: Executed right after the Component object is created.
5400 /// The readiness of the Component and its resources is not guaranteed at this stage.
5401 /// - `RuntimeReady`: The Action is triggered after the Component object has been created and all associated
5402 /// runtime resources (e.g. Pods) are in a ready state.
5403 /// - `ComponentReady`: The Action is triggered after the Component itself is in a ready state.
5404 /// This process does not affect the readiness state of the Component or the Cluster.
5405 /// - `ClusterReady`: The Action is executed after the Cluster is in a ready state.
5406 /// This execution does not alter the Component or the Cluster's state of readiness.
5407 ///
5408 /// This field cannot be updated.
5409 #[serde(default, skip_serializing_if = "Option::is_none", rename = "preCondition")]
5410 pub pre_condition: Option<String>,
5411 /// Defines the strategy to be taken when retrying the Action after a failure.
5412 ///
5413 /// It specifies the conditions under which the Action should be retried and the limits to apply,
5414 /// such as the maximum number of retries and backoff strategy.
5415 ///
5416 /// This field cannot be updated.
5417 #[serde(default, skip_serializing_if = "Option::is_none", rename = "retryPolicy")]
5418 pub retry_policy: Option<ComponentDefinitionLifecycleActionsSwitchoverWithoutCandidateRetryPolicy>,
5419 /// Defines the criteria used to select the target Pod(s) for executing the Action.
5420 /// This is useful when there is no default target replica identified.
5421 /// It allows for precise control over which Pod(s) the Action should run in.
5422 ///
5423 /// This field cannot be updated.
5424 ///
5425 /// Note: This field is reserved for future use and is not currently active.
5426 #[serde(default, skip_serializing_if = "Option::is_none", rename = "targetPodSelector")]
5427 pub target_pod_selector: Option<ComponentDefinitionLifecycleActionsSwitchoverWithoutCandidateTargetPodSelector>,
5428 /// Specifies the maximum duration in seconds that the Action is allowed to run.
5429 ///
5430 /// If the Action does not complete within this time frame, it will be terminated.
5431 ///
5432 /// This field cannot be updated.
5433 #[serde(default, skip_serializing_if = "Option::is_none", rename = "timeoutSeconds")]
5434 pub timeout_seconds: Option<i32>,
5435}
5436
5437/// EnvVar represents an environment variable present in a Container.
5438#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
5439pub struct ComponentDefinitionLifecycleActionsSwitchoverWithoutCandidateEnv {
5440 /// Name of the environment variable. Must be a C_IDENTIFIER.
5441 pub name: String,
5442 /// Variable references $(VAR_NAME) are expanded
5443 /// using the previously defined environment variables in the container and
5444 /// any service environment variables. If a variable cannot be resolved,
5445 /// the reference in the input string will be unchanged. Double $$ are reduced
5446 /// to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e.
5447 /// "$$(VAR_NAME)" will produce the string literal "$(VAR_NAME)".
5448 /// Escaped references will never be expanded, regardless of whether the variable
5449 /// exists or not.
5450 /// Defaults to "".
5451 #[serde(default, skip_serializing_if = "Option::is_none")]
5452 pub value: Option<String>,
5453 /// Source for the environment variable's value. Cannot be used if value is not empty.
5454 #[serde(default, skip_serializing_if = "Option::is_none", rename = "valueFrom")]
5455 pub value_from: Option<ComponentDefinitionLifecycleActionsSwitchoverWithoutCandidateEnvValueFrom>,
5456}
5457
5458/// Source for the environment variable's value. Cannot be used if value is not empty.
5459#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
5460pub struct ComponentDefinitionLifecycleActionsSwitchoverWithoutCandidateEnvValueFrom {
5461 /// Selects a key of a ConfigMap.
5462 #[serde(default, skip_serializing_if = "Option::is_none", rename = "configMapKeyRef")]
5463 pub config_map_key_ref: Option<ComponentDefinitionLifecycleActionsSwitchoverWithoutCandidateEnvValueFromConfigMapKeyRef>,
5464 /// Selects a field of the pod: supports metadata.name, metadata.namespace, `metadata.labels['<KEY>']`, `metadata.annotations['<KEY>']`,
5465 /// spec.nodeName, spec.serviceAccountName, status.hostIP, status.podIP, status.podIPs.
5466 #[serde(default, skip_serializing_if = "Option::is_none", rename = "fieldRef")]
5467 pub field_ref: Option<ComponentDefinitionLifecycleActionsSwitchoverWithoutCandidateEnvValueFromFieldRef>,
5468 /// Selects a resource of the container: only resources limits and requests
5469 /// (limits.cpu, limits.memory, limits.ephemeral-storage, requests.cpu, requests.memory and requests.ephemeral-storage) are currently supported.
5470 #[serde(default, skip_serializing_if = "Option::is_none", rename = "resourceFieldRef")]
5471 pub resource_field_ref: Option<ComponentDefinitionLifecycleActionsSwitchoverWithoutCandidateEnvValueFromResourceFieldRef>,
5472 /// Selects a key of a secret in the pod's namespace
5473 #[serde(default, skip_serializing_if = "Option::is_none", rename = "secretKeyRef")]
5474 pub secret_key_ref: Option<ComponentDefinitionLifecycleActionsSwitchoverWithoutCandidateEnvValueFromSecretKeyRef>,
5475}
5476
5477/// Selects a key of a ConfigMap.
5478#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
5479pub struct ComponentDefinitionLifecycleActionsSwitchoverWithoutCandidateEnvValueFromConfigMapKeyRef {
5480 /// The key to select.
5481 pub key: String,
5482 /// Name of the referent.
5483 /// More info: <https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names>
5484 #[serde(default, skip_serializing_if = "Option::is_none")]
5485 pub name: Option<String>,
5486 /// Specify whether the ConfigMap or its key must be defined
5487 #[serde(default, skip_serializing_if = "Option::is_none")]
5488 pub optional: Option<bool>,
5489}
5490
5491/// Selects a field of the pod: supports metadata.name, metadata.namespace, `metadata.labels['<KEY>']`, `metadata.annotations['<KEY>']`,
5492/// spec.nodeName, spec.serviceAccountName, status.hostIP, status.podIP, status.podIPs.
5493#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
5494pub struct ComponentDefinitionLifecycleActionsSwitchoverWithoutCandidateEnvValueFromFieldRef {
5495 /// Version of the schema the FieldPath is written in terms of, defaults to "v1".
5496 #[serde(default, skip_serializing_if = "Option::is_none", rename = "apiVersion")]
5497 pub api_version: Option<String>,
5498 /// Path of the field to select in the specified API version.
5499 #[serde(rename = "fieldPath")]
5500 pub field_path: String,
5501}
5502
5503/// Selects a resource of the container: only resources limits and requests
5504/// (limits.cpu, limits.memory, limits.ephemeral-storage, requests.cpu, requests.memory and requests.ephemeral-storage) are currently supported.
5505#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
5506pub struct ComponentDefinitionLifecycleActionsSwitchoverWithoutCandidateEnvValueFromResourceFieldRef {
5507 /// Container name: required for volumes, optional for env vars
5508 #[serde(default, skip_serializing_if = "Option::is_none", rename = "containerName")]
5509 pub container_name: Option<String>,
5510 /// Specifies the output format of the exposed resources, defaults to "1"
5511 #[serde(default, skip_serializing_if = "Option::is_none")]
5512 pub divisor: Option<IntOrString>,
5513 /// Required: resource to select
5514 pub resource: String,
5515}
5516
5517/// Selects a key of a secret in the pod's namespace
5518#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
5519pub struct ComponentDefinitionLifecycleActionsSwitchoverWithoutCandidateEnvValueFromSecretKeyRef {
5520 /// The key of the secret to select from. Must be a valid secret key.
5521 pub key: String,
5522 /// Name of the referent.
5523 /// More info: <https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names>
5524 #[serde(default, skip_serializing_if = "Option::is_none")]
5525 pub name: Option<String>,
5526 /// Specify whether the Secret or its key must be defined
5527 #[serde(default, skip_serializing_if = "Option::is_none")]
5528 pub optional: Option<bool>,
5529}
5530
5531/// Defines the command to run.
5532///
5533/// This field cannot be updated.
5534#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
5535pub struct ComponentDefinitionLifecycleActionsSwitchoverWithoutCandidateExec {
5536 /// Args represents the arguments that are passed to the `command` for execution.
5537 #[serde(default, skip_serializing_if = "Option::is_none")]
5538 pub args: Option<Vec<String>>,
5539 /// Specifies the command to be executed inside the container.
5540 /// The working directory for this command is the container's root directory('/').
5541 /// Commands are executed directly without a shell environment, meaning shell-specific syntax ('|', etc.) is not supported.
5542 /// If the shell is required, it must be explicitly invoked in the command.
5543 ///
5544 /// A successful execution is indicated by an exit status of 0; any non-zero status signifies a failure.
5545 #[serde(default, skip_serializing_if = "Option::is_none")]
5546 pub command: Option<Vec<String>>,
5547}
5548
5549/// Specifies the HTTP request to perform.
5550///
5551/// This field cannot be updated.
5552///
5553/// Note: HTTPAction is to be implemented in future version.
5554#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
5555pub struct ComponentDefinitionLifecycleActionsSwitchoverWithoutCandidateHttp {
5556 /// Indicates the server's domain name or IP address. Defaults to the Pod's IP.
5557 /// Prefer setting the "Host" header in httpHeaders when needed.
5558 #[serde(default, skip_serializing_if = "Option::is_none")]
5559 pub host: Option<String>,
5560 /// Allows for the inclusion of custom headers in the request.
5561 /// HTTP permits the use of repeated headers.
5562 #[serde(default, skip_serializing_if = "Option::is_none", rename = "httpHeaders")]
5563 pub http_headers: Option<Vec<ComponentDefinitionLifecycleActionsSwitchoverWithoutCandidateHttpHttpHeaders>>,
5564 /// Represents the type of HTTP request to be made, such as "GET," "POST," "PUT," etc.
5565 /// If not specified, "GET" is the default method.
5566 #[serde(default, skip_serializing_if = "Option::is_none")]
5567 pub method: Option<String>,
5568 /// Specifies the endpoint to be requested on the HTTP server.
5569 #[serde(default, skip_serializing_if = "Option::is_none")]
5570 pub path: Option<String>,
5571 /// Specifies the target port for the HTTP request.
5572 /// It can be specified either as a numeric value in the range of 1 to 65535,
5573 /// or as a named port that meets the IANA_SVC_NAME specification.
5574 pub port: IntOrString,
5575 /// Designates the protocol used to make the request, such as HTTP or HTTPS.
5576 /// If not specified, HTTP is used by default.
5577 #[serde(default, skip_serializing_if = "Option::is_none")]
5578 pub scheme: Option<String>,
5579}
5580
5581/// HTTPHeader describes a custom header to be used in HTTP probes
5582#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
5583pub struct ComponentDefinitionLifecycleActionsSwitchoverWithoutCandidateHttpHttpHeaders {
5584 /// The header field name.
5585 /// This will be canonicalized upon output, so case-variant names will be understood as the same header.
5586 pub name: String,
5587 /// The header field value
5588 pub value: String,
5589}
5590
5591/// Defines the strategy to be taken when retrying the Action after a failure.
5592///
5593/// It specifies the conditions under which the Action should be retried and the limits to apply,
5594/// such as the maximum number of retries and backoff strategy.
5595///
5596/// This field cannot be updated.
5597#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
5598pub struct ComponentDefinitionLifecycleActionsSwitchoverWithoutCandidateRetryPolicy {
5599 /// Defines the maximum number of retry attempts that should be made for a given Action.
5600 /// This value is set to 0 by default, indicating that no retries will be made.
5601 #[serde(default, skip_serializing_if = "Option::is_none", rename = "maxRetries")]
5602 pub max_retries: Option<i64>,
5603 /// Indicates the duration of time to wait between each retry attempt.
5604 /// This value is set to 0 by default, indicating that there will be no delay between retry attempts.
5605 #[serde(default, skip_serializing_if = "Option::is_none", rename = "retryInterval")]
5606 pub retry_interval: Option<i64>,
5607}
5608
5609/// Represents a switchover process that does not involve a specific candidate primary or leader instance.
5610/// As with the previous field, only Action.Exec is currently supported, not Action.HTTP.
5611#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
5612pub enum ComponentDefinitionLifecycleActionsSwitchoverWithoutCandidateTargetPodSelector {
5613 Any,
5614 All,
5615 Role,
5616 Ordinal,
5617}
5618
5619#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
5620pub struct ComponentDefinitionLogConfigs {
5621 /// Specifies the paths or patterns identifying where the log files are stored.
5622 /// This field allows the system to locate and manage log files effectively.
5623 ///
5624 /// Examples:
5625 ///
5626 /// - /home/postgres/pgdata/pgroot/data/log/postgresql-*
5627 /// - /data/mysql/log/mysqld-error.log
5628 #[serde(rename = "filePathPattern")]
5629 pub file_path_pattern: String,
5630 /// Specifies a descriptive label for the log type, such as 'slow' for a MySQL slow log file.
5631 /// It provides a clear identification of the log's purpose and content.
5632 pub name: String,
5633}
5634
5635/// Deprecated since v0.9
5636/// monitor is monitoring config which provided by provider.
5637#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
5638pub struct ComponentDefinitionMonitor {
5639 /// builtIn is a switch to enable KubeBlocks builtIn monitoring.
5640 /// If BuiltIn is set to true, monitor metrics will be scraped automatically.
5641 /// If BuiltIn is set to false, the provider should set ExporterConfig and Sidecar container own.
5642 #[serde(default, skip_serializing_if = "Option::is_none", rename = "builtIn")]
5643 pub built_in: Option<bool>,
5644 /// exporterConfig provided by provider, which specify necessary information to Time Series Database.
5645 /// exporterConfig is valid when builtIn is false.
5646 #[serde(default, skip_serializing_if = "Option::is_none", rename = "exporterConfig")]
5647 pub exporter_config: Option<ComponentDefinitionMonitorExporterConfig>,
5648}
5649
5650/// exporterConfig provided by provider, which specify necessary information to Time Series Database.
5651/// exporterConfig is valid when builtIn is false.
5652#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
5653pub struct ComponentDefinitionMonitorExporterConfig {
5654 /// scrapePath is exporter url path for Time Series Database to scrape metrics.
5655 #[serde(default, skip_serializing_if = "Option::is_none", rename = "scrapePath")]
5656 pub scrape_path: Option<String>,
5657 /// scrapePort is exporter port for Time Series Database to scrape metrics.
5658 #[serde(rename = "scrapePort")]
5659 pub scrape_port: IntOrString,
5660}
5661
5662/// PolicyRule holds information that describes a policy rule, but does not contain information
5663/// about who the rule applies to or which namespace the rule applies to.
5664#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
5665pub struct ComponentDefinitionPolicyRules {
5666 /// APIGroups is the name of the APIGroup that contains the resources. If multiple API groups are specified, any action requested against one of
5667 /// the enumerated resources in any API group will be allowed. "" represents the core API group and "*" represents all API groups.
5668 #[serde(default, skip_serializing_if = "Option::is_none", rename = "apiGroups")]
5669 pub api_groups: Option<Vec<String>>,
5670 /// NonResourceURLs is a set of partial urls that a user should have access to. *s are allowed, but only as the full, final step in the path
5671 /// Since non-resource URLs are not namespaced, this field is only applicable for ClusterRoles referenced from a ClusterRoleBinding.
5672 /// Rules can either apply to API resources (such as "pods" or "secrets") or non-resource URL paths (such as "/api"), but not both.
5673 #[serde(default, skip_serializing_if = "Option::is_none", rename = "nonResourceURLs")]
5674 pub non_resource_ur_ls: Option<Vec<String>>,
5675 /// ResourceNames is an optional white list of names that the rule applies to. An empty set means that everything is allowed.
5676 #[serde(default, skip_serializing_if = "Option::is_none", rename = "resourceNames")]
5677 pub resource_names: Option<Vec<String>>,
5678 /// Resources is a list of resources this rule applies to. '*' represents all resources.
5679 #[serde(default, skip_serializing_if = "Option::is_none")]
5680 pub resources: Option<Vec<String>>,
5681 /// Verbs is a list of Verbs that apply to ALL the ResourceKinds contained in this rule. '*' represents all verbs.
5682 pub verbs: Vec<String>,
5683}
5684
5685/// Defines the upper limit of the number of replicas supported by the Component.
5686///
5687/// It defines the maximum number of replicas that can be created for the Component.
5688/// This field allows you to set a limit on the scalability of the Component, preventing it from exceeding a certain number of replicas.
5689///
5690/// This field is immutable.
5691#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
5692pub struct ComponentDefinitionReplicasLimit {
5693 /// The maximum limit of replicas.
5694 #[serde(rename = "maxReplicas")]
5695 pub max_replicas: i32,
5696 /// The minimum limit of replicas.
5697 #[serde(rename = "minReplicas")]
5698 pub min_replicas: i32,
5699}
5700
5701#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
5702pub enum ComponentDefinitionRoleArbitrator {
5703 External,
5704 Lorry,
5705}
5706
5707/// ReplicaRole represents a role that can be assumed by a component instance.
5708#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
5709pub struct ComponentDefinitionRoles {
5710 /// Defines the role's identifier. It is used to set the "apps.kubeblocks.io/role" label value
5711 /// on the corresponding object.
5712 ///
5713 /// This field is immutable once set.
5714 pub name: String,
5715 /// Indicates whether a replica assigned this role is capable of providing services.
5716 ///
5717 /// This field is immutable once set.
5718 #[serde(default, skip_serializing_if = "Option::is_none")]
5719 pub serviceable: Option<bool>,
5720 /// Specifies whether a replica with this role has voting rights.
5721 /// In distributed systems, this typically means the replica can participate in consensus decisions,
5722 /// configuration changes, or other processes that require a quorum.
5723 ///
5724 /// This field is immutable once set.
5725 #[serde(default, skip_serializing_if = "Option::is_none")]
5726 pub votable: Option<bool>,
5727 /// Determines if a replica in this role has the authority to perform write operations.
5728 /// A writable replica can modify data, handle update operations.
5729 ///
5730 /// This field is immutable once set.
5731 #[serde(default, skip_serializing_if = "Option::is_none")]
5732 pub writable: Option<bool>,
5733}
5734
5735/// Specifies the PodSpec template used in the Component.
5736/// It includes the following elements:
5737///
5738/// - Init containers
5739/// - Containers
5740/// - Image
5741/// - Commands
5742/// - Args
5743/// - Envs
5744/// - Mounts
5745/// - Ports
5746/// - Security context
5747/// - Probes
5748/// - Lifecycle
5749/// - Volumes
5750///
5751/// This field is intended to define static settings that remain consistent across all instantiated Components.
5752/// Dynamic settings such as CPU and memory resource limits, as well as scheduling settings (affinity,
5753/// toleration, priority), may vary among different instantiated Components.
5754/// They should be specified in the `cluster.spec.componentSpecs` (ClusterComponentSpec).
5755///
5756/// Specific instances of a Component may override settings defined here, such as using a different container image
5757/// or modifying environment variable values.
5758/// These instance-specific overrides can be specified in `cluster.spec.componentSpecs[*].instances`.
5759///
5760/// This field is immutable and cannot be updated once set.
5761#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
5762pub struct ComponentDefinitionRuntime {
5763 /// Optional duration in seconds the pod may be active on the node relative to
5764 /// StartTime before the system will actively try to mark it failed and kill associated containers.
5765 /// Value must be a positive integer.
5766 #[serde(default, skip_serializing_if = "Option::is_none", rename = "activeDeadlineSeconds")]
5767 pub active_deadline_seconds: Option<i64>,
5768 /// If specified, the pod's scheduling constraints
5769 #[serde(default, skip_serializing_if = "Option::is_none")]
5770 pub affinity: Option<ComponentDefinitionRuntimeAffinity>,
5771 /// AutomountServiceAccountToken indicates whether a service account token should be automatically mounted.
5772 #[serde(default, skip_serializing_if = "Option::is_none", rename = "automountServiceAccountToken")]
5773 pub automount_service_account_token: Option<bool>,
5774 /// List of containers belonging to the pod.
5775 /// Containers cannot currently be added or removed.
5776 /// There must be at least one container in a Pod.
5777 /// Cannot be updated.
5778 pub containers: Vec<ComponentDefinitionRuntimeContainers>,
5779 /// Specifies the DNS parameters of a pod.
5780 /// Parameters specified here will be merged to the generated DNS
5781 /// configuration based on DNSPolicy.
5782 #[serde(default, skip_serializing_if = "Option::is_none", rename = "dnsConfig")]
5783 pub dns_config: Option<ComponentDefinitionRuntimeDnsConfig>,
5784 /// Set DNS policy for the pod.
5785 /// Defaults to "ClusterFirst".
5786 /// Valid values are 'ClusterFirstWithHostNet', 'ClusterFirst', 'Default' or 'None'.
5787 /// DNS parameters given in DNSConfig will be merged with the policy selected with DNSPolicy.
5788 /// To have DNS options set along with hostNetwork, you have to specify DNS policy
5789 /// explicitly to 'ClusterFirstWithHostNet'.
5790 #[serde(default, skip_serializing_if = "Option::is_none", rename = "dnsPolicy")]
5791 pub dns_policy: Option<String>,
5792 /// EnableServiceLinks indicates whether information about services should be injected into pod's
5793 /// environment variables, matching the syntax of Docker links.
5794 /// Optional: Defaults to true.
5795 #[serde(default, skip_serializing_if = "Option::is_none", rename = "enableServiceLinks")]
5796 pub enable_service_links: Option<bool>,
5797 /// List of ephemeral containers run in this pod. Ephemeral containers may be run in an existing
5798 /// pod to perform user-initiated actions such as debugging. This list cannot be specified when
5799 /// creating a pod, and it cannot be modified by updating the pod spec. In order to add an
5800 /// ephemeral container to an existing pod, use the pod's ephemeralcontainers subresource.
5801 #[serde(default, skip_serializing_if = "Option::is_none", rename = "ephemeralContainers")]
5802 pub ephemeral_containers: Option<Vec<ComponentDefinitionRuntimeEphemeralContainers>>,
5803 /// HostAliases is an optional list of hosts and IPs that will be injected into the pod's hosts
5804 /// file if specified. This is only valid for non-hostNetwork pods.
5805 #[serde(default, skip_serializing_if = "Option::is_none", rename = "hostAliases")]
5806 pub host_aliases: Option<Vec<ComponentDefinitionRuntimeHostAliases>>,
5807 /// Use the host's ipc namespace.
5808 /// Optional: Default to false.
5809 #[serde(default, skip_serializing_if = "Option::is_none", rename = "hostIPC")]
5810 pub host_ipc: Option<bool>,
5811 /// Host networking requested for this pod. Use the host's network namespace.
5812 /// If this option is set, the ports that will be used must be specified.
5813 /// Default to false.
5814 #[serde(default, skip_serializing_if = "Option::is_none", rename = "hostNetwork")]
5815 pub host_network: Option<bool>,
5816 /// Use the host's pid namespace.
5817 /// Optional: Default to false.
5818 #[serde(default, skip_serializing_if = "Option::is_none", rename = "hostPID")]
5819 pub host_pid: Option<bool>,
5820 /// Use the host's user namespace.
5821 /// Optional: Default to true.
5822 /// If set to true or not present, the pod will be run in the host user namespace, useful
5823 /// for when the pod needs a feature only available to the host user namespace, such as
5824 /// loading a kernel module with CAP_SYS_MODULE.
5825 /// When set to false, a new userns is created for the pod. Setting false is useful for
5826 /// mitigating container breakout vulnerabilities even allowing users to run their
5827 /// containers as root without actually having root privileges on the host.
5828 /// This field is alpha-level and is only honored by servers that enable the UserNamespacesSupport feature.
5829 #[serde(default, skip_serializing_if = "Option::is_none", rename = "hostUsers")]
5830 pub host_users: Option<bool>,
5831 /// Specifies the hostname of the Pod
5832 /// If not specified, the pod's hostname will be set to a system-defined value.
5833 #[serde(default, skip_serializing_if = "Option::is_none")]
5834 pub hostname: Option<String>,
5835 /// ImagePullSecrets is an optional list of references to secrets in the same namespace to use for pulling any of the images used by this PodSpec.
5836 /// If specified, these secrets will be passed to individual puller implementations for them to use.
5837 /// More info: <https://kubernetes.io/docs/concepts/containers/images#specifying-imagepullsecrets-on-a-pod>
5838 #[serde(default, skip_serializing_if = "Option::is_none", rename = "imagePullSecrets")]
5839 pub image_pull_secrets: Option<Vec<ComponentDefinitionRuntimeImagePullSecrets>>,
5840 /// List of initialization containers belonging to the pod.
5841 /// Init containers are executed in order prior to containers being started. If any
5842 /// init container fails, the pod is considered to have failed and is handled according
5843 /// to its restartPolicy. The name for an init container or normal container must be
5844 /// unique among all containers.
5845 /// Init containers may not have Lifecycle actions, Readiness probes, Liveness probes, or Startup probes.
5846 /// The resourceRequirements of an init container are taken into account during scheduling
5847 /// by finding the highest request/limit for each resource type, and then using the max of
5848 /// of that value or the sum of the normal containers. Limits are applied to init containers
5849 /// in a similar fashion.
5850 /// Init containers cannot currently be added or removed.
5851 /// Cannot be updated.
5852 /// More info: <https://kubernetes.io/docs/concepts/workloads/pods/init-containers/>
5853 #[serde(default, skip_serializing_if = "Option::is_none", rename = "initContainers")]
5854 pub init_containers: Option<Vec<ComponentDefinitionRuntimeInitContainers>>,
5855 /// NodeName is a request to schedule this pod onto a specific node. If it is non-empty,
5856 /// the scheduler simply schedules this pod onto that node, assuming that it fits resource
5857 /// requirements.
5858 #[serde(default, skip_serializing_if = "Option::is_none", rename = "nodeName")]
5859 pub node_name: Option<String>,
5860 /// NodeSelector is a selector which must be true for the pod to fit on a node.
5861 /// Selector which must match a node's labels for the pod to be scheduled on that node.
5862 /// More info: <https://kubernetes.io/docs/concepts/configuration/assign-pod-node/>
5863 #[serde(default, skip_serializing_if = "Option::is_none", rename = "nodeSelector")]
5864 pub node_selector: Option<BTreeMap<String, String>>,
5865 /// Specifies the OS of the containers in the pod.
5866 /// Some pod and container fields are restricted if this is set.
5867 ///
5868 /// If the OS field is set to linux, the following fields must be unset:
5869 /// -securityContext.windowsOptions
5870 ///
5871 /// If the OS field is set to windows, following fields must be unset:
5872 /// - spec.hostPID
5873 /// - spec.hostIPC
5874 /// - spec.hostUsers
5875 /// - spec.securityContext.seLinuxOptions
5876 /// - spec.securityContext.seccompProfile
5877 /// - spec.securityContext.fsGroup
5878 /// - spec.securityContext.fsGroupChangePolicy
5879 /// - spec.securityContext.sysctls
5880 /// - spec.shareProcessNamespace
5881 /// - spec.securityContext.runAsUser
5882 /// - spec.securityContext.runAsGroup
5883 /// - spec.securityContext.supplementalGroups
5884 /// - spec.containers[*].securityContext.seLinuxOptions
5885 /// - spec.containers[*].securityContext.seccompProfile
5886 /// - spec.containers[*].securityContext.capabilities
5887 /// - spec.containers[*].securityContext.readOnlyRootFilesystem
5888 /// - spec.containers[*].securityContext.privileged
5889 /// - spec.containers[*].securityContext.allowPrivilegeEscalation
5890 /// - spec.containers[*].securityContext.procMount
5891 /// - spec.containers[*].securityContext.runAsUser
5892 /// - spec.containers[*].securityContext.runAsGroup
5893 #[serde(default, skip_serializing_if = "Option::is_none")]
5894 pub os: Option<ComponentDefinitionRuntimeOs>,
5895 /// Overhead represents the resource overhead associated with running a pod for a given RuntimeClass.
5896 /// This field will be autopopulated at admission time by the RuntimeClass admission controller. If
5897 /// the RuntimeClass admission controller is enabled, overhead must not be set in Pod create requests.
5898 /// The RuntimeClass admission controller will reject Pod create requests which have the overhead already
5899 /// set. If RuntimeClass is configured and selected in the PodSpec, Overhead will be set to the value
5900 /// defined in the corresponding RuntimeClass, otherwise it will remain unset and treated as zero.
5901 /// More info: <https://git.k8s.io/enhancements/keps/sig-node/688-pod-overhead/README.md>
5902 #[serde(default, skip_serializing_if = "Option::is_none")]
5903 pub overhead: Option<BTreeMap<String, IntOrString>>,
5904 /// PreemptionPolicy is the Policy for preempting pods with lower priority.
5905 /// One of Never, PreemptLowerPriority.
5906 /// Defaults to PreemptLowerPriority if unset.
5907 #[serde(default, skip_serializing_if = "Option::is_none", rename = "preemptionPolicy")]
5908 pub preemption_policy: Option<String>,
5909 /// The priority value. Various system components use this field to find the
5910 /// priority of the pod. When Priority Admission Controller is enabled, it
5911 /// prevents users from setting this field. The admission controller populates
5912 /// this field from PriorityClassName.
5913 /// The higher the value, the higher the priority.
5914 #[serde(default, skip_serializing_if = "Option::is_none")]
5915 pub priority: Option<i32>,
5916 /// If specified, indicates the pod's priority. "system-node-critical" and
5917 /// "system-cluster-critical" are two special keywords which indicate the
5918 /// highest priorities with the former being the highest priority. Any other
5919 /// name must be defined by creating a PriorityClass object with that name.
5920 /// If not specified, the pod priority will be default or zero if there is no
5921 /// default.
5922 #[serde(default, skip_serializing_if = "Option::is_none", rename = "priorityClassName")]
5923 pub priority_class_name: Option<String>,
5924 /// If specified, all readiness gates will be evaluated for pod readiness.
5925 /// A pod is ready when all its containers are ready AND
5926 /// all conditions specified in the readiness gates have status equal to "True"
5927 /// More info: <https://git.k8s.io/enhancements/keps/sig-network/580-pod-readiness-gates>
5928 #[serde(default, skip_serializing_if = "Option::is_none", rename = "readinessGates")]
5929 pub readiness_gates: Option<Vec<ComponentDefinitionRuntimeReadinessGates>>,
5930 /// ResourceClaims defines which ResourceClaims must be allocated
5931 /// and reserved before the Pod is allowed to start. The resources
5932 /// will be made available to those containers which consume them
5933 /// by name.
5934 ///
5935 /// This is an alpha field and requires enabling the
5936 /// DynamicResourceAllocation feature gate.
5937 ///
5938 /// This field is immutable.
5939 #[serde(default, skip_serializing_if = "Option::is_none", rename = "resourceClaims")]
5940 pub resource_claims: Option<Vec<ComponentDefinitionRuntimeResourceClaims>>,
5941 /// Restart policy for all containers within the pod.
5942 /// One of Always, OnFailure, Never. In some contexts, only a subset of those values may be permitted.
5943 /// Default to Always.
5944 /// More info: <https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#restart-policy>
5945 #[serde(default, skip_serializing_if = "Option::is_none", rename = "restartPolicy")]
5946 pub restart_policy: Option<String>,
5947 /// RuntimeClassName refers to a RuntimeClass object in the node.k8s.io group, which should be used
5948 /// to run this pod. If no RuntimeClass resource matches the named class, the pod will not be run.
5949 /// If unset or empty, the "legacy" RuntimeClass will be used, which is an implicit class with an
5950 /// empty definition that uses the default runtime handler.
5951 /// More info: <https://git.k8s.io/enhancements/keps/sig-node/585-runtime-class>
5952 #[serde(default, skip_serializing_if = "Option::is_none", rename = "runtimeClassName")]
5953 pub runtime_class_name: Option<String>,
5954 /// If specified, the pod will be dispatched by specified scheduler.
5955 /// If not specified, the pod will be dispatched by default scheduler.
5956 #[serde(default, skip_serializing_if = "Option::is_none", rename = "schedulerName")]
5957 pub scheduler_name: Option<String>,
5958 /// SchedulingGates is an opaque list of values that if specified will block scheduling the pod.
5959 /// If schedulingGates is not empty, the pod will stay in the SchedulingGated state and the
5960 /// scheduler will not attempt to schedule the pod.
5961 ///
5962 /// SchedulingGates can only be set at pod creation time, and be removed only afterwards.
5963 ///
5964 /// This is a beta feature enabled by the PodSchedulingReadiness feature gate.
5965 #[serde(default, skip_serializing_if = "Option::is_none", rename = "schedulingGates")]
5966 pub scheduling_gates: Option<Vec<ComponentDefinitionRuntimeSchedulingGates>>,
5967 /// SecurityContext holds pod-level security attributes and common container settings.
5968 /// Optional: Defaults to empty. See type description for default values of each field.
5969 #[serde(default, skip_serializing_if = "Option::is_none", rename = "securityContext")]
5970 pub security_context: Option<ComponentDefinitionRuntimeSecurityContext>,
5971 /// DeprecatedServiceAccount is a depreciated alias for ServiceAccountName.
5972 /// Deprecated: Use serviceAccountName instead.
5973 #[serde(default, skip_serializing_if = "Option::is_none", rename = "serviceAccount")]
5974 pub service_account: Option<String>,
5975 /// ServiceAccountName is the name of the ServiceAccount to use to run this pod.
5976 /// More info: <https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/>
5977 #[serde(default, skip_serializing_if = "Option::is_none", rename = "serviceAccountName")]
5978 pub service_account_name: Option<String>,
5979 /// If true the pod's hostname will be configured as the pod's FQDN, rather than the leaf name (the default).
5980 /// In Linux containers, this means setting the FQDN in the hostname field of the kernel (the nodename field of struct utsname).
5981 /// In Windows containers, this means setting the registry value of hostname for the registry key HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters to FQDN.
5982 /// If a pod does not have FQDN, this has no effect.
5983 /// Default to false.
5984 #[serde(default, skip_serializing_if = "Option::is_none", rename = "setHostnameAsFQDN")]
5985 pub set_hostname_as_fqdn: Option<bool>,
5986 /// Share a single process namespace between all of the containers in a pod.
5987 /// When this is set containers will be able to view and signal processes from other containers
5988 /// in the same pod, and the first process in each container will not be assigned PID 1.
5989 /// HostPID and ShareProcessNamespace cannot both be set.
5990 /// Optional: Default to false.
5991 #[serde(default, skip_serializing_if = "Option::is_none", rename = "shareProcessNamespace")]
5992 pub share_process_namespace: Option<bool>,
5993 /// If specified, the fully qualified Pod hostname will be "<hostname>.<subdomain>.<pod namespace>.svc.<cluster domain>".
5994 /// If not specified, the pod will not have a domainname at all.
5995 #[serde(default, skip_serializing_if = "Option::is_none")]
5996 pub subdomain: Option<String>,
5997 /// Optional duration in seconds the pod needs to terminate gracefully. May be decreased in delete request.
5998 /// Value must be non-negative integer. The value zero indicates stop immediately via
5999 /// the kill signal (no opportunity to shut down).
6000 /// If this value is nil, the default grace period will be used instead.
6001 /// The grace period is the duration in seconds after the processes running in the pod are sent
6002 /// a termination signal and the time when the processes are forcibly halted with a kill signal.
6003 /// Set this value longer than the expected cleanup time for your process.
6004 /// Defaults to 30 seconds.
6005 #[serde(default, skip_serializing_if = "Option::is_none", rename = "terminationGracePeriodSeconds")]
6006 pub termination_grace_period_seconds: Option<i64>,
6007 /// If specified, the pod's tolerations.
6008 #[serde(default, skip_serializing_if = "Option::is_none")]
6009 pub tolerations: Option<Vec<ComponentDefinitionRuntimeTolerations>>,
6010 /// TopologySpreadConstraints describes how a group of pods ought to spread across topology
6011 /// domains. Scheduler will schedule pods in a way which abides by the constraints.
6012 /// All topologySpreadConstraints are ANDed.
6013 #[serde(default, skip_serializing_if = "Option::is_none", rename = "topologySpreadConstraints")]
6014 pub topology_spread_constraints: Option<Vec<ComponentDefinitionRuntimeTopologySpreadConstraints>>,
6015 /// List of volumes that can be mounted by containers belonging to the pod.
6016 /// More info: <https://kubernetes.io/docs/concepts/storage/volumes>
6017 #[serde(default, skip_serializing_if = "Option::is_none")]
6018 pub volumes: Option<Vec<ComponentDefinitionRuntimeVolumes>>,
6019}
6020
6021/// If specified, the pod's scheduling constraints
6022#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
6023pub struct ComponentDefinitionRuntimeAffinity {
6024 /// Describes node affinity scheduling rules for the pod.
6025 #[serde(default, skip_serializing_if = "Option::is_none", rename = "nodeAffinity")]
6026 pub node_affinity: Option<ComponentDefinitionRuntimeAffinityNodeAffinity>,
6027 /// Describes pod affinity scheduling rules (e.g. co-locate this pod in the same node, zone, etc. as some other pod(s)).
6028 #[serde(default, skip_serializing_if = "Option::is_none", rename = "podAffinity")]
6029 pub pod_affinity: Option<ComponentDefinitionRuntimeAffinityPodAffinity>,
6030 /// Describes pod anti-affinity scheduling rules (e.g. avoid putting this pod in the same node, zone, etc. as some other pod(s)).
6031 #[serde(default, skip_serializing_if = "Option::is_none", rename = "podAntiAffinity")]
6032 pub pod_anti_affinity: Option<ComponentDefinitionRuntimeAffinityPodAntiAffinity>,
6033}
6034
6035/// Describes node affinity scheduling rules for the pod.
6036#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
6037pub struct ComponentDefinitionRuntimeAffinityNodeAffinity {
6038 /// The scheduler will prefer to schedule pods to nodes that satisfy
6039 /// the affinity expressions specified by this field, but it may choose
6040 /// a node that violates one or more of the expressions. The node that is
6041 /// most preferred is the one with the greatest sum of weights, i.e.
6042 /// for each node that meets all of the scheduling requirements (resource
6043 /// request, requiredDuringScheduling affinity expressions, etc.),
6044 /// compute a sum by iterating through the elements of this field and adding
6045 /// "weight" to the sum if the node matches the corresponding matchExpressions; the
6046 /// node(s) with the highest sum are the most preferred.
6047 #[serde(default, skip_serializing_if = "Option::is_none", rename = "preferredDuringSchedulingIgnoredDuringExecution")]
6048 pub preferred_during_scheduling_ignored_during_execution: Option<Vec<ComponentDefinitionRuntimeAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecution>>,
6049 /// If the affinity requirements specified by this field are not met at
6050 /// scheduling time, the pod will not be scheduled onto the node.
6051 /// If the affinity requirements specified by this field cease to be met
6052 /// at some point during pod execution (e.g. due to an update), the system
6053 /// may or may not try to eventually evict the pod from its node.
6054 #[serde(default, skip_serializing_if = "Option::is_none", rename = "requiredDuringSchedulingIgnoredDuringExecution")]
6055 pub required_during_scheduling_ignored_during_execution: Option<ComponentDefinitionRuntimeAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecution>,
6056}
6057
6058/// An empty preferred scheduling term matches all objects with implicit weight 0
6059/// (i.e. it's a no-op). A null preferred scheduling term matches no objects (i.e. is also a no-op).
6060#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
6061pub struct ComponentDefinitionRuntimeAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecution {
6062 /// A node selector term, associated with the corresponding weight.
6063 pub preference: ComponentDefinitionRuntimeAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecutionPreference,
6064 /// Weight associated with matching the corresponding nodeSelectorTerm, in the range 1-100.
6065 pub weight: i32,
6066}
6067
6068/// A node selector term, associated with the corresponding weight.
6069#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
6070pub struct ComponentDefinitionRuntimeAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecutionPreference {
6071 /// A list of node selector requirements by node's labels.
6072 #[serde(default, skip_serializing_if = "Option::is_none", rename = "matchExpressions")]
6073 pub match_expressions: Option<Vec<ComponentDefinitionRuntimeAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecutionPreferenceMatchExpressions>>,
6074 /// A list of node selector requirements by node's fields.
6075 #[serde(default, skip_serializing_if = "Option::is_none", rename = "matchFields")]
6076 pub match_fields: Option<Vec<ComponentDefinitionRuntimeAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecutionPreferenceMatchFields>>,
6077}
6078
6079/// A node selector requirement is a selector that contains values, a key, and an operator
6080/// that relates the key and values.
6081#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
6082pub struct ComponentDefinitionRuntimeAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecutionPreferenceMatchExpressions {
6083 /// The label key that the selector applies to.
6084 pub key: String,
6085 /// Represents a key's relationship to a set of values.
6086 /// Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt.
6087 pub operator: String,
6088 /// An array of string values. If the operator is In or NotIn,
6089 /// the values array must be non-empty. If the operator is Exists or DoesNotExist,
6090 /// the values array must be empty. If the operator is Gt or Lt, the values
6091 /// array must have a single element, which will be interpreted as an integer.
6092 /// This array is replaced during a strategic merge patch.
6093 #[serde(default, skip_serializing_if = "Option::is_none")]
6094 pub values: Option<Vec<String>>,
6095}
6096
6097/// A node selector requirement is a selector that contains values, a key, and an operator
6098/// that relates the key and values.
6099#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
6100pub struct ComponentDefinitionRuntimeAffinityNodeAffinityPreferredDuringSchedulingIgnoredDuringExecutionPreferenceMatchFields {
6101 /// The label key that the selector applies to.
6102 pub key: String,
6103 /// Represents a key's relationship to a set of values.
6104 /// Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt.
6105 pub operator: String,
6106 /// An array of string values. If the operator is In or NotIn,
6107 /// the values array must be non-empty. If the operator is Exists or DoesNotExist,
6108 /// the values array must be empty. If the operator is Gt or Lt, the values
6109 /// array must have a single element, which will be interpreted as an integer.
6110 /// This array is replaced during a strategic merge patch.
6111 #[serde(default, skip_serializing_if = "Option::is_none")]
6112 pub values: Option<Vec<String>>,
6113}
6114
6115/// If the affinity requirements specified by this field are not met at
6116/// scheduling time, the pod will not be scheduled onto the node.
6117/// If the affinity requirements specified by this field cease to be met
6118/// at some point during pod execution (e.g. due to an update), the system
6119/// may or may not try to eventually evict the pod from its node.
6120#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
6121pub struct ComponentDefinitionRuntimeAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecution {
6122 /// Required. A list of node selector terms. The terms are ORed.
6123 #[serde(rename = "nodeSelectorTerms")]
6124 pub node_selector_terms: Vec<ComponentDefinitionRuntimeAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecutionNodeSelectorTerms>,
6125}
6126
6127/// A null or empty node selector term matches no objects. The requirements of
6128/// them are ANDed.
6129/// The TopologySelectorTerm type implements a subset of the NodeSelectorTerm.
6130#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
6131pub struct ComponentDefinitionRuntimeAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecutionNodeSelectorTerms {
6132 /// A list of node selector requirements by node's labels.
6133 #[serde(default, skip_serializing_if = "Option::is_none", rename = "matchExpressions")]
6134 pub match_expressions: Option<Vec<ComponentDefinitionRuntimeAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecutionNodeSelectorTermsMatchExpressions>>,
6135 /// A list of node selector requirements by node's fields.
6136 #[serde(default, skip_serializing_if = "Option::is_none", rename = "matchFields")]
6137 pub match_fields: Option<Vec<ComponentDefinitionRuntimeAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecutionNodeSelectorTermsMatchFields>>,
6138}
6139
6140/// A node selector requirement is a selector that contains values, a key, and an operator
6141/// that relates the key and values.
6142#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
6143pub struct ComponentDefinitionRuntimeAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecutionNodeSelectorTermsMatchExpressions {
6144 /// The label key that the selector applies to.
6145 pub key: String,
6146 /// Represents a key's relationship to a set of values.
6147 /// Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt.
6148 pub operator: String,
6149 /// An array of string values. If the operator is In or NotIn,
6150 /// the values array must be non-empty. If the operator is Exists or DoesNotExist,
6151 /// the values array must be empty. If the operator is Gt or Lt, the values
6152 /// array must have a single element, which will be interpreted as an integer.
6153 /// This array is replaced during a strategic merge patch.
6154 #[serde(default, skip_serializing_if = "Option::is_none")]
6155 pub values: Option<Vec<String>>,
6156}
6157
6158/// A node selector requirement is a selector that contains values, a key, and an operator
6159/// that relates the key and values.
6160#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
6161pub struct ComponentDefinitionRuntimeAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecutionNodeSelectorTermsMatchFields {
6162 /// The label key that the selector applies to.
6163 pub key: String,
6164 /// Represents a key's relationship to a set of values.
6165 /// Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt.
6166 pub operator: String,
6167 /// An array of string values. If the operator is In or NotIn,
6168 /// the values array must be non-empty. If the operator is Exists or DoesNotExist,
6169 /// the values array must be empty. If the operator is Gt or Lt, the values
6170 /// array must have a single element, which will be interpreted as an integer.
6171 /// This array is replaced during a strategic merge patch.
6172 #[serde(default, skip_serializing_if = "Option::is_none")]
6173 pub values: Option<Vec<String>>,
6174}
6175
6176/// Describes pod affinity scheduling rules (e.g. co-locate this pod in the same node, zone, etc. as some other pod(s)).
6177#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
6178pub struct ComponentDefinitionRuntimeAffinityPodAffinity {
6179 /// The scheduler will prefer to schedule pods to nodes that satisfy
6180 /// the affinity expressions specified by this field, but it may choose
6181 /// a node that violates one or more of the expressions. The node that is
6182 /// most preferred is the one with the greatest sum of weights, i.e.
6183 /// for each node that meets all of the scheduling requirements (resource
6184 /// request, requiredDuringScheduling affinity expressions, etc.),
6185 /// compute a sum by iterating through the elements of this field and adding
6186 /// "weight" to the sum if the node has pods which matches the corresponding podAffinityTerm; the
6187 /// node(s) with the highest sum are the most preferred.
6188 #[serde(default, skip_serializing_if = "Option::is_none", rename = "preferredDuringSchedulingIgnoredDuringExecution")]
6189 pub preferred_during_scheduling_ignored_during_execution: Option<Vec<ComponentDefinitionRuntimeAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecution>>,
6190 /// If the affinity requirements specified by this field are not met at
6191 /// scheduling time, the pod will not be scheduled onto the node.
6192 /// If the affinity requirements specified by this field cease to be met
6193 /// at some point during pod execution (e.g. due to a pod label update), the
6194 /// system may or may not try to eventually evict the pod from its node.
6195 /// When there are multiple elements, the lists of nodes corresponding to each
6196 /// podAffinityTerm are intersected, i.e. all terms must be satisfied.
6197 #[serde(default, skip_serializing_if = "Option::is_none", rename = "requiredDuringSchedulingIgnoredDuringExecution")]
6198 pub required_during_scheduling_ignored_during_execution: Option<Vec<ComponentDefinitionRuntimeAffinityPodAffinityRequiredDuringSchedulingIgnoredDuringExecution>>,
6199}
6200
6201/// The weights of all of the matched WeightedPodAffinityTerm fields are added per-node to find the most preferred node(s)
6202#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
6203pub struct ComponentDefinitionRuntimeAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecution {
6204 /// Required. A pod affinity term, associated with the corresponding weight.
6205 #[serde(rename = "podAffinityTerm")]
6206 pub pod_affinity_term: ComponentDefinitionRuntimeAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionPodAffinityTerm,
6207 /// weight associated with matching the corresponding podAffinityTerm,
6208 /// in the range 1-100.
6209 pub weight: i32,
6210}
6211
6212/// Required. A pod affinity term, associated with the corresponding weight.
6213#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
6214pub struct ComponentDefinitionRuntimeAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionPodAffinityTerm {
6215 /// A label query over a set of resources, in this case pods.
6216 /// If it's null, this PodAffinityTerm matches with no Pods.
6217 #[serde(default, skip_serializing_if = "Option::is_none", rename = "labelSelector")]
6218 pub label_selector: Option<ComponentDefinitionRuntimeAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionPodAffinityTermLabelSelector>,
6219 /// MatchLabelKeys is a set of pod label keys to select which pods will
6220 /// be taken into consideration. The keys are used to lookup values from the
6221 /// incoming pod labels, those key-value labels are merged with `LabelSelector` as `key in (value)`
6222 /// to select the group of existing pods which pods will be taken into consideration
6223 /// for the incoming pod's pod (anti) affinity. Keys that don't exist in the incoming
6224 /// pod labels will be ignored. The default value is empty.
6225 /// The same key is forbidden to exist in both MatchLabelKeys and LabelSelector.
6226 /// Also, MatchLabelKeys cannot be set when LabelSelector isn't set.
6227 /// This is an alpha field and requires enabling MatchLabelKeysInPodAffinity feature gate.
6228 #[serde(default, skip_serializing_if = "Option::is_none", rename = "matchLabelKeys")]
6229 pub match_label_keys: Option<Vec<String>>,
6230 /// MismatchLabelKeys is a set of pod label keys to select which pods will
6231 /// be taken into consideration. The keys are used to lookup values from the
6232 /// incoming pod labels, those key-value labels are merged with `LabelSelector` as `key notin (value)`
6233 /// to select the group of existing pods which pods will be taken into consideration
6234 /// for the incoming pod's pod (anti) affinity. Keys that don't exist in the incoming
6235 /// pod labels will be ignored. The default value is empty.
6236 /// The same key is forbidden to exist in both MismatchLabelKeys and LabelSelector.
6237 /// Also, MismatchLabelKeys cannot be set when LabelSelector isn't set.
6238 /// This is an alpha field and requires enabling MatchLabelKeysInPodAffinity feature gate.
6239 #[serde(default, skip_serializing_if = "Option::is_none", rename = "mismatchLabelKeys")]
6240 pub mismatch_label_keys: Option<Vec<String>>,
6241 /// A label query over the set of namespaces that the term applies to.
6242 /// The term is applied to the union of the namespaces selected by this field
6243 /// and the ones listed in the namespaces field.
6244 /// null selector and null or empty namespaces list means "this pod's namespace".
6245 /// An empty selector ({}) matches all namespaces.
6246 #[serde(default, skip_serializing_if = "Option::is_none", rename = "namespaceSelector")]
6247 pub namespace_selector: Option<ComponentDefinitionRuntimeAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionPodAffinityTermNamespaceSelector>,
6248 /// namespaces specifies a static list of namespace names that the term applies to.
6249 /// The term is applied to the union of the namespaces listed in this field
6250 /// and the ones selected by namespaceSelector.
6251 /// null or empty namespaces list and null namespaceSelector means "this pod's namespace".
6252 #[serde(default, skip_serializing_if = "Option::is_none")]
6253 pub namespaces: Option<Vec<String>>,
6254 /// This pod should be co-located (affinity) or not co-located (anti-affinity) with the pods matching
6255 /// the labelSelector in the specified namespaces, where co-located is defined as running on a node
6256 /// whose value of the label with key topologyKey matches that of any node on which any of the
6257 /// selected pods is running.
6258 /// Empty topologyKey is not allowed.
6259 #[serde(rename = "topologyKey")]
6260 pub topology_key: String,
6261}
6262
6263/// A label query over a set of resources, in this case pods.
6264/// If it's null, this PodAffinityTerm matches with no Pods.
6265#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
6266pub struct ComponentDefinitionRuntimeAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionPodAffinityTermLabelSelector {
6267 /// matchExpressions is a list of label selector requirements. The requirements are ANDed.
6268 #[serde(default, skip_serializing_if = "Option::is_none", rename = "matchExpressions")]
6269 pub match_expressions: Option<Vec<ComponentDefinitionRuntimeAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionPodAffinityTermLabelSelectorMatchExpressions>>,
6270 /// matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
6271 /// map is equivalent to an element of matchExpressions, whose key field is "key", the
6272 /// operator is "In", and the values array contains only "value". The requirements are ANDed.
6273 #[serde(default, skip_serializing_if = "Option::is_none", rename = "matchLabels")]
6274 pub match_labels: Option<BTreeMap<String, String>>,
6275}
6276
6277/// A label selector requirement is a selector that contains values, a key, and an operator that
6278/// relates the key and values.
6279#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
6280pub struct ComponentDefinitionRuntimeAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionPodAffinityTermLabelSelectorMatchExpressions {
6281 /// key is the label key that the selector applies to.
6282 pub key: String,
6283 /// operator represents a key's relationship to a set of values.
6284 /// Valid operators are In, NotIn, Exists and DoesNotExist.
6285 pub operator: String,
6286 /// values is an array of string values. If the operator is In or NotIn,
6287 /// the values array must be non-empty. If the operator is Exists or DoesNotExist,
6288 /// the values array must be empty. This array is replaced during a strategic
6289 /// merge patch.
6290 #[serde(default, skip_serializing_if = "Option::is_none")]
6291 pub values: Option<Vec<String>>,
6292}
6293
6294/// A label query over the set of namespaces that the term applies to.
6295/// The term is applied to the union of the namespaces selected by this field
6296/// and the ones listed in the namespaces field.
6297/// null selector and null or empty namespaces list means "this pod's namespace".
6298/// An empty selector ({}) matches all namespaces.
6299#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
6300pub struct ComponentDefinitionRuntimeAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionPodAffinityTermNamespaceSelector {
6301 /// matchExpressions is a list of label selector requirements. The requirements are ANDed.
6302 #[serde(default, skip_serializing_if = "Option::is_none", rename = "matchExpressions")]
6303 pub match_expressions: Option<Vec<ComponentDefinitionRuntimeAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionPodAffinityTermNamespaceSelectorMatchExpressions>>,
6304 /// matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
6305 /// map is equivalent to an element of matchExpressions, whose key field is "key", the
6306 /// operator is "In", and the values array contains only "value". The requirements are ANDed.
6307 #[serde(default, skip_serializing_if = "Option::is_none", rename = "matchLabels")]
6308 pub match_labels: Option<BTreeMap<String, String>>,
6309}
6310
6311/// A label selector requirement is a selector that contains values, a key, and an operator that
6312/// relates the key and values.
6313#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
6314pub struct ComponentDefinitionRuntimeAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionPodAffinityTermNamespaceSelectorMatchExpressions {
6315 /// key is the label key that the selector applies to.
6316 pub key: String,
6317 /// operator represents a key's relationship to a set of values.
6318 /// Valid operators are In, NotIn, Exists and DoesNotExist.
6319 pub operator: String,
6320 /// values is an array of string values. If the operator is In or NotIn,
6321 /// the values array must be non-empty. If the operator is Exists or DoesNotExist,
6322 /// the values array must be empty. This array is replaced during a strategic
6323 /// merge patch.
6324 #[serde(default, skip_serializing_if = "Option::is_none")]
6325 pub values: Option<Vec<String>>,
6326}
6327
6328/// Defines a set of pods (namely those matching the labelSelector
6329/// relative to the given namespace(s)) that this pod should be
6330/// co-located (affinity) or not co-located (anti-affinity) with,
6331/// where co-located is defined as running on a node whose value of
6332/// the label with key <topologyKey> matches that of any node on which
6333/// a pod of the set of pods is running
6334#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
6335pub struct ComponentDefinitionRuntimeAffinityPodAffinityRequiredDuringSchedulingIgnoredDuringExecution {
6336 /// A label query over a set of resources, in this case pods.
6337 /// If it's null, this PodAffinityTerm matches with no Pods.
6338 #[serde(default, skip_serializing_if = "Option::is_none", rename = "labelSelector")]
6339 pub label_selector: Option<ComponentDefinitionRuntimeAffinityPodAffinityRequiredDuringSchedulingIgnoredDuringExecutionLabelSelector>,
6340 /// MatchLabelKeys is a set of pod label keys to select which pods will
6341 /// be taken into consideration. The keys are used to lookup values from the
6342 /// incoming pod labels, those key-value labels are merged with `LabelSelector` as `key in (value)`
6343 /// to select the group of existing pods which pods will be taken into consideration
6344 /// for the incoming pod's pod (anti) affinity. Keys that don't exist in the incoming
6345 /// pod labels will be ignored. The default value is empty.
6346 /// The same key is forbidden to exist in both MatchLabelKeys and LabelSelector.
6347 /// Also, MatchLabelKeys cannot be set when LabelSelector isn't set.
6348 /// This is an alpha field and requires enabling MatchLabelKeysInPodAffinity feature gate.
6349 #[serde(default, skip_serializing_if = "Option::is_none", rename = "matchLabelKeys")]
6350 pub match_label_keys: Option<Vec<String>>,
6351 /// MismatchLabelKeys is a set of pod label keys to select which pods will
6352 /// be taken into consideration. The keys are used to lookup values from the
6353 /// incoming pod labels, those key-value labels are merged with `LabelSelector` as `key notin (value)`
6354 /// to select the group of existing pods which pods will be taken into consideration
6355 /// for the incoming pod's pod (anti) affinity. Keys that don't exist in the incoming
6356 /// pod labels will be ignored. The default value is empty.
6357 /// The same key is forbidden to exist in both MismatchLabelKeys and LabelSelector.
6358 /// Also, MismatchLabelKeys cannot be set when LabelSelector isn't set.
6359 /// This is an alpha field and requires enabling MatchLabelKeysInPodAffinity feature gate.
6360 #[serde(default, skip_serializing_if = "Option::is_none", rename = "mismatchLabelKeys")]
6361 pub mismatch_label_keys: Option<Vec<String>>,
6362 /// A label query over the set of namespaces that the term applies to.
6363 /// The term is applied to the union of the namespaces selected by this field
6364 /// and the ones listed in the namespaces field.
6365 /// null selector and null or empty namespaces list means "this pod's namespace".
6366 /// An empty selector ({}) matches all namespaces.
6367 #[serde(default, skip_serializing_if = "Option::is_none", rename = "namespaceSelector")]
6368 pub namespace_selector: Option<ComponentDefinitionRuntimeAffinityPodAffinityRequiredDuringSchedulingIgnoredDuringExecutionNamespaceSelector>,
6369 /// namespaces specifies a static list of namespace names that the term applies to.
6370 /// The term is applied to the union of the namespaces listed in this field
6371 /// and the ones selected by namespaceSelector.
6372 /// null or empty namespaces list and null namespaceSelector means "this pod's namespace".
6373 #[serde(default, skip_serializing_if = "Option::is_none")]
6374 pub namespaces: Option<Vec<String>>,
6375 /// This pod should be co-located (affinity) or not co-located (anti-affinity) with the pods matching
6376 /// the labelSelector in the specified namespaces, where co-located is defined as running on a node
6377 /// whose value of the label with key topologyKey matches that of any node on which any of the
6378 /// selected pods is running.
6379 /// Empty topologyKey is not allowed.
6380 #[serde(rename = "topologyKey")]
6381 pub topology_key: String,
6382}
6383
6384/// A label query over a set of resources, in this case pods.
6385/// If it's null, this PodAffinityTerm matches with no Pods.
6386#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
6387pub struct ComponentDefinitionRuntimeAffinityPodAffinityRequiredDuringSchedulingIgnoredDuringExecutionLabelSelector {
6388 /// matchExpressions is a list of label selector requirements. The requirements are ANDed.
6389 #[serde(default, skip_serializing_if = "Option::is_none", rename = "matchExpressions")]
6390 pub match_expressions: Option<Vec<ComponentDefinitionRuntimeAffinityPodAffinityRequiredDuringSchedulingIgnoredDuringExecutionLabelSelectorMatchExpressions>>,
6391 /// matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
6392 /// map is equivalent to an element of matchExpressions, whose key field is "key", the
6393 /// operator is "In", and the values array contains only "value". The requirements are ANDed.
6394 #[serde(default, skip_serializing_if = "Option::is_none", rename = "matchLabels")]
6395 pub match_labels: Option<BTreeMap<String, String>>,
6396}
6397
6398/// A label selector requirement is a selector that contains values, a key, and an operator that
6399/// relates the key and values.
6400#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
6401pub struct ComponentDefinitionRuntimeAffinityPodAffinityRequiredDuringSchedulingIgnoredDuringExecutionLabelSelectorMatchExpressions {
6402 /// key is the label key that the selector applies to.
6403 pub key: String,
6404 /// operator represents a key's relationship to a set of values.
6405 /// Valid operators are In, NotIn, Exists and DoesNotExist.
6406 pub operator: String,
6407 /// values is an array of string values. If the operator is In or NotIn,
6408 /// the values array must be non-empty. If the operator is Exists or DoesNotExist,
6409 /// the values array must be empty. This array is replaced during a strategic
6410 /// merge patch.
6411 #[serde(default, skip_serializing_if = "Option::is_none")]
6412 pub values: Option<Vec<String>>,
6413}
6414
6415/// A label query over the set of namespaces that the term applies to.
6416/// The term is applied to the union of the namespaces selected by this field
6417/// and the ones listed in the namespaces field.
6418/// null selector and null or empty namespaces list means "this pod's namespace".
6419/// An empty selector ({}) matches all namespaces.
6420#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
6421pub struct ComponentDefinitionRuntimeAffinityPodAffinityRequiredDuringSchedulingIgnoredDuringExecutionNamespaceSelector {
6422 /// matchExpressions is a list of label selector requirements. The requirements are ANDed.
6423 #[serde(default, skip_serializing_if = "Option::is_none", rename = "matchExpressions")]
6424 pub match_expressions: Option<Vec<ComponentDefinitionRuntimeAffinityPodAffinityRequiredDuringSchedulingIgnoredDuringExecutionNamespaceSelectorMatchExpressions>>,
6425 /// matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
6426 /// map is equivalent to an element of matchExpressions, whose key field is "key", the
6427 /// operator is "In", and the values array contains only "value". The requirements are ANDed.
6428 #[serde(default, skip_serializing_if = "Option::is_none", rename = "matchLabels")]
6429 pub match_labels: Option<BTreeMap<String, String>>,
6430}
6431
6432/// A label selector requirement is a selector that contains values, a key, and an operator that
6433/// relates the key and values.
6434#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
6435pub struct ComponentDefinitionRuntimeAffinityPodAffinityRequiredDuringSchedulingIgnoredDuringExecutionNamespaceSelectorMatchExpressions {
6436 /// key is the label key that the selector applies to.
6437 pub key: String,
6438 /// operator represents a key's relationship to a set of values.
6439 /// Valid operators are In, NotIn, Exists and DoesNotExist.
6440 pub operator: String,
6441 /// values is an array of string values. If the operator is In or NotIn,
6442 /// the values array must be non-empty. If the operator is Exists or DoesNotExist,
6443 /// the values array must be empty. This array is replaced during a strategic
6444 /// merge patch.
6445 #[serde(default, skip_serializing_if = "Option::is_none")]
6446 pub values: Option<Vec<String>>,
6447}
6448
6449/// Describes pod anti-affinity scheduling rules (e.g. avoid putting this pod in the same node, zone, etc. as some other pod(s)).
6450#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
6451pub struct ComponentDefinitionRuntimeAffinityPodAntiAffinity {
6452 /// The scheduler will prefer to schedule pods to nodes that satisfy
6453 /// the anti-affinity expressions specified by this field, but it may choose
6454 /// a node that violates one or more of the expressions. The node that is
6455 /// most preferred is the one with the greatest sum of weights, i.e.
6456 /// for each node that meets all of the scheduling requirements (resource
6457 /// request, requiredDuringScheduling anti-affinity expressions, etc.),
6458 /// compute a sum by iterating through the elements of this field and adding
6459 /// "weight" to the sum if the node has pods which matches the corresponding podAffinityTerm; the
6460 /// node(s) with the highest sum are the most preferred.
6461 #[serde(default, skip_serializing_if = "Option::is_none", rename = "preferredDuringSchedulingIgnoredDuringExecution")]
6462 pub preferred_during_scheduling_ignored_during_execution: Option<Vec<ComponentDefinitionRuntimeAffinityPodAntiAffinityPreferredDuringSchedulingIgnoredDuringExecution>>,
6463 /// If the anti-affinity requirements specified by this field are not met at
6464 /// scheduling time, the pod will not be scheduled onto the node.
6465 /// If the anti-affinity requirements specified by this field cease to be met
6466 /// at some point during pod execution (e.g. due to a pod label update), the
6467 /// system may or may not try to eventually evict the pod from its node.
6468 /// When there are multiple elements, the lists of nodes corresponding to each
6469 /// podAffinityTerm are intersected, i.e. all terms must be satisfied.
6470 #[serde(default, skip_serializing_if = "Option::is_none", rename = "requiredDuringSchedulingIgnoredDuringExecution")]
6471 pub required_during_scheduling_ignored_during_execution: Option<Vec<ComponentDefinitionRuntimeAffinityPodAntiAffinityRequiredDuringSchedulingIgnoredDuringExecution>>,
6472}
6473
6474/// The weights of all of the matched WeightedPodAffinityTerm fields are added per-node to find the most preferred node(s)
6475#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
6476pub struct ComponentDefinitionRuntimeAffinityPodAntiAffinityPreferredDuringSchedulingIgnoredDuringExecution {
6477 /// Required. A pod affinity term, associated with the corresponding weight.
6478 #[serde(rename = "podAffinityTerm")]
6479 pub pod_affinity_term: ComponentDefinitionRuntimeAffinityPodAntiAffinityPreferredDuringSchedulingIgnoredDuringExecutionPodAffinityTerm,
6480 /// weight associated with matching the corresponding podAffinityTerm,
6481 /// in the range 1-100.
6482 pub weight: i32,
6483}
6484
6485/// Required. A pod affinity term, associated with the corresponding weight.
6486#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
6487pub struct ComponentDefinitionRuntimeAffinityPodAntiAffinityPreferredDuringSchedulingIgnoredDuringExecutionPodAffinityTerm {
6488 /// A label query over a set of resources, in this case pods.
6489 /// If it's null, this PodAffinityTerm matches with no Pods.
6490 #[serde(default, skip_serializing_if = "Option::is_none", rename = "labelSelector")]
6491 pub label_selector: Option<ComponentDefinitionRuntimeAffinityPodAntiAffinityPreferredDuringSchedulingIgnoredDuringExecutionPodAffinityTermLabelSelector>,
6492 /// MatchLabelKeys is a set of pod label keys to select which pods will
6493 /// be taken into consideration. The keys are used to lookup values from the
6494 /// incoming pod labels, those key-value labels are merged with `LabelSelector` as `key in (value)`
6495 /// to select the group of existing pods which pods will be taken into consideration
6496 /// for the incoming pod's pod (anti) affinity. Keys that don't exist in the incoming
6497 /// pod labels will be ignored. The default value is empty.
6498 /// The same key is forbidden to exist in both MatchLabelKeys and LabelSelector.
6499 /// Also, MatchLabelKeys cannot be set when LabelSelector isn't set.
6500 /// This is an alpha field and requires enabling MatchLabelKeysInPodAffinity feature gate.
6501 #[serde(default, skip_serializing_if = "Option::is_none", rename = "matchLabelKeys")]
6502 pub match_label_keys: Option<Vec<String>>,
6503 /// MismatchLabelKeys is a set of pod label keys to select which pods will
6504 /// be taken into consideration. The keys are used to lookup values from the
6505 /// incoming pod labels, those key-value labels are merged with `LabelSelector` as `key notin (value)`
6506 /// to select the group of existing pods which pods will be taken into consideration
6507 /// for the incoming pod's pod (anti) affinity. Keys that don't exist in the incoming
6508 /// pod labels will be ignored. The default value is empty.
6509 /// The same key is forbidden to exist in both MismatchLabelKeys and LabelSelector.
6510 /// Also, MismatchLabelKeys cannot be set when LabelSelector isn't set.
6511 /// This is an alpha field and requires enabling MatchLabelKeysInPodAffinity feature gate.
6512 #[serde(default, skip_serializing_if = "Option::is_none", rename = "mismatchLabelKeys")]
6513 pub mismatch_label_keys: Option<Vec<String>>,
6514 /// A label query over the set of namespaces that the term applies to.
6515 /// The term is applied to the union of the namespaces selected by this field
6516 /// and the ones listed in the namespaces field.
6517 /// null selector and null or empty namespaces list means "this pod's namespace".
6518 /// An empty selector ({}) matches all namespaces.
6519 #[serde(default, skip_serializing_if = "Option::is_none", rename = "namespaceSelector")]
6520 pub namespace_selector: Option<ComponentDefinitionRuntimeAffinityPodAntiAffinityPreferredDuringSchedulingIgnoredDuringExecutionPodAffinityTermNamespaceSelector>,
6521 /// namespaces specifies a static list of namespace names that the term applies to.
6522 /// The term is applied to the union of the namespaces listed in this field
6523 /// and the ones selected by namespaceSelector.
6524 /// null or empty namespaces list and null namespaceSelector means "this pod's namespace".
6525 #[serde(default, skip_serializing_if = "Option::is_none")]
6526 pub namespaces: Option<Vec<String>>,
6527 /// This pod should be co-located (affinity) or not co-located (anti-affinity) with the pods matching
6528 /// the labelSelector in the specified namespaces, where co-located is defined as running on a node
6529 /// whose value of the label with key topologyKey matches that of any node on which any of the
6530 /// selected pods is running.
6531 /// Empty topologyKey is not allowed.
6532 #[serde(rename = "topologyKey")]
6533 pub topology_key: String,
6534}
6535
6536/// A label query over a set of resources, in this case pods.
6537/// If it's null, this PodAffinityTerm matches with no Pods.
6538#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
6539pub struct ComponentDefinitionRuntimeAffinityPodAntiAffinityPreferredDuringSchedulingIgnoredDuringExecutionPodAffinityTermLabelSelector {
6540 /// matchExpressions is a list of label selector requirements. The requirements are ANDed.
6541 #[serde(default, skip_serializing_if = "Option::is_none", rename = "matchExpressions")]
6542 pub match_expressions: Option<Vec<ComponentDefinitionRuntimeAffinityPodAntiAffinityPreferredDuringSchedulingIgnoredDuringExecutionPodAffinityTermLabelSelectorMatchExpressions>>,
6543 /// matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
6544 /// map is equivalent to an element of matchExpressions, whose key field is "key", the
6545 /// operator is "In", and the values array contains only "value". The requirements are ANDed.
6546 #[serde(default, skip_serializing_if = "Option::is_none", rename = "matchLabels")]
6547 pub match_labels: Option<BTreeMap<String, String>>,
6548}
6549
6550/// A label selector requirement is a selector that contains values, a key, and an operator that
6551/// relates the key and values.
6552#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
6553pub struct ComponentDefinitionRuntimeAffinityPodAntiAffinityPreferredDuringSchedulingIgnoredDuringExecutionPodAffinityTermLabelSelectorMatchExpressions {
6554 /// key is the label key that the selector applies to.
6555 pub key: String,
6556 /// operator represents a key's relationship to a set of values.
6557 /// Valid operators are In, NotIn, Exists and DoesNotExist.
6558 pub operator: String,
6559 /// values is an array of string values. If the operator is In or NotIn,
6560 /// the values array must be non-empty. If the operator is Exists or DoesNotExist,
6561 /// the values array must be empty. This array is replaced during a strategic
6562 /// merge patch.
6563 #[serde(default, skip_serializing_if = "Option::is_none")]
6564 pub values: Option<Vec<String>>,
6565}
6566
6567/// A label query over the set of namespaces that the term applies to.
6568/// The term is applied to the union of the namespaces selected by this field
6569/// and the ones listed in the namespaces field.
6570/// null selector and null or empty namespaces list means "this pod's namespace".
6571/// An empty selector ({}) matches all namespaces.
6572#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
6573pub struct ComponentDefinitionRuntimeAffinityPodAntiAffinityPreferredDuringSchedulingIgnoredDuringExecutionPodAffinityTermNamespaceSelector {
6574 /// matchExpressions is a list of label selector requirements. The requirements are ANDed.
6575 #[serde(default, skip_serializing_if = "Option::is_none", rename = "matchExpressions")]
6576 pub match_expressions: Option<Vec<ComponentDefinitionRuntimeAffinityPodAntiAffinityPreferredDuringSchedulingIgnoredDuringExecutionPodAffinityTermNamespaceSelectorMatchExpressions>>,
6577 /// matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
6578 /// map is equivalent to an element of matchExpressions, whose key field is "key", the
6579 /// operator is "In", and the values array contains only "value". The requirements are ANDed.
6580 #[serde(default, skip_serializing_if = "Option::is_none", rename = "matchLabels")]
6581 pub match_labels: Option<BTreeMap<String, String>>,
6582}
6583
6584/// A label selector requirement is a selector that contains values, a key, and an operator that
6585/// relates the key and values.
6586#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
6587pub struct ComponentDefinitionRuntimeAffinityPodAntiAffinityPreferredDuringSchedulingIgnoredDuringExecutionPodAffinityTermNamespaceSelectorMatchExpressions {
6588 /// key is the label key that the selector applies to.
6589 pub key: String,
6590 /// operator represents a key's relationship to a set of values.
6591 /// Valid operators are In, NotIn, Exists and DoesNotExist.
6592 pub operator: String,
6593 /// values is an array of string values. If the operator is In or NotIn,
6594 /// the values array must be non-empty. If the operator is Exists or DoesNotExist,
6595 /// the values array must be empty. This array is replaced during a strategic
6596 /// merge patch.
6597 #[serde(default, skip_serializing_if = "Option::is_none")]
6598 pub values: Option<Vec<String>>,
6599}
6600
6601/// Defines a set of pods (namely those matching the labelSelector
6602/// relative to the given namespace(s)) that this pod should be
6603/// co-located (affinity) or not co-located (anti-affinity) with,
6604/// where co-located is defined as running on a node whose value of
6605/// the label with key <topologyKey> matches that of any node on which
6606/// a pod of the set of pods is running
6607#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
6608pub struct ComponentDefinitionRuntimeAffinityPodAntiAffinityRequiredDuringSchedulingIgnoredDuringExecution {
6609 /// A label query over a set of resources, in this case pods.
6610 /// If it's null, this PodAffinityTerm matches with no Pods.
6611 #[serde(default, skip_serializing_if = "Option::is_none", rename = "labelSelector")]
6612 pub label_selector: Option<ComponentDefinitionRuntimeAffinityPodAntiAffinityRequiredDuringSchedulingIgnoredDuringExecutionLabelSelector>,
6613 /// MatchLabelKeys is a set of pod label keys to select which pods will
6614 /// be taken into consideration. The keys are used to lookup values from the
6615 /// incoming pod labels, those key-value labels are merged with `LabelSelector` as `key in (value)`
6616 /// to select the group of existing pods which pods will be taken into consideration
6617 /// for the incoming pod's pod (anti) affinity. Keys that don't exist in the incoming
6618 /// pod labels will be ignored. The default value is empty.
6619 /// The same key is forbidden to exist in both MatchLabelKeys and LabelSelector.
6620 /// Also, MatchLabelKeys cannot be set when LabelSelector isn't set.
6621 /// This is an alpha field and requires enabling MatchLabelKeysInPodAffinity feature gate.
6622 #[serde(default, skip_serializing_if = "Option::is_none", rename = "matchLabelKeys")]
6623 pub match_label_keys: Option<Vec<String>>,
6624 /// MismatchLabelKeys is a set of pod label keys to select which pods will
6625 /// be taken into consideration. The keys are used to lookup values from the
6626 /// incoming pod labels, those key-value labels are merged with `LabelSelector` as `key notin (value)`
6627 /// to select the group of existing pods which pods will be taken into consideration
6628 /// for the incoming pod's pod (anti) affinity. Keys that don't exist in the incoming
6629 /// pod labels will be ignored. The default value is empty.
6630 /// The same key is forbidden to exist in both MismatchLabelKeys and LabelSelector.
6631 /// Also, MismatchLabelKeys cannot be set when LabelSelector isn't set.
6632 /// This is an alpha field and requires enabling MatchLabelKeysInPodAffinity feature gate.
6633 #[serde(default, skip_serializing_if = "Option::is_none", rename = "mismatchLabelKeys")]
6634 pub mismatch_label_keys: Option<Vec<String>>,
6635 /// A label query over the set of namespaces that the term applies to.
6636 /// The term is applied to the union of the namespaces selected by this field
6637 /// and the ones listed in the namespaces field.
6638 /// null selector and null or empty namespaces list means "this pod's namespace".
6639 /// An empty selector ({}) matches all namespaces.
6640 #[serde(default, skip_serializing_if = "Option::is_none", rename = "namespaceSelector")]
6641 pub namespace_selector: Option<ComponentDefinitionRuntimeAffinityPodAntiAffinityRequiredDuringSchedulingIgnoredDuringExecutionNamespaceSelector>,
6642 /// namespaces specifies a static list of namespace names that the term applies to.
6643 /// The term is applied to the union of the namespaces listed in this field
6644 /// and the ones selected by namespaceSelector.
6645 /// null or empty namespaces list and null namespaceSelector means "this pod's namespace".
6646 #[serde(default, skip_serializing_if = "Option::is_none")]
6647 pub namespaces: Option<Vec<String>>,
6648 /// This pod should be co-located (affinity) or not co-located (anti-affinity) with the pods matching
6649 /// the labelSelector in the specified namespaces, where co-located is defined as running on a node
6650 /// whose value of the label with key topologyKey matches that of any node on which any of the
6651 /// selected pods is running.
6652 /// Empty topologyKey is not allowed.
6653 #[serde(rename = "topologyKey")]
6654 pub topology_key: String,
6655}
6656
6657/// A label query over a set of resources, in this case pods.
6658/// If it's null, this PodAffinityTerm matches with no Pods.
6659#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
6660pub struct ComponentDefinitionRuntimeAffinityPodAntiAffinityRequiredDuringSchedulingIgnoredDuringExecutionLabelSelector {
6661 /// matchExpressions is a list of label selector requirements. The requirements are ANDed.
6662 #[serde(default, skip_serializing_if = "Option::is_none", rename = "matchExpressions")]
6663 pub match_expressions: Option<Vec<ComponentDefinitionRuntimeAffinityPodAntiAffinityRequiredDuringSchedulingIgnoredDuringExecutionLabelSelectorMatchExpressions>>,
6664 /// matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
6665 /// map is equivalent to an element of matchExpressions, whose key field is "key", the
6666 /// operator is "In", and the values array contains only "value". The requirements are ANDed.
6667 #[serde(default, skip_serializing_if = "Option::is_none", rename = "matchLabels")]
6668 pub match_labels: Option<BTreeMap<String, String>>,
6669}
6670
6671/// A label selector requirement is a selector that contains values, a key, and an operator that
6672/// relates the key and values.
6673#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
6674pub struct ComponentDefinitionRuntimeAffinityPodAntiAffinityRequiredDuringSchedulingIgnoredDuringExecutionLabelSelectorMatchExpressions {
6675 /// key is the label key that the selector applies to.
6676 pub key: String,
6677 /// operator represents a key's relationship to a set of values.
6678 /// Valid operators are In, NotIn, Exists and DoesNotExist.
6679 pub operator: String,
6680 /// values is an array of string values. If the operator is In or NotIn,
6681 /// the values array must be non-empty. If the operator is Exists or DoesNotExist,
6682 /// the values array must be empty. This array is replaced during a strategic
6683 /// merge patch.
6684 #[serde(default, skip_serializing_if = "Option::is_none")]
6685 pub values: Option<Vec<String>>,
6686}
6687
6688/// A label query over the set of namespaces that the term applies to.
6689/// The term is applied to the union of the namespaces selected by this field
6690/// and the ones listed in the namespaces field.
6691/// null selector and null or empty namespaces list means "this pod's namespace".
6692/// An empty selector ({}) matches all namespaces.
6693#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
6694pub struct ComponentDefinitionRuntimeAffinityPodAntiAffinityRequiredDuringSchedulingIgnoredDuringExecutionNamespaceSelector {
6695 /// matchExpressions is a list of label selector requirements. The requirements are ANDed.
6696 #[serde(default, skip_serializing_if = "Option::is_none", rename = "matchExpressions")]
6697 pub match_expressions: Option<Vec<ComponentDefinitionRuntimeAffinityPodAntiAffinityRequiredDuringSchedulingIgnoredDuringExecutionNamespaceSelectorMatchExpressions>>,
6698 /// matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
6699 /// map is equivalent to an element of matchExpressions, whose key field is "key", the
6700 /// operator is "In", and the values array contains only "value". The requirements are ANDed.
6701 #[serde(default, skip_serializing_if = "Option::is_none", rename = "matchLabels")]
6702 pub match_labels: Option<BTreeMap<String, String>>,
6703}
6704
6705/// A label selector requirement is a selector that contains values, a key, and an operator that
6706/// relates the key and values.
6707#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
6708pub struct ComponentDefinitionRuntimeAffinityPodAntiAffinityRequiredDuringSchedulingIgnoredDuringExecutionNamespaceSelectorMatchExpressions {
6709 /// key is the label key that the selector applies to.
6710 pub key: String,
6711 /// operator represents a key's relationship to a set of values.
6712 /// Valid operators are In, NotIn, Exists and DoesNotExist.
6713 pub operator: String,
6714 /// values is an array of string values. If the operator is In or NotIn,
6715 /// the values array must be non-empty. If the operator is Exists or DoesNotExist,
6716 /// the values array must be empty. This array is replaced during a strategic
6717 /// merge patch.
6718 #[serde(default, skip_serializing_if = "Option::is_none")]
6719 pub values: Option<Vec<String>>,
6720}
6721
6722/// A single application container that you want to run within a pod.
6723#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
6724pub struct ComponentDefinitionRuntimeContainers {
6725 /// Arguments to the entrypoint.
6726 /// The container image's CMD is used if this is not provided.
6727 /// Variable references $(VAR_NAME) are expanded using the container's environment. If a variable
6728 /// cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced
6729 /// to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" will
6730 /// produce the string literal "$(VAR_NAME)". Escaped references will never be expanded, regardless
6731 /// of whether the variable exists or not. Cannot be updated.
6732 /// More info: <https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell>
6733 #[serde(default, skip_serializing_if = "Option::is_none")]
6734 pub args: Option<Vec<String>>,
6735 /// Entrypoint array. Not executed within a shell.
6736 /// The container image's ENTRYPOINT is used if this is not provided.
6737 /// Variable references $(VAR_NAME) are expanded using the container's environment. If a variable
6738 /// cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced
6739 /// to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" will
6740 /// produce the string literal "$(VAR_NAME)". Escaped references will never be expanded, regardless
6741 /// of whether the variable exists or not. Cannot be updated.
6742 /// More info: <https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell>
6743 #[serde(default, skip_serializing_if = "Option::is_none")]
6744 pub command: Option<Vec<String>>,
6745 /// List of environment variables to set in the container.
6746 /// Cannot be updated.
6747 #[serde(default, skip_serializing_if = "Option::is_none")]
6748 pub env: Option<Vec<ComponentDefinitionRuntimeContainersEnv>>,
6749 /// List of sources to populate environment variables in the container.
6750 /// The keys defined within a source must be a C_IDENTIFIER. All invalid keys
6751 /// will be reported as an event when the container is starting. When a key exists in multiple
6752 /// sources, the value associated with the last source will take precedence.
6753 /// Values defined by an Env with a duplicate key will take precedence.
6754 /// Cannot be updated.
6755 #[serde(default, skip_serializing_if = "Option::is_none", rename = "envFrom")]
6756 pub env_from: Option<Vec<ComponentDefinitionRuntimeContainersEnvFrom>>,
6757 /// Container image name.
6758 /// More info: <https://kubernetes.io/docs/concepts/containers/images>
6759 /// This field is optional to allow higher level config management to default or override
6760 /// container images in workload controllers like Deployments and StatefulSets.
6761 #[serde(default, skip_serializing_if = "Option::is_none")]
6762 pub image: Option<String>,
6763 /// Image pull policy.
6764 /// One of Always, Never, IfNotPresent.
6765 /// Defaults to Always if :latest tag is specified, or IfNotPresent otherwise.
6766 /// Cannot be updated.
6767 /// More info: <https://kubernetes.io/docs/concepts/containers/images#updating-images>
6768 #[serde(default, skip_serializing_if = "Option::is_none", rename = "imagePullPolicy")]
6769 pub image_pull_policy: Option<String>,
6770 /// Actions that the management system should take in response to container lifecycle events.
6771 /// Cannot be updated.
6772 #[serde(default, skip_serializing_if = "Option::is_none")]
6773 pub lifecycle: Option<ComponentDefinitionRuntimeContainersLifecycle>,
6774 /// Periodic probe of container liveness.
6775 /// Container will be restarted if the probe fails.
6776 /// Cannot be updated.
6777 /// More info: <https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes>
6778 #[serde(default, skip_serializing_if = "Option::is_none", rename = "livenessProbe")]
6779 pub liveness_probe: Option<ComponentDefinitionRuntimeContainersLivenessProbe>,
6780 /// Name of the container specified as a DNS_LABEL.
6781 /// Each container in a pod must have a unique name (DNS_LABEL).
6782 /// Cannot be updated.
6783 pub name: String,
6784 /// List of ports to expose from the container. Not specifying a port here
6785 /// DOES NOT prevent that port from being exposed. Any port which is
6786 /// listening on the default "0.0.0.0" address inside a container will be
6787 /// accessible from the network.
6788 /// Modifying this array with strategic merge patch may corrupt the data.
6789 /// For more information See <https://github.com/kubernetes/kubernetes/issues/108255.>
6790 /// Cannot be updated.
6791 #[serde(default, skip_serializing_if = "Option::is_none")]
6792 pub ports: Option<Vec<ComponentDefinitionRuntimeContainersPorts>>,
6793 /// Periodic probe of container service readiness.
6794 /// Container will be removed from service endpoints if the probe fails.
6795 /// Cannot be updated.
6796 /// More info: <https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes>
6797 #[serde(default, skip_serializing_if = "Option::is_none", rename = "readinessProbe")]
6798 pub readiness_probe: Option<ComponentDefinitionRuntimeContainersReadinessProbe>,
6799 /// Resources resize policy for the container.
6800 #[serde(default, skip_serializing_if = "Option::is_none", rename = "resizePolicy")]
6801 pub resize_policy: Option<Vec<ComponentDefinitionRuntimeContainersResizePolicy>>,
6802 /// Compute Resources required by this container.
6803 /// Cannot be updated.
6804 /// More info: <https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/>
6805 #[serde(default, skip_serializing_if = "Option::is_none")]
6806 pub resources: Option<ComponentDefinitionRuntimeContainersResources>,
6807 /// RestartPolicy defines the restart behavior of individual containers in a pod.
6808 /// This field may only be set for init containers, and the only allowed value is "Always".
6809 /// For non-init containers or when this field is not specified,
6810 /// the restart behavior is defined by the Pod's restart policy and the container type.
6811 /// Setting the RestartPolicy as "Always" for the init container will have the following effect:
6812 /// this init container will be continually restarted on
6813 /// exit until all regular containers have terminated. Once all regular
6814 /// containers have completed, all init containers with restartPolicy "Always"
6815 /// will be shut down. This lifecycle differs from normal init containers and
6816 /// is often referred to as a "sidecar" container. Although this init
6817 /// container still starts in the init container sequence, it does not wait
6818 /// for the container to complete before proceeding to the next init
6819 /// container. Instead, the next init container starts immediately after this
6820 /// init container is started, or after any startupProbe has successfully
6821 /// completed.
6822 #[serde(default, skip_serializing_if = "Option::is_none", rename = "restartPolicy")]
6823 pub restart_policy: Option<String>,
6824 /// SecurityContext defines the security options the container should be run with.
6825 /// If set, the fields of SecurityContext override the equivalent fields of PodSecurityContext.
6826 /// More info: <https://kubernetes.io/docs/tasks/configure-pod-container/security-context/>
6827 #[serde(default, skip_serializing_if = "Option::is_none", rename = "securityContext")]
6828 pub security_context: Option<ComponentDefinitionRuntimeContainersSecurityContext>,
6829 /// StartupProbe indicates that the Pod has successfully initialized.
6830 /// If specified, no other probes are executed until this completes successfully.
6831 /// If this probe fails, the Pod will be restarted, just as if the livenessProbe failed.
6832 /// This can be used to provide different probe parameters at the beginning of a Pod's lifecycle,
6833 /// when it might take a long time to load data or warm a cache, than during steady-state operation.
6834 /// This cannot be updated.
6835 /// More info: <https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes>
6836 #[serde(default, skip_serializing_if = "Option::is_none", rename = "startupProbe")]
6837 pub startup_probe: Option<ComponentDefinitionRuntimeContainersStartupProbe>,
6838 /// Whether this container should allocate a buffer for stdin in the container runtime. If this
6839 /// is not set, reads from stdin in the container will always result in EOF.
6840 /// Default is false.
6841 #[serde(default, skip_serializing_if = "Option::is_none")]
6842 pub stdin: Option<bool>,
6843 /// Whether the container runtime should close the stdin channel after it has been opened by
6844 /// a single attach. When stdin is true the stdin stream will remain open across multiple attach
6845 /// sessions. If stdinOnce is set to true, stdin is opened on container start, is empty until the
6846 /// first client attaches to stdin, and then remains open and accepts data until the client disconnects,
6847 /// at which time stdin is closed and remains closed until the container is restarted. If this
6848 /// flag is false, a container processes that reads from stdin will never receive an EOF.
6849 /// Default is false
6850 #[serde(default, skip_serializing_if = "Option::is_none", rename = "stdinOnce")]
6851 pub stdin_once: Option<bool>,
6852 /// Optional: Path at which the file to which the container's termination message
6853 /// will be written is mounted into the container's filesystem.
6854 /// Message written is intended to be brief final status, such as an assertion failure message.
6855 /// Will be truncated by the node if greater than 4096 bytes. The total message length across
6856 /// all containers will be limited to 12kb.
6857 /// Defaults to /dev/termination-log.
6858 /// Cannot be updated.
6859 #[serde(default, skip_serializing_if = "Option::is_none", rename = "terminationMessagePath")]
6860 pub termination_message_path: Option<String>,
6861 /// Indicate how the termination message should be populated. File will use the contents of
6862 /// terminationMessagePath to populate the container status message on both success and failure.
6863 /// FallbackToLogsOnError will use the last chunk of container log output if the termination
6864 /// message file is empty and the container exited with an error.
6865 /// The log output is limited to 2048 bytes or 80 lines, whichever is smaller.
6866 /// Defaults to File.
6867 /// Cannot be updated.
6868 #[serde(default, skip_serializing_if = "Option::is_none", rename = "terminationMessagePolicy")]
6869 pub termination_message_policy: Option<String>,
6870 /// Whether this container should allocate a TTY for itself, also requires 'stdin' to be true.
6871 /// Default is false.
6872 #[serde(default, skip_serializing_if = "Option::is_none")]
6873 pub tty: Option<bool>,
6874 /// volumeDevices is the list of block devices to be used by the container.
6875 #[serde(default, skip_serializing_if = "Option::is_none", rename = "volumeDevices")]
6876 pub volume_devices: Option<Vec<ComponentDefinitionRuntimeContainersVolumeDevices>>,
6877 /// Pod volumes to mount into the container's filesystem.
6878 /// Cannot be updated.
6879 #[serde(default, skip_serializing_if = "Option::is_none", rename = "volumeMounts")]
6880 pub volume_mounts: Option<Vec<ComponentDefinitionRuntimeContainersVolumeMounts>>,
6881 /// Container's working directory.
6882 /// If not specified, the container runtime's default will be used, which
6883 /// might be configured in the container image.
6884 /// Cannot be updated.
6885 #[serde(default, skip_serializing_if = "Option::is_none", rename = "workingDir")]
6886 pub working_dir: Option<String>,
6887}
6888
6889/// EnvVar represents an environment variable present in a Container.
6890#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
6891pub struct ComponentDefinitionRuntimeContainersEnv {
6892 /// Name of the environment variable. Must be a C_IDENTIFIER.
6893 pub name: String,
6894 /// Variable references $(VAR_NAME) are expanded
6895 /// using the previously defined environment variables in the container and
6896 /// any service environment variables. If a variable cannot be resolved,
6897 /// the reference in the input string will be unchanged. Double $$ are reduced
6898 /// to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e.
6899 /// "$$(VAR_NAME)" will produce the string literal "$(VAR_NAME)".
6900 /// Escaped references will never be expanded, regardless of whether the variable
6901 /// exists or not.
6902 /// Defaults to "".
6903 #[serde(default, skip_serializing_if = "Option::is_none")]
6904 pub value: Option<String>,
6905 /// Source for the environment variable's value. Cannot be used if value is not empty.
6906 #[serde(default, skip_serializing_if = "Option::is_none", rename = "valueFrom")]
6907 pub value_from: Option<ComponentDefinitionRuntimeContainersEnvValueFrom>,
6908}
6909
6910/// Source for the environment variable's value. Cannot be used if value is not empty.
6911#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
6912pub struct ComponentDefinitionRuntimeContainersEnvValueFrom {
6913 /// Selects a key of a ConfigMap.
6914 #[serde(default, skip_serializing_if = "Option::is_none", rename = "configMapKeyRef")]
6915 pub config_map_key_ref: Option<ComponentDefinitionRuntimeContainersEnvValueFromConfigMapKeyRef>,
6916 /// Selects a field of the pod: supports metadata.name, metadata.namespace, `metadata.labels['<KEY>']`, `metadata.annotations['<KEY>']`,
6917 /// spec.nodeName, spec.serviceAccountName, status.hostIP, status.podIP, status.podIPs.
6918 #[serde(default, skip_serializing_if = "Option::is_none", rename = "fieldRef")]
6919 pub field_ref: Option<ComponentDefinitionRuntimeContainersEnvValueFromFieldRef>,
6920 /// Selects a resource of the container: only resources limits and requests
6921 /// (limits.cpu, limits.memory, limits.ephemeral-storage, requests.cpu, requests.memory and requests.ephemeral-storage) are currently supported.
6922 #[serde(default, skip_serializing_if = "Option::is_none", rename = "resourceFieldRef")]
6923 pub resource_field_ref: Option<ComponentDefinitionRuntimeContainersEnvValueFromResourceFieldRef>,
6924 /// Selects a key of a secret in the pod's namespace
6925 #[serde(default, skip_serializing_if = "Option::is_none", rename = "secretKeyRef")]
6926 pub secret_key_ref: Option<ComponentDefinitionRuntimeContainersEnvValueFromSecretKeyRef>,
6927}
6928
6929/// Selects a key of a ConfigMap.
6930#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
6931pub struct ComponentDefinitionRuntimeContainersEnvValueFromConfigMapKeyRef {
6932 /// The key to select.
6933 pub key: String,
6934 /// Name of the referent.
6935 /// More info: <https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names>
6936 #[serde(default, skip_serializing_if = "Option::is_none")]
6937 pub name: Option<String>,
6938 /// Specify whether the ConfigMap or its key must be defined
6939 #[serde(default, skip_serializing_if = "Option::is_none")]
6940 pub optional: Option<bool>,
6941}
6942
6943/// Selects a field of the pod: supports metadata.name, metadata.namespace, `metadata.labels['<KEY>']`, `metadata.annotations['<KEY>']`,
6944/// spec.nodeName, spec.serviceAccountName, status.hostIP, status.podIP, status.podIPs.
6945#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
6946pub struct ComponentDefinitionRuntimeContainersEnvValueFromFieldRef {
6947 /// Version of the schema the FieldPath is written in terms of, defaults to "v1".
6948 #[serde(default, skip_serializing_if = "Option::is_none", rename = "apiVersion")]
6949 pub api_version: Option<String>,
6950 /// Path of the field to select in the specified API version.
6951 #[serde(rename = "fieldPath")]
6952 pub field_path: String,
6953}
6954
6955/// Selects a resource of the container: only resources limits and requests
6956/// (limits.cpu, limits.memory, limits.ephemeral-storage, requests.cpu, requests.memory and requests.ephemeral-storage) are currently supported.
6957#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
6958pub struct ComponentDefinitionRuntimeContainersEnvValueFromResourceFieldRef {
6959 /// Container name: required for volumes, optional for env vars
6960 #[serde(default, skip_serializing_if = "Option::is_none", rename = "containerName")]
6961 pub container_name: Option<String>,
6962 /// Specifies the output format of the exposed resources, defaults to "1"
6963 #[serde(default, skip_serializing_if = "Option::is_none")]
6964 pub divisor: Option<IntOrString>,
6965 /// Required: resource to select
6966 pub resource: String,
6967}
6968
6969/// Selects a key of a secret in the pod's namespace
6970#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
6971pub struct ComponentDefinitionRuntimeContainersEnvValueFromSecretKeyRef {
6972 /// The key of the secret to select from. Must be a valid secret key.
6973 pub key: String,
6974 /// Name of the referent.
6975 /// More info: <https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names>
6976 #[serde(default, skip_serializing_if = "Option::is_none")]
6977 pub name: Option<String>,
6978 /// Specify whether the Secret or its key must be defined
6979 #[serde(default, skip_serializing_if = "Option::is_none")]
6980 pub optional: Option<bool>,
6981}
6982
6983/// EnvFromSource represents the source of a set of ConfigMaps
6984#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
6985pub struct ComponentDefinitionRuntimeContainersEnvFrom {
6986 /// The ConfigMap to select from
6987 #[serde(default, skip_serializing_if = "Option::is_none", rename = "configMapRef")]
6988 pub config_map_ref: Option<ComponentDefinitionRuntimeContainersEnvFromConfigMapRef>,
6989 /// An optional identifier to prepend to each key in the ConfigMap. Must be a C_IDENTIFIER.
6990 #[serde(default, skip_serializing_if = "Option::is_none")]
6991 pub prefix: Option<String>,
6992 /// The Secret to select from
6993 #[serde(default, skip_serializing_if = "Option::is_none", rename = "secretRef")]
6994 pub secret_ref: Option<ComponentDefinitionRuntimeContainersEnvFromSecretRef>,
6995}
6996
6997/// The ConfigMap to select from
6998#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
6999pub struct ComponentDefinitionRuntimeContainersEnvFromConfigMapRef {
7000 /// Name of the referent.
7001 /// More info: <https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names>
7002 #[serde(default, skip_serializing_if = "Option::is_none")]
7003 pub name: Option<String>,
7004 /// Specify whether the ConfigMap must be defined
7005 #[serde(default, skip_serializing_if = "Option::is_none")]
7006 pub optional: Option<bool>,
7007}
7008
7009/// The Secret to select from
7010#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
7011pub struct ComponentDefinitionRuntimeContainersEnvFromSecretRef {
7012 /// Name of the referent.
7013 /// More info: <https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names>
7014 #[serde(default, skip_serializing_if = "Option::is_none")]
7015 pub name: Option<String>,
7016 /// Specify whether the Secret must be defined
7017 #[serde(default, skip_serializing_if = "Option::is_none")]
7018 pub optional: Option<bool>,
7019}
7020
7021/// Actions that the management system should take in response to container lifecycle events.
7022/// Cannot be updated.
7023#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
7024pub struct ComponentDefinitionRuntimeContainersLifecycle {
7025 /// PostStart is called immediately after a container is created. If the handler fails,
7026 /// the container is terminated and restarted according to its restart policy.
7027 /// Other management of the container blocks until the hook completes.
7028 /// More info: <https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks>
7029 #[serde(default, skip_serializing_if = "Option::is_none", rename = "postStart")]
7030 pub post_start: Option<ComponentDefinitionRuntimeContainersLifecyclePostStart>,
7031 /// PreStop is called immediately before a container is terminated due to an
7032 /// API request or management event such as liveness/startup probe failure,
7033 /// preemption, resource contention, etc. The handler is not called if the
7034 /// container crashes or exits. The Pod's termination grace period countdown begins before the
7035 /// PreStop hook is executed. Regardless of the outcome of the handler, the
7036 /// container will eventually terminate within the Pod's termination grace
7037 /// period (unless delayed by finalizers). Other management of the container blocks until the hook completes
7038 /// or until the termination grace period is reached.
7039 /// More info: <https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks>
7040 #[serde(default, skip_serializing_if = "Option::is_none", rename = "preStop")]
7041 pub pre_stop: Option<ComponentDefinitionRuntimeContainersLifecyclePreStop>,
7042}
7043
7044/// PostStart is called immediately after a container is created. If the handler fails,
7045/// the container is terminated and restarted according to its restart policy.
7046/// Other management of the container blocks until the hook completes.
7047/// More info: <https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks>
7048#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
7049pub struct ComponentDefinitionRuntimeContainersLifecyclePostStart {
7050 /// Exec specifies the action to take.
7051 #[serde(default, skip_serializing_if = "Option::is_none")]
7052 pub exec: Option<ComponentDefinitionRuntimeContainersLifecyclePostStartExec>,
7053 /// HTTPGet specifies the http request to perform.
7054 #[serde(default, skip_serializing_if = "Option::is_none", rename = "httpGet")]
7055 pub http_get: Option<ComponentDefinitionRuntimeContainersLifecyclePostStartHttpGet>,
7056 /// Sleep represents the duration that the container should sleep before being terminated.
7057 #[serde(default, skip_serializing_if = "Option::is_none")]
7058 pub sleep: Option<ComponentDefinitionRuntimeContainersLifecyclePostStartSleep>,
7059 /// Deprecated. TCPSocket is NOT supported as a LifecycleHandler and kept
7060 /// for the backward compatibility. There are no validation of this field and
7061 /// lifecycle hooks will fail in runtime when tcp handler is specified.
7062 #[serde(default, skip_serializing_if = "Option::is_none", rename = "tcpSocket")]
7063 pub tcp_socket: Option<ComponentDefinitionRuntimeContainersLifecyclePostStartTcpSocket>,
7064}
7065
7066/// Exec specifies the action to take.
7067#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
7068pub struct ComponentDefinitionRuntimeContainersLifecyclePostStartExec {
7069 /// Command is the command line to execute inside the container, the working directory for the
7070 /// command is root ('/') in the container's filesystem. The command is simply exec'd, it is
7071 /// not run inside a shell, so traditional shell instructions ('|', etc) won't work. To use
7072 /// a shell, you need to explicitly call out to that shell.
7073 /// Exit status of 0 is treated as live/healthy and non-zero is unhealthy.
7074 #[serde(default, skip_serializing_if = "Option::is_none")]
7075 pub command: Option<Vec<String>>,
7076}
7077
7078/// HTTPGet specifies the http request to perform.
7079#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
7080pub struct ComponentDefinitionRuntimeContainersLifecyclePostStartHttpGet {
7081 /// Host name to connect to, defaults to the pod IP. You probably want to set
7082 /// "Host" in httpHeaders instead.
7083 #[serde(default, skip_serializing_if = "Option::is_none")]
7084 pub host: Option<String>,
7085 /// Custom headers to set in the request. HTTP allows repeated headers.
7086 #[serde(default, skip_serializing_if = "Option::is_none", rename = "httpHeaders")]
7087 pub http_headers: Option<Vec<ComponentDefinitionRuntimeContainersLifecyclePostStartHttpGetHttpHeaders>>,
7088 /// Path to access on the HTTP server.
7089 #[serde(default, skip_serializing_if = "Option::is_none")]
7090 pub path: Option<String>,
7091 /// Name or number of the port to access on the container.
7092 /// Number must be in the range 1 to 65535.
7093 /// Name must be an IANA_SVC_NAME.
7094 pub port: IntOrString,
7095 /// Scheme to use for connecting to the host.
7096 /// Defaults to HTTP.
7097 #[serde(default, skip_serializing_if = "Option::is_none")]
7098 pub scheme: Option<String>,
7099}
7100
7101/// HTTPHeader describes a custom header to be used in HTTP probes
7102#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
7103pub struct ComponentDefinitionRuntimeContainersLifecyclePostStartHttpGetHttpHeaders {
7104 /// The header field name.
7105 /// This will be canonicalized upon output, so case-variant names will be understood as the same header.
7106 pub name: String,
7107 /// The header field value
7108 pub value: String,
7109}
7110
7111/// Sleep represents the duration that the container should sleep before being terminated.
7112#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
7113pub struct ComponentDefinitionRuntimeContainersLifecyclePostStartSleep {
7114 /// Seconds is the number of seconds to sleep.
7115 pub seconds: i64,
7116}
7117
7118/// Deprecated. TCPSocket is NOT supported as a LifecycleHandler and kept
7119/// for the backward compatibility. There are no validation of this field and
7120/// lifecycle hooks will fail in runtime when tcp handler is specified.
7121#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
7122pub struct ComponentDefinitionRuntimeContainersLifecyclePostStartTcpSocket {
7123 /// Optional: Host name to connect to, defaults to the pod IP.
7124 #[serde(default, skip_serializing_if = "Option::is_none")]
7125 pub host: Option<String>,
7126 /// Number or name of the port to access on the container.
7127 /// Number must be in the range 1 to 65535.
7128 /// Name must be an IANA_SVC_NAME.
7129 pub port: IntOrString,
7130}
7131
7132/// PreStop is called immediately before a container is terminated due to an
7133/// API request or management event such as liveness/startup probe failure,
7134/// preemption, resource contention, etc. The handler is not called if the
7135/// container crashes or exits. The Pod's termination grace period countdown begins before the
7136/// PreStop hook is executed. Regardless of the outcome of the handler, the
7137/// container will eventually terminate within the Pod's termination grace
7138/// period (unless delayed by finalizers). Other management of the container blocks until the hook completes
7139/// or until the termination grace period is reached.
7140/// More info: <https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks>
7141#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
7142pub struct ComponentDefinitionRuntimeContainersLifecyclePreStop {
7143 /// Exec specifies the action to take.
7144 #[serde(default, skip_serializing_if = "Option::is_none")]
7145 pub exec: Option<ComponentDefinitionRuntimeContainersLifecyclePreStopExec>,
7146 /// HTTPGet specifies the http request to perform.
7147 #[serde(default, skip_serializing_if = "Option::is_none", rename = "httpGet")]
7148 pub http_get: Option<ComponentDefinitionRuntimeContainersLifecyclePreStopHttpGet>,
7149 /// Sleep represents the duration that the container should sleep before being terminated.
7150 #[serde(default, skip_serializing_if = "Option::is_none")]
7151 pub sleep: Option<ComponentDefinitionRuntimeContainersLifecyclePreStopSleep>,
7152 /// Deprecated. TCPSocket is NOT supported as a LifecycleHandler and kept
7153 /// for the backward compatibility. There are no validation of this field and
7154 /// lifecycle hooks will fail in runtime when tcp handler is specified.
7155 #[serde(default, skip_serializing_if = "Option::is_none", rename = "tcpSocket")]
7156 pub tcp_socket: Option<ComponentDefinitionRuntimeContainersLifecyclePreStopTcpSocket>,
7157}
7158
7159/// Exec specifies the action to take.
7160#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
7161pub struct ComponentDefinitionRuntimeContainersLifecyclePreStopExec {
7162 /// Command is the command line to execute inside the container, the working directory for the
7163 /// command is root ('/') in the container's filesystem. The command is simply exec'd, it is
7164 /// not run inside a shell, so traditional shell instructions ('|', etc) won't work. To use
7165 /// a shell, you need to explicitly call out to that shell.
7166 /// Exit status of 0 is treated as live/healthy and non-zero is unhealthy.
7167 #[serde(default, skip_serializing_if = "Option::is_none")]
7168 pub command: Option<Vec<String>>,
7169}
7170
7171/// HTTPGet specifies the http request to perform.
7172#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
7173pub struct ComponentDefinitionRuntimeContainersLifecyclePreStopHttpGet {
7174 /// Host name to connect to, defaults to the pod IP. You probably want to set
7175 /// "Host" in httpHeaders instead.
7176 #[serde(default, skip_serializing_if = "Option::is_none")]
7177 pub host: Option<String>,
7178 /// Custom headers to set in the request. HTTP allows repeated headers.
7179 #[serde(default, skip_serializing_if = "Option::is_none", rename = "httpHeaders")]
7180 pub http_headers: Option<Vec<ComponentDefinitionRuntimeContainersLifecyclePreStopHttpGetHttpHeaders>>,
7181 /// Path to access on the HTTP server.
7182 #[serde(default, skip_serializing_if = "Option::is_none")]
7183 pub path: Option<String>,
7184 /// Name or number of the port to access on the container.
7185 /// Number must be in the range 1 to 65535.
7186 /// Name must be an IANA_SVC_NAME.
7187 pub port: IntOrString,
7188 /// Scheme to use for connecting to the host.
7189 /// Defaults to HTTP.
7190 #[serde(default, skip_serializing_if = "Option::is_none")]
7191 pub scheme: Option<String>,
7192}
7193
7194/// HTTPHeader describes a custom header to be used in HTTP probes
7195#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
7196pub struct ComponentDefinitionRuntimeContainersLifecyclePreStopHttpGetHttpHeaders {
7197 /// The header field name.
7198 /// This will be canonicalized upon output, so case-variant names will be understood as the same header.
7199 pub name: String,
7200 /// The header field value
7201 pub value: String,
7202}
7203
7204/// Sleep represents the duration that the container should sleep before being terminated.
7205#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
7206pub struct ComponentDefinitionRuntimeContainersLifecyclePreStopSleep {
7207 /// Seconds is the number of seconds to sleep.
7208 pub seconds: i64,
7209}
7210
7211/// Deprecated. TCPSocket is NOT supported as a LifecycleHandler and kept
7212/// for the backward compatibility. There are no validation of this field and
7213/// lifecycle hooks will fail in runtime when tcp handler is specified.
7214#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
7215pub struct ComponentDefinitionRuntimeContainersLifecyclePreStopTcpSocket {
7216 /// Optional: Host name to connect to, defaults to the pod IP.
7217 #[serde(default, skip_serializing_if = "Option::is_none")]
7218 pub host: Option<String>,
7219 /// Number or name of the port to access on the container.
7220 /// Number must be in the range 1 to 65535.
7221 /// Name must be an IANA_SVC_NAME.
7222 pub port: IntOrString,
7223}
7224
7225/// Periodic probe of container liveness.
7226/// Container will be restarted if the probe fails.
7227/// Cannot be updated.
7228/// More info: <https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes>
7229#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
7230pub struct ComponentDefinitionRuntimeContainersLivenessProbe {
7231 /// Exec specifies the action to take.
7232 #[serde(default, skip_serializing_if = "Option::is_none")]
7233 pub exec: Option<ComponentDefinitionRuntimeContainersLivenessProbeExec>,
7234 /// Minimum consecutive failures for the probe to be considered failed after having succeeded.
7235 /// Defaults to 3. Minimum value is 1.
7236 #[serde(default, skip_serializing_if = "Option::is_none", rename = "failureThreshold")]
7237 pub failure_threshold: Option<i32>,
7238 /// GRPC specifies an action involving a GRPC port.
7239 #[serde(default, skip_serializing_if = "Option::is_none")]
7240 pub grpc: Option<ComponentDefinitionRuntimeContainersLivenessProbeGrpc>,
7241 /// HTTPGet specifies the http request to perform.
7242 #[serde(default, skip_serializing_if = "Option::is_none", rename = "httpGet")]
7243 pub http_get: Option<ComponentDefinitionRuntimeContainersLivenessProbeHttpGet>,
7244 /// Number of seconds after the container has started before liveness probes are initiated.
7245 /// More info: <https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes>
7246 #[serde(default, skip_serializing_if = "Option::is_none", rename = "initialDelaySeconds")]
7247 pub initial_delay_seconds: Option<i32>,
7248 /// How often (in seconds) to perform the probe.
7249 /// Default to 10 seconds. Minimum value is 1.
7250 #[serde(default, skip_serializing_if = "Option::is_none", rename = "periodSeconds")]
7251 pub period_seconds: Option<i32>,
7252 /// Minimum consecutive successes for the probe to be considered successful after having failed.
7253 /// Defaults to 1. Must be 1 for liveness and startup. Minimum value is 1.
7254 #[serde(default, skip_serializing_if = "Option::is_none", rename = "successThreshold")]
7255 pub success_threshold: Option<i32>,
7256 /// TCPSocket specifies an action involving a TCP port.
7257 #[serde(default, skip_serializing_if = "Option::is_none", rename = "tcpSocket")]
7258 pub tcp_socket: Option<ComponentDefinitionRuntimeContainersLivenessProbeTcpSocket>,
7259 /// Optional duration in seconds the pod needs to terminate gracefully upon probe failure.
7260 /// The grace period is the duration in seconds after the processes running in the pod are sent
7261 /// a termination signal and the time when the processes are forcibly halted with a kill signal.
7262 /// Set this value longer than the expected cleanup time for your process.
7263 /// If this value is nil, the pod's terminationGracePeriodSeconds will be used. Otherwise, this
7264 /// value overrides the value provided by the pod spec.
7265 /// Value must be non-negative integer. The value zero indicates stop immediately via
7266 /// the kill signal (no opportunity to shut down).
7267 /// This is a beta field and requires enabling ProbeTerminationGracePeriod feature gate.
7268 /// Minimum value is 1. spec.terminationGracePeriodSeconds is used if unset.
7269 #[serde(default, skip_serializing_if = "Option::is_none", rename = "terminationGracePeriodSeconds")]
7270 pub termination_grace_period_seconds: Option<i64>,
7271 /// Number of seconds after which the probe times out.
7272 /// Defaults to 1 second. Minimum value is 1.
7273 /// More info: <https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes>
7274 #[serde(default, skip_serializing_if = "Option::is_none", rename = "timeoutSeconds")]
7275 pub timeout_seconds: Option<i32>,
7276}
7277
7278/// Exec specifies the action to take.
7279#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
7280pub struct ComponentDefinitionRuntimeContainersLivenessProbeExec {
7281 /// Command is the command line to execute inside the container, the working directory for the
7282 /// command is root ('/') in the container's filesystem. The command is simply exec'd, it is
7283 /// not run inside a shell, so traditional shell instructions ('|', etc) won't work. To use
7284 /// a shell, you need to explicitly call out to that shell.
7285 /// Exit status of 0 is treated as live/healthy and non-zero is unhealthy.
7286 #[serde(default, skip_serializing_if = "Option::is_none")]
7287 pub command: Option<Vec<String>>,
7288}
7289
7290/// GRPC specifies an action involving a GRPC port.
7291#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
7292pub struct ComponentDefinitionRuntimeContainersLivenessProbeGrpc {
7293 /// Port number of the gRPC service. Number must be in the range 1 to 65535.
7294 pub port: i32,
7295 /// Service is the name of the service to place in the gRPC HealthCheckRequest
7296 /// (see <https://github.com/grpc/grpc/blob/master/doc/health-checking.md).>
7297 ///
7298 /// If this is not specified, the default behavior is defined by gRPC.
7299 #[serde(default, skip_serializing_if = "Option::is_none")]
7300 pub service: Option<String>,
7301}
7302
7303/// HTTPGet specifies the http request to perform.
7304#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
7305pub struct ComponentDefinitionRuntimeContainersLivenessProbeHttpGet {
7306 /// Host name to connect to, defaults to the pod IP. You probably want to set
7307 /// "Host" in httpHeaders instead.
7308 #[serde(default, skip_serializing_if = "Option::is_none")]
7309 pub host: Option<String>,
7310 /// Custom headers to set in the request. HTTP allows repeated headers.
7311 #[serde(default, skip_serializing_if = "Option::is_none", rename = "httpHeaders")]
7312 pub http_headers: Option<Vec<ComponentDefinitionRuntimeContainersLivenessProbeHttpGetHttpHeaders>>,
7313 /// Path to access on the HTTP server.
7314 #[serde(default, skip_serializing_if = "Option::is_none")]
7315 pub path: Option<String>,
7316 /// Name or number of the port to access on the container.
7317 /// Number must be in the range 1 to 65535.
7318 /// Name must be an IANA_SVC_NAME.
7319 pub port: IntOrString,
7320 /// Scheme to use for connecting to the host.
7321 /// Defaults to HTTP.
7322 #[serde(default, skip_serializing_if = "Option::is_none")]
7323 pub scheme: Option<String>,
7324}
7325
7326/// HTTPHeader describes a custom header to be used in HTTP probes
7327#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
7328pub struct ComponentDefinitionRuntimeContainersLivenessProbeHttpGetHttpHeaders {
7329 /// The header field name.
7330 /// This will be canonicalized upon output, so case-variant names will be understood as the same header.
7331 pub name: String,
7332 /// The header field value
7333 pub value: String,
7334}
7335
7336/// TCPSocket specifies an action involving a TCP port.
7337#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
7338pub struct ComponentDefinitionRuntimeContainersLivenessProbeTcpSocket {
7339 /// Optional: Host name to connect to, defaults to the pod IP.
7340 #[serde(default, skip_serializing_if = "Option::is_none")]
7341 pub host: Option<String>,
7342 /// Number or name of the port to access on the container.
7343 /// Number must be in the range 1 to 65535.
7344 /// Name must be an IANA_SVC_NAME.
7345 pub port: IntOrString,
7346}
7347
7348/// ContainerPort represents a network port in a single container.
7349#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
7350pub struct ComponentDefinitionRuntimeContainersPorts {
7351 /// Number of port to expose on the pod's IP address.
7352 /// This must be a valid port number, 0 < x < 65536.
7353 #[serde(rename = "containerPort")]
7354 pub container_port: i32,
7355 /// What host IP to bind the external port to.
7356 #[serde(default, skip_serializing_if = "Option::is_none", rename = "hostIP")]
7357 pub host_ip: Option<String>,
7358 /// Number of port to expose on the host.
7359 /// If specified, this must be a valid port number, 0 < x < 65536.
7360 /// If HostNetwork is specified, this must match ContainerPort.
7361 /// Most containers do not need this.
7362 #[serde(default, skip_serializing_if = "Option::is_none", rename = "hostPort")]
7363 pub host_port: Option<i32>,
7364 /// If specified, this must be an IANA_SVC_NAME and unique within the pod. Each
7365 /// named port in a pod must have a unique name. Name for the port that can be
7366 /// referred to by services.
7367 #[serde(default, skip_serializing_if = "Option::is_none")]
7368 pub name: Option<String>,
7369 /// Protocol for port. Must be UDP, TCP, or SCTP.
7370 /// Defaults to "TCP".
7371 #[serde(default, skip_serializing_if = "Option::is_none")]
7372 pub protocol: Option<String>,
7373}
7374
7375/// Periodic probe of container service readiness.
7376/// Container will be removed from service endpoints if the probe fails.
7377/// Cannot be updated.
7378/// More info: <https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes>
7379#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
7380pub struct ComponentDefinitionRuntimeContainersReadinessProbe {
7381 /// Exec specifies the action to take.
7382 #[serde(default, skip_serializing_if = "Option::is_none")]
7383 pub exec: Option<ComponentDefinitionRuntimeContainersReadinessProbeExec>,
7384 /// Minimum consecutive failures for the probe to be considered failed after having succeeded.
7385 /// Defaults to 3. Minimum value is 1.
7386 #[serde(default, skip_serializing_if = "Option::is_none", rename = "failureThreshold")]
7387 pub failure_threshold: Option<i32>,
7388 /// GRPC specifies an action involving a GRPC port.
7389 #[serde(default, skip_serializing_if = "Option::is_none")]
7390 pub grpc: Option<ComponentDefinitionRuntimeContainersReadinessProbeGrpc>,
7391 /// HTTPGet specifies the http request to perform.
7392 #[serde(default, skip_serializing_if = "Option::is_none", rename = "httpGet")]
7393 pub http_get: Option<ComponentDefinitionRuntimeContainersReadinessProbeHttpGet>,
7394 /// Number of seconds after the container has started before liveness probes are initiated.
7395 /// More info: <https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes>
7396 #[serde(default, skip_serializing_if = "Option::is_none", rename = "initialDelaySeconds")]
7397 pub initial_delay_seconds: Option<i32>,
7398 /// How often (in seconds) to perform the probe.
7399 /// Default to 10 seconds. Minimum value is 1.
7400 #[serde(default, skip_serializing_if = "Option::is_none", rename = "periodSeconds")]
7401 pub period_seconds: Option<i32>,
7402 /// Minimum consecutive successes for the probe to be considered successful after having failed.
7403 /// Defaults to 1. Must be 1 for liveness and startup. Minimum value is 1.
7404 #[serde(default, skip_serializing_if = "Option::is_none", rename = "successThreshold")]
7405 pub success_threshold: Option<i32>,
7406 /// TCPSocket specifies an action involving a TCP port.
7407 #[serde(default, skip_serializing_if = "Option::is_none", rename = "tcpSocket")]
7408 pub tcp_socket: Option<ComponentDefinitionRuntimeContainersReadinessProbeTcpSocket>,
7409 /// Optional duration in seconds the pod needs to terminate gracefully upon probe failure.
7410 /// The grace period is the duration in seconds after the processes running in the pod are sent
7411 /// a termination signal and the time when the processes are forcibly halted with a kill signal.
7412 /// Set this value longer than the expected cleanup time for your process.
7413 /// If this value is nil, the pod's terminationGracePeriodSeconds will be used. Otherwise, this
7414 /// value overrides the value provided by the pod spec.
7415 /// Value must be non-negative integer. The value zero indicates stop immediately via
7416 /// the kill signal (no opportunity to shut down).
7417 /// This is a beta field and requires enabling ProbeTerminationGracePeriod feature gate.
7418 /// Minimum value is 1. spec.terminationGracePeriodSeconds is used if unset.
7419 #[serde(default, skip_serializing_if = "Option::is_none", rename = "terminationGracePeriodSeconds")]
7420 pub termination_grace_period_seconds: Option<i64>,
7421 /// Number of seconds after which the probe times out.
7422 /// Defaults to 1 second. Minimum value is 1.
7423 /// More info: <https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes>
7424 #[serde(default, skip_serializing_if = "Option::is_none", rename = "timeoutSeconds")]
7425 pub timeout_seconds: Option<i32>,
7426}
7427
7428/// Exec specifies the action to take.
7429#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
7430pub struct ComponentDefinitionRuntimeContainersReadinessProbeExec {
7431 /// Command is the command line to execute inside the container, the working directory for the
7432 /// command is root ('/') in the container's filesystem. The command is simply exec'd, it is
7433 /// not run inside a shell, so traditional shell instructions ('|', etc) won't work. To use
7434 /// a shell, you need to explicitly call out to that shell.
7435 /// Exit status of 0 is treated as live/healthy and non-zero is unhealthy.
7436 #[serde(default, skip_serializing_if = "Option::is_none")]
7437 pub command: Option<Vec<String>>,
7438}
7439
7440/// GRPC specifies an action involving a GRPC port.
7441#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
7442pub struct ComponentDefinitionRuntimeContainersReadinessProbeGrpc {
7443 /// Port number of the gRPC service. Number must be in the range 1 to 65535.
7444 pub port: i32,
7445 /// Service is the name of the service to place in the gRPC HealthCheckRequest
7446 /// (see <https://github.com/grpc/grpc/blob/master/doc/health-checking.md).>
7447 ///
7448 /// If this is not specified, the default behavior is defined by gRPC.
7449 #[serde(default, skip_serializing_if = "Option::is_none")]
7450 pub service: Option<String>,
7451}
7452
7453/// HTTPGet specifies the http request to perform.
7454#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
7455pub struct ComponentDefinitionRuntimeContainersReadinessProbeHttpGet {
7456 /// Host name to connect to, defaults to the pod IP. You probably want to set
7457 /// "Host" in httpHeaders instead.
7458 #[serde(default, skip_serializing_if = "Option::is_none")]
7459 pub host: Option<String>,
7460 /// Custom headers to set in the request. HTTP allows repeated headers.
7461 #[serde(default, skip_serializing_if = "Option::is_none", rename = "httpHeaders")]
7462 pub http_headers: Option<Vec<ComponentDefinitionRuntimeContainersReadinessProbeHttpGetHttpHeaders>>,
7463 /// Path to access on the HTTP server.
7464 #[serde(default, skip_serializing_if = "Option::is_none")]
7465 pub path: Option<String>,
7466 /// Name or number of the port to access on the container.
7467 /// Number must be in the range 1 to 65535.
7468 /// Name must be an IANA_SVC_NAME.
7469 pub port: IntOrString,
7470 /// Scheme to use for connecting to the host.
7471 /// Defaults to HTTP.
7472 #[serde(default, skip_serializing_if = "Option::is_none")]
7473 pub scheme: Option<String>,
7474}
7475
7476/// HTTPHeader describes a custom header to be used in HTTP probes
7477#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
7478pub struct ComponentDefinitionRuntimeContainersReadinessProbeHttpGetHttpHeaders {
7479 /// The header field name.
7480 /// This will be canonicalized upon output, so case-variant names will be understood as the same header.
7481 pub name: String,
7482 /// The header field value
7483 pub value: String,
7484}
7485
7486/// TCPSocket specifies an action involving a TCP port.
7487#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
7488pub struct ComponentDefinitionRuntimeContainersReadinessProbeTcpSocket {
7489 /// Optional: Host name to connect to, defaults to the pod IP.
7490 #[serde(default, skip_serializing_if = "Option::is_none")]
7491 pub host: Option<String>,
7492 /// Number or name of the port to access on the container.
7493 /// Number must be in the range 1 to 65535.
7494 /// Name must be an IANA_SVC_NAME.
7495 pub port: IntOrString,
7496}
7497
7498/// ContainerResizePolicy represents resource resize policy for the container.
7499#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
7500pub struct ComponentDefinitionRuntimeContainersResizePolicy {
7501 /// Name of the resource to which this resource resize policy applies.
7502 /// Supported values: cpu, memory.
7503 #[serde(rename = "resourceName")]
7504 pub resource_name: String,
7505 /// Restart policy to apply when specified resource is resized.
7506 /// If not specified, it defaults to NotRequired.
7507 #[serde(rename = "restartPolicy")]
7508 pub restart_policy: String,
7509}
7510
7511/// Compute Resources required by this container.
7512/// Cannot be updated.
7513/// More info: <https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/>
7514#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
7515pub struct ComponentDefinitionRuntimeContainersResources {
7516 /// Claims lists the names of resources, defined in spec.resourceClaims,
7517 /// that are used by this container.
7518 ///
7519 /// This is an alpha field and requires enabling the
7520 /// DynamicResourceAllocation feature gate.
7521 ///
7522 /// This field is immutable. It can only be set for containers.
7523 #[serde(default, skip_serializing_if = "Option::is_none")]
7524 pub claims: Option<Vec<ComponentDefinitionRuntimeContainersResourcesClaims>>,
7525 /// Limits describes the maximum amount of compute resources allowed.
7526 /// More info: <https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/>
7527 #[serde(default, skip_serializing_if = "Option::is_none")]
7528 pub limits: Option<BTreeMap<String, IntOrString>>,
7529 /// Requests describes the minimum amount of compute resources required.
7530 /// If Requests is omitted for a container, it defaults to Limits if that is explicitly specified,
7531 /// otherwise to an implementation-defined value. Requests cannot exceed Limits.
7532 /// More info: <https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/>
7533 #[serde(default, skip_serializing_if = "Option::is_none")]
7534 pub requests: Option<BTreeMap<String, IntOrString>>,
7535}
7536
7537/// ResourceClaim references one entry in PodSpec.ResourceClaims.
7538#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
7539pub struct ComponentDefinitionRuntimeContainersResourcesClaims {
7540 /// Name must match the name of one entry in pod.spec.resourceClaims of
7541 /// the Pod where this field is used. It makes that resource available
7542 /// inside a container.
7543 pub name: String,
7544}
7545
7546/// SecurityContext defines the security options the container should be run with.
7547/// If set, the fields of SecurityContext override the equivalent fields of PodSecurityContext.
7548/// More info: <https://kubernetes.io/docs/tasks/configure-pod-container/security-context/>
7549#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
7550pub struct ComponentDefinitionRuntimeContainersSecurityContext {
7551 /// AllowPrivilegeEscalation controls whether a process can gain more
7552 /// privileges than its parent process. This bool directly controls if
7553 /// the no_new_privs flag will be set on the container process.
7554 /// AllowPrivilegeEscalation is true always when the container is:
7555 /// 1) run as Privileged
7556 /// 2) has CAP_SYS_ADMIN
7557 /// Note that this field cannot be set when spec.os.name is windows.
7558 #[serde(default, skip_serializing_if = "Option::is_none", rename = "allowPrivilegeEscalation")]
7559 pub allow_privilege_escalation: Option<bool>,
7560 /// The capabilities to add/drop when running containers.
7561 /// Defaults to the default set of capabilities granted by the container runtime.
7562 /// Note that this field cannot be set when spec.os.name is windows.
7563 #[serde(default, skip_serializing_if = "Option::is_none")]
7564 pub capabilities: Option<ComponentDefinitionRuntimeContainersSecurityContextCapabilities>,
7565 /// Run container in privileged mode.
7566 /// Processes in privileged containers are essentially equivalent to root on the host.
7567 /// Defaults to false.
7568 /// Note that this field cannot be set when spec.os.name is windows.
7569 #[serde(default, skip_serializing_if = "Option::is_none")]
7570 pub privileged: Option<bool>,
7571 /// procMount denotes the type of proc mount to use for the containers.
7572 /// The default is DefaultProcMount which uses the container runtime defaults for
7573 /// readonly paths and masked paths.
7574 /// This requires the ProcMountType feature flag to be enabled.
7575 /// Note that this field cannot be set when spec.os.name is windows.
7576 #[serde(default, skip_serializing_if = "Option::is_none", rename = "procMount")]
7577 pub proc_mount: Option<String>,
7578 /// Whether this container has a read-only root filesystem.
7579 /// Default is false.
7580 /// Note that this field cannot be set when spec.os.name is windows.
7581 #[serde(default, skip_serializing_if = "Option::is_none", rename = "readOnlyRootFilesystem")]
7582 pub read_only_root_filesystem: Option<bool>,
7583 /// The GID to run the entrypoint of the container process.
7584 /// Uses runtime default if unset.
7585 /// May also be set in PodSecurityContext. If set in both SecurityContext and
7586 /// PodSecurityContext, the value specified in SecurityContext takes precedence.
7587 /// Note that this field cannot be set when spec.os.name is windows.
7588 #[serde(default, skip_serializing_if = "Option::is_none", rename = "runAsGroup")]
7589 pub run_as_group: Option<i64>,
7590 /// Indicates that the container must run as a non-root user.
7591 /// If true, the Kubelet will validate the image at runtime to ensure that it
7592 /// does not run as UID 0 (root) and fail to start the container if it does.
7593 /// If unset or false, no such validation will be performed.
7594 /// May also be set in PodSecurityContext. If set in both SecurityContext and
7595 /// PodSecurityContext, the value specified in SecurityContext takes precedence.
7596 #[serde(default, skip_serializing_if = "Option::is_none", rename = "runAsNonRoot")]
7597 pub run_as_non_root: Option<bool>,
7598 /// The UID to run the entrypoint of the container process.
7599 /// Defaults to user specified in image metadata if unspecified.
7600 /// May also be set in PodSecurityContext. If set in both SecurityContext and
7601 /// PodSecurityContext, the value specified in SecurityContext takes precedence.
7602 /// Note that this field cannot be set when spec.os.name is windows.
7603 #[serde(default, skip_serializing_if = "Option::is_none", rename = "runAsUser")]
7604 pub run_as_user: Option<i64>,
7605 /// The SELinux context to be applied to the container.
7606 /// If unspecified, the container runtime will allocate a random SELinux context for each
7607 /// container. May also be set in PodSecurityContext. If set in both SecurityContext and
7608 /// PodSecurityContext, the value specified in SecurityContext takes precedence.
7609 /// Note that this field cannot be set when spec.os.name is windows.
7610 #[serde(default, skip_serializing_if = "Option::is_none", rename = "seLinuxOptions")]
7611 pub se_linux_options: Option<ComponentDefinitionRuntimeContainersSecurityContextSeLinuxOptions>,
7612 /// The seccomp options to use by this container. If seccomp options are
7613 /// provided at both the pod & container level, the container options
7614 /// override the pod options.
7615 /// Note that this field cannot be set when spec.os.name is windows.
7616 #[serde(default, skip_serializing_if = "Option::is_none", rename = "seccompProfile")]
7617 pub seccomp_profile: Option<ComponentDefinitionRuntimeContainersSecurityContextSeccompProfile>,
7618 /// The Windows specific settings applied to all containers.
7619 /// If unspecified, the options from the PodSecurityContext will be used.
7620 /// If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence.
7621 /// Note that this field cannot be set when spec.os.name is linux.
7622 #[serde(default, skip_serializing_if = "Option::is_none", rename = "windowsOptions")]
7623 pub windows_options: Option<ComponentDefinitionRuntimeContainersSecurityContextWindowsOptions>,
7624}
7625
7626/// The capabilities to add/drop when running containers.
7627/// Defaults to the default set of capabilities granted by the container runtime.
7628/// Note that this field cannot be set when spec.os.name is windows.
7629#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
7630pub struct ComponentDefinitionRuntimeContainersSecurityContextCapabilities {
7631 /// Added capabilities
7632 #[serde(default, skip_serializing_if = "Option::is_none")]
7633 pub add: Option<Vec<String>>,
7634 /// Removed capabilities
7635 #[serde(default, skip_serializing_if = "Option::is_none")]
7636 pub drop: Option<Vec<String>>,
7637}
7638
7639/// The SELinux context to be applied to the container.
7640/// If unspecified, the container runtime will allocate a random SELinux context for each
7641/// container. May also be set in PodSecurityContext. If set in both SecurityContext and
7642/// PodSecurityContext, the value specified in SecurityContext takes precedence.
7643/// Note that this field cannot be set when spec.os.name is windows.
7644#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
7645pub struct ComponentDefinitionRuntimeContainersSecurityContextSeLinuxOptions {
7646 /// Level is SELinux level label that applies to the container.
7647 #[serde(default, skip_serializing_if = "Option::is_none")]
7648 pub level: Option<String>,
7649 /// Role is a SELinux role label that applies to the container.
7650 #[serde(default, skip_serializing_if = "Option::is_none")]
7651 pub role: Option<String>,
7652 /// Type is a SELinux type label that applies to the container.
7653 #[serde(default, skip_serializing_if = "Option::is_none", rename = "type")]
7654 pub r#type: Option<String>,
7655 /// User is a SELinux user label that applies to the container.
7656 #[serde(default, skip_serializing_if = "Option::is_none")]
7657 pub user: Option<String>,
7658}
7659
7660/// The seccomp options to use by this container. If seccomp options are
7661/// provided at both the pod & container level, the container options
7662/// override the pod options.
7663/// Note that this field cannot be set when spec.os.name is windows.
7664#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
7665pub struct ComponentDefinitionRuntimeContainersSecurityContextSeccompProfile {
7666 /// localhostProfile indicates a profile defined in a file on the node should be used.
7667 /// The profile must be preconfigured on the node to work.
7668 /// Must be a descending path, relative to the kubelet's configured seccomp profile location.
7669 /// Must be set if type is "Localhost". Must NOT be set for any other type.
7670 #[serde(default, skip_serializing_if = "Option::is_none", rename = "localhostProfile")]
7671 pub localhost_profile: Option<String>,
7672 /// type indicates which kind of seccomp profile will be applied.
7673 /// Valid options are:
7674 ///
7675 /// Localhost - a profile defined in a file on the node should be used.
7676 /// RuntimeDefault - the container runtime default profile should be used.
7677 /// Unconfined - no profile should be applied.
7678 #[serde(rename = "type")]
7679 pub r#type: String,
7680}
7681
7682/// The Windows specific settings applied to all containers.
7683/// If unspecified, the options from the PodSecurityContext will be used.
7684/// If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence.
7685/// Note that this field cannot be set when spec.os.name is linux.
7686#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
7687pub struct ComponentDefinitionRuntimeContainersSecurityContextWindowsOptions {
7688 /// GMSACredentialSpec is where the GMSA admission webhook
7689 /// (<https://github.com/kubernetes-sigs/windows-gmsa)> inlines the contents of the
7690 /// GMSA credential spec named by the GMSACredentialSpecName field.
7691 #[serde(default, skip_serializing_if = "Option::is_none", rename = "gmsaCredentialSpec")]
7692 pub gmsa_credential_spec: Option<String>,
7693 /// GMSACredentialSpecName is the name of the GMSA credential spec to use.
7694 #[serde(default, skip_serializing_if = "Option::is_none", rename = "gmsaCredentialSpecName")]
7695 pub gmsa_credential_spec_name: Option<String>,
7696 /// HostProcess determines if a container should be run as a 'Host Process' container.
7697 /// All of a Pod's containers must have the same effective HostProcess value
7698 /// (it is not allowed to have a mix of HostProcess containers and non-HostProcess containers).
7699 /// In addition, if HostProcess is true then HostNetwork must also be set to true.
7700 #[serde(default, skip_serializing_if = "Option::is_none", rename = "hostProcess")]
7701 pub host_process: Option<bool>,
7702 /// The UserName in Windows to run the entrypoint of the container process.
7703 /// Defaults to the user specified in image metadata if unspecified.
7704 /// May also be set in PodSecurityContext. If set in both SecurityContext and
7705 /// PodSecurityContext, the value specified in SecurityContext takes precedence.
7706 #[serde(default, skip_serializing_if = "Option::is_none", rename = "runAsUserName")]
7707 pub run_as_user_name: Option<String>,
7708}
7709
7710/// StartupProbe indicates that the Pod has successfully initialized.
7711/// If specified, no other probes are executed until this completes successfully.
7712/// If this probe fails, the Pod will be restarted, just as if the livenessProbe failed.
7713/// This can be used to provide different probe parameters at the beginning of a Pod's lifecycle,
7714/// when it might take a long time to load data or warm a cache, than during steady-state operation.
7715/// This cannot be updated.
7716/// More info: <https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes>
7717#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
7718pub struct ComponentDefinitionRuntimeContainersStartupProbe {
7719 /// Exec specifies the action to take.
7720 #[serde(default, skip_serializing_if = "Option::is_none")]
7721 pub exec: Option<ComponentDefinitionRuntimeContainersStartupProbeExec>,
7722 /// Minimum consecutive failures for the probe to be considered failed after having succeeded.
7723 /// Defaults to 3. Minimum value is 1.
7724 #[serde(default, skip_serializing_if = "Option::is_none", rename = "failureThreshold")]
7725 pub failure_threshold: Option<i32>,
7726 /// GRPC specifies an action involving a GRPC port.
7727 #[serde(default, skip_serializing_if = "Option::is_none")]
7728 pub grpc: Option<ComponentDefinitionRuntimeContainersStartupProbeGrpc>,
7729 /// HTTPGet specifies the http request to perform.
7730 #[serde(default, skip_serializing_if = "Option::is_none", rename = "httpGet")]
7731 pub http_get: Option<ComponentDefinitionRuntimeContainersStartupProbeHttpGet>,
7732 /// Number of seconds after the container has started before liveness probes are initiated.
7733 /// More info: <https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes>
7734 #[serde(default, skip_serializing_if = "Option::is_none", rename = "initialDelaySeconds")]
7735 pub initial_delay_seconds: Option<i32>,
7736 /// How often (in seconds) to perform the probe.
7737 /// Default to 10 seconds. Minimum value is 1.
7738 #[serde(default, skip_serializing_if = "Option::is_none", rename = "periodSeconds")]
7739 pub period_seconds: Option<i32>,
7740 /// Minimum consecutive successes for the probe to be considered successful after having failed.
7741 /// Defaults to 1. Must be 1 for liveness and startup. Minimum value is 1.
7742 #[serde(default, skip_serializing_if = "Option::is_none", rename = "successThreshold")]
7743 pub success_threshold: Option<i32>,
7744 /// TCPSocket specifies an action involving a TCP port.
7745 #[serde(default, skip_serializing_if = "Option::is_none", rename = "tcpSocket")]
7746 pub tcp_socket: Option<ComponentDefinitionRuntimeContainersStartupProbeTcpSocket>,
7747 /// Optional duration in seconds the pod needs to terminate gracefully upon probe failure.
7748 /// The grace period is the duration in seconds after the processes running in the pod are sent
7749 /// a termination signal and the time when the processes are forcibly halted with a kill signal.
7750 /// Set this value longer than the expected cleanup time for your process.
7751 /// If this value is nil, the pod's terminationGracePeriodSeconds will be used. Otherwise, this
7752 /// value overrides the value provided by the pod spec.
7753 /// Value must be non-negative integer. The value zero indicates stop immediately via
7754 /// the kill signal (no opportunity to shut down).
7755 /// This is a beta field and requires enabling ProbeTerminationGracePeriod feature gate.
7756 /// Minimum value is 1. spec.terminationGracePeriodSeconds is used if unset.
7757 #[serde(default, skip_serializing_if = "Option::is_none", rename = "terminationGracePeriodSeconds")]
7758 pub termination_grace_period_seconds: Option<i64>,
7759 /// Number of seconds after which the probe times out.
7760 /// Defaults to 1 second. Minimum value is 1.
7761 /// More info: <https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes>
7762 #[serde(default, skip_serializing_if = "Option::is_none", rename = "timeoutSeconds")]
7763 pub timeout_seconds: Option<i32>,
7764}
7765
7766/// Exec specifies the action to take.
7767#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
7768pub struct ComponentDefinitionRuntimeContainersStartupProbeExec {
7769 /// Command is the command line to execute inside the container, the working directory for the
7770 /// command is root ('/') in the container's filesystem. The command is simply exec'd, it is
7771 /// not run inside a shell, so traditional shell instructions ('|', etc) won't work. To use
7772 /// a shell, you need to explicitly call out to that shell.
7773 /// Exit status of 0 is treated as live/healthy and non-zero is unhealthy.
7774 #[serde(default, skip_serializing_if = "Option::is_none")]
7775 pub command: Option<Vec<String>>,
7776}
7777
7778/// GRPC specifies an action involving a GRPC port.
7779#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
7780pub struct ComponentDefinitionRuntimeContainersStartupProbeGrpc {
7781 /// Port number of the gRPC service. Number must be in the range 1 to 65535.
7782 pub port: i32,
7783 /// Service is the name of the service to place in the gRPC HealthCheckRequest
7784 /// (see <https://github.com/grpc/grpc/blob/master/doc/health-checking.md).>
7785 ///
7786 /// If this is not specified, the default behavior is defined by gRPC.
7787 #[serde(default, skip_serializing_if = "Option::is_none")]
7788 pub service: Option<String>,
7789}
7790
7791/// HTTPGet specifies the http request to perform.
7792#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
7793pub struct ComponentDefinitionRuntimeContainersStartupProbeHttpGet {
7794 /// Host name to connect to, defaults to the pod IP. You probably want to set
7795 /// "Host" in httpHeaders instead.
7796 #[serde(default, skip_serializing_if = "Option::is_none")]
7797 pub host: Option<String>,
7798 /// Custom headers to set in the request. HTTP allows repeated headers.
7799 #[serde(default, skip_serializing_if = "Option::is_none", rename = "httpHeaders")]
7800 pub http_headers: Option<Vec<ComponentDefinitionRuntimeContainersStartupProbeHttpGetHttpHeaders>>,
7801 /// Path to access on the HTTP server.
7802 #[serde(default, skip_serializing_if = "Option::is_none")]
7803 pub path: Option<String>,
7804 /// Name or number of the port to access on the container.
7805 /// Number must be in the range 1 to 65535.
7806 /// Name must be an IANA_SVC_NAME.
7807 pub port: IntOrString,
7808 /// Scheme to use for connecting to the host.
7809 /// Defaults to HTTP.
7810 #[serde(default, skip_serializing_if = "Option::is_none")]
7811 pub scheme: Option<String>,
7812}
7813
7814/// HTTPHeader describes a custom header to be used in HTTP probes
7815#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
7816pub struct ComponentDefinitionRuntimeContainersStartupProbeHttpGetHttpHeaders {
7817 /// The header field name.
7818 /// This will be canonicalized upon output, so case-variant names will be understood as the same header.
7819 pub name: String,
7820 /// The header field value
7821 pub value: String,
7822}
7823
7824/// TCPSocket specifies an action involving a TCP port.
7825#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
7826pub struct ComponentDefinitionRuntimeContainersStartupProbeTcpSocket {
7827 /// Optional: Host name to connect to, defaults to the pod IP.
7828 #[serde(default, skip_serializing_if = "Option::is_none")]
7829 pub host: Option<String>,
7830 /// Number or name of the port to access on the container.
7831 /// Number must be in the range 1 to 65535.
7832 /// Name must be an IANA_SVC_NAME.
7833 pub port: IntOrString,
7834}
7835
7836/// volumeDevice describes a mapping of a raw block device within a container.
7837#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
7838pub struct ComponentDefinitionRuntimeContainersVolumeDevices {
7839 /// devicePath is the path inside of the container that the device will be mapped to.
7840 #[serde(rename = "devicePath")]
7841 pub device_path: String,
7842 /// name must match the name of a persistentVolumeClaim in the pod
7843 pub name: String,
7844}
7845
7846/// VolumeMount describes a mounting of a Volume within a container.
7847#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
7848pub struct ComponentDefinitionRuntimeContainersVolumeMounts {
7849 /// Path within the container at which the volume should be mounted. Must
7850 /// not contain ':'.
7851 #[serde(rename = "mountPath")]
7852 pub mount_path: String,
7853 /// mountPropagation determines how mounts are propagated from the host
7854 /// to container and the other way around.
7855 /// When not set, MountPropagationNone is used.
7856 /// This field is beta in 1.10.
7857 #[serde(default, skip_serializing_if = "Option::is_none", rename = "mountPropagation")]
7858 pub mount_propagation: Option<String>,
7859 /// This must match the Name of a Volume.
7860 pub name: String,
7861 /// Mounted read-only if true, read-write otherwise (false or unspecified).
7862 /// Defaults to false.
7863 #[serde(default, skip_serializing_if = "Option::is_none", rename = "readOnly")]
7864 pub read_only: Option<bool>,
7865 /// Path within the volume from which the container's volume should be mounted.
7866 /// Defaults to "" (volume's root).
7867 #[serde(default, skip_serializing_if = "Option::is_none", rename = "subPath")]
7868 pub sub_path: Option<String>,
7869 /// Expanded path within the volume from which the container's volume should be mounted.
7870 /// Behaves similarly to SubPath but environment variable references $(VAR_NAME) are expanded using the container's environment.
7871 /// Defaults to "" (volume's root).
7872 /// SubPathExpr and SubPath are mutually exclusive.
7873 #[serde(default, skip_serializing_if = "Option::is_none", rename = "subPathExpr")]
7874 pub sub_path_expr: Option<String>,
7875}
7876
7877/// Specifies the DNS parameters of a pod.
7878/// Parameters specified here will be merged to the generated DNS
7879/// configuration based on DNSPolicy.
7880#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
7881pub struct ComponentDefinitionRuntimeDnsConfig {
7882 /// A list of DNS name server IP addresses.
7883 /// This will be appended to the base nameservers generated from DNSPolicy.
7884 /// Duplicated nameservers will be removed.
7885 #[serde(default, skip_serializing_if = "Option::is_none")]
7886 pub nameservers: Option<Vec<String>>,
7887 /// A list of DNS resolver options.
7888 /// This will be merged with the base options generated from DNSPolicy.
7889 /// Duplicated entries will be removed. Resolution options given in Options
7890 /// will override those that appear in the base DNSPolicy.
7891 #[serde(default, skip_serializing_if = "Option::is_none")]
7892 pub options: Option<Vec<ComponentDefinitionRuntimeDnsConfigOptions>>,
7893 /// A list of DNS search domains for host-name lookup.
7894 /// This will be appended to the base search paths generated from DNSPolicy.
7895 /// Duplicated search paths will be removed.
7896 #[serde(default, skip_serializing_if = "Option::is_none")]
7897 pub searches: Option<Vec<String>>,
7898}
7899
7900/// PodDNSConfigOption defines DNS resolver options of a pod.
7901#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
7902pub struct ComponentDefinitionRuntimeDnsConfigOptions {
7903 /// Required.
7904 #[serde(default, skip_serializing_if = "Option::is_none")]
7905 pub name: Option<String>,
7906 #[serde(default, skip_serializing_if = "Option::is_none")]
7907 pub value: Option<String>,
7908}
7909
7910/// An EphemeralContainer is a temporary container that you may add to an existing Pod for
7911/// user-initiated activities such as debugging. Ephemeral containers have no resource or
7912/// scheduling guarantees, and they will not be restarted when they exit or when a Pod is
7913/// removed or restarted. The kubelet may evict a Pod if an ephemeral container causes the
7914/// Pod to exceed its resource allocation.
7915///
7916/// To add an ephemeral container, use the ephemeralcontainers subresource of an existing
7917/// Pod. Ephemeral containers may not be removed or restarted.
7918#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
7919pub struct ComponentDefinitionRuntimeEphemeralContainers {
7920 /// Arguments to the entrypoint.
7921 /// The image's CMD is used if this is not provided.
7922 /// Variable references $(VAR_NAME) are expanded using the container's environment. If a variable
7923 /// cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced
7924 /// to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" will
7925 /// produce the string literal "$(VAR_NAME)". Escaped references will never be expanded, regardless
7926 /// of whether the variable exists or not. Cannot be updated.
7927 /// More info: <https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell>
7928 #[serde(default, skip_serializing_if = "Option::is_none")]
7929 pub args: Option<Vec<String>>,
7930 /// Entrypoint array. Not executed within a shell.
7931 /// The image's ENTRYPOINT is used if this is not provided.
7932 /// Variable references $(VAR_NAME) are expanded using the container's environment. If a variable
7933 /// cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced
7934 /// to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" will
7935 /// produce the string literal "$(VAR_NAME)". Escaped references will never be expanded, regardless
7936 /// of whether the variable exists or not. Cannot be updated.
7937 /// More info: <https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell>
7938 #[serde(default, skip_serializing_if = "Option::is_none")]
7939 pub command: Option<Vec<String>>,
7940 /// List of environment variables to set in the container.
7941 /// Cannot be updated.
7942 #[serde(default, skip_serializing_if = "Option::is_none")]
7943 pub env: Option<Vec<ComponentDefinitionRuntimeEphemeralContainersEnv>>,
7944 /// List of sources to populate environment variables in the container.
7945 /// The keys defined within a source must be a C_IDENTIFIER. All invalid keys
7946 /// will be reported as an event when the container is starting. When a key exists in multiple
7947 /// sources, the value associated with the last source will take precedence.
7948 /// Values defined by an Env with a duplicate key will take precedence.
7949 /// Cannot be updated.
7950 #[serde(default, skip_serializing_if = "Option::is_none", rename = "envFrom")]
7951 pub env_from: Option<Vec<ComponentDefinitionRuntimeEphemeralContainersEnvFrom>>,
7952 /// Container image name.
7953 /// More info: <https://kubernetes.io/docs/concepts/containers/images>
7954 #[serde(default, skip_serializing_if = "Option::is_none")]
7955 pub image: Option<String>,
7956 /// Image pull policy.
7957 /// One of Always, Never, IfNotPresent.
7958 /// Defaults to Always if :latest tag is specified, or IfNotPresent otherwise.
7959 /// Cannot be updated.
7960 /// More info: <https://kubernetes.io/docs/concepts/containers/images#updating-images>
7961 #[serde(default, skip_serializing_if = "Option::is_none", rename = "imagePullPolicy")]
7962 pub image_pull_policy: Option<String>,
7963 /// Lifecycle is not allowed for ephemeral containers.
7964 #[serde(default, skip_serializing_if = "Option::is_none")]
7965 pub lifecycle: Option<ComponentDefinitionRuntimeEphemeralContainersLifecycle>,
7966 /// Probes are not allowed for ephemeral containers.
7967 #[serde(default, skip_serializing_if = "Option::is_none", rename = "livenessProbe")]
7968 pub liveness_probe: Option<ComponentDefinitionRuntimeEphemeralContainersLivenessProbe>,
7969 /// Name of the ephemeral container specified as a DNS_LABEL.
7970 /// This name must be unique among all containers, init containers and ephemeral containers.
7971 pub name: String,
7972 /// Ports are not allowed for ephemeral containers.
7973 #[serde(default, skip_serializing_if = "Option::is_none")]
7974 pub ports: Option<Vec<ComponentDefinitionRuntimeEphemeralContainersPorts>>,
7975 /// Probes are not allowed for ephemeral containers.
7976 #[serde(default, skip_serializing_if = "Option::is_none", rename = "readinessProbe")]
7977 pub readiness_probe: Option<ComponentDefinitionRuntimeEphemeralContainersReadinessProbe>,
7978 /// Resources resize policy for the container.
7979 #[serde(default, skip_serializing_if = "Option::is_none", rename = "resizePolicy")]
7980 pub resize_policy: Option<Vec<ComponentDefinitionRuntimeEphemeralContainersResizePolicy>>,
7981 /// Resources are not allowed for ephemeral containers. Ephemeral containers use spare resources
7982 /// already allocated to the pod.
7983 #[serde(default, skip_serializing_if = "Option::is_none")]
7984 pub resources: Option<ComponentDefinitionRuntimeEphemeralContainersResources>,
7985 /// Restart policy for the container to manage the restart behavior of each
7986 /// container within a pod.
7987 /// This may only be set for init containers. You cannot set this field on
7988 /// ephemeral containers.
7989 #[serde(default, skip_serializing_if = "Option::is_none", rename = "restartPolicy")]
7990 pub restart_policy: Option<String>,
7991 /// Optional: SecurityContext defines the security options the ephemeral container should be run with.
7992 /// If set, the fields of SecurityContext override the equivalent fields of PodSecurityContext.
7993 #[serde(default, skip_serializing_if = "Option::is_none", rename = "securityContext")]
7994 pub security_context: Option<ComponentDefinitionRuntimeEphemeralContainersSecurityContext>,
7995 /// Probes are not allowed for ephemeral containers.
7996 #[serde(default, skip_serializing_if = "Option::is_none", rename = "startupProbe")]
7997 pub startup_probe: Option<ComponentDefinitionRuntimeEphemeralContainersStartupProbe>,
7998 /// Whether this container should allocate a buffer for stdin in the container runtime. If this
7999 /// is not set, reads from stdin in the container will always result in EOF.
8000 /// Default is false.
8001 #[serde(default, skip_serializing_if = "Option::is_none")]
8002 pub stdin: Option<bool>,
8003 /// Whether the container runtime should close the stdin channel after it has been opened by
8004 /// a single attach. When stdin is true the stdin stream will remain open across multiple attach
8005 /// sessions. If stdinOnce is set to true, stdin is opened on container start, is empty until the
8006 /// first client attaches to stdin, and then remains open and accepts data until the client disconnects,
8007 /// at which time stdin is closed and remains closed until the container is restarted. If this
8008 /// flag is false, a container processes that reads from stdin will never receive an EOF.
8009 /// Default is false
8010 #[serde(default, skip_serializing_if = "Option::is_none", rename = "stdinOnce")]
8011 pub stdin_once: Option<bool>,
8012 /// If set, the name of the container from PodSpec that this ephemeral container targets.
8013 /// The ephemeral container will be run in the namespaces (IPC, PID, etc) of this container.
8014 /// If not set then the ephemeral container uses the namespaces configured in the Pod spec.
8015 ///
8016 /// The container runtime must implement support for this feature. If the runtime does not
8017 /// support namespace targeting then the result of setting this field is undefined.
8018 #[serde(default, skip_serializing_if = "Option::is_none", rename = "targetContainerName")]
8019 pub target_container_name: Option<String>,
8020 /// Optional: Path at which the file to which the container's termination message
8021 /// will be written is mounted into the container's filesystem.
8022 /// Message written is intended to be brief final status, such as an assertion failure message.
8023 /// Will be truncated by the node if greater than 4096 bytes. The total message length across
8024 /// all containers will be limited to 12kb.
8025 /// Defaults to /dev/termination-log.
8026 /// Cannot be updated.
8027 #[serde(default, skip_serializing_if = "Option::is_none", rename = "terminationMessagePath")]
8028 pub termination_message_path: Option<String>,
8029 /// Indicate how the termination message should be populated. File will use the contents of
8030 /// terminationMessagePath to populate the container status message on both success and failure.
8031 /// FallbackToLogsOnError will use the last chunk of container log output if the termination
8032 /// message file is empty and the container exited with an error.
8033 /// The log output is limited to 2048 bytes or 80 lines, whichever is smaller.
8034 /// Defaults to File.
8035 /// Cannot be updated.
8036 #[serde(default, skip_serializing_if = "Option::is_none", rename = "terminationMessagePolicy")]
8037 pub termination_message_policy: Option<String>,
8038 /// Whether this container should allocate a TTY for itself, also requires 'stdin' to be true.
8039 /// Default is false.
8040 #[serde(default, skip_serializing_if = "Option::is_none")]
8041 pub tty: Option<bool>,
8042 /// volumeDevices is the list of block devices to be used by the container.
8043 #[serde(default, skip_serializing_if = "Option::is_none", rename = "volumeDevices")]
8044 pub volume_devices: Option<Vec<ComponentDefinitionRuntimeEphemeralContainersVolumeDevices>>,
8045 /// Pod volumes to mount into the container's filesystem. Subpath mounts are not allowed for ephemeral containers.
8046 /// Cannot be updated.
8047 #[serde(default, skip_serializing_if = "Option::is_none", rename = "volumeMounts")]
8048 pub volume_mounts: Option<Vec<ComponentDefinitionRuntimeEphemeralContainersVolumeMounts>>,
8049 /// Container's working directory.
8050 /// If not specified, the container runtime's default will be used, which
8051 /// might be configured in the container image.
8052 /// Cannot be updated.
8053 #[serde(default, skip_serializing_if = "Option::is_none", rename = "workingDir")]
8054 pub working_dir: Option<String>,
8055}
8056
8057/// EnvVar represents an environment variable present in a Container.
8058#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
8059pub struct ComponentDefinitionRuntimeEphemeralContainersEnv {
8060 /// Name of the environment variable. Must be a C_IDENTIFIER.
8061 pub name: String,
8062 /// Variable references $(VAR_NAME) are expanded
8063 /// using the previously defined environment variables in the container and
8064 /// any service environment variables. If a variable cannot be resolved,
8065 /// the reference in the input string will be unchanged. Double $$ are reduced
8066 /// to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e.
8067 /// "$$(VAR_NAME)" will produce the string literal "$(VAR_NAME)".
8068 /// Escaped references will never be expanded, regardless of whether the variable
8069 /// exists or not.
8070 /// Defaults to "".
8071 #[serde(default, skip_serializing_if = "Option::is_none")]
8072 pub value: Option<String>,
8073 /// Source for the environment variable's value. Cannot be used if value is not empty.
8074 #[serde(default, skip_serializing_if = "Option::is_none", rename = "valueFrom")]
8075 pub value_from: Option<ComponentDefinitionRuntimeEphemeralContainersEnvValueFrom>,
8076}
8077
8078/// Source for the environment variable's value. Cannot be used if value is not empty.
8079#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
8080pub struct ComponentDefinitionRuntimeEphemeralContainersEnvValueFrom {
8081 /// Selects a key of a ConfigMap.
8082 #[serde(default, skip_serializing_if = "Option::is_none", rename = "configMapKeyRef")]
8083 pub config_map_key_ref: Option<ComponentDefinitionRuntimeEphemeralContainersEnvValueFromConfigMapKeyRef>,
8084 /// Selects a field of the pod: supports metadata.name, metadata.namespace, `metadata.labels['<KEY>']`, `metadata.annotations['<KEY>']`,
8085 /// spec.nodeName, spec.serviceAccountName, status.hostIP, status.podIP, status.podIPs.
8086 #[serde(default, skip_serializing_if = "Option::is_none", rename = "fieldRef")]
8087 pub field_ref: Option<ComponentDefinitionRuntimeEphemeralContainersEnvValueFromFieldRef>,
8088 /// Selects a resource of the container: only resources limits and requests
8089 /// (limits.cpu, limits.memory, limits.ephemeral-storage, requests.cpu, requests.memory and requests.ephemeral-storage) are currently supported.
8090 #[serde(default, skip_serializing_if = "Option::is_none", rename = "resourceFieldRef")]
8091 pub resource_field_ref: Option<ComponentDefinitionRuntimeEphemeralContainersEnvValueFromResourceFieldRef>,
8092 /// Selects a key of a secret in the pod's namespace
8093 #[serde(default, skip_serializing_if = "Option::is_none", rename = "secretKeyRef")]
8094 pub secret_key_ref: Option<ComponentDefinitionRuntimeEphemeralContainersEnvValueFromSecretKeyRef>,
8095}
8096
8097/// Selects a key of a ConfigMap.
8098#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
8099pub struct ComponentDefinitionRuntimeEphemeralContainersEnvValueFromConfigMapKeyRef {
8100 /// The key to select.
8101 pub key: String,
8102 /// Name of the referent.
8103 /// More info: <https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names>
8104 #[serde(default, skip_serializing_if = "Option::is_none")]
8105 pub name: Option<String>,
8106 /// Specify whether the ConfigMap or its key must be defined
8107 #[serde(default, skip_serializing_if = "Option::is_none")]
8108 pub optional: Option<bool>,
8109}
8110
8111/// Selects a field of the pod: supports metadata.name, metadata.namespace, `metadata.labels['<KEY>']`, `metadata.annotations['<KEY>']`,
8112/// spec.nodeName, spec.serviceAccountName, status.hostIP, status.podIP, status.podIPs.
8113#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
8114pub struct ComponentDefinitionRuntimeEphemeralContainersEnvValueFromFieldRef {
8115 /// Version of the schema the FieldPath is written in terms of, defaults to "v1".
8116 #[serde(default, skip_serializing_if = "Option::is_none", rename = "apiVersion")]
8117 pub api_version: Option<String>,
8118 /// Path of the field to select in the specified API version.
8119 #[serde(rename = "fieldPath")]
8120 pub field_path: String,
8121}
8122
8123/// Selects a resource of the container: only resources limits and requests
8124/// (limits.cpu, limits.memory, limits.ephemeral-storage, requests.cpu, requests.memory and requests.ephemeral-storage) are currently supported.
8125#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
8126pub struct ComponentDefinitionRuntimeEphemeralContainersEnvValueFromResourceFieldRef {
8127 /// Container name: required for volumes, optional for env vars
8128 #[serde(default, skip_serializing_if = "Option::is_none", rename = "containerName")]
8129 pub container_name: Option<String>,
8130 /// Specifies the output format of the exposed resources, defaults to "1"
8131 #[serde(default, skip_serializing_if = "Option::is_none")]
8132 pub divisor: Option<IntOrString>,
8133 /// Required: resource to select
8134 pub resource: String,
8135}
8136
8137/// Selects a key of a secret in the pod's namespace
8138#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
8139pub struct ComponentDefinitionRuntimeEphemeralContainersEnvValueFromSecretKeyRef {
8140 /// The key of the secret to select from. Must be a valid secret key.
8141 pub key: String,
8142 /// Name of the referent.
8143 /// More info: <https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names>
8144 #[serde(default, skip_serializing_if = "Option::is_none")]
8145 pub name: Option<String>,
8146 /// Specify whether the Secret or its key must be defined
8147 #[serde(default, skip_serializing_if = "Option::is_none")]
8148 pub optional: Option<bool>,
8149}
8150
8151/// EnvFromSource represents the source of a set of ConfigMaps
8152#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
8153pub struct ComponentDefinitionRuntimeEphemeralContainersEnvFrom {
8154 /// The ConfigMap to select from
8155 #[serde(default, skip_serializing_if = "Option::is_none", rename = "configMapRef")]
8156 pub config_map_ref: Option<ComponentDefinitionRuntimeEphemeralContainersEnvFromConfigMapRef>,
8157 /// An optional identifier to prepend to each key in the ConfigMap. Must be a C_IDENTIFIER.
8158 #[serde(default, skip_serializing_if = "Option::is_none")]
8159 pub prefix: Option<String>,
8160 /// The Secret to select from
8161 #[serde(default, skip_serializing_if = "Option::is_none", rename = "secretRef")]
8162 pub secret_ref: Option<ComponentDefinitionRuntimeEphemeralContainersEnvFromSecretRef>,
8163}
8164
8165/// The ConfigMap to select from
8166#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
8167pub struct ComponentDefinitionRuntimeEphemeralContainersEnvFromConfigMapRef {
8168 /// Name of the referent.
8169 /// More info: <https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names>
8170 #[serde(default, skip_serializing_if = "Option::is_none")]
8171 pub name: Option<String>,
8172 /// Specify whether the ConfigMap must be defined
8173 #[serde(default, skip_serializing_if = "Option::is_none")]
8174 pub optional: Option<bool>,
8175}
8176
8177/// The Secret to select from
8178#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
8179pub struct ComponentDefinitionRuntimeEphemeralContainersEnvFromSecretRef {
8180 /// Name of the referent.
8181 /// More info: <https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names>
8182 #[serde(default, skip_serializing_if = "Option::is_none")]
8183 pub name: Option<String>,
8184 /// Specify whether the Secret must be defined
8185 #[serde(default, skip_serializing_if = "Option::is_none")]
8186 pub optional: Option<bool>,
8187}
8188
8189/// Lifecycle is not allowed for ephemeral containers.
8190#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
8191pub struct ComponentDefinitionRuntimeEphemeralContainersLifecycle {
8192 /// PostStart is called immediately after a container is created. If the handler fails,
8193 /// the container is terminated and restarted according to its restart policy.
8194 /// Other management of the container blocks until the hook completes.
8195 /// More info: <https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks>
8196 #[serde(default, skip_serializing_if = "Option::is_none", rename = "postStart")]
8197 pub post_start: Option<ComponentDefinitionRuntimeEphemeralContainersLifecyclePostStart>,
8198 /// PreStop is called immediately before a container is terminated due to an
8199 /// API request or management event such as liveness/startup probe failure,
8200 /// preemption, resource contention, etc. The handler is not called if the
8201 /// container crashes or exits. The Pod's termination grace period countdown begins before the
8202 /// PreStop hook is executed. Regardless of the outcome of the handler, the
8203 /// container will eventually terminate within the Pod's termination grace
8204 /// period (unless delayed by finalizers). Other management of the container blocks until the hook completes
8205 /// or until the termination grace period is reached.
8206 /// More info: <https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks>
8207 #[serde(default, skip_serializing_if = "Option::is_none", rename = "preStop")]
8208 pub pre_stop: Option<ComponentDefinitionRuntimeEphemeralContainersLifecyclePreStop>,
8209}
8210
8211/// PostStart is called immediately after a container is created. If the handler fails,
8212/// the container is terminated and restarted according to its restart policy.
8213/// Other management of the container blocks until the hook completes.
8214/// More info: <https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks>
8215#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
8216pub struct ComponentDefinitionRuntimeEphemeralContainersLifecyclePostStart {
8217 /// Exec specifies the action to take.
8218 #[serde(default, skip_serializing_if = "Option::is_none")]
8219 pub exec: Option<ComponentDefinitionRuntimeEphemeralContainersLifecyclePostStartExec>,
8220 /// HTTPGet specifies the http request to perform.
8221 #[serde(default, skip_serializing_if = "Option::is_none", rename = "httpGet")]
8222 pub http_get: Option<ComponentDefinitionRuntimeEphemeralContainersLifecyclePostStartHttpGet>,
8223 /// Sleep represents the duration that the container should sleep before being terminated.
8224 #[serde(default, skip_serializing_if = "Option::is_none")]
8225 pub sleep: Option<ComponentDefinitionRuntimeEphemeralContainersLifecyclePostStartSleep>,
8226 /// Deprecated. TCPSocket is NOT supported as a LifecycleHandler and kept
8227 /// for the backward compatibility. There are no validation of this field and
8228 /// lifecycle hooks will fail in runtime when tcp handler is specified.
8229 #[serde(default, skip_serializing_if = "Option::is_none", rename = "tcpSocket")]
8230 pub tcp_socket: Option<ComponentDefinitionRuntimeEphemeralContainersLifecyclePostStartTcpSocket>,
8231}
8232
8233/// Exec specifies the action to take.
8234#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
8235pub struct ComponentDefinitionRuntimeEphemeralContainersLifecyclePostStartExec {
8236 /// Command is the command line to execute inside the container, the working directory for the
8237 /// command is root ('/') in the container's filesystem. The command is simply exec'd, it is
8238 /// not run inside a shell, so traditional shell instructions ('|', etc) won't work. To use
8239 /// a shell, you need to explicitly call out to that shell.
8240 /// Exit status of 0 is treated as live/healthy and non-zero is unhealthy.
8241 #[serde(default, skip_serializing_if = "Option::is_none")]
8242 pub command: Option<Vec<String>>,
8243}
8244
8245/// HTTPGet specifies the http request to perform.
8246#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
8247pub struct ComponentDefinitionRuntimeEphemeralContainersLifecyclePostStartHttpGet {
8248 /// Host name to connect to, defaults to the pod IP. You probably want to set
8249 /// "Host" in httpHeaders instead.
8250 #[serde(default, skip_serializing_if = "Option::is_none")]
8251 pub host: Option<String>,
8252 /// Custom headers to set in the request. HTTP allows repeated headers.
8253 #[serde(default, skip_serializing_if = "Option::is_none", rename = "httpHeaders")]
8254 pub http_headers: Option<Vec<ComponentDefinitionRuntimeEphemeralContainersLifecyclePostStartHttpGetHttpHeaders>>,
8255 /// Path to access on the HTTP server.
8256 #[serde(default, skip_serializing_if = "Option::is_none")]
8257 pub path: Option<String>,
8258 /// Name or number of the port to access on the container.
8259 /// Number must be in the range 1 to 65535.
8260 /// Name must be an IANA_SVC_NAME.
8261 pub port: IntOrString,
8262 /// Scheme to use for connecting to the host.
8263 /// Defaults to HTTP.
8264 #[serde(default, skip_serializing_if = "Option::is_none")]
8265 pub scheme: Option<String>,
8266}
8267
8268/// HTTPHeader describes a custom header to be used in HTTP probes
8269#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
8270pub struct ComponentDefinitionRuntimeEphemeralContainersLifecyclePostStartHttpGetHttpHeaders {
8271 /// The header field name.
8272 /// This will be canonicalized upon output, so case-variant names will be understood as the same header.
8273 pub name: String,
8274 /// The header field value
8275 pub value: String,
8276}
8277
8278/// Sleep represents the duration that the container should sleep before being terminated.
8279#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
8280pub struct ComponentDefinitionRuntimeEphemeralContainersLifecyclePostStartSleep {
8281 /// Seconds is the number of seconds to sleep.
8282 pub seconds: i64,
8283}
8284
8285/// Deprecated. TCPSocket is NOT supported as a LifecycleHandler and kept
8286/// for the backward compatibility. There are no validation of this field and
8287/// lifecycle hooks will fail in runtime when tcp handler is specified.
8288#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
8289pub struct ComponentDefinitionRuntimeEphemeralContainersLifecyclePostStartTcpSocket {
8290 /// Optional: Host name to connect to, defaults to the pod IP.
8291 #[serde(default, skip_serializing_if = "Option::is_none")]
8292 pub host: Option<String>,
8293 /// Number or name of the port to access on the container.
8294 /// Number must be in the range 1 to 65535.
8295 /// Name must be an IANA_SVC_NAME.
8296 pub port: IntOrString,
8297}
8298
8299/// PreStop is called immediately before a container is terminated due to an
8300/// API request or management event such as liveness/startup probe failure,
8301/// preemption, resource contention, etc. The handler is not called if the
8302/// container crashes or exits. The Pod's termination grace period countdown begins before the
8303/// PreStop hook is executed. Regardless of the outcome of the handler, the
8304/// container will eventually terminate within the Pod's termination grace
8305/// period (unless delayed by finalizers). Other management of the container blocks until the hook completes
8306/// or until the termination grace period is reached.
8307/// More info: <https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks>
8308#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
8309pub struct ComponentDefinitionRuntimeEphemeralContainersLifecyclePreStop {
8310 /// Exec specifies the action to take.
8311 #[serde(default, skip_serializing_if = "Option::is_none")]
8312 pub exec: Option<ComponentDefinitionRuntimeEphemeralContainersLifecyclePreStopExec>,
8313 /// HTTPGet specifies the http request to perform.
8314 #[serde(default, skip_serializing_if = "Option::is_none", rename = "httpGet")]
8315 pub http_get: Option<ComponentDefinitionRuntimeEphemeralContainersLifecyclePreStopHttpGet>,
8316 /// Sleep represents the duration that the container should sleep before being terminated.
8317 #[serde(default, skip_serializing_if = "Option::is_none")]
8318 pub sleep: Option<ComponentDefinitionRuntimeEphemeralContainersLifecyclePreStopSleep>,
8319 /// Deprecated. TCPSocket is NOT supported as a LifecycleHandler and kept
8320 /// for the backward compatibility. There are no validation of this field and
8321 /// lifecycle hooks will fail in runtime when tcp handler is specified.
8322 #[serde(default, skip_serializing_if = "Option::is_none", rename = "tcpSocket")]
8323 pub tcp_socket: Option<ComponentDefinitionRuntimeEphemeralContainersLifecyclePreStopTcpSocket>,
8324}
8325
8326/// Exec specifies the action to take.
8327#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
8328pub struct ComponentDefinitionRuntimeEphemeralContainersLifecyclePreStopExec {
8329 /// Command is the command line to execute inside the container, the working directory for the
8330 /// command is root ('/') in the container's filesystem. The command is simply exec'd, it is
8331 /// not run inside a shell, so traditional shell instructions ('|', etc) won't work. To use
8332 /// a shell, you need to explicitly call out to that shell.
8333 /// Exit status of 0 is treated as live/healthy and non-zero is unhealthy.
8334 #[serde(default, skip_serializing_if = "Option::is_none")]
8335 pub command: Option<Vec<String>>,
8336}
8337
8338/// HTTPGet specifies the http request to perform.
8339#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
8340pub struct ComponentDefinitionRuntimeEphemeralContainersLifecyclePreStopHttpGet {
8341 /// Host name to connect to, defaults to the pod IP. You probably want to set
8342 /// "Host" in httpHeaders instead.
8343 #[serde(default, skip_serializing_if = "Option::is_none")]
8344 pub host: Option<String>,
8345 /// Custom headers to set in the request. HTTP allows repeated headers.
8346 #[serde(default, skip_serializing_if = "Option::is_none", rename = "httpHeaders")]
8347 pub http_headers: Option<Vec<ComponentDefinitionRuntimeEphemeralContainersLifecyclePreStopHttpGetHttpHeaders>>,
8348 /// Path to access on the HTTP server.
8349 #[serde(default, skip_serializing_if = "Option::is_none")]
8350 pub path: Option<String>,
8351 /// Name or number of the port to access on the container.
8352 /// Number must be in the range 1 to 65535.
8353 /// Name must be an IANA_SVC_NAME.
8354 pub port: IntOrString,
8355 /// Scheme to use for connecting to the host.
8356 /// Defaults to HTTP.
8357 #[serde(default, skip_serializing_if = "Option::is_none")]
8358 pub scheme: Option<String>,
8359}
8360
8361/// HTTPHeader describes a custom header to be used in HTTP probes
8362#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
8363pub struct ComponentDefinitionRuntimeEphemeralContainersLifecyclePreStopHttpGetHttpHeaders {
8364 /// The header field name.
8365 /// This will be canonicalized upon output, so case-variant names will be understood as the same header.
8366 pub name: String,
8367 /// The header field value
8368 pub value: String,
8369}
8370
8371/// Sleep represents the duration that the container should sleep before being terminated.
8372#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
8373pub struct ComponentDefinitionRuntimeEphemeralContainersLifecyclePreStopSleep {
8374 /// Seconds is the number of seconds to sleep.
8375 pub seconds: i64,
8376}
8377
8378/// Deprecated. TCPSocket is NOT supported as a LifecycleHandler and kept
8379/// for the backward compatibility. There are no validation of this field and
8380/// lifecycle hooks will fail in runtime when tcp handler is specified.
8381#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
8382pub struct ComponentDefinitionRuntimeEphemeralContainersLifecyclePreStopTcpSocket {
8383 /// Optional: Host name to connect to, defaults to the pod IP.
8384 #[serde(default, skip_serializing_if = "Option::is_none")]
8385 pub host: Option<String>,
8386 /// Number or name of the port to access on the container.
8387 /// Number must be in the range 1 to 65535.
8388 /// Name must be an IANA_SVC_NAME.
8389 pub port: IntOrString,
8390}
8391
8392/// Probes are not allowed for ephemeral containers.
8393#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
8394pub struct ComponentDefinitionRuntimeEphemeralContainersLivenessProbe {
8395 /// Exec specifies the action to take.
8396 #[serde(default, skip_serializing_if = "Option::is_none")]
8397 pub exec: Option<ComponentDefinitionRuntimeEphemeralContainersLivenessProbeExec>,
8398 /// Minimum consecutive failures for the probe to be considered failed after having succeeded.
8399 /// Defaults to 3. Minimum value is 1.
8400 #[serde(default, skip_serializing_if = "Option::is_none", rename = "failureThreshold")]
8401 pub failure_threshold: Option<i32>,
8402 /// GRPC specifies an action involving a GRPC port.
8403 #[serde(default, skip_serializing_if = "Option::is_none")]
8404 pub grpc: Option<ComponentDefinitionRuntimeEphemeralContainersLivenessProbeGrpc>,
8405 /// HTTPGet specifies the http request to perform.
8406 #[serde(default, skip_serializing_if = "Option::is_none", rename = "httpGet")]
8407 pub http_get: Option<ComponentDefinitionRuntimeEphemeralContainersLivenessProbeHttpGet>,
8408 /// Number of seconds after the container has started before liveness probes are initiated.
8409 /// More info: <https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes>
8410 #[serde(default, skip_serializing_if = "Option::is_none", rename = "initialDelaySeconds")]
8411 pub initial_delay_seconds: Option<i32>,
8412 /// How often (in seconds) to perform the probe.
8413 /// Default to 10 seconds. Minimum value is 1.
8414 #[serde(default, skip_serializing_if = "Option::is_none", rename = "periodSeconds")]
8415 pub period_seconds: Option<i32>,
8416 /// Minimum consecutive successes for the probe to be considered successful after having failed.
8417 /// Defaults to 1. Must be 1 for liveness and startup. Minimum value is 1.
8418 #[serde(default, skip_serializing_if = "Option::is_none", rename = "successThreshold")]
8419 pub success_threshold: Option<i32>,
8420 /// TCPSocket specifies an action involving a TCP port.
8421 #[serde(default, skip_serializing_if = "Option::is_none", rename = "tcpSocket")]
8422 pub tcp_socket: Option<ComponentDefinitionRuntimeEphemeralContainersLivenessProbeTcpSocket>,
8423 /// Optional duration in seconds the pod needs to terminate gracefully upon probe failure.
8424 /// The grace period is the duration in seconds after the processes running in the pod are sent
8425 /// a termination signal and the time when the processes are forcibly halted with a kill signal.
8426 /// Set this value longer than the expected cleanup time for your process.
8427 /// If this value is nil, the pod's terminationGracePeriodSeconds will be used. Otherwise, this
8428 /// value overrides the value provided by the pod spec.
8429 /// Value must be non-negative integer. The value zero indicates stop immediately via
8430 /// the kill signal (no opportunity to shut down).
8431 /// This is a beta field and requires enabling ProbeTerminationGracePeriod feature gate.
8432 /// Minimum value is 1. spec.terminationGracePeriodSeconds is used if unset.
8433 #[serde(default, skip_serializing_if = "Option::is_none", rename = "terminationGracePeriodSeconds")]
8434 pub termination_grace_period_seconds: Option<i64>,
8435 /// Number of seconds after which the probe times out.
8436 /// Defaults to 1 second. Minimum value is 1.
8437 /// More info: <https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes>
8438 #[serde(default, skip_serializing_if = "Option::is_none", rename = "timeoutSeconds")]
8439 pub timeout_seconds: Option<i32>,
8440}
8441
8442/// Exec specifies the action to take.
8443#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
8444pub struct ComponentDefinitionRuntimeEphemeralContainersLivenessProbeExec {
8445 /// Command is the command line to execute inside the container, the working directory for the
8446 /// command is root ('/') in the container's filesystem. The command is simply exec'd, it is
8447 /// not run inside a shell, so traditional shell instructions ('|', etc) won't work. To use
8448 /// a shell, you need to explicitly call out to that shell.
8449 /// Exit status of 0 is treated as live/healthy and non-zero is unhealthy.
8450 #[serde(default, skip_serializing_if = "Option::is_none")]
8451 pub command: Option<Vec<String>>,
8452}
8453
8454/// GRPC specifies an action involving a GRPC port.
8455#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
8456pub struct ComponentDefinitionRuntimeEphemeralContainersLivenessProbeGrpc {
8457 /// Port number of the gRPC service. Number must be in the range 1 to 65535.
8458 pub port: i32,
8459 /// Service is the name of the service to place in the gRPC HealthCheckRequest
8460 /// (see <https://github.com/grpc/grpc/blob/master/doc/health-checking.md).>
8461 ///
8462 /// If this is not specified, the default behavior is defined by gRPC.
8463 #[serde(default, skip_serializing_if = "Option::is_none")]
8464 pub service: Option<String>,
8465}
8466
8467/// HTTPGet specifies the http request to perform.
8468#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
8469pub struct ComponentDefinitionRuntimeEphemeralContainersLivenessProbeHttpGet {
8470 /// Host name to connect to, defaults to the pod IP. You probably want to set
8471 /// "Host" in httpHeaders instead.
8472 #[serde(default, skip_serializing_if = "Option::is_none")]
8473 pub host: Option<String>,
8474 /// Custom headers to set in the request. HTTP allows repeated headers.
8475 #[serde(default, skip_serializing_if = "Option::is_none", rename = "httpHeaders")]
8476 pub http_headers: Option<Vec<ComponentDefinitionRuntimeEphemeralContainersLivenessProbeHttpGetHttpHeaders>>,
8477 /// Path to access on the HTTP server.
8478 #[serde(default, skip_serializing_if = "Option::is_none")]
8479 pub path: Option<String>,
8480 /// Name or number of the port to access on the container.
8481 /// Number must be in the range 1 to 65535.
8482 /// Name must be an IANA_SVC_NAME.
8483 pub port: IntOrString,
8484 /// Scheme to use for connecting to the host.
8485 /// Defaults to HTTP.
8486 #[serde(default, skip_serializing_if = "Option::is_none")]
8487 pub scheme: Option<String>,
8488}
8489
8490/// HTTPHeader describes a custom header to be used in HTTP probes
8491#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
8492pub struct ComponentDefinitionRuntimeEphemeralContainersLivenessProbeHttpGetHttpHeaders {
8493 /// The header field name.
8494 /// This will be canonicalized upon output, so case-variant names will be understood as the same header.
8495 pub name: String,
8496 /// The header field value
8497 pub value: String,
8498}
8499
8500/// TCPSocket specifies an action involving a TCP port.
8501#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
8502pub struct ComponentDefinitionRuntimeEphemeralContainersLivenessProbeTcpSocket {
8503 /// Optional: Host name to connect to, defaults to the pod IP.
8504 #[serde(default, skip_serializing_if = "Option::is_none")]
8505 pub host: Option<String>,
8506 /// Number or name of the port to access on the container.
8507 /// Number must be in the range 1 to 65535.
8508 /// Name must be an IANA_SVC_NAME.
8509 pub port: IntOrString,
8510}
8511
8512/// ContainerPort represents a network port in a single container.
8513#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
8514pub struct ComponentDefinitionRuntimeEphemeralContainersPorts {
8515 /// Number of port to expose on the pod's IP address.
8516 /// This must be a valid port number, 0 < x < 65536.
8517 #[serde(rename = "containerPort")]
8518 pub container_port: i32,
8519 /// What host IP to bind the external port to.
8520 #[serde(default, skip_serializing_if = "Option::is_none", rename = "hostIP")]
8521 pub host_ip: Option<String>,
8522 /// Number of port to expose on the host.
8523 /// If specified, this must be a valid port number, 0 < x < 65536.
8524 /// If HostNetwork is specified, this must match ContainerPort.
8525 /// Most containers do not need this.
8526 #[serde(default, skip_serializing_if = "Option::is_none", rename = "hostPort")]
8527 pub host_port: Option<i32>,
8528 /// If specified, this must be an IANA_SVC_NAME and unique within the pod. Each
8529 /// named port in a pod must have a unique name. Name for the port that can be
8530 /// referred to by services.
8531 #[serde(default, skip_serializing_if = "Option::is_none")]
8532 pub name: Option<String>,
8533 /// Protocol for port. Must be UDP, TCP, or SCTP.
8534 /// Defaults to "TCP".
8535 #[serde(default, skip_serializing_if = "Option::is_none")]
8536 pub protocol: Option<String>,
8537}
8538
8539/// Probes are not allowed for ephemeral containers.
8540#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
8541pub struct ComponentDefinitionRuntimeEphemeralContainersReadinessProbe {
8542 /// Exec specifies the action to take.
8543 #[serde(default, skip_serializing_if = "Option::is_none")]
8544 pub exec: Option<ComponentDefinitionRuntimeEphemeralContainersReadinessProbeExec>,
8545 /// Minimum consecutive failures for the probe to be considered failed after having succeeded.
8546 /// Defaults to 3. Minimum value is 1.
8547 #[serde(default, skip_serializing_if = "Option::is_none", rename = "failureThreshold")]
8548 pub failure_threshold: Option<i32>,
8549 /// GRPC specifies an action involving a GRPC port.
8550 #[serde(default, skip_serializing_if = "Option::is_none")]
8551 pub grpc: Option<ComponentDefinitionRuntimeEphemeralContainersReadinessProbeGrpc>,
8552 /// HTTPGet specifies the http request to perform.
8553 #[serde(default, skip_serializing_if = "Option::is_none", rename = "httpGet")]
8554 pub http_get: Option<ComponentDefinitionRuntimeEphemeralContainersReadinessProbeHttpGet>,
8555 /// Number of seconds after the container has started before liveness probes are initiated.
8556 /// More info: <https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes>
8557 #[serde(default, skip_serializing_if = "Option::is_none", rename = "initialDelaySeconds")]
8558 pub initial_delay_seconds: Option<i32>,
8559 /// How often (in seconds) to perform the probe.
8560 /// Default to 10 seconds. Minimum value is 1.
8561 #[serde(default, skip_serializing_if = "Option::is_none", rename = "periodSeconds")]
8562 pub period_seconds: Option<i32>,
8563 /// Minimum consecutive successes for the probe to be considered successful after having failed.
8564 /// Defaults to 1. Must be 1 for liveness and startup. Minimum value is 1.
8565 #[serde(default, skip_serializing_if = "Option::is_none", rename = "successThreshold")]
8566 pub success_threshold: Option<i32>,
8567 /// TCPSocket specifies an action involving a TCP port.
8568 #[serde(default, skip_serializing_if = "Option::is_none", rename = "tcpSocket")]
8569 pub tcp_socket: Option<ComponentDefinitionRuntimeEphemeralContainersReadinessProbeTcpSocket>,
8570 /// Optional duration in seconds the pod needs to terminate gracefully upon probe failure.
8571 /// The grace period is the duration in seconds after the processes running in the pod are sent
8572 /// a termination signal and the time when the processes are forcibly halted with a kill signal.
8573 /// Set this value longer than the expected cleanup time for your process.
8574 /// If this value is nil, the pod's terminationGracePeriodSeconds will be used. Otherwise, this
8575 /// value overrides the value provided by the pod spec.
8576 /// Value must be non-negative integer. The value zero indicates stop immediately via
8577 /// the kill signal (no opportunity to shut down).
8578 /// This is a beta field and requires enabling ProbeTerminationGracePeriod feature gate.
8579 /// Minimum value is 1. spec.terminationGracePeriodSeconds is used if unset.
8580 #[serde(default, skip_serializing_if = "Option::is_none", rename = "terminationGracePeriodSeconds")]
8581 pub termination_grace_period_seconds: Option<i64>,
8582 /// Number of seconds after which the probe times out.
8583 /// Defaults to 1 second. Minimum value is 1.
8584 /// More info: <https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes>
8585 #[serde(default, skip_serializing_if = "Option::is_none", rename = "timeoutSeconds")]
8586 pub timeout_seconds: Option<i32>,
8587}
8588
8589/// Exec specifies the action to take.
8590#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
8591pub struct ComponentDefinitionRuntimeEphemeralContainersReadinessProbeExec {
8592 /// Command is the command line to execute inside the container, the working directory for the
8593 /// command is root ('/') in the container's filesystem. The command is simply exec'd, it is
8594 /// not run inside a shell, so traditional shell instructions ('|', etc) won't work. To use
8595 /// a shell, you need to explicitly call out to that shell.
8596 /// Exit status of 0 is treated as live/healthy and non-zero is unhealthy.
8597 #[serde(default, skip_serializing_if = "Option::is_none")]
8598 pub command: Option<Vec<String>>,
8599}
8600
8601/// GRPC specifies an action involving a GRPC port.
8602#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
8603pub struct ComponentDefinitionRuntimeEphemeralContainersReadinessProbeGrpc {
8604 /// Port number of the gRPC service. Number must be in the range 1 to 65535.
8605 pub port: i32,
8606 /// Service is the name of the service to place in the gRPC HealthCheckRequest
8607 /// (see <https://github.com/grpc/grpc/blob/master/doc/health-checking.md).>
8608 ///
8609 /// If this is not specified, the default behavior is defined by gRPC.
8610 #[serde(default, skip_serializing_if = "Option::is_none")]
8611 pub service: Option<String>,
8612}
8613
8614/// HTTPGet specifies the http request to perform.
8615#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
8616pub struct ComponentDefinitionRuntimeEphemeralContainersReadinessProbeHttpGet {
8617 /// Host name to connect to, defaults to the pod IP. You probably want to set
8618 /// "Host" in httpHeaders instead.
8619 #[serde(default, skip_serializing_if = "Option::is_none")]
8620 pub host: Option<String>,
8621 /// Custom headers to set in the request. HTTP allows repeated headers.
8622 #[serde(default, skip_serializing_if = "Option::is_none", rename = "httpHeaders")]
8623 pub http_headers: Option<Vec<ComponentDefinitionRuntimeEphemeralContainersReadinessProbeHttpGetHttpHeaders>>,
8624 /// Path to access on the HTTP server.
8625 #[serde(default, skip_serializing_if = "Option::is_none")]
8626 pub path: Option<String>,
8627 /// Name or number of the port to access on the container.
8628 /// Number must be in the range 1 to 65535.
8629 /// Name must be an IANA_SVC_NAME.
8630 pub port: IntOrString,
8631 /// Scheme to use for connecting to the host.
8632 /// Defaults to HTTP.
8633 #[serde(default, skip_serializing_if = "Option::is_none")]
8634 pub scheme: Option<String>,
8635}
8636
8637/// HTTPHeader describes a custom header to be used in HTTP probes
8638#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
8639pub struct ComponentDefinitionRuntimeEphemeralContainersReadinessProbeHttpGetHttpHeaders {
8640 /// The header field name.
8641 /// This will be canonicalized upon output, so case-variant names will be understood as the same header.
8642 pub name: String,
8643 /// The header field value
8644 pub value: String,
8645}
8646
8647/// TCPSocket specifies an action involving a TCP port.
8648#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
8649pub struct ComponentDefinitionRuntimeEphemeralContainersReadinessProbeTcpSocket {
8650 /// Optional: Host name to connect to, defaults to the pod IP.
8651 #[serde(default, skip_serializing_if = "Option::is_none")]
8652 pub host: Option<String>,
8653 /// Number or name of the port to access on the container.
8654 /// Number must be in the range 1 to 65535.
8655 /// Name must be an IANA_SVC_NAME.
8656 pub port: IntOrString,
8657}
8658
8659/// ContainerResizePolicy represents resource resize policy for the container.
8660#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
8661pub struct ComponentDefinitionRuntimeEphemeralContainersResizePolicy {
8662 /// Name of the resource to which this resource resize policy applies.
8663 /// Supported values: cpu, memory.
8664 #[serde(rename = "resourceName")]
8665 pub resource_name: String,
8666 /// Restart policy to apply when specified resource is resized.
8667 /// If not specified, it defaults to NotRequired.
8668 #[serde(rename = "restartPolicy")]
8669 pub restart_policy: String,
8670}
8671
8672/// Resources are not allowed for ephemeral containers. Ephemeral containers use spare resources
8673/// already allocated to the pod.
8674#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
8675pub struct ComponentDefinitionRuntimeEphemeralContainersResources {
8676 /// Claims lists the names of resources, defined in spec.resourceClaims,
8677 /// that are used by this container.
8678 ///
8679 /// This is an alpha field and requires enabling the
8680 /// DynamicResourceAllocation feature gate.
8681 ///
8682 /// This field is immutable. It can only be set for containers.
8683 #[serde(default, skip_serializing_if = "Option::is_none")]
8684 pub claims: Option<Vec<ComponentDefinitionRuntimeEphemeralContainersResourcesClaims>>,
8685 /// Limits describes the maximum amount of compute resources allowed.
8686 /// More info: <https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/>
8687 #[serde(default, skip_serializing_if = "Option::is_none")]
8688 pub limits: Option<BTreeMap<String, IntOrString>>,
8689 /// Requests describes the minimum amount of compute resources required.
8690 /// If Requests is omitted for a container, it defaults to Limits if that is explicitly specified,
8691 /// otherwise to an implementation-defined value. Requests cannot exceed Limits.
8692 /// More info: <https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/>
8693 #[serde(default, skip_serializing_if = "Option::is_none")]
8694 pub requests: Option<BTreeMap<String, IntOrString>>,
8695}
8696
8697/// ResourceClaim references one entry in PodSpec.ResourceClaims.
8698#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
8699pub struct ComponentDefinitionRuntimeEphemeralContainersResourcesClaims {
8700 /// Name must match the name of one entry in pod.spec.resourceClaims of
8701 /// the Pod where this field is used. It makes that resource available
8702 /// inside a container.
8703 pub name: String,
8704}
8705
8706/// Optional: SecurityContext defines the security options the ephemeral container should be run with.
8707/// If set, the fields of SecurityContext override the equivalent fields of PodSecurityContext.
8708#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
8709pub struct ComponentDefinitionRuntimeEphemeralContainersSecurityContext {
8710 /// AllowPrivilegeEscalation controls whether a process can gain more
8711 /// privileges than its parent process. This bool directly controls if
8712 /// the no_new_privs flag will be set on the container process.
8713 /// AllowPrivilegeEscalation is true always when the container is:
8714 /// 1) run as Privileged
8715 /// 2) has CAP_SYS_ADMIN
8716 /// Note that this field cannot be set when spec.os.name is windows.
8717 #[serde(default, skip_serializing_if = "Option::is_none", rename = "allowPrivilegeEscalation")]
8718 pub allow_privilege_escalation: Option<bool>,
8719 /// The capabilities to add/drop when running containers.
8720 /// Defaults to the default set of capabilities granted by the container runtime.
8721 /// Note that this field cannot be set when spec.os.name is windows.
8722 #[serde(default, skip_serializing_if = "Option::is_none")]
8723 pub capabilities: Option<ComponentDefinitionRuntimeEphemeralContainersSecurityContextCapabilities>,
8724 /// Run container in privileged mode.
8725 /// Processes in privileged containers are essentially equivalent to root on the host.
8726 /// Defaults to false.
8727 /// Note that this field cannot be set when spec.os.name is windows.
8728 #[serde(default, skip_serializing_if = "Option::is_none")]
8729 pub privileged: Option<bool>,
8730 /// procMount denotes the type of proc mount to use for the containers.
8731 /// The default is DefaultProcMount which uses the container runtime defaults for
8732 /// readonly paths and masked paths.
8733 /// This requires the ProcMountType feature flag to be enabled.
8734 /// Note that this field cannot be set when spec.os.name is windows.
8735 #[serde(default, skip_serializing_if = "Option::is_none", rename = "procMount")]
8736 pub proc_mount: Option<String>,
8737 /// Whether this container has a read-only root filesystem.
8738 /// Default is false.
8739 /// Note that this field cannot be set when spec.os.name is windows.
8740 #[serde(default, skip_serializing_if = "Option::is_none", rename = "readOnlyRootFilesystem")]
8741 pub read_only_root_filesystem: Option<bool>,
8742 /// The GID to run the entrypoint of the container process.
8743 /// Uses runtime default if unset.
8744 /// May also be set in PodSecurityContext. If set in both SecurityContext and
8745 /// PodSecurityContext, the value specified in SecurityContext takes precedence.
8746 /// Note that this field cannot be set when spec.os.name is windows.
8747 #[serde(default, skip_serializing_if = "Option::is_none", rename = "runAsGroup")]
8748 pub run_as_group: Option<i64>,
8749 /// Indicates that the container must run as a non-root user.
8750 /// If true, the Kubelet will validate the image at runtime to ensure that it
8751 /// does not run as UID 0 (root) and fail to start the container if it does.
8752 /// If unset or false, no such validation will be performed.
8753 /// May also be set in PodSecurityContext. If set in both SecurityContext and
8754 /// PodSecurityContext, the value specified in SecurityContext takes precedence.
8755 #[serde(default, skip_serializing_if = "Option::is_none", rename = "runAsNonRoot")]
8756 pub run_as_non_root: Option<bool>,
8757 /// The UID to run the entrypoint of the container process.
8758 /// Defaults to user specified in image metadata if unspecified.
8759 /// May also be set in PodSecurityContext. If set in both SecurityContext and
8760 /// PodSecurityContext, the value specified in SecurityContext takes precedence.
8761 /// Note that this field cannot be set when spec.os.name is windows.
8762 #[serde(default, skip_serializing_if = "Option::is_none", rename = "runAsUser")]
8763 pub run_as_user: Option<i64>,
8764 /// The SELinux context to be applied to the container.
8765 /// If unspecified, the container runtime will allocate a random SELinux context for each
8766 /// container. May also be set in PodSecurityContext. If set in both SecurityContext and
8767 /// PodSecurityContext, the value specified in SecurityContext takes precedence.
8768 /// Note that this field cannot be set when spec.os.name is windows.
8769 #[serde(default, skip_serializing_if = "Option::is_none", rename = "seLinuxOptions")]
8770 pub se_linux_options: Option<ComponentDefinitionRuntimeEphemeralContainersSecurityContextSeLinuxOptions>,
8771 /// The seccomp options to use by this container. If seccomp options are
8772 /// provided at both the pod & container level, the container options
8773 /// override the pod options.
8774 /// Note that this field cannot be set when spec.os.name is windows.
8775 #[serde(default, skip_serializing_if = "Option::is_none", rename = "seccompProfile")]
8776 pub seccomp_profile: Option<ComponentDefinitionRuntimeEphemeralContainersSecurityContextSeccompProfile>,
8777 /// The Windows specific settings applied to all containers.
8778 /// If unspecified, the options from the PodSecurityContext will be used.
8779 /// If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence.
8780 /// Note that this field cannot be set when spec.os.name is linux.
8781 #[serde(default, skip_serializing_if = "Option::is_none", rename = "windowsOptions")]
8782 pub windows_options: Option<ComponentDefinitionRuntimeEphemeralContainersSecurityContextWindowsOptions>,
8783}
8784
8785/// The capabilities to add/drop when running containers.
8786/// Defaults to the default set of capabilities granted by the container runtime.
8787/// Note that this field cannot be set when spec.os.name is windows.
8788#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
8789pub struct ComponentDefinitionRuntimeEphemeralContainersSecurityContextCapabilities {
8790 /// Added capabilities
8791 #[serde(default, skip_serializing_if = "Option::is_none")]
8792 pub add: Option<Vec<String>>,
8793 /// Removed capabilities
8794 #[serde(default, skip_serializing_if = "Option::is_none")]
8795 pub drop: Option<Vec<String>>,
8796}
8797
8798/// The SELinux context to be applied to the container.
8799/// If unspecified, the container runtime will allocate a random SELinux context for each
8800/// container. May also be set in PodSecurityContext. If set in both SecurityContext and
8801/// PodSecurityContext, the value specified in SecurityContext takes precedence.
8802/// Note that this field cannot be set when spec.os.name is windows.
8803#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
8804pub struct ComponentDefinitionRuntimeEphemeralContainersSecurityContextSeLinuxOptions {
8805 /// Level is SELinux level label that applies to the container.
8806 #[serde(default, skip_serializing_if = "Option::is_none")]
8807 pub level: Option<String>,
8808 /// Role is a SELinux role label that applies to the container.
8809 #[serde(default, skip_serializing_if = "Option::is_none")]
8810 pub role: Option<String>,
8811 /// Type is a SELinux type label that applies to the container.
8812 #[serde(default, skip_serializing_if = "Option::is_none", rename = "type")]
8813 pub r#type: Option<String>,
8814 /// User is a SELinux user label that applies to the container.
8815 #[serde(default, skip_serializing_if = "Option::is_none")]
8816 pub user: Option<String>,
8817}
8818
8819/// The seccomp options to use by this container. If seccomp options are
8820/// provided at both the pod & container level, the container options
8821/// override the pod options.
8822/// Note that this field cannot be set when spec.os.name is windows.
8823#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
8824pub struct ComponentDefinitionRuntimeEphemeralContainersSecurityContextSeccompProfile {
8825 /// localhostProfile indicates a profile defined in a file on the node should be used.
8826 /// The profile must be preconfigured on the node to work.
8827 /// Must be a descending path, relative to the kubelet's configured seccomp profile location.
8828 /// Must be set if type is "Localhost". Must NOT be set for any other type.
8829 #[serde(default, skip_serializing_if = "Option::is_none", rename = "localhostProfile")]
8830 pub localhost_profile: Option<String>,
8831 /// type indicates which kind of seccomp profile will be applied.
8832 /// Valid options are:
8833 ///
8834 /// Localhost - a profile defined in a file on the node should be used.
8835 /// RuntimeDefault - the container runtime default profile should be used.
8836 /// Unconfined - no profile should be applied.
8837 #[serde(rename = "type")]
8838 pub r#type: String,
8839}
8840
8841/// The Windows specific settings applied to all containers.
8842/// If unspecified, the options from the PodSecurityContext will be used.
8843/// If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence.
8844/// Note that this field cannot be set when spec.os.name is linux.
8845#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
8846pub struct ComponentDefinitionRuntimeEphemeralContainersSecurityContextWindowsOptions {
8847 /// GMSACredentialSpec is where the GMSA admission webhook
8848 /// (<https://github.com/kubernetes-sigs/windows-gmsa)> inlines the contents of the
8849 /// GMSA credential spec named by the GMSACredentialSpecName field.
8850 #[serde(default, skip_serializing_if = "Option::is_none", rename = "gmsaCredentialSpec")]
8851 pub gmsa_credential_spec: Option<String>,
8852 /// GMSACredentialSpecName is the name of the GMSA credential spec to use.
8853 #[serde(default, skip_serializing_if = "Option::is_none", rename = "gmsaCredentialSpecName")]
8854 pub gmsa_credential_spec_name: Option<String>,
8855 /// HostProcess determines if a container should be run as a 'Host Process' container.
8856 /// All of a Pod's containers must have the same effective HostProcess value
8857 /// (it is not allowed to have a mix of HostProcess containers and non-HostProcess containers).
8858 /// In addition, if HostProcess is true then HostNetwork must also be set to true.
8859 #[serde(default, skip_serializing_if = "Option::is_none", rename = "hostProcess")]
8860 pub host_process: Option<bool>,
8861 /// The UserName in Windows to run the entrypoint of the container process.
8862 /// Defaults to the user specified in image metadata if unspecified.
8863 /// May also be set in PodSecurityContext. If set in both SecurityContext and
8864 /// PodSecurityContext, the value specified in SecurityContext takes precedence.
8865 #[serde(default, skip_serializing_if = "Option::is_none", rename = "runAsUserName")]
8866 pub run_as_user_name: Option<String>,
8867}
8868
8869/// Probes are not allowed for ephemeral containers.
8870#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
8871pub struct ComponentDefinitionRuntimeEphemeralContainersStartupProbe {
8872 /// Exec specifies the action to take.
8873 #[serde(default, skip_serializing_if = "Option::is_none")]
8874 pub exec: Option<ComponentDefinitionRuntimeEphemeralContainersStartupProbeExec>,
8875 /// Minimum consecutive failures for the probe to be considered failed after having succeeded.
8876 /// Defaults to 3. Minimum value is 1.
8877 #[serde(default, skip_serializing_if = "Option::is_none", rename = "failureThreshold")]
8878 pub failure_threshold: Option<i32>,
8879 /// GRPC specifies an action involving a GRPC port.
8880 #[serde(default, skip_serializing_if = "Option::is_none")]
8881 pub grpc: Option<ComponentDefinitionRuntimeEphemeralContainersStartupProbeGrpc>,
8882 /// HTTPGet specifies the http request to perform.
8883 #[serde(default, skip_serializing_if = "Option::is_none", rename = "httpGet")]
8884 pub http_get: Option<ComponentDefinitionRuntimeEphemeralContainersStartupProbeHttpGet>,
8885 /// Number of seconds after the container has started before liveness probes are initiated.
8886 /// More info: <https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes>
8887 #[serde(default, skip_serializing_if = "Option::is_none", rename = "initialDelaySeconds")]
8888 pub initial_delay_seconds: Option<i32>,
8889 /// How often (in seconds) to perform the probe.
8890 /// Default to 10 seconds. Minimum value is 1.
8891 #[serde(default, skip_serializing_if = "Option::is_none", rename = "periodSeconds")]
8892 pub period_seconds: Option<i32>,
8893 /// Minimum consecutive successes for the probe to be considered successful after having failed.
8894 /// Defaults to 1. Must be 1 for liveness and startup. Minimum value is 1.
8895 #[serde(default, skip_serializing_if = "Option::is_none", rename = "successThreshold")]
8896 pub success_threshold: Option<i32>,
8897 /// TCPSocket specifies an action involving a TCP port.
8898 #[serde(default, skip_serializing_if = "Option::is_none", rename = "tcpSocket")]
8899 pub tcp_socket: Option<ComponentDefinitionRuntimeEphemeralContainersStartupProbeTcpSocket>,
8900 /// Optional duration in seconds the pod needs to terminate gracefully upon probe failure.
8901 /// The grace period is the duration in seconds after the processes running in the pod are sent
8902 /// a termination signal and the time when the processes are forcibly halted with a kill signal.
8903 /// Set this value longer than the expected cleanup time for your process.
8904 /// If this value is nil, the pod's terminationGracePeriodSeconds will be used. Otherwise, this
8905 /// value overrides the value provided by the pod spec.
8906 /// Value must be non-negative integer. The value zero indicates stop immediately via
8907 /// the kill signal (no opportunity to shut down).
8908 /// This is a beta field and requires enabling ProbeTerminationGracePeriod feature gate.
8909 /// Minimum value is 1. spec.terminationGracePeriodSeconds is used if unset.
8910 #[serde(default, skip_serializing_if = "Option::is_none", rename = "terminationGracePeriodSeconds")]
8911 pub termination_grace_period_seconds: Option<i64>,
8912 /// Number of seconds after which the probe times out.
8913 /// Defaults to 1 second. Minimum value is 1.
8914 /// More info: <https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes>
8915 #[serde(default, skip_serializing_if = "Option::is_none", rename = "timeoutSeconds")]
8916 pub timeout_seconds: Option<i32>,
8917}
8918
8919/// Exec specifies the action to take.
8920#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
8921pub struct ComponentDefinitionRuntimeEphemeralContainersStartupProbeExec {
8922 /// Command is the command line to execute inside the container, the working directory for the
8923 /// command is root ('/') in the container's filesystem. The command is simply exec'd, it is
8924 /// not run inside a shell, so traditional shell instructions ('|', etc) won't work. To use
8925 /// a shell, you need to explicitly call out to that shell.
8926 /// Exit status of 0 is treated as live/healthy and non-zero is unhealthy.
8927 #[serde(default, skip_serializing_if = "Option::is_none")]
8928 pub command: Option<Vec<String>>,
8929}
8930
8931/// GRPC specifies an action involving a GRPC port.
8932#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
8933pub struct ComponentDefinitionRuntimeEphemeralContainersStartupProbeGrpc {
8934 /// Port number of the gRPC service. Number must be in the range 1 to 65535.
8935 pub port: i32,
8936 /// Service is the name of the service to place in the gRPC HealthCheckRequest
8937 /// (see <https://github.com/grpc/grpc/blob/master/doc/health-checking.md).>
8938 ///
8939 /// If this is not specified, the default behavior is defined by gRPC.
8940 #[serde(default, skip_serializing_if = "Option::is_none")]
8941 pub service: Option<String>,
8942}
8943
8944/// HTTPGet specifies the http request to perform.
8945#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
8946pub struct ComponentDefinitionRuntimeEphemeralContainersStartupProbeHttpGet {
8947 /// Host name to connect to, defaults to the pod IP. You probably want to set
8948 /// "Host" in httpHeaders instead.
8949 #[serde(default, skip_serializing_if = "Option::is_none")]
8950 pub host: Option<String>,
8951 /// Custom headers to set in the request. HTTP allows repeated headers.
8952 #[serde(default, skip_serializing_if = "Option::is_none", rename = "httpHeaders")]
8953 pub http_headers: Option<Vec<ComponentDefinitionRuntimeEphemeralContainersStartupProbeHttpGetHttpHeaders>>,
8954 /// Path to access on the HTTP server.
8955 #[serde(default, skip_serializing_if = "Option::is_none")]
8956 pub path: Option<String>,
8957 /// Name or number of the port to access on the container.
8958 /// Number must be in the range 1 to 65535.
8959 /// Name must be an IANA_SVC_NAME.
8960 pub port: IntOrString,
8961 /// Scheme to use for connecting to the host.
8962 /// Defaults to HTTP.
8963 #[serde(default, skip_serializing_if = "Option::is_none")]
8964 pub scheme: Option<String>,
8965}
8966
8967/// HTTPHeader describes a custom header to be used in HTTP probes
8968#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
8969pub struct ComponentDefinitionRuntimeEphemeralContainersStartupProbeHttpGetHttpHeaders {
8970 /// The header field name.
8971 /// This will be canonicalized upon output, so case-variant names will be understood as the same header.
8972 pub name: String,
8973 /// The header field value
8974 pub value: String,
8975}
8976
8977/// TCPSocket specifies an action involving a TCP port.
8978#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
8979pub struct ComponentDefinitionRuntimeEphemeralContainersStartupProbeTcpSocket {
8980 /// Optional: Host name to connect to, defaults to the pod IP.
8981 #[serde(default, skip_serializing_if = "Option::is_none")]
8982 pub host: Option<String>,
8983 /// Number or name of the port to access on the container.
8984 /// Number must be in the range 1 to 65535.
8985 /// Name must be an IANA_SVC_NAME.
8986 pub port: IntOrString,
8987}
8988
8989/// volumeDevice describes a mapping of a raw block device within a container.
8990#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
8991pub struct ComponentDefinitionRuntimeEphemeralContainersVolumeDevices {
8992 /// devicePath is the path inside of the container that the device will be mapped to.
8993 #[serde(rename = "devicePath")]
8994 pub device_path: String,
8995 /// name must match the name of a persistentVolumeClaim in the pod
8996 pub name: String,
8997}
8998
8999/// VolumeMount describes a mounting of a Volume within a container.
9000#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
9001pub struct ComponentDefinitionRuntimeEphemeralContainersVolumeMounts {
9002 /// Path within the container at which the volume should be mounted. Must
9003 /// not contain ':'.
9004 #[serde(rename = "mountPath")]
9005 pub mount_path: String,
9006 /// mountPropagation determines how mounts are propagated from the host
9007 /// to container and the other way around.
9008 /// When not set, MountPropagationNone is used.
9009 /// This field is beta in 1.10.
9010 #[serde(default, skip_serializing_if = "Option::is_none", rename = "mountPropagation")]
9011 pub mount_propagation: Option<String>,
9012 /// This must match the Name of a Volume.
9013 pub name: String,
9014 /// Mounted read-only if true, read-write otherwise (false or unspecified).
9015 /// Defaults to false.
9016 #[serde(default, skip_serializing_if = "Option::is_none", rename = "readOnly")]
9017 pub read_only: Option<bool>,
9018 /// Path within the volume from which the container's volume should be mounted.
9019 /// Defaults to "" (volume's root).
9020 #[serde(default, skip_serializing_if = "Option::is_none", rename = "subPath")]
9021 pub sub_path: Option<String>,
9022 /// Expanded path within the volume from which the container's volume should be mounted.
9023 /// Behaves similarly to SubPath but environment variable references $(VAR_NAME) are expanded using the container's environment.
9024 /// Defaults to "" (volume's root).
9025 /// SubPathExpr and SubPath are mutually exclusive.
9026 #[serde(default, skip_serializing_if = "Option::is_none", rename = "subPathExpr")]
9027 pub sub_path_expr: Option<String>,
9028}
9029
9030/// HostAlias holds the mapping between IP and hostnames that will be injected as an entry in the
9031/// pod's hosts file.
9032#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
9033pub struct ComponentDefinitionRuntimeHostAliases {
9034 /// Hostnames for the above IP address.
9035 #[serde(default, skip_serializing_if = "Option::is_none")]
9036 pub hostnames: Option<Vec<String>>,
9037 /// IP address of the host file entry.
9038 #[serde(default, skip_serializing_if = "Option::is_none")]
9039 pub ip: Option<String>,
9040}
9041
9042/// LocalObjectReference contains enough information to let you locate the
9043/// referenced object inside the same namespace.
9044#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
9045pub struct ComponentDefinitionRuntimeImagePullSecrets {
9046 /// Name of the referent.
9047 /// More info: <https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names>
9048 #[serde(default, skip_serializing_if = "Option::is_none")]
9049 pub name: Option<String>,
9050}
9051
9052/// A single application container that you want to run within a pod.
9053#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
9054pub struct ComponentDefinitionRuntimeInitContainers {
9055 /// Arguments to the entrypoint.
9056 /// The container image's CMD is used if this is not provided.
9057 /// Variable references $(VAR_NAME) are expanded using the container's environment. If a variable
9058 /// cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced
9059 /// to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" will
9060 /// produce the string literal "$(VAR_NAME)". Escaped references will never be expanded, regardless
9061 /// of whether the variable exists or not. Cannot be updated.
9062 /// More info: <https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell>
9063 #[serde(default, skip_serializing_if = "Option::is_none")]
9064 pub args: Option<Vec<String>>,
9065 /// Entrypoint array. Not executed within a shell.
9066 /// The container image's ENTRYPOINT is used if this is not provided.
9067 /// Variable references $(VAR_NAME) are expanded using the container's environment. If a variable
9068 /// cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced
9069 /// to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" will
9070 /// produce the string literal "$(VAR_NAME)". Escaped references will never be expanded, regardless
9071 /// of whether the variable exists or not. Cannot be updated.
9072 /// More info: <https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell>
9073 #[serde(default, skip_serializing_if = "Option::is_none")]
9074 pub command: Option<Vec<String>>,
9075 /// List of environment variables to set in the container.
9076 /// Cannot be updated.
9077 #[serde(default, skip_serializing_if = "Option::is_none")]
9078 pub env: Option<Vec<ComponentDefinitionRuntimeInitContainersEnv>>,
9079 /// List of sources to populate environment variables in the container.
9080 /// The keys defined within a source must be a C_IDENTIFIER. All invalid keys
9081 /// will be reported as an event when the container is starting. When a key exists in multiple
9082 /// sources, the value associated with the last source will take precedence.
9083 /// Values defined by an Env with a duplicate key will take precedence.
9084 /// Cannot be updated.
9085 #[serde(default, skip_serializing_if = "Option::is_none", rename = "envFrom")]
9086 pub env_from: Option<Vec<ComponentDefinitionRuntimeInitContainersEnvFrom>>,
9087 /// Container image name.
9088 /// More info: <https://kubernetes.io/docs/concepts/containers/images>
9089 /// This field is optional to allow higher level config management to default or override
9090 /// container images in workload controllers like Deployments and StatefulSets.
9091 #[serde(default, skip_serializing_if = "Option::is_none")]
9092 pub image: Option<String>,
9093 /// Image pull policy.
9094 /// One of Always, Never, IfNotPresent.
9095 /// Defaults to Always if :latest tag is specified, or IfNotPresent otherwise.
9096 /// Cannot be updated.
9097 /// More info: <https://kubernetes.io/docs/concepts/containers/images#updating-images>
9098 #[serde(default, skip_serializing_if = "Option::is_none", rename = "imagePullPolicy")]
9099 pub image_pull_policy: Option<String>,
9100 /// Actions that the management system should take in response to container lifecycle events.
9101 /// Cannot be updated.
9102 #[serde(default, skip_serializing_if = "Option::is_none")]
9103 pub lifecycle: Option<ComponentDefinitionRuntimeInitContainersLifecycle>,
9104 /// Periodic probe of container liveness.
9105 /// Container will be restarted if the probe fails.
9106 /// Cannot be updated.
9107 /// More info: <https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes>
9108 #[serde(default, skip_serializing_if = "Option::is_none", rename = "livenessProbe")]
9109 pub liveness_probe: Option<ComponentDefinitionRuntimeInitContainersLivenessProbe>,
9110 /// Name of the container specified as a DNS_LABEL.
9111 /// Each container in a pod must have a unique name (DNS_LABEL).
9112 /// Cannot be updated.
9113 pub name: String,
9114 /// List of ports to expose from the container. Not specifying a port here
9115 /// DOES NOT prevent that port from being exposed. Any port which is
9116 /// listening on the default "0.0.0.0" address inside a container will be
9117 /// accessible from the network.
9118 /// Modifying this array with strategic merge patch may corrupt the data.
9119 /// For more information See <https://github.com/kubernetes/kubernetes/issues/108255.>
9120 /// Cannot be updated.
9121 #[serde(default, skip_serializing_if = "Option::is_none")]
9122 pub ports: Option<Vec<ComponentDefinitionRuntimeInitContainersPorts>>,
9123 /// Periodic probe of container service readiness.
9124 /// Container will be removed from service endpoints if the probe fails.
9125 /// Cannot be updated.
9126 /// More info: <https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes>
9127 #[serde(default, skip_serializing_if = "Option::is_none", rename = "readinessProbe")]
9128 pub readiness_probe: Option<ComponentDefinitionRuntimeInitContainersReadinessProbe>,
9129 /// Resources resize policy for the container.
9130 #[serde(default, skip_serializing_if = "Option::is_none", rename = "resizePolicy")]
9131 pub resize_policy: Option<Vec<ComponentDefinitionRuntimeInitContainersResizePolicy>>,
9132 /// Compute Resources required by this container.
9133 /// Cannot be updated.
9134 /// More info: <https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/>
9135 #[serde(default, skip_serializing_if = "Option::is_none")]
9136 pub resources: Option<ComponentDefinitionRuntimeInitContainersResources>,
9137 /// RestartPolicy defines the restart behavior of individual containers in a pod.
9138 /// This field may only be set for init containers, and the only allowed value is "Always".
9139 /// For non-init containers or when this field is not specified,
9140 /// the restart behavior is defined by the Pod's restart policy and the container type.
9141 /// Setting the RestartPolicy as "Always" for the init container will have the following effect:
9142 /// this init container will be continually restarted on
9143 /// exit until all regular containers have terminated. Once all regular
9144 /// containers have completed, all init containers with restartPolicy "Always"
9145 /// will be shut down. This lifecycle differs from normal init containers and
9146 /// is often referred to as a "sidecar" container. Although this init
9147 /// container still starts in the init container sequence, it does not wait
9148 /// for the container to complete before proceeding to the next init
9149 /// container. Instead, the next init container starts immediately after this
9150 /// init container is started, or after any startupProbe has successfully
9151 /// completed.
9152 #[serde(default, skip_serializing_if = "Option::is_none", rename = "restartPolicy")]
9153 pub restart_policy: Option<String>,
9154 /// SecurityContext defines the security options the container should be run with.
9155 /// If set, the fields of SecurityContext override the equivalent fields of PodSecurityContext.
9156 /// More info: <https://kubernetes.io/docs/tasks/configure-pod-container/security-context/>
9157 #[serde(default, skip_serializing_if = "Option::is_none", rename = "securityContext")]
9158 pub security_context: Option<ComponentDefinitionRuntimeInitContainersSecurityContext>,
9159 /// StartupProbe indicates that the Pod has successfully initialized.
9160 /// If specified, no other probes are executed until this completes successfully.
9161 /// If this probe fails, the Pod will be restarted, just as if the livenessProbe failed.
9162 /// This can be used to provide different probe parameters at the beginning of a Pod's lifecycle,
9163 /// when it might take a long time to load data or warm a cache, than during steady-state operation.
9164 /// This cannot be updated.
9165 /// More info: <https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes>
9166 #[serde(default, skip_serializing_if = "Option::is_none", rename = "startupProbe")]
9167 pub startup_probe: Option<ComponentDefinitionRuntimeInitContainersStartupProbe>,
9168 /// Whether this container should allocate a buffer for stdin in the container runtime. If this
9169 /// is not set, reads from stdin in the container will always result in EOF.
9170 /// Default is false.
9171 #[serde(default, skip_serializing_if = "Option::is_none")]
9172 pub stdin: Option<bool>,
9173 /// Whether the container runtime should close the stdin channel after it has been opened by
9174 /// a single attach. When stdin is true the stdin stream will remain open across multiple attach
9175 /// sessions. If stdinOnce is set to true, stdin is opened on container start, is empty until the
9176 /// first client attaches to stdin, and then remains open and accepts data until the client disconnects,
9177 /// at which time stdin is closed and remains closed until the container is restarted. If this
9178 /// flag is false, a container processes that reads from stdin will never receive an EOF.
9179 /// Default is false
9180 #[serde(default, skip_serializing_if = "Option::is_none", rename = "stdinOnce")]
9181 pub stdin_once: Option<bool>,
9182 /// Optional: Path at which the file to which the container's termination message
9183 /// will be written is mounted into the container's filesystem.
9184 /// Message written is intended to be brief final status, such as an assertion failure message.
9185 /// Will be truncated by the node if greater than 4096 bytes. The total message length across
9186 /// all containers will be limited to 12kb.
9187 /// Defaults to /dev/termination-log.
9188 /// Cannot be updated.
9189 #[serde(default, skip_serializing_if = "Option::is_none", rename = "terminationMessagePath")]
9190 pub termination_message_path: Option<String>,
9191 /// Indicate how the termination message should be populated. File will use the contents of
9192 /// terminationMessagePath to populate the container status message on both success and failure.
9193 /// FallbackToLogsOnError will use the last chunk of container log output if the termination
9194 /// message file is empty and the container exited with an error.
9195 /// The log output is limited to 2048 bytes or 80 lines, whichever is smaller.
9196 /// Defaults to File.
9197 /// Cannot be updated.
9198 #[serde(default, skip_serializing_if = "Option::is_none", rename = "terminationMessagePolicy")]
9199 pub termination_message_policy: Option<String>,
9200 /// Whether this container should allocate a TTY for itself, also requires 'stdin' to be true.
9201 /// Default is false.
9202 #[serde(default, skip_serializing_if = "Option::is_none")]
9203 pub tty: Option<bool>,
9204 /// volumeDevices is the list of block devices to be used by the container.
9205 #[serde(default, skip_serializing_if = "Option::is_none", rename = "volumeDevices")]
9206 pub volume_devices: Option<Vec<ComponentDefinitionRuntimeInitContainersVolumeDevices>>,
9207 /// Pod volumes to mount into the container's filesystem.
9208 /// Cannot be updated.
9209 #[serde(default, skip_serializing_if = "Option::is_none", rename = "volumeMounts")]
9210 pub volume_mounts: Option<Vec<ComponentDefinitionRuntimeInitContainersVolumeMounts>>,
9211 /// Container's working directory.
9212 /// If not specified, the container runtime's default will be used, which
9213 /// might be configured in the container image.
9214 /// Cannot be updated.
9215 #[serde(default, skip_serializing_if = "Option::is_none", rename = "workingDir")]
9216 pub working_dir: Option<String>,
9217}
9218
9219/// EnvVar represents an environment variable present in a Container.
9220#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
9221pub struct ComponentDefinitionRuntimeInitContainersEnv {
9222 /// Name of the environment variable. Must be a C_IDENTIFIER.
9223 pub name: String,
9224 /// Variable references $(VAR_NAME) are expanded
9225 /// using the previously defined environment variables in the container and
9226 /// any service environment variables. If a variable cannot be resolved,
9227 /// the reference in the input string will be unchanged. Double $$ are reduced
9228 /// to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e.
9229 /// "$$(VAR_NAME)" will produce the string literal "$(VAR_NAME)".
9230 /// Escaped references will never be expanded, regardless of whether the variable
9231 /// exists or not.
9232 /// Defaults to "".
9233 #[serde(default, skip_serializing_if = "Option::is_none")]
9234 pub value: Option<String>,
9235 /// Source for the environment variable's value. Cannot be used if value is not empty.
9236 #[serde(default, skip_serializing_if = "Option::is_none", rename = "valueFrom")]
9237 pub value_from: Option<ComponentDefinitionRuntimeInitContainersEnvValueFrom>,
9238}
9239
9240/// Source for the environment variable's value. Cannot be used if value is not empty.
9241#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
9242pub struct ComponentDefinitionRuntimeInitContainersEnvValueFrom {
9243 /// Selects a key of a ConfigMap.
9244 #[serde(default, skip_serializing_if = "Option::is_none", rename = "configMapKeyRef")]
9245 pub config_map_key_ref: Option<ComponentDefinitionRuntimeInitContainersEnvValueFromConfigMapKeyRef>,
9246 /// Selects a field of the pod: supports metadata.name, metadata.namespace, `metadata.labels['<KEY>']`, `metadata.annotations['<KEY>']`,
9247 /// spec.nodeName, spec.serviceAccountName, status.hostIP, status.podIP, status.podIPs.
9248 #[serde(default, skip_serializing_if = "Option::is_none", rename = "fieldRef")]
9249 pub field_ref: Option<ComponentDefinitionRuntimeInitContainersEnvValueFromFieldRef>,
9250 /// Selects a resource of the container: only resources limits and requests
9251 /// (limits.cpu, limits.memory, limits.ephemeral-storage, requests.cpu, requests.memory and requests.ephemeral-storage) are currently supported.
9252 #[serde(default, skip_serializing_if = "Option::is_none", rename = "resourceFieldRef")]
9253 pub resource_field_ref: Option<ComponentDefinitionRuntimeInitContainersEnvValueFromResourceFieldRef>,
9254 /// Selects a key of a secret in the pod's namespace
9255 #[serde(default, skip_serializing_if = "Option::is_none", rename = "secretKeyRef")]
9256 pub secret_key_ref: Option<ComponentDefinitionRuntimeInitContainersEnvValueFromSecretKeyRef>,
9257}
9258
9259/// Selects a key of a ConfigMap.
9260#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
9261pub struct ComponentDefinitionRuntimeInitContainersEnvValueFromConfigMapKeyRef {
9262 /// The key to select.
9263 pub key: String,
9264 /// Name of the referent.
9265 /// More info: <https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names>
9266 #[serde(default, skip_serializing_if = "Option::is_none")]
9267 pub name: Option<String>,
9268 /// Specify whether the ConfigMap or its key must be defined
9269 #[serde(default, skip_serializing_if = "Option::is_none")]
9270 pub optional: Option<bool>,
9271}
9272
9273/// Selects a field of the pod: supports metadata.name, metadata.namespace, `metadata.labels['<KEY>']`, `metadata.annotations['<KEY>']`,
9274/// spec.nodeName, spec.serviceAccountName, status.hostIP, status.podIP, status.podIPs.
9275#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
9276pub struct ComponentDefinitionRuntimeInitContainersEnvValueFromFieldRef {
9277 /// Version of the schema the FieldPath is written in terms of, defaults to "v1".
9278 #[serde(default, skip_serializing_if = "Option::is_none", rename = "apiVersion")]
9279 pub api_version: Option<String>,
9280 /// Path of the field to select in the specified API version.
9281 #[serde(rename = "fieldPath")]
9282 pub field_path: String,
9283}
9284
9285/// Selects a resource of the container: only resources limits and requests
9286/// (limits.cpu, limits.memory, limits.ephemeral-storage, requests.cpu, requests.memory and requests.ephemeral-storage) are currently supported.
9287#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
9288pub struct ComponentDefinitionRuntimeInitContainersEnvValueFromResourceFieldRef {
9289 /// Container name: required for volumes, optional for env vars
9290 #[serde(default, skip_serializing_if = "Option::is_none", rename = "containerName")]
9291 pub container_name: Option<String>,
9292 /// Specifies the output format of the exposed resources, defaults to "1"
9293 #[serde(default, skip_serializing_if = "Option::is_none")]
9294 pub divisor: Option<IntOrString>,
9295 /// Required: resource to select
9296 pub resource: String,
9297}
9298
9299/// Selects a key of a secret in the pod's namespace
9300#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
9301pub struct ComponentDefinitionRuntimeInitContainersEnvValueFromSecretKeyRef {
9302 /// The key of the secret to select from. Must be a valid secret key.
9303 pub key: String,
9304 /// Name of the referent.
9305 /// More info: <https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names>
9306 #[serde(default, skip_serializing_if = "Option::is_none")]
9307 pub name: Option<String>,
9308 /// Specify whether the Secret or its key must be defined
9309 #[serde(default, skip_serializing_if = "Option::is_none")]
9310 pub optional: Option<bool>,
9311}
9312
9313/// EnvFromSource represents the source of a set of ConfigMaps
9314#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
9315pub struct ComponentDefinitionRuntimeInitContainersEnvFrom {
9316 /// The ConfigMap to select from
9317 #[serde(default, skip_serializing_if = "Option::is_none", rename = "configMapRef")]
9318 pub config_map_ref: Option<ComponentDefinitionRuntimeInitContainersEnvFromConfigMapRef>,
9319 /// An optional identifier to prepend to each key in the ConfigMap. Must be a C_IDENTIFIER.
9320 #[serde(default, skip_serializing_if = "Option::is_none")]
9321 pub prefix: Option<String>,
9322 /// The Secret to select from
9323 #[serde(default, skip_serializing_if = "Option::is_none", rename = "secretRef")]
9324 pub secret_ref: Option<ComponentDefinitionRuntimeInitContainersEnvFromSecretRef>,
9325}
9326
9327/// The ConfigMap to select from
9328#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
9329pub struct ComponentDefinitionRuntimeInitContainersEnvFromConfigMapRef {
9330 /// Name of the referent.
9331 /// More info: <https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names>
9332 #[serde(default, skip_serializing_if = "Option::is_none")]
9333 pub name: Option<String>,
9334 /// Specify whether the ConfigMap must be defined
9335 #[serde(default, skip_serializing_if = "Option::is_none")]
9336 pub optional: Option<bool>,
9337}
9338
9339/// The Secret to select from
9340#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
9341pub struct ComponentDefinitionRuntimeInitContainersEnvFromSecretRef {
9342 /// Name of the referent.
9343 /// More info: <https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names>
9344 #[serde(default, skip_serializing_if = "Option::is_none")]
9345 pub name: Option<String>,
9346 /// Specify whether the Secret must be defined
9347 #[serde(default, skip_serializing_if = "Option::is_none")]
9348 pub optional: Option<bool>,
9349}
9350
9351/// Actions that the management system should take in response to container lifecycle events.
9352/// Cannot be updated.
9353#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
9354pub struct ComponentDefinitionRuntimeInitContainersLifecycle {
9355 /// PostStart is called immediately after a container is created. If the handler fails,
9356 /// the container is terminated and restarted according to its restart policy.
9357 /// Other management of the container blocks until the hook completes.
9358 /// More info: <https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks>
9359 #[serde(default, skip_serializing_if = "Option::is_none", rename = "postStart")]
9360 pub post_start: Option<ComponentDefinitionRuntimeInitContainersLifecyclePostStart>,
9361 /// PreStop is called immediately before a container is terminated due to an
9362 /// API request or management event such as liveness/startup probe failure,
9363 /// preemption, resource contention, etc. The handler is not called if the
9364 /// container crashes or exits. The Pod's termination grace period countdown begins before the
9365 /// PreStop hook is executed. Regardless of the outcome of the handler, the
9366 /// container will eventually terminate within the Pod's termination grace
9367 /// period (unless delayed by finalizers). Other management of the container blocks until the hook completes
9368 /// or until the termination grace period is reached.
9369 /// More info: <https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks>
9370 #[serde(default, skip_serializing_if = "Option::is_none", rename = "preStop")]
9371 pub pre_stop: Option<ComponentDefinitionRuntimeInitContainersLifecyclePreStop>,
9372}
9373
9374/// PostStart is called immediately after a container is created. If the handler fails,
9375/// the container is terminated and restarted according to its restart policy.
9376/// Other management of the container blocks until the hook completes.
9377/// More info: <https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks>
9378#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
9379pub struct ComponentDefinitionRuntimeInitContainersLifecyclePostStart {
9380 /// Exec specifies the action to take.
9381 #[serde(default, skip_serializing_if = "Option::is_none")]
9382 pub exec: Option<ComponentDefinitionRuntimeInitContainersLifecyclePostStartExec>,
9383 /// HTTPGet specifies the http request to perform.
9384 #[serde(default, skip_serializing_if = "Option::is_none", rename = "httpGet")]
9385 pub http_get: Option<ComponentDefinitionRuntimeInitContainersLifecyclePostStartHttpGet>,
9386 /// Sleep represents the duration that the container should sleep before being terminated.
9387 #[serde(default, skip_serializing_if = "Option::is_none")]
9388 pub sleep: Option<ComponentDefinitionRuntimeInitContainersLifecyclePostStartSleep>,
9389 /// Deprecated. TCPSocket is NOT supported as a LifecycleHandler and kept
9390 /// for the backward compatibility. There are no validation of this field and
9391 /// lifecycle hooks will fail in runtime when tcp handler is specified.
9392 #[serde(default, skip_serializing_if = "Option::is_none", rename = "tcpSocket")]
9393 pub tcp_socket: Option<ComponentDefinitionRuntimeInitContainersLifecyclePostStartTcpSocket>,
9394}
9395
9396/// Exec specifies the action to take.
9397#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
9398pub struct ComponentDefinitionRuntimeInitContainersLifecyclePostStartExec {
9399 /// Command is the command line to execute inside the container, the working directory for the
9400 /// command is root ('/') in the container's filesystem. The command is simply exec'd, it is
9401 /// not run inside a shell, so traditional shell instructions ('|', etc) won't work. To use
9402 /// a shell, you need to explicitly call out to that shell.
9403 /// Exit status of 0 is treated as live/healthy and non-zero is unhealthy.
9404 #[serde(default, skip_serializing_if = "Option::is_none")]
9405 pub command: Option<Vec<String>>,
9406}
9407
9408/// HTTPGet specifies the http request to perform.
9409#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
9410pub struct ComponentDefinitionRuntimeInitContainersLifecyclePostStartHttpGet {
9411 /// Host name to connect to, defaults to the pod IP. You probably want to set
9412 /// "Host" in httpHeaders instead.
9413 #[serde(default, skip_serializing_if = "Option::is_none")]
9414 pub host: Option<String>,
9415 /// Custom headers to set in the request. HTTP allows repeated headers.
9416 #[serde(default, skip_serializing_if = "Option::is_none", rename = "httpHeaders")]
9417 pub http_headers: Option<Vec<ComponentDefinitionRuntimeInitContainersLifecyclePostStartHttpGetHttpHeaders>>,
9418 /// Path to access on the HTTP server.
9419 #[serde(default, skip_serializing_if = "Option::is_none")]
9420 pub path: Option<String>,
9421 /// Name or number of the port to access on the container.
9422 /// Number must be in the range 1 to 65535.
9423 /// Name must be an IANA_SVC_NAME.
9424 pub port: IntOrString,
9425 /// Scheme to use for connecting to the host.
9426 /// Defaults to HTTP.
9427 #[serde(default, skip_serializing_if = "Option::is_none")]
9428 pub scheme: Option<String>,
9429}
9430
9431/// HTTPHeader describes a custom header to be used in HTTP probes
9432#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
9433pub struct ComponentDefinitionRuntimeInitContainersLifecyclePostStartHttpGetHttpHeaders {
9434 /// The header field name.
9435 /// This will be canonicalized upon output, so case-variant names will be understood as the same header.
9436 pub name: String,
9437 /// The header field value
9438 pub value: String,
9439}
9440
9441/// Sleep represents the duration that the container should sleep before being terminated.
9442#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
9443pub struct ComponentDefinitionRuntimeInitContainersLifecyclePostStartSleep {
9444 /// Seconds is the number of seconds to sleep.
9445 pub seconds: i64,
9446}
9447
9448/// Deprecated. TCPSocket is NOT supported as a LifecycleHandler and kept
9449/// for the backward compatibility. There are no validation of this field and
9450/// lifecycle hooks will fail in runtime when tcp handler is specified.
9451#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
9452pub struct ComponentDefinitionRuntimeInitContainersLifecyclePostStartTcpSocket {
9453 /// Optional: Host name to connect to, defaults to the pod IP.
9454 #[serde(default, skip_serializing_if = "Option::is_none")]
9455 pub host: Option<String>,
9456 /// Number or name of the port to access on the container.
9457 /// Number must be in the range 1 to 65535.
9458 /// Name must be an IANA_SVC_NAME.
9459 pub port: IntOrString,
9460}
9461
9462/// PreStop is called immediately before a container is terminated due to an
9463/// API request or management event such as liveness/startup probe failure,
9464/// preemption, resource contention, etc. The handler is not called if the
9465/// container crashes or exits. The Pod's termination grace period countdown begins before the
9466/// PreStop hook is executed. Regardless of the outcome of the handler, the
9467/// container will eventually terminate within the Pod's termination grace
9468/// period (unless delayed by finalizers). Other management of the container blocks until the hook completes
9469/// or until the termination grace period is reached.
9470/// More info: <https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks>
9471#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
9472pub struct ComponentDefinitionRuntimeInitContainersLifecyclePreStop {
9473 /// Exec specifies the action to take.
9474 #[serde(default, skip_serializing_if = "Option::is_none")]
9475 pub exec: Option<ComponentDefinitionRuntimeInitContainersLifecyclePreStopExec>,
9476 /// HTTPGet specifies the http request to perform.
9477 #[serde(default, skip_serializing_if = "Option::is_none", rename = "httpGet")]
9478 pub http_get: Option<ComponentDefinitionRuntimeInitContainersLifecyclePreStopHttpGet>,
9479 /// Sleep represents the duration that the container should sleep before being terminated.
9480 #[serde(default, skip_serializing_if = "Option::is_none")]
9481 pub sleep: Option<ComponentDefinitionRuntimeInitContainersLifecyclePreStopSleep>,
9482 /// Deprecated. TCPSocket is NOT supported as a LifecycleHandler and kept
9483 /// for the backward compatibility. There are no validation of this field and
9484 /// lifecycle hooks will fail in runtime when tcp handler is specified.
9485 #[serde(default, skip_serializing_if = "Option::is_none", rename = "tcpSocket")]
9486 pub tcp_socket: Option<ComponentDefinitionRuntimeInitContainersLifecyclePreStopTcpSocket>,
9487}
9488
9489/// Exec specifies the action to take.
9490#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
9491pub struct ComponentDefinitionRuntimeInitContainersLifecyclePreStopExec {
9492 /// Command is the command line to execute inside the container, the working directory for the
9493 /// command is root ('/') in the container's filesystem. The command is simply exec'd, it is
9494 /// not run inside a shell, so traditional shell instructions ('|', etc) won't work. To use
9495 /// a shell, you need to explicitly call out to that shell.
9496 /// Exit status of 0 is treated as live/healthy and non-zero is unhealthy.
9497 #[serde(default, skip_serializing_if = "Option::is_none")]
9498 pub command: Option<Vec<String>>,
9499}
9500
9501/// HTTPGet specifies the http request to perform.
9502#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
9503pub struct ComponentDefinitionRuntimeInitContainersLifecyclePreStopHttpGet {
9504 /// Host name to connect to, defaults to the pod IP. You probably want to set
9505 /// "Host" in httpHeaders instead.
9506 #[serde(default, skip_serializing_if = "Option::is_none")]
9507 pub host: Option<String>,
9508 /// Custom headers to set in the request. HTTP allows repeated headers.
9509 #[serde(default, skip_serializing_if = "Option::is_none", rename = "httpHeaders")]
9510 pub http_headers: Option<Vec<ComponentDefinitionRuntimeInitContainersLifecyclePreStopHttpGetHttpHeaders>>,
9511 /// Path to access on the HTTP server.
9512 #[serde(default, skip_serializing_if = "Option::is_none")]
9513 pub path: Option<String>,
9514 /// Name or number of the port to access on the container.
9515 /// Number must be in the range 1 to 65535.
9516 /// Name must be an IANA_SVC_NAME.
9517 pub port: IntOrString,
9518 /// Scheme to use for connecting to the host.
9519 /// Defaults to HTTP.
9520 #[serde(default, skip_serializing_if = "Option::is_none")]
9521 pub scheme: Option<String>,
9522}
9523
9524/// HTTPHeader describes a custom header to be used in HTTP probes
9525#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
9526pub struct ComponentDefinitionRuntimeInitContainersLifecyclePreStopHttpGetHttpHeaders {
9527 /// The header field name.
9528 /// This will be canonicalized upon output, so case-variant names will be understood as the same header.
9529 pub name: String,
9530 /// The header field value
9531 pub value: String,
9532}
9533
9534/// Sleep represents the duration that the container should sleep before being terminated.
9535#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
9536pub struct ComponentDefinitionRuntimeInitContainersLifecyclePreStopSleep {
9537 /// Seconds is the number of seconds to sleep.
9538 pub seconds: i64,
9539}
9540
9541/// Deprecated. TCPSocket is NOT supported as a LifecycleHandler and kept
9542/// for the backward compatibility. There are no validation of this field and
9543/// lifecycle hooks will fail in runtime when tcp handler is specified.
9544#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
9545pub struct ComponentDefinitionRuntimeInitContainersLifecyclePreStopTcpSocket {
9546 /// Optional: Host name to connect to, defaults to the pod IP.
9547 #[serde(default, skip_serializing_if = "Option::is_none")]
9548 pub host: Option<String>,
9549 /// Number or name of the port to access on the container.
9550 /// Number must be in the range 1 to 65535.
9551 /// Name must be an IANA_SVC_NAME.
9552 pub port: IntOrString,
9553}
9554
9555/// Periodic probe of container liveness.
9556/// Container will be restarted if the probe fails.
9557/// Cannot be updated.
9558/// More info: <https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes>
9559#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
9560pub struct ComponentDefinitionRuntimeInitContainersLivenessProbe {
9561 /// Exec specifies the action to take.
9562 #[serde(default, skip_serializing_if = "Option::is_none")]
9563 pub exec: Option<ComponentDefinitionRuntimeInitContainersLivenessProbeExec>,
9564 /// Minimum consecutive failures for the probe to be considered failed after having succeeded.
9565 /// Defaults to 3. Minimum value is 1.
9566 #[serde(default, skip_serializing_if = "Option::is_none", rename = "failureThreshold")]
9567 pub failure_threshold: Option<i32>,
9568 /// GRPC specifies an action involving a GRPC port.
9569 #[serde(default, skip_serializing_if = "Option::is_none")]
9570 pub grpc: Option<ComponentDefinitionRuntimeInitContainersLivenessProbeGrpc>,
9571 /// HTTPGet specifies the http request to perform.
9572 #[serde(default, skip_serializing_if = "Option::is_none", rename = "httpGet")]
9573 pub http_get: Option<ComponentDefinitionRuntimeInitContainersLivenessProbeHttpGet>,
9574 /// Number of seconds after the container has started before liveness probes are initiated.
9575 /// More info: <https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes>
9576 #[serde(default, skip_serializing_if = "Option::is_none", rename = "initialDelaySeconds")]
9577 pub initial_delay_seconds: Option<i32>,
9578 /// How often (in seconds) to perform the probe.
9579 /// Default to 10 seconds. Minimum value is 1.
9580 #[serde(default, skip_serializing_if = "Option::is_none", rename = "periodSeconds")]
9581 pub period_seconds: Option<i32>,
9582 /// Minimum consecutive successes for the probe to be considered successful after having failed.
9583 /// Defaults to 1. Must be 1 for liveness and startup. Minimum value is 1.
9584 #[serde(default, skip_serializing_if = "Option::is_none", rename = "successThreshold")]
9585 pub success_threshold: Option<i32>,
9586 /// TCPSocket specifies an action involving a TCP port.
9587 #[serde(default, skip_serializing_if = "Option::is_none", rename = "tcpSocket")]
9588 pub tcp_socket: Option<ComponentDefinitionRuntimeInitContainersLivenessProbeTcpSocket>,
9589 /// Optional duration in seconds the pod needs to terminate gracefully upon probe failure.
9590 /// The grace period is the duration in seconds after the processes running in the pod are sent
9591 /// a termination signal and the time when the processes are forcibly halted with a kill signal.
9592 /// Set this value longer than the expected cleanup time for your process.
9593 /// If this value is nil, the pod's terminationGracePeriodSeconds will be used. Otherwise, this
9594 /// value overrides the value provided by the pod spec.
9595 /// Value must be non-negative integer. The value zero indicates stop immediately via
9596 /// the kill signal (no opportunity to shut down).
9597 /// This is a beta field and requires enabling ProbeTerminationGracePeriod feature gate.
9598 /// Minimum value is 1. spec.terminationGracePeriodSeconds is used if unset.
9599 #[serde(default, skip_serializing_if = "Option::is_none", rename = "terminationGracePeriodSeconds")]
9600 pub termination_grace_period_seconds: Option<i64>,
9601 /// Number of seconds after which the probe times out.
9602 /// Defaults to 1 second. Minimum value is 1.
9603 /// More info: <https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes>
9604 #[serde(default, skip_serializing_if = "Option::is_none", rename = "timeoutSeconds")]
9605 pub timeout_seconds: Option<i32>,
9606}
9607
9608/// Exec specifies the action to take.
9609#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
9610pub struct ComponentDefinitionRuntimeInitContainersLivenessProbeExec {
9611 /// Command is the command line to execute inside the container, the working directory for the
9612 /// command is root ('/') in the container's filesystem. The command is simply exec'd, it is
9613 /// not run inside a shell, so traditional shell instructions ('|', etc) won't work. To use
9614 /// a shell, you need to explicitly call out to that shell.
9615 /// Exit status of 0 is treated as live/healthy and non-zero is unhealthy.
9616 #[serde(default, skip_serializing_if = "Option::is_none")]
9617 pub command: Option<Vec<String>>,
9618}
9619
9620/// GRPC specifies an action involving a GRPC port.
9621#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
9622pub struct ComponentDefinitionRuntimeInitContainersLivenessProbeGrpc {
9623 /// Port number of the gRPC service. Number must be in the range 1 to 65535.
9624 pub port: i32,
9625 /// Service is the name of the service to place in the gRPC HealthCheckRequest
9626 /// (see <https://github.com/grpc/grpc/blob/master/doc/health-checking.md).>
9627 ///
9628 /// If this is not specified, the default behavior is defined by gRPC.
9629 #[serde(default, skip_serializing_if = "Option::is_none")]
9630 pub service: Option<String>,
9631}
9632
9633/// HTTPGet specifies the http request to perform.
9634#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
9635pub struct ComponentDefinitionRuntimeInitContainersLivenessProbeHttpGet {
9636 /// Host name to connect to, defaults to the pod IP. You probably want to set
9637 /// "Host" in httpHeaders instead.
9638 #[serde(default, skip_serializing_if = "Option::is_none")]
9639 pub host: Option<String>,
9640 /// Custom headers to set in the request. HTTP allows repeated headers.
9641 #[serde(default, skip_serializing_if = "Option::is_none", rename = "httpHeaders")]
9642 pub http_headers: Option<Vec<ComponentDefinitionRuntimeInitContainersLivenessProbeHttpGetHttpHeaders>>,
9643 /// Path to access on the HTTP server.
9644 #[serde(default, skip_serializing_if = "Option::is_none")]
9645 pub path: Option<String>,
9646 /// Name or number of the port to access on the container.
9647 /// Number must be in the range 1 to 65535.
9648 /// Name must be an IANA_SVC_NAME.
9649 pub port: IntOrString,
9650 /// Scheme to use for connecting to the host.
9651 /// Defaults to HTTP.
9652 #[serde(default, skip_serializing_if = "Option::is_none")]
9653 pub scheme: Option<String>,
9654}
9655
9656/// HTTPHeader describes a custom header to be used in HTTP probes
9657#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
9658pub struct ComponentDefinitionRuntimeInitContainersLivenessProbeHttpGetHttpHeaders {
9659 /// The header field name.
9660 /// This will be canonicalized upon output, so case-variant names will be understood as the same header.
9661 pub name: String,
9662 /// The header field value
9663 pub value: String,
9664}
9665
9666/// TCPSocket specifies an action involving a TCP port.
9667#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
9668pub struct ComponentDefinitionRuntimeInitContainersLivenessProbeTcpSocket {
9669 /// Optional: Host name to connect to, defaults to the pod IP.
9670 #[serde(default, skip_serializing_if = "Option::is_none")]
9671 pub host: Option<String>,
9672 /// Number or name of the port to access on the container.
9673 /// Number must be in the range 1 to 65535.
9674 /// Name must be an IANA_SVC_NAME.
9675 pub port: IntOrString,
9676}
9677
9678/// ContainerPort represents a network port in a single container.
9679#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
9680pub struct ComponentDefinitionRuntimeInitContainersPorts {
9681 /// Number of port to expose on the pod's IP address.
9682 /// This must be a valid port number, 0 < x < 65536.
9683 #[serde(rename = "containerPort")]
9684 pub container_port: i32,
9685 /// What host IP to bind the external port to.
9686 #[serde(default, skip_serializing_if = "Option::is_none", rename = "hostIP")]
9687 pub host_ip: Option<String>,
9688 /// Number of port to expose on the host.
9689 /// If specified, this must be a valid port number, 0 < x < 65536.
9690 /// If HostNetwork is specified, this must match ContainerPort.
9691 /// Most containers do not need this.
9692 #[serde(default, skip_serializing_if = "Option::is_none", rename = "hostPort")]
9693 pub host_port: Option<i32>,
9694 /// If specified, this must be an IANA_SVC_NAME and unique within the pod. Each
9695 /// named port in a pod must have a unique name. Name for the port that can be
9696 /// referred to by services.
9697 #[serde(default, skip_serializing_if = "Option::is_none")]
9698 pub name: Option<String>,
9699 /// Protocol for port. Must be UDP, TCP, or SCTP.
9700 /// Defaults to "TCP".
9701 #[serde(default, skip_serializing_if = "Option::is_none")]
9702 pub protocol: Option<String>,
9703}
9704
9705/// Periodic probe of container service readiness.
9706/// Container will be removed from service endpoints if the probe fails.
9707/// Cannot be updated.
9708/// More info: <https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes>
9709#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
9710pub struct ComponentDefinitionRuntimeInitContainersReadinessProbe {
9711 /// Exec specifies the action to take.
9712 #[serde(default, skip_serializing_if = "Option::is_none")]
9713 pub exec: Option<ComponentDefinitionRuntimeInitContainersReadinessProbeExec>,
9714 /// Minimum consecutive failures for the probe to be considered failed after having succeeded.
9715 /// Defaults to 3. Minimum value is 1.
9716 #[serde(default, skip_serializing_if = "Option::is_none", rename = "failureThreshold")]
9717 pub failure_threshold: Option<i32>,
9718 /// GRPC specifies an action involving a GRPC port.
9719 #[serde(default, skip_serializing_if = "Option::is_none")]
9720 pub grpc: Option<ComponentDefinitionRuntimeInitContainersReadinessProbeGrpc>,
9721 /// HTTPGet specifies the http request to perform.
9722 #[serde(default, skip_serializing_if = "Option::is_none", rename = "httpGet")]
9723 pub http_get: Option<ComponentDefinitionRuntimeInitContainersReadinessProbeHttpGet>,
9724 /// Number of seconds after the container has started before liveness probes are initiated.
9725 /// More info: <https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes>
9726 #[serde(default, skip_serializing_if = "Option::is_none", rename = "initialDelaySeconds")]
9727 pub initial_delay_seconds: Option<i32>,
9728 /// How often (in seconds) to perform the probe.
9729 /// Default to 10 seconds. Minimum value is 1.
9730 #[serde(default, skip_serializing_if = "Option::is_none", rename = "periodSeconds")]
9731 pub period_seconds: Option<i32>,
9732 /// Minimum consecutive successes for the probe to be considered successful after having failed.
9733 /// Defaults to 1. Must be 1 for liveness and startup. Minimum value is 1.
9734 #[serde(default, skip_serializing_if = "Option::is_none", rename = "successThreshold")]
9735 pub success_threshold: Option<i32>,
9736 /// TCPSocket specifies an action involving a TCP port.
9737 #[serde(default, skip_serializing_if = "Option::is_none", rename = "tcpSocket")]
9738 pub tcp_socket: Option<ComponentDefinitionRuntimeInitContainersReadinessProbeTcpSocket>,
9739 /// Optional duration in seconds the pod needs to terminate gracefully upon probe failure.
9740 /// The grace period is the duration in seconds after the processes running in the pod are sent
9741 /// a termination signal and the time when the processes are forcibly halted with a kill signal.
9742 /// Set this value longer than the expected cleanup time for your process.
9743 /// If this value is nil, the pod's terminationGracePeriodSeconds will be used. Otherwise, this
9744 /// value overrides the value provided by the pod spec.
9745 /// Value must be non-negative integer. The value zero indicates stop immediately via
9746 /// the kill signal (no opportunity to shut down).
9747 /// This is a beta field and requires enabling ProbeTerminationGracePeriod feature gate.
9748 /// Minimum value is 1. spec.terminationGracePeriodSeconds is used if unset.
9749 #[serde(default, skip_serializing_if = "Option::is_none", rename = "terminationGracePeriodSeconds")]
9750 pub termination_grace_period_seconds: Option<i64>,
9751 /// Number of seconds after which the probe times out.
9752 /// Defaults to 1 second. Minimum value is 1.
9753 /// More info: <https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes>
9754 #[serde(default, skip_serializing_if = "Option::is_none", rename = "timeoutSeconds")]
9755 pub timeout_seconds: Option<i32>,
9756}
9757
9758/// Exec specifies the action to take.
9759#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
9760pub struct ComponentDefinitionRuntimeInitContainersReadinessProbeExec {
9761 /// Command is the command line to execute inside the container, the working directory for the
9762 /// command is root ('/') in the container's filesystem. The command is simply exec'd, it is
9763 /// not run inside a shell, so traditional shell instructions ('|', etc) won't work. To use
9764 /// a shell, you need to explicitly call out to that shell.
9765 /// Exit status of 0 is treated as live/healthy and non-zero is unhealthy.
9766 #[serde(default, skip_serializing_if = "Option::is_none")]
9767 pub command: Option<Vec<String>>,
9768}
9769
9770/// GRPC specifies an action involving a GRPC port.
9771#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
9772pub struct ComponentDefinitionRuntimeInitContainersReadinessProbeGrpc {
9773 /// Port number of the gRPC service. Number must be in the range 1 to 65535.
9774 pub port: i32,
9775 /// Service is the name of the service to place in the gRPC HealthCheckRequest
9776 /// (see <https://github.com/grpc/grpc/blob/master/doc/health-checking.md).>
9777 ///
9778 /// If this is not specified, the default behavior is defined by gRPC.
9779 #[serde(default, skip_serializing_if = "Option::is_none")]
9780 pub service: Option<String>,
9781}
9782
9783/// HTTPGet specifies the http request to perform.
9784#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
9785pub struct ComponentDefinitionRuntimeInitContainersReadinessProbeHttpGet {
9786 /// Host name to connect to, defaults to the pod IP. You probably want to set
9787 /// "Host" in httpHeaders instead.
9788 #[serde(default, skip_serializing_if = "Option::is_none")]
9789 pub host: Option<String>,
9790 /// Custom headers to set in the request. HTTP allows repeated headers.
9791 #[serde(default, skip_serializing_if = "Option::is_none", rename = "httpHeaders")]
9792 pub http_headers: Option<Vec<ComponentDefinitionRuntimeInitContainersReadinessProbeHttpGetHttpHeaders>>,
9793 /// Path to access on the HTTP server.
9794 #[serde(default, skip_serializing_if = "Option::is_none")]
9795 pub path: Option<String>,
9796 /// Name or number of the port to access on the container.
9797 /// Number must be in the range 1 to 65535.
9798 /// Name must be an IANA_SVC_NAME.
9799 pub port: IntOrString,
9800 /// Scheme to use for connecting to the host.
9801 /// Defaults to HTTP.
9802 #[serde(default, skip_serializing_if = "Option::is_none")]
9803 pub scheme: Option<String>,
9804}
9805
9806/// HTTPHeader describes a custom header to be used in HTTP probes
9807#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
9808pub struct ComponentDefinitionRuntimeInitContainersReadinessProbeHttpGetHttpHeaders {
9809 /// The header field name.
9810 /// This will be canonicalized upon output, so case-variant names will be understood as the same header.
9811 pub name: String,
9812 /// The header field value
9813 pub value: String,
9814}
9815
9816/// TCPSocket specifies an action involving a TCP port.
9817#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
9818pub struct ComponentDefinitionRuntimeInitContainersReadinessProbeTcpSocket {
9819 /// Optional: Host name to connect to, defaults to the pod IP.
9820 #[serde(default, skip_serializing_if = "Option::is_none")]
9821 pub host: Option<String>,
9822 /// Number or name of the port to access on the container.
9823 /// Number must be in the range 1 to 65535.
9824 /// Name must be an IANA_SVC_NAME.
9825 pub port: IntOrString,
9826}
9827
9828/// ContainerResizePolicy represents resource resize policy for the container.
9829#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
9830pub struct ComponentDefinitionRuntimeInitContainersResizePolicy {
9831 /// Name of the resource to which this resource resize policy applies.
9832 /// Supported values: cpu, memory.
9833 #[serde(rename = "resourceName")]
9834 pub resource_name: String,
9835 /// Restart policy to apply when specified resource is resized.
9836 /// If not specified, it defaults to NotRequired.
9837 #[serde(rename = "restartPolicy")]
9838 pub restart_policy: String,
9839}
9840
9841/// Compute Resources required by this container.
9842/// Cannot be updated.
9843/// More info: <https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/>
9844#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
9845pub struct ComponentDefinitionRuntimeInitContainersResources {
9846 /// Claims lists the names of resources, defined in spec.resourceClaims,
9847 /// that are used by this container.
9848 ///
9849 /// This is an alpha field and requires enabling the
9850 /// DynamicResourceAllocation feature gate.
9851 ///
9852 /// This field is immutable. It can only be set for containers.
9853 #[serde(default, skip_serializing_if = "Option::is_none")]
9854 pub claims: Option<Vec<ComponentDefinitionRuntimeInitContainersResourcesClaims>>,
9855 /// Limits describes the maximum amount of compute resources allowed.
9856 /// More info: <https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/>
9857 #[serde(default, skip_serializing_if = "Option::is_none")]
9858 pub limits: Option<BTreeMap<String, IntOrString>>,
9859 /// Requests describes the minimum amount of compute resources required.
9860 /// If Requests is omitted for a container, it defaults to Limits if that is explicitly specified,
9861 /// otherwise to an implementation-defined value. Requests cannot exceed Limits.
9862 /// More info: <https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/>
9863 #[serde(default, skip_serializing_if = "Option::is_none")]
9864 pub requests: Option<BTreeMap<String, IntOrString>>,
9865}
9866
9867/// ResourceClaim references one entry in PodSpec.ResourceClaims.
9868#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
9869pub struct ComponentDefinitionRuntimeInitContainersResourcesClaims {
9870 /// Name must match the name of one entry in pod.spec.resourceClaims of
9871 /// the Pod where this field is used. It makes that resource available
9872 /// inside a container.
9873 pub name: String,
9874}
9875
9876/// SecurityContext defines the security options the container should be run with.
9877/// If set, the fields of SecurityContext override the equivalent fields of PodSecurityContext.
9878/// More info: <https://kubernetes.io/docs/tasks/configure-pod-container/security-context/>
9879#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
9880pub struct ComponentDefinitionRuntimeInitContainersSecurityContext {
9881 /// AllowPrivilegeEscalation controls whether a process can gain more
9882 /// privileges than its parent process. This bool directly controls if
9883 /// the no_new_privs flag will be set on the container process.
9884 /// AllowPrivilegeEscalation is true always when the container is:
9885 /// 1) run as Privileged
9886 /// 2) has CAP_SYS_ADMIN
9887 /// Note that this field cannot be set when spec.os.name is windows.
9888 #[serde(default, skip_serializing_if = "Option::is_none", rename = "allowPrivilegeEscalation")]
9889 pub allow_privilege_escalation: Option<bool>,
9890 /// The capabilities to add/drop when running containers.
9891 /// Defaults to the default set of capabilities granted by the container runtime.
9892 /// Note that this field cannot be set when spec.os.name is windows.
9893 #[serde(default, skip_serializing_if = "Option::is_none")]
9894 pub capabilities: Option<ComponentDefinitionRuntimeInitContainersSecurityContextCapabilities>,
9895 /// Run container in privileged mode.
9896 /// Processes in privileged containers are essentially equivalent to root on the host.
9897 /// Defaults to false.
9898 /// Note that this field cannot be set when spec.os.name is windows.
9899 #[serde(default, skip_serializing_if = "Option::is_none")]
9900 pub privileged: Option<bool>,
9901 /// procMount denotes the type of proc mount to use for the containers.
9902 /// The default is DefaultProcMount which uses the container runtime defaults for
9903 /// readonly paths and masked paths.
9904 /// This requires the ProcMountType feature flag to be enabled.
9905 /// Note that this field cannot be set when spec.os.name is windows.
9906 #[serde(default, skip_serializing_if = "Option::is_none", rename = "procMount")]
9907 pub proc_mount: Option<String>,
9908 /// Whether this container has a read-only root filesystem.
9909 /// Default is false.
9910 /// Note that this field cannot be set when spec.os.name is windows.
9911 #[serde(default, skip_serializing_if = "Option::is_none", rename = "readOnlyRootFilesystem")]
9912 pub read_only_root_filesystem: Option<bool>,
9913 /// The GID to run the entrypoint of the container process.
9914 /// Uses runtime default if unset.
9915 /// May also be set in PodSecurityContext. If set in both SecurityContext and
9916 /// PodSecurityContext, the value specified in SecurityContext takes precedence.
9917 /// Note that this field cannot be set when spec.os.name is windows.
9918 #[serde(default, skip_serializing_if = "Option::is_none", rename = "runAsGroup")]
9919 pub run_as_group: Option<i64>,
9920 /// Indicates that the container must run as a non-root user.
9921 /// If true, the Kubelet will validate the image at runtime to ensure that it
9922 /// does not run as UID 0 (root) and fail to start the container if it does.
9923 /// If unset or false, no such validation will be performed.
9924 /// May also be set in PodSecurityContext. If set in both SecurityContext and
9925 /// PodSecurityContext, the value specified in SecurityContext takes precedence.
9926 #[serde(default, skip_serializing_if = "Option::is_none", rename = "runAsNonRoot")]
9927 pub run_as_non_root: Option<bool>,
9928 /// The UID to run the entrypoint of the container process.
9929 /// Defaults to user specified in image metadata if unspecified.
9930 /// May also be set in PodSecurityContext. If set in both SecurityContext and
9931 /// PodSecurityContext, the value specified in SecurityContext takes precedence.
9932 /// Note that this field cannot be set when spec.os.name is windows.
9933 #[serde(default, skip_serializing_if = "Option::is_none", rename = "runAsUser")]
9934 pub run_as_user: Option<i64>,
9935 /// The SELinux context to be applied to the container.
9936 /// If unspecified, the container runtime will allocate a random SELinux context for each
9937 /// container. May also be set in PodSecurityContext. If set in both SecurityContext and
9938 /// PodSecurityContext, the value specified in SecurityContext takes precedence.
9939 /// Note that this field cannot be set when spec.os.name is windows.
9940 #[serde(default, skip_serializing_if = "Option::is_none", rename = "seLinuxOptions")]
9941 pub se_linux_options: Option<ComponentDefinitionRuntimeInitContainersSecurityContextSeLinuxOptions>,
9942 /// The seccomp options to use by this container. If seccomp options are
9943 /// provided at both the pod & container level, the container options
9944 /// override the pod options.
9945 /// Note that this field cannot be set when spec.os.name is windows.
9946 #[serde(default, skip_serializing_if = "Option::is_none", rename = "seccompProfile")]
9947 pub seccomp_profile: Option<ComponentDefinitionRuntimeInitContainersSecurityContextSeccompProfile>,
9948 /// The Windows specific settings applied to all containers.
9949 /// If unspecified, the options from the PodSecurityContext will be used.
9950 /// If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence.
9951 /// Note that this field cannot be set when spec.os.name is linux.
9952 #[serde(default, skip_serializing_if = "Option::is_none", rename = "windowsOptions")]
9953 pub windows_options: Option<ComponentDefinitionRuntimeInitContainersSecurityContextWindowsOptions>,
9954}
9955
9956/// The capabilities to add/drop when running containers.
9957/// Defaults to the default set of capabilities granted by the container runtime.
9958/// Note that this field cannot be set when spec.os.name is windows.
9959#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
9960pub struct ComponentDefinitionRuntimeInitContainersSecurityContextCapabilities {
9961 /// Added capabilities
9962 #[serde(default, skip_serializing_if = "Option::is_none")]
9963 pub add: Option<Vec<String>>,
9964 /// Removed capabilities
9965 #[serde(default, skip_serializing_if = "Option::is_none")]
9966 pub drop: Option<Vec<String>>,
9967}
9968
9969/// The SELinux context to be applied to the container.
9970/// If unspecified, the container runtime will allocate a random SELinux context for each
9971/// container. May also be set in PodSecurityContext. If set in both SecurityContext and
9972/// PodSecurityContext, the value specified in SecurityContext takes precedence.
9973/// Note that this field cannot be set when spec.os.name is windows.
9974#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
9975pub struct ComponentDefinitionRuntimeInitContainersSecurityContextSeLinuxOptions {
9976 /// Level is SELinux level label that applies to the container.
9977 #[serde(default, skip_serializing_if = "Option::is_none")]
9978 pub level: Option<String>,
9979 /// Role is a SELinux role label that applies to the container.
9980 #[serde(default, skip_serializing_if = "Option::is_none")]
9981 pub role: Option<String>,
9982 /// Type is a SELinux type label that applies to the container.
9983 #[serde(default, skip_serializing_if = "Option::is_none", rename = "type")]
9984 pub r#type: Option<String>,
9985 /// User is a SELinux user label that applies to the container.
9986 #[serde(default, skip_serializing_if = "Option::is_none")]
9987 pub user: Option<String>,
9988}
9989
9990/// The seccomp options to use by this container. If seccomp options are
9991/// provided at both the pod & container level, the container options
9992/// override the pod options.
9993/// Note that this field cannot be set when spec.os.name is windows.
9994#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
9995pub struct ComponentDefinitionRuntimeInitContainersSecurityContextSeccompProfile {
9996 /// localhostProfile indicates a profile defined in a file on the node should be used.
9997 /// The profile must be preconfigured on the node to work.
9998 /// Must be a descending path, relative to the kubelet's configured seccomp profile location.
9999 /// Must be set if type is "Localhost". Must NOT be set for any other type.
10000 #[serde(default, skip_serializing_if = "Option::is_none", rename = "localhostProfile")]
10001 pub localhost_profile: Option<String>,
10002 /// type indicates which kind of seccomp profile will be applied.
10003 /// Valid options are:
10004 ///
10005 /// Localhost - a profile defined in a file on the node should be used.
10006 /// RuntimeDefault - the container runtime default profile should be used.
10007 /// Unconfined - no profile should be applied.
10008 #[serde(rename = "type")]
10009 pub r#type: String,
10010}
10011
10012/// The Windows specific settings applied to all containers.
10013/// If unspecified, the options from the PodSecurityContext will be used.
10014/// If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence.
10015/// Note that this field cannot be set when spec.os.name is linux.
10016#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
10017pub struct ComponentDefinitionRuntimeInitContainersSecurityContextWindowsOptions {
10018 /// GMSACredentialSpec is where the GMSA admission webhook
10019 /// (<https://github.com/kubernetes-sigs/windows-gmsa)> inlines the contents of the
10020 /// GMSA credential spec named by the GMSACredentialSpecName field.
10021 #[serde(default, skip_serializing_if = "Option::is_none", rename = "gmsaCredentialSpec")]
10022 pub gmsa_credential_spec: Option<String>,
10023 /// GMSACredentialSpecName is the name of the GMSA credential spec to use.
10024 #[serde(default, skip_serializing_if = "Option::is_none", rename = "gmsaCredentialSpecName")]
10025 pub gmsa_credential_spec_name: Option<String>,
10026 /// HostProcess determines if a container should be run as a 'Host Process' container.
10027 /// All of a Pod's containers must have the same effective HostProcess value
10028 /// (it is not allowed to have a mix of HostProcess containers and non-HostProcess containers).
10029 /// In addition, if HostProcess is true then HostNetwork must also be set to true.
10030 #[serde(default, skip_serializing_if = "Option::is_none", rename = "hostProcess")]
10031 pub host_process: Option<bool>,
10032 /// The UserName in Windows to run the entrypoint of the container process.
10033 /// Defaults to the user specified in image metadata if unspecified.
10034 /// May also be set in PodSecurityContext. If set in both SecurityContext and
10035 /// PodSecurityContext, the value specified in SecurityContext takes precedence.
10036 #[serde(default, skip_serializing_if = "Option::is_none", rename = "runAsUserName")]
10037 pub run_as_user_name: Option<String>,
10038}
10039
10040/// StartupProbe indicates that the Pod has successfully initialized.
10041/// If specified, no other probes are executed until this completes successfully.
10042/// If this probe fails, the Pod will be restarted, just as if the livenessProbe failed.
10043/// This can be used to provide different probe parameters at the beginning of a Pod's lifecycle,
10044/// when it might take a long time to load data or warm a cache, than during steady-state operation.
10045/// This cannot be updated.
10046/// More info: <https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes>
10047#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
10048pub struct ComponentDefinitionRuntimeInitContainersStartupProbe {
10049 /// Exec specifies the action to take.
10050 #[serde(default, skip_serializing_if = "Option::is_none")]
10051 pub exec: Option<ComponentDefinitionRuntimeInitContainersStartupProbeExec>,
10052 /// Minimum consecutive failures for the probe to be considered failed after having succeeded.
10053 /// Defaults to 3. Minimum value is 1.
10054 #[serde(default, skip_serializing_if = "Option::is_none", rename = "failureThreshold")]
10055 pub failure_threshold: Option<i32>,
10056 /// GRPC specifies an action involving a GRPC port.
10057 #[serde(default, skip_serializing_if = "Option::is_none")]
10058 pub grpc: Option<ComponentDefinitionRuntimeInitContainersStartupProbeGrpc>,
10059 /// HTTPGet specifies the http request to perform.
10060 #[serde(default, skip_serializing_if = "Option::is_none", rename = "httpGet")]
10061 pub http_get: Option<ComponentDefinitionRuntimeInitContainersStartupProbeHttpGet>,
10062 /// Number of seconds after the container has started before liveness probes are initiated.
10063 /// More info: <https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes>
10064 #[serde(default, skip_serializing_if = "Option::is_none", rename = "initialDelaySeconds")]
10065 pub initial_delay_seconds: Option<i32>,
10066 /// How often (in seconds) to perform the probe.
10067 /// Default to 10 seconds. Minimum value is 1.
10068 #[serde(default, skip_serializing_if = "Option::is_none", rename = "periodSeconds")]
10069 pub period_seconds: Option<i32>,
10070 /// Minimum consecutive successes for the probe to be considered successful after having failed.
10071 /// Defaults to 1. Must be 1 for liveness and startup. Minimum value is 1.
10072 #[serde(default, skip_serializing_if = "Option::is_none", rename = "successThreshold")]
10073 pub success_threshold: Option<i32>,
10074 /// TCPSocket specifies an action involving a TCP port.
10075 #[serde(default, skip_serializing_if = "Option::is_none", rename = "tcpSocket")]
10076 pub tcp_socket: Option<ComponentDefinitionRuntimeInitContainersStartupProbeTcpSocket>,
10077 /// Optional duration in seconds the pod needs to terminate gracefully upon probe failure.
10078 /// The grace period is the duration in seconds after the processes running in the pod are sent
10079 /// a termination signal and the time when the processes are forcibly halted with a kill signal.
10080 /// Set this value longer than the expected cleanup time for your process.
10081 /// If this value is nil, the pod's terminationGracePeriodSeconds will be used. Otherwise, this
10082 /// value overrides the value provided by the pod spec.
10083 /// Value must be non-negative integer. The value zero indicates stop immediately via
10084 /// the kill signal (no opportunity to shut down).
10085 /// This is a beta field and requires enabling ProbeTerminationGracePeriod feature gate.
10086 /// Minimum value is 1. spec.terminationGracePeriodSeconds is used if unset.
10087 #[serde(default, skip_serializing_if = "Option::is_none", rename = "terminationGracePeriodSeconds")]
10088 pub termination_grace_period_seconds: Option<i64>,
10089 /// Number of seconds after which the probe times out.
10090 /// Defaults to 1 second. Minimum value is 1.
10091 /// More info: <https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes>
10092 #[serde(default, skip_serializing_if = "Option::is_none", rename = "timeoutSeconds")]
10093 pub timeout_seconds: Option<i32>,
10094}
10095
10096/// Exec specifies the action to take.
10097#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
10098pub struct ComponentDefinitionRuntimeInitContainersStartupProbeExec {
10099 /// Command is the command line to execute inside the container, the working directory for the
10100 /// command is root ('/') in the container's filesystem. The command is simply exec'd, it is
10101 /// not run inside a shell, so traditional shell instructions ('|', etc) won't work. To use
10102 /// a shell, you need to explicitly call out to that shell.
10103 /// Exit status of 0 is treated as live/healthy and non-zero is unhealthy.
10104 #[serde(default, skip_serializing_if = "Option::is_none")]
10105 pub command: Option<Vec<String>>,
10106}
10107
10108/// GRPC specifies an action involving a GRPC port.
10109#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
10110pub struct ComponentDefinitionRuntimeInitContainersStartupProbeGrpc {
10111 /// Port number of the gRPC service. Number must be in the range 1 to 65535.
10112 pub port: i32,
10113 /// Service is the name of the service to place in the gRPC HealthCheckRequest
10114 /// (see <https://github.com/grpc/grpc/blob/master/doc/health-checking.md).>
10115 ///
10116 /// If this is not specified, the default behavior is defined by gRPC.
10117 #[serde(default, skip_serializing_if = "Option::is_none")]
10118 pub service: Option<String>,
10119}
10120
10121/// HTTPGet specifies the http request to perform.
10122#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
10123pub struct ComponentDefinitionRuntimeInitContainersStartupProbeHttpGet {
10124 /// Host name to connect to, defaults to the pod IP. You probably want to set
10125 /// "Host" in httpHeaders instead.
10126 #[serde(default, skip_serializing_if = "Option::is_none")]
10127 pub host: Option<String>,
10128 /// Custom headers to set in the request. HTTP allows repeated headers.
10129 #[serde(default, skip_serializing_if = "Option::is_none", rename = "httpHeaders")]
10130 pub http_headers: Option<Vec<ComponentDefinitionRuntimeInitContainersStartupProbeHttpGetHttpHeaders>>,
10131 /// Path to access on the HTTP server.
10132 #[serde(default, skip_serializing_if = "Option::is_none")]
10133 pub path: Option<String>,
10134 /// Name or number of the port to access on the container.
10135 /// Number must be in the range 1 to 65535.
10136 /// Name must be an IANA_SVC_NAME.
10137 pub port: IntOrString,
10138 /// Scheme to use for connecting to the host.
10139 /// Defaults to HTTP.
10140 #[serde(default, skip_serializing_if = "Option::is_none")]
10141 pub scheme: Option<String>,
10142}
10143
10144/// HTTPHeader describes a custom header to be used in HTTP probes
10145#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
10146pub struct ComponentDefinitionRuntimeInitContainersStartupProbeHttpGetHttpHeaders {
10147 /// The header field name.
10148 /// This will be canonicalized upon output, so case-variant names will be understood as the same header.
10149 pub name: String,
10150 /// The header field value
10151 pub value: String,
10152}
10153
10154/// TCPSocket specifies an action involving a TCP port.
10155#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
10156pub struct ComponentDefinitionRuntimeInitContainersStartupProbeTcpSocket {
10157 /// Optional: Host name to connect to, defaults to the pod IP.
10158 #[serde(default, skip_serializing_if = "Option::is_none")]
10159 pub host: Option<String>,
10160 /// Number or name of the port to access on the container.
10161 /// Number must be in the range 1 to 65535.
10162 /// Name must be an IANA_SVC_NAME.
10163 pub port: IntOrString,
10164}
10165
10166/// volumeDevice describes a mapping of a raw block device within a container.
10167#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
10168pub struct ComponentDefinitionRuntimeInitContainersVolumeDevices {
10169 /// devicePath is the path inside of the container that the device will be mapped to.
10170 #[serde(rename = "devicePath")]
10171 pub device_path: String,
10172 /// name must match the name of a persistentVolumeClaim in the pod
10173 pub name: String,
10174}
10175
10176/// VolumeMount describes a mounting of a Volume within a container.
10177#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
10178pub struct ComponentDefinitionRuntimeInitContainersVolumeMounts {
10179 /// Path within the container at which the volume should be mounted. Must
10180 /// not contain ':'.
10181 #[serde(rename = "mountPath")]
10182 pub mount_path: String,
10183 /// mountPropagation determines how mounts are propagated from the host
10184 /// to container and the other way around.
10185 /// When not set, MountPropagationNone is used.
10186 /// This field is beta in 1.10.
10187 #[serde(default, skip_serializing_if = "Option::is_none", rename = "mountPropagation")]
10188 pub mount_propagation: Option<String>,
10189 /// This must match the Name of a Volume.
10190 pub name: String,
10191 /// Mounted read-only if true, read-write otherwise (false or unspecified).
10192 /// Defaults to false.
10193 #[serde(default, skip_serializing_if = "Option::is_none", rename = "readOnly")]
10194 pub read_only: Option<bool>,
10195 /// Path within the volume from which the container's volume should be mounted.
10196 /// Defaults to "" (volume's root).
10197 #[serde(default, skip_serializing_if = "Option::is_none", rename = "subPath")]
10198 pub sub_path: Option<String>,
10199 /// Expanded path within the volume from which the container's volume should be mounted.
10200 /// Behaves similarly to SubPath but environment variable references $(VAR_NAME) are expanded using the container's environment.
10201 /// Defaults to "" (volume's root).
10202 /// SubPathExpr and SubPath are mutually exclusive.
10203 #[serde(default, skip_serializing_if = "Option::is_none", rename = "subPathExpr")]
10204 pub sub_path_expr: Option<String>,
10205}
10206
10207/// Specifies the OS of the containers in the pod.
10208/// Some pod and container fields are restricted if this is set.
10209///
10210/// If the OS field is set to linux, the following fields must be unset:
10211/// -securityContext.windowsOptions
10212///
10213/// If the OS field is set to windows, following fields must be unset:
10214/// - spec.hostPID
10215/// - spec.hostIPC
10216/// - spec.hostUsers
10217/// - spec.securityContext.seLinuxOptions
10218/// - spec.securityContext.seccompProfile
10219/// - spec.securityContext.fsGroup
10220/// - spec.securityContext.fsGroupChangePolicy
10221/// - spec.securityContext.sysctls
10222/// - spec.shareProcessNamespace
10223/// - spec.securityContext.runAsUser
10224/// - spec.securityContext.runAsGroup
10225/// - spec.securityContext.supplementalGroups
10226/// - spec.containers[*].securityContext.seLinuxOptions
10227/// - spec.containers[*].securityContext.seccompProfile
10228/// - spec.containers[*].securityContext.capabilities
10229/// - spec.containers[*].securityContext.readOnlyRootFilesystem
10230/// - spec.containers[*].securityContext.privileged
10231/// - spec.containers[*].securityContext.allowPrivilegeEscalation
10232/// - spec.containers[*].securityContext.procMount
10233/// - spec.containers[*].securityContext.runAsUser
10234/// - spec.containers[*].securityContext.runAsGroup
10235#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
10236pub struct ComponentDefinitionRuntimeOs {
10237 /// Name is the name of the operating system. The currently supported values are linux and windows.
10238 /// Additional value may be defined in future and can be one of:
10239 /// <https://github.com/opencontainers/runtime-spec/blob/master/config.md#platform-specific-configuration>
10240 /// Clients should expect to handle additional values and treat unrecognized values in this field as os: null
10241 pub name: String,
10242}
10243
10244/// PodReadinessGate contains the reference to a pod condition
10245#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
10246pub struct ComponentDefinitionRuntimeReadinessGates {
10247 /// ConditionType refers to a condition in the pod's condition list with matching type.
10248 #[serde(rename = "conditionType")]
10249 pub condition_type: String,
10250}
10251
10252/// PodResourceClaim references exactly one ResourceClaim through a ClaimSource.
10253/// It adds a name to it that uniquely identifies the ResourceClaim inside the Pod.
10254/// Containers that need access to the ResourceClaim reference it with this name.
10255#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
10256pub struct ComponentDefinitionRuntimeResourceClaims {
10257 /// Name uniquely identifies this resource claim inside the pod.
10258 /// This must be a DNS_LABEL.
10259 pub name: String,
10260 /// Source describes where to find the ResourceClaim.
10261 #[serde(default, skip_serializing_if = "Option::is_none")]
10262 pub source: Option<ComponentDefinitionRuntimeResourceClaimsSource>,
10263}
10264
10265/// Source describes where to find the ResourceClaim.
10266#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
10267pub struct ComponentDefinitionRuntimeResourceClaimsSource {
10268 /// ResourceClaimName is the name of a ResourceClaim object in the same
10269 /// namespace as this pod.
10270 #[serde(default, skip_serializing_if = "Option::is_none", rename = "resourceClaimName")]
10271 pub resource_claim_name: Option<String>,
10272 /// ResourceClaimTemplateName is the name of a ResourceClaimTemplate
10273 /// object in the same namespace as this pod.
10274 ///
10275 /// The template will be used to create a new ResourceClaim, which will
10276 /// be bound to this pod. When this pod is deleted, the ResourceClaim
10277 /// will also be deleted. The pod name and resource name, along with a
10278 /// generated component, will be used to form a unique name for the
10279 /// ResourceClaim, which will be recorded in pod.status.resourceClaimStatuses.
10280 ///
10281 /// This field is immutable and no changes will be made to the
10282 /// corresponding ResourceClaim by the control plane after creating the
10283 /// ResourceClaim.
10284 #[serde(default, skip_serializing_if = "Option::is_none", rename = "resourceClaimTemplateName")]
10285 pub resource_claim_template_name: Option<String>,
10286}
10287
10288/// PodSchedulingGate is associated to a Pod to guard its scheduling.
10289#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
10290pub struct ComponentDefinitionRuntimeSchedulingGates {
10291 /// Name of the scheduling gate.
10292 /// Each scheduling gate must have a unique name field.
10293 pub name: String,
10294}
10295
10296/// SecurityContext holds pod-level security attributes and common container settings.
10297/// Optional: Defaults to empty. See type description for default values of each field.
10298#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
10299pub struct ComponentDefinitionRuntimeSecurityContext {
10300 /// A special supplemental group that applies to all containers in a pod.
10301 /// Some volume types allow the Kubelet to change the ownership of that volume
10302 /// to be owned by the pod:
10303 ///
10304 /// 1. The owning GID will be the FSGroup
10305 /// 2. The setgid bit is set (new files created in the volume will be owned by FSGroup)
10306 /// 3. The permission bits are OR'd with rw-rw----
10307 ///
10308 /// If unset, the Kubelet will not modify the ownership and permissions of any volume.
10309 /// Note that this field cannot be set when spec.os.name is windows.
10310 #[serde(default, skip_serializing_if = "Option::is_none", rename = "fsGroup")]
10311 pub fs_group: Option<i64>,
10312 /// fsGroupChangePolicy defines behavior of changing ownership and permission of the volume
10313 /// before being exposed inside Pod. This field will only apply to
10314 /// volume types which support fsGroup based ownership(and permissions).
10315 /// It will have no effect on ephemeral volume types such as: secret, configmaps
10316 /// and emptydir.
10317 /// Valid values are "OnRootMismatch" and "Always". If not specified, "Always" is used.
10318 /// Note that this field cannot be set when spec.os.name is windows.
10319 #[serde(default, skip_serializing_if = "Option::is_none", rename = "fsGroupChangePolicy")]
10320 pub fs_group_change_policy: Option<String>,
10321 /// The GID to run the entrypoint of the container process.
10322 /// Uses runtime default if unset.
10323 /// May also be set in SecurityContext. If set in both SecurityContext and
10324 /// PodSecurityContext, the value specified in SecurityContext takes precedence
10325 /// for that container.
10326 /// Note that this field cannot be set when spec.os.name is windows.
10327 #[serde(default, skip_serializing_if = "Option::is_none", rename = "runAsGroup")]
10328 pub run_as_group: Option<i64>,
10329 /// Indicates that the container must run as a non-root user.
10330 /// If true, the Kubelet will validate the image at runtime to ensure that it
10331 /// does not run as UID 0 (root) and fail to start the container if it does.
10332 /// If unset or false, no such validation will be performed.
10333 /// May also be set in SecurityContext. If set in both SecurityContext and
10334 /// PodSecurityContext, the value specified in SecurityContext takes precedence.
10335 #[serde(default, skip_serializing_if = "Option::is_none", rename = "runAsNonRoot")]
10336 pub run_as_non_root: Option<bool>,
10337 /// The UID to run the entrypoint of the container process.
10338 /// Defaults to user specified in image metadata if unspecified.
10339 /// May also be set in SecurityContext. If set in both SecurityContext and
10340 /// PodSecurityContext, the value specified in SecurityContext takes precedence
10341 /// for that container.
10342 /// Note that this field cannot be set when spec.os.name is windows.
10343 #[serde(default, skip_serializing_if = "Option::is_none", rename = "runAsUser")]
10344 pub run_as_user: Option<i64>,
10345 /// The SELinux context to be applied to all containers.
10346 /// If unspecified, the container runtime will allocate a random SELinux context for each
10347 /// container. May also be set in SecurityContext. If set in
10348 /// both SecurityContext and PodSecurityContext, the value specified in SecurityContext
10349 /// takes precedence for that container.
10350 /// Note that this field cannot be set when spec.os.name is windows.
10351 #[serde(default, skip_serializing_if = "Option::is_none", rename = "seLinuxOptions")]
10352 pub se_linux_options: Option<ComponentDefinitionRuntimeSecurityContextSeLinuxOptions>,
10353 /// The seccomp options to use by the containers in this pod.
10354 /// Note that this field cannot be set when spec.os.name is windows.
10355 #[serde(default, skip_serializing_if = "Option::is_none", rename = "seccompProfile")]
10356 pub seccomp_profile: Option<ComponentDefinitionRuntimeSecurityContextSeccompProfile>,
10357 /// A list of groups applied to the first process run in each container, in addition
10358 /// to the container's primary GID, the fsGroup (if specified), and group memberships
10359 /// defined in the container image for the uid of the container process. If unspecified,
10360 /// no additional groups are added to any container. Note that group memberships
10361 /// defined in the container image for the uid of the container process are still effective,
10362 /// even if they are not included in this list.
10363 /// Note that this field cannot be set when spec.os.name is windows.
10364 #[serde(default, skip_serializing_if = "Option::is_none", rename = "supplementalGroups")]
10365 pub supplemental_groups: Option<Vec<i64>>,
10366 /// Sysctls hold a list of namespaced sysctls used for the pod. Pods with unsupported
10367 /// sysctls (by the container runtime) might fail to launch.
10368 /// Note that this field cannot be set when spec.os.name is windows.
10369 #[serde(default, skip_serializing_if = "Option::is_none")]
10370 pub sysctls: Option<Vec<ComponentDefinitionRuntimeSecurityContextSysctls>>,
10371 /// The Windows specific settings applied to all containers.
10372 /// If unspecified, the options within a container's SecurityContext will be used.
10373 /// If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence.
10374 /// Note that this field cannot be set when spec.os.name is linux.
10375 #[serde(default, skip_serializing_if = "Option::is_none", rename = "windowsOptions")]
10376 pub windows_options: Option<ComponentDefinitionRuntimeSecurityContextWindowsOptions>,
10377}
10378
10379/// The SELinux context to be applied to all containers.
10380/// If unspecified, the container runtime will allocate a random SELinux context for each
10381/// container. May also be set in SecurityContext. If set in
10382/// both SecurityContext and PodSecurityContext, the value specified in SecurityContext
10383/// takes precedence for that container.
10384/// Note that this field cannot be set when spec.os.name is windows.
10385#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
10386pub struct ComponentDefinitionRuntimeSecurityContextSeLinuxOptions {
10387 /// Level is SELinux level label that applies to the container.
10388 #[serde(default, skip_serializing_if = "Option::is_none")]
10389 pub level: Option<String>,
10390 /// Role is a SELinux role label that applies to the container.
10391 #[serde(default, skip_serializing_if = "Option::is_none")]
10392 pub role: Option<String>,
10393 /// Type is a SELinux type label that applies to the container.
10394 #[serde(default, skip_serializing_if = "Option::is_none", rename = "type")]
10395 pub r#type: Option<String>,
10396 /// User is a SELinux user label that applies to the container.
10397 #[serde(default, skip_serializing_if = "Option::is_none")]
10398 pub user: Option<String>,
10399}
10400
10401/// The seccomp options to use by the containers in this pod.
10402/// Note that this field cannot be set when spec.os.name is windows.
10403#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
10404pub struct ComponentDefinitionRuntimeSecurityContextSeccompProfile {
10405 /// localhostProfile indicates a profile defined in a file on the node should be used.
10406 /// The profile must be preconfigured on the node to work.
10407 /// Must be a descending path, relative to the kubelet's configured seccomp profile location.
10408 /// Must be set if type is "Localhost". Must NOT be set for any other type.
10409 #[serde(default, skip_serializing_if = "Option::is_none", rename = "localhostProfile")]
10410 pub localhost_profile: Option<String>,
10411 /// type indicates which kind of seccomp profile will be applied.
10412 /// Valid options are:
10413 ///
10414 /// Localhost - a profile defined in a file on the node should be used.
10415 /// RuntimeDefault - the container runtime default profile should be used.
10416 /// Unconfined - no profile should be applied.
10417 #[serde(rename = "type")]
10418 pub r#type: String,
10419}
10420
10421/// Sysctl defines a kernel parameter to be set
10422#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
10423pub struct ComponentDefinitionRuntimeSecurityContextSysctls {
10424 /// Name of a property to set
10425 pub name: String,
10426 /// Value of a property to set
10427 pub value: String,
10428}
10429
10430/// The Windows specific settings applied to all containers.
10431/// If unspecified, the options within a container's SecurityContext will be used.
10432/// If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence.
10433/// Note that this field cannot be set when spec.os.name is linux.
10434#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
10435pub struct ComponentDefinitionRuntimeSecurityContextWindowsOptions {
10436 /// GMSACredentialSpec is where the GMSA admission webhook
10437 /// (<https://github.com/kubernetes-sigs/windows-gmsa)> inlines the contents of the
10438 /// GMSA credential spec named by the GMSACredentialSpecName field.
10439 #[serde(default, skip_serializing_if = "Option::is_none", rename = "gmsaCredentialSpec")]
10440 pub gmsa_credential_spec: Option<String>,
10441 /// GMSACredentialSpecName is the name of the GMSA credential spec to use.
10442 #[serde(default, skip_serializing_if = "Option::is_none", rename = "gmsaCredentialSpecName")]
10443 pub gmsa_credential_spec_name: Option<String>,
10444 /// HostProcess determines if a container should be run as a 'Host Process' container.
10445 /// All of a Pod's containers must have the same effective HostProcess value
10446 /// (it is not allowed to have a mix of HostProcess containers and non-HostProcess containers).
10447 /// In addition, if HostProcess is true then HostNetwork must also be set to true.
10448 #[serde(default, skip_serializing_if = "Option::is_none", rename = "hostProcess")]
10449 pub host_process: Option<bool>,
10450 /// The UserName in Windows to run the entrypoint of the container process.
10451 /// Defaults to the user specified in image metadata if unspecified.
10452 /// May also be set in PodSecurityContext. If set in both SecurityContext and
10453 /// PodSecurityContext, the value specified in SecurityContext takes precedence.
10454 #[serde(default, skip_serializing_if = "Option::is_none", rename = "runAsUserName")]
10455 pub run_as_user_name: Option<String>,
10456}
10457
10458/// The pod this Toleration is attached to tolerates any taint that matches
10459/// the triple <key,value,effect> using the matching operator <operator>.
10460#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
10461pub struct ComponentDefinitionRuntimeTolerations {
10462 /// Effect indicates the taint effect to match. Empty means match all taint effects.
10463 /// When specified, allowed values are NoSchedule, PreferNoSchedule and NoExecute.
10464 #[serde(default, skip_serializing_if = "Option::is_none")]
10465 pub effect: Option<String>,
10466 /// Key is the taint key that the toleration applies to. Empty means match all taint keys.
10467 /// If the key is empty, operator must be Exists; this combination means to match all values and all keys.
10468 #[serde(default, skip_serializing_if = "Option::is_none")]
10469 pub key: Option<String>,
10470 /// Operator represents a key's relationship to the value.
10471 /// Valid operators are Exists and Equal. Defaults to Equal.
10472 /// Exists is equivalent to wildcard for value, so that a pod can
10473 /// tolerate all taints of a particular category.
10474 #[serde(default, skip_serializing_if = "Option::is_none")]
10475 pub operator: Option<String>,
10476 /// TolerationSeconds represents the period of time the toleration (which must be
10477 /// of effect NoExecute, otherwise this field is ignored) tolerates the taint. By default,
10478 /// it is not set, which means tolerate the taint forever (do not evict). Zero and
10479 /// negative values will be treated as 0 (evict immediately) by the system.
10480 #[serde(default, skip_serializing_if = "Option::is_none", rename = "tolerationSeconds")]
10481 pub toleration_seconds: Option<i64>,
10482 /// Value is the taint value the toleration matches to.
10483 /// If the operator is Exists, the value should be empty, otherwise just a regular string.
10484 #[serde(default, skip_serializing_if = "Option::is_none")]
10485 pub value: Option<String>,
10486}
10487
10488/// TopologySpreadConstraint specifies how to spread matching pods among the given topology.
10489#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
10490pub struct ComponentDefinitionRuntimeTopologySpreadConstraints {
10491 /// LabelSelector is used to find matching pods.
10492 /// Pods that match this label selector are counted to determine the number of pods
10493 /// in their corresponding topology domain.
10494 #[serde(default, skip_serializing_if = "Option::is_none", rename = "labelSelector")]
10495 pub label_selector: Option<ComponentDefinitionRuntimeTopologySpreadConstraintsLabelSelector>,
10496 /// MatchLabelKeys is a set of pod label keys to select the pods over which
10497 /// spreading will be calculated. The keys are used to lookup values from the
10498 /// incoming pod labels, those key-value labels are ANDed with labelSelector
10499 /// to select the group of existing pods over which spreading will be calculated
10500 /// for the incoming pod. The same key is forbidden to exist in both MatchLabelKeys and LabelSelector.
10501 /// MatchLabelKeys cannot be set when LabelSelector isn't set.
10502 /// Keys that don't exist in the incoming pod labels will
10503 /// be ignored. A null or empty list means only match against labelSelector.
10504 ///
10505 /// This is a beta field and requires the MatchLabelKeysInPodTopologySpread feature gate to be enabled (enabled by default).
10506 #[serde(default, skip_serializing_if = "Option::is_none", rename = "matchLabelKeys")]
10507 pub match_label_keys: Option<Vec<String>>,
10508 /// MaxSkew describes the degree to which pods may be unevenly distributed.
10509 /// When `whenUnsatisfiable=DoNotSchedule`, it is the maximum permitted difference
10510 /// between the number of matching pods in the target topology and the global minimum.
10511 /// The global minimum is the minimum number of matching pods in an eligible domain
10512 /// or zero if the number of eligible domains is less than MinDomains.
10513 /// For example, in a 3-zone cluster, MaxSkew is set to 1, and pods with the same
10514 /// labelSelector spread as 2/2/1:
10515 /// In this case, the global minimum is 1.
10516 /// | zone1 | zone2 | zone3 |
10517 /// | P P | P P | P |
10518 /// - if MaxSkew is 1, incoming pod can only be scheduled to zone3 to become 2/2/2;
10519 /// scheduling it onto zone1(zone2) would make the ActualSkew(3-1) on zone1(zone2)
10520 /// violate MaxSkew(1).
10521 /// - if MaxSkew is 2, incoming pod can be scheduled onto any zone.
10522 /// When `whenUnsatisfiable=ScheduleAnyway`, it is used to give higher precedence
10523 /// to topologies that satisfy it.
10524 /// It's a required field. Default value is 1 and 0 is not allowed.
10525 #[serde(rename = "maxSkew")]
10526 pub max_skew: i32,
10527 /// MinDomains indicates a minimum number of eligible domains.
10528 /// When the number of eligible domains with matching topology keys is less than minDomains,
10529 /// Pod Topology Spread treats "global minimum" as 0, and then the calculation of Skew is performed.
10530 /// And when the number of eligible domains with matching topology keys equals or greater than minDomains,
10531 /// this value has no effect on scheduling.
10532 /// As a result, when the number of eligible domains is less than minDomains,
10533 /// scheduler won't schedule more than maxSkew Pods to those domains.
10534 /// If value is nil, the constraint behaves as if MinDomains is equal to 1.
10535 /// Valid values are integers greater than 0.
10536 /// When value is not nil, WhenUnsatisfiable must be DoNotSchedule.
10537 ///
10538 /// For example, in a 3-zone cluster, MaxSkew is set to 2, MinDomains is set to 5 and pods with the same
10539 /// labelSelector spread as 2/2/2:
10540 /// | zone1 | zone2 | zone3 |
10541 /// | P P | P P | P P |
10542 /// The number of domains is less than 5(MinDomains), so "global minimum" is treated as 0.
10543 /// In this situation, new pod with the same labelSelector cannot be scheduled,
10544 /// because computed skew will be 3(3 - 0) if new Pod is scheduled to any of the three zones,
10545 /// it will violate MaxSkew.
10546 ///
10547 /// This is a beta field and requires the MinDomainsInPodTopologySpread feature gate to be enabled (enabled by default).
10548 #[serde(default, skip_serializing_if = "Option::is_none", rename = "minDomains")]
10549 pub min_domains: Option<i32>,
10550 /// NodeAffinityPolicy indicates how we will treat Pod's nodeAffinity/nodeSelector
10551 /// when calculating pod topology spread skew. Options are:
10552 /// - Honor: only nodes matching nodeAffinity/nodeSelector are included in the calculations.
10553 /// - Ignore: nodeAffinity/nodeSelector are ignored. All nodes are included in the calculations.
10554 ///
10555 /// If this value is nil, the behavior is equivalent to the Honor policy.
10556 /// This is a beta-level feature default enabled by the NodeInclusionPolicyInPodTopologySpread feature flag.
10557 #[serde(default, skip_serializing_if = "Option::is_none", rename = "nodeAffinityPolicy")]
10558 pub node_affinity_policy: Option<String>,
10559 /// NodeTaintsPolicy indicates how we will treat node taints when calculating
10560 /// pod topology spread skew. Options are:
10561 /// - Honor: nodes without taints, along with tainted nodes for which the incoming pod
10562 /// has a toleration, are included.
10563 /// - Ignore: node taints are ignored. All nodes are included.
10564 ///
10565 /// If this value is nil, the behavior is equivalent to the Ignore policy.
10566 /// This is a beta-level feature default enabled by the NodeInclusionPolicyInPodTopologySpread feature flag.
10567 #[serde(default, skip_serializing_if = "Option::is_none", rename = "nodeTaintsPolicy")]
10568 pub node_taints_policy: Option<String>,
10569 /// TopologyKey is the key of node labels. Nodes that have a label with this key
10570 /// and identical values are considered to be in the same topology.
10571 /// We consider each <key, value> as a "bucket", and try to put balanced number
10572 /// of pods into each bucket.
10573 /// We define a domain as a particular instance of a topology.
10574 /// Also, we define an eligible domain as a domain whose nodes meet the requirements of
10575 /// nodeAffinityPolicy and nodeTaintsPolicy.
10576 /// e.g. If TopologyKey is "kubernetes.io/hostname", each Node is a domain of that topology.
10577 /// And, if TopologyKey is "topology.kubernetes.io/zone", each zone is a domain of that topology.
10578 /// It's a required field.
10579 #[serde(rename = "topologyKey")]
10580 pub topology_key: String,
10581 /// WhenUnsatisfiable indicates how to deal with a pod if it doesn't satisfy
10582 /// the spread constraint.
10583 /// - DoNotSchedule (default) tells the scheduler not to schedule it.
10584 /// - ScheduleAnyway tells the scheduler to schedule the pod in any location,
10585 /// but giving higher precedence to topologies that would help reduce the
10586 /// skew.
10587 /// A constraint is considered "Unsatisfiable" for an incoming pod
10588 /// if and only if every possible node assignment for that pod would violate
10589 /// "MaxSkew" on some topology.
10590 /// For example, in a 3-zone cluster, MaxSkew is set to 1, and pods with the same
10591 /// labelSelector spread as 3/1/1:
10592 /// | zone1 | zone2 | zone3 |
10593 /// | P P P | P | P |
10594 /// If WhenUnsatisfiable is set to DoNotSchedule, incoming pod can only be scheduled
10595 /// to zone2(zone3) to become 3/2/1(3/1/2) as ActualSkew(2-1) on zone2(zone3) satisfies
10596 /// MaxSkew(1). In other words, the cluster can still be imbalanced, but scheduler
10597 /// won't make it *more* imbalanced.
10598 /// It's a required field.
10599 #[serde(rename = "whenUnsatisfiable")]
10600 pub when_unsatisfiable: String,
10601}
10602
10603/// LabelSelector is used to find matching pods.
10604/// Pods that match this label selector are counted to determine the number of pods
10605/// in their corresponding topology domain.
10606#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
10607pub struct ComponentDefinitionRuntimeTopologySpreadConstraintsLabelSelector {
10608 /// matchExpressions is a list of label selector requirements. The requirements are ANDed.
10609 #[serde(default, skip_serializing_if = "Option::is_none", rename = "matchExpressions")]
10610 pub match_expressions: Option<Vec<ComponentDefinitionRuntimeTopologySpreadConstraintsLabelSelectorMatchExpressions>>,
10611 /// matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
10612 /// map is equivalent to an element of matchExpressions, whose key field is "key", the
10613 /// operator is "In", and the values array contains only "value". The requirements are ANDed.
10614 #[serde(default, skip_serializing_if = "Option::is_none", rename = "matchLabels")]
10615 pub match_labels: Option<BTreeMap<String, String>>,
10616}
10617
10618/// A label selector requirement is a selector that contains values, a key, and an operator that
10619/// relates the key and values.
10620#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
10621pub struct ComponentDefinitionRuntimeTopologySpreadConstraintsLabelSelectorMatchExpressions {
10622 /// key is the label key that the selector applies to.
10623 pub key: String,
10624 /// operator represents a key's relationship to a set of values.
10625 /// Valid operators are In, NotIn, Exists and DoesNotExist.
10626 pub operator: String,
10627 /// values is an array of string values. If the operator is In or NotIn,
10628 /// the values array must be non-empty. If the operator is Exists or DoesNotExist,
10629 /// the values array must be empty. This array is replaced during a strategic
10630 /// merge patch.
10631 #[serde(default, skip_serializing_if = "Option::is_none")]
10632 pub values: Option<Vec<String>>,
10633}
10634
10635/// Volume represents a named volume in a pod that may be accessed by any container in the pod.
10636#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
10637pub struct ComponentDefinitionRuntimeVolumes {
10638 /// awsElasticBlockStore represents an AWS Disk resource that is attached to a
10639 /// kubelet's host machine and then exposed to the pod.
10640 /// More info: <https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore>
10641 #[serde(default, skip_serializing_if = "Option::is_none", rename = "awsElasticBlockStore")]
10642 pub aws_elastic_block_store: Option<ComponentDefinitionRuntimeVolumesAwsElasticBlockStore>,
10643 /// azureDisk represents an Azure Data Disk mount on the host and bind mount to the pod.
10644 #[serde(default, skip_serializing_if = "Option::is_none", rename = "azureDisk")]
10645 pub azure_disk: Option<ComponentDefinitionRuntimeVolumesAzureDisk>,
10646 /// azureFile represents an Azure File Service mount on the host and bind mount to the pod.
10647 #[serde(default, skip_serializing_if = "Option::is_none", rename = "azureFile")]
10648 pub azure_file: Option<ComponentDefinitionRuntimeVolumesAzureFile>,
10649 /// cephFS represents a Ceph FS mount on the host that shares a pod's lifetime
10650 #[serde(default, skip_serializing_if = "Option::is_none")]
10651 pub cephfs: Option<ComponentDefinitionRuntimeVolumesCephfs>,
10652 /// cinder represents a cinder volume attached and mounted on kubelets host machine.
10653 /// More info: <https://examples.k8s.io/mysql-cinder-pd/README.md>
10654 #[serde(default, skip_serializing_if = "Option::is_none")]
10655 pub cinder: Option<ComponentDefinitionRuntimeVolumesCinder>,
10656 /// configMap represents a configMap that should populate this volume
10657 #[serde(default, skip_serializing_if = "Option::is_none", rename = "configMap")]
10658 pub config_map: Option<ComponentDefinitionRuntimeVolumesConfigMap>,
10659 /// csi (Container Storage Interface) represents ephemeral storage that is handled by certain external CSI drivers (Beta feature).
10660 #[serde(default, skip_serializing_if = "Option::is_none")]
10661 pub csi: Option<ComponentDefinitionRuntimeVolumesCsi>,
10662 /// downwardAPI represents downward API about the pod that should populate this volume
10663 #[serde(default, skip_serializing_if = "Option::is_none", rename = "downwardAPI")]
10664 pub downward_api: Option<ComponentDefinitionRuntimeVolumesDownwardApi>,
10665 /// emptyDir represents a temporary directory that shares a pod's lifetime.
10666 /// More info: <https://kubernetes.io/docs/concepts/storage/volumes#emptydir>
10667 #[serde(default, skip_serializing_if = "Option::is_none", rename = "emptyDir")]
10668 pub empty_dir: Option<ComponentDefinitionRuntimeVolumesEmptyDir>,
10669 /// ephemeral represents a volume that is handled by a cluster storage driver.
10670 /// The volume's lifecycle is tied to the pod that defines it - it will be created before the pod starts,
10671 /// and deleted when the pod is removed.
10672 ///
10673 /// Use this if:
10674 /// a) the volume is only needed while the pod runs,
10675 /// b) features of normal volumes like restoring from snapshot or capacity
10676 /// tracking are needed,
10677 /// c) the storage driver is specified through a storage class, and
10678 /// d) the storage driver supports dynamic volume provisioning through
10679 /// a PersistentVolumeClaim (see EphemeralVolumeSource for more
10680 /// information on the connection between this volume type
10681 /// and PersistentVolumeClaim).
10682 ///
10683 /// Use PersistentVolumeClaim or one of the vendor-specific
10684 /// APIs for volumes that persist for longer than the lifecycle
10685 /// of an individual pod.
10686 ///
10687 /// Use CSI for light-weight local ephemeral volumes if the CSI driver is meant to
10688 /// be used that way - see the documentation of the driver for
10689 /// more information.
10690 ///
10691 /// A pod can use both types of ephemeral volumes and
10692 /// persistent volumes at the same time.
10693 #[serde(default, skip_serializing_if = "Option::is_none")]
10694 pub ephemeral: Option<ComponentDefinitionRuntimeVolumesEphemeral>,
10695 /// fc represents a Fibre Channel resource that is attached to a kubelet's host machine and then exposed to the pod.
10696 #[serde(default, skip_serializing_if = "Option::is_none")]
10697 pub fc: Option<ComponentDefinitionRuntimeVolumesFc>,
10698 /// flexVolume represents a generic volume resource that is
10699 /// provisioned/attached using an exec based plugin.
10700 #[serde(default, skip_serializing_if = "Option::is_none", rename = "flexVolume")]
10701 pub flex_volume: Option<ComponentDefinitionRuntimeVolumesFlexVolume>,
10702 /// flocker represents a Flocker volume attached to a kubelet's host machine. This depends on the Flocker control service being running
10703 #[serde(default, skip_serializing_if = "Option::is_none")]
10704 pub flocker: Option<ComponentDefinitionRuntimeVolumesFlocker>,
10705 /// gcePersistentDisk represents a GCE Disk resource that is attached to a
10706 /// kubelet's host machine and then exposed to the pod.
10707 /// More info: <https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk>
10708 #[serde(default, skip_serializing_if = "Option::is_none", rename = "gcePersistentDisk")]
10709 pub gce_persistent_disk: Option<ComponentDefinitionRuntimeVolumesGcePersistentDisk>,
10710 /// gitRepo represents a git repository at a particular revision.
10711 /// DEPRECATED: GitRepo is deprecated. To provision a container with a git repo, mount an
10712 /// EmptyDir into an InitContainer that clones the repo using git, then mount the EmptyDir
10713 /// into the Pod's container.
10714 #[serde(default, skip_serializing_if = "Option::is_none", rename = "gitRepo")]
10715 pub git_repo: Option<ComponentDefinitionRuntimeVolumesGitRepo>,
10716 /// glusterfs represents a Glusterfs mount on the host that shares a pod's lifetime.
10717 /// More info: <https://examples.k8s.io/volumes/glusterfs/README.md>
10718 #[serde(default, skip_serializing_if = "Option::is_none")]
10719 pub glusterfs: Option<ComponentDefinitionRuntimeVolumesGlusterfs>,
10720 /// hostPath represents a pre-existing file or directory on the host
10721 /// machine that is directly exposed to the container. This is generally
10722 /// used for system agents or other privileged things that are allowed
10723 /// to see the host machine. Most containers will NOT need this.
10724 /// More info: <https://kubernetes.io/docs/concepts/storage/volumes#hostpath>
10725 #[serde(default, skip_serializing_if = "Option::is_none", rename = "hostPath")]
10726 pub host_path: Option<ComponentDefinitionRuntimeVolumesHostPath>,
10727 /// iscsi represents an ISCSI Disk resource that is attached to a
10728 /// kubelet's host machine and then exposed to the pod.
10729 /// More info: <https://examples.k8s.io/volumes/iscsi/README.md>
10730 #[serde(default, skip_serializing_if = "Option::is_none")]
10731 pub iscsi: Option<ComponentDefinitionRuntimeVolumesIscsi>,
10732 /// name of the volume.
10733 /// Must be a DNS_LABEL and unique within the pod.
10734 /// More info: <https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names>
10735 pub name: String,
10736 /// nfs represents an NFS mount on the host that shares a pod's lifetime
10737 /// More info: <https://kubernetes.io/docs/concepts/storage/volumes#nfs>
10738 #[serde(default, skip_serializing_if = "Option::is_none")]
10739 pub nfs: Option<ComponentDefinitionRuntimeVolumesNfs>,
10740 /// persistentVolumeClaimVolumeSource represents a reference to a
10741 /// PersistentVolumeClaim in the same namespace.
10742 /// More info: <https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims>
10743 #[serde(default, skip_serializing_if = "Option::is_none", rename = "persistentVolumeClaim")]
10744 pub persistent_volume_claim: Option<ComponentDefinitionRuntimeVolumesPersistentVolumeClaim>,
10745 /// photonPersistentDisk represents a PhotonController persistent disk attached and mounted on kubelets host machine
10746 #[serde(default, skip_serializing_if = "Option::is_none", rename = "photonPersistentDisk")]
10747 pub photon_persistent_disk: Option<ComponentDefinitionRuntimeVolumesPhotonPersistentDisk>,
10748 /// portworxVolume represents a portworx volume attached and mounted on kubelets host machine
10749 #[serde(default, skip_serializing_if = "Option::is_none", rename = "portworxVolume")]
10750 pub portworx_volume: Option<ComponentDefinitionRuntimeVolumesPortworxVolume>,
10751 /// projected items for all in one resources secrets, configmaps, and downward API
10752 #[serde(default, skip_serializing_if = "Option::is_none")]
10753 pub projected: Option<ComponentDefinitionRuntimeVolumesProjected>,
10754 /// quobyte represents a Quobyte mount on the host that shares a pod's lifetime
10755 #[serde(default, skip_serializing_if = "Option::is_none")]
10756 pub quobyte: Option<ComponentDefinitionRuntimeVolumesQuobyte>,
10757 /// rbd represents a Rados Block Device mount on the host that shares a pod's lifetime.
10758 /// More info: <https://examples.k8s.io/volumes/rbd/README.md>
10759 #[serde(default, skip_serializing_if = "Option::is_none")]
10760 pub rbd: Option<ComponentDefinitionRuntimeVolumesRbd>,
10761 /// scaleIO represents a ScaleIO persistent volume attached and mounted on Kubernetes nodes.
10762 #[serde(default, skip_serializing_if = "Option::is_none", rename = "scaleIO")]
10763 pub scale_io: Option<ComponentDefinitionRuntimeVolumesScaleIo>,
10764 /// secret represents a secret that should populate this volume.
10765 /// More info: <https://kubernetes.io/docs/concepts/storage/volumes#secret>
10766 #[serde(default, skip_serializing_if = "Option::is_none")]
10767 pub secret: Option<ComponentDefinitionRuntimeVolumesSecret>,
10768 /// storageOS represents a StorageOS volume attached and mounted on Kubernetes nodes.
10769 #[serde(default, skip_serializing_if = "Option::is_none")]
10770 pub storageos: Option<ComponentDefinitionRuntimeVolumesStorageos>,
10771 /// vsphereVolume represents a vSphere volume attached and mounted on kubelets host machine
10772 #[serde(default, skip_serializing_if = "Option::is_none", rename = "vsphereVolume")]
10773 pub vsphere_volume: Option<ComponentDefinitionRuntimeVolumesVsphereVolume>,
10774}
10775
10776/// awsElasticBlockStore represents an AWS Disk resource that is attached to a
10777/// kubelet's host machine and then exposed to the pod.
10778/// More info: <https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore>
10779#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
10780pub struct ComponentDefinitionRuntimeVolumesAwsElasticBlockStore {
10781 /// fsType is the filesystem type of the volume that you want to mount.
10782 /// Tip: Ensure that the filesystem type is supported by the host operating system.
10783 /// Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified.
10784 /// More info: <https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore>
10785 #[serde(default, skip_serializing_if = "Option::is_none", rename = "fsType")]
10786 pub fs_type: Option<String>,
10787 /// partition is the partition in the volume that you want to mount.
10788 /// If omitted, the default is to mount by volume name.
10789 /// Examples: For volume /dev/sda1, you specify the partition as "1".
10790 /// Similarly, the volume partition for /dev/sda is "0" (or you can leave the property empty).
10791 #[serde(default, skip_serializing_if = "Option::is_none")]
10792 pub partition: Option<i32>,
10793 /// readOnly value true will force the readOnly setting in VolumeMounts.
10794 /// More info: <https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore>
10795 #[serde(default, skip_serializing_if = "Option::is_none", rename = "readOnly")]
10796 pub read_only: Option<bool>,
10797 /// volumeID is unique ID of the persistent disk resource in AWS (Amazon EBS volume).
10798 /// More info: <https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore>
10799 #[serde(rename = "volumeID")]
10800 pub volume_id: String,
10801}
10802
10803/// azureDisk represents an Azure Data Disk mount on the host and bind mount to the pod.
10804#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
10805pub struct ComponentDefinitionRuntimeVolumesAzureDisk {
10806 /// cachingMode is the Host Caching mode: None, Read Only, Read Write.
10807 #[serde(default, skip_serializing_if = "Option::is_none", rename = "cachingMode")]
10808 pub caching_mode: Option<String>,
10809 /// diskName is the Name of the data disk in the blob storage
10810 #[serde(rename = "diskName")]
10811 pub disk_name: String,
10812 /// diskURI is the URI of data disk in the blob storage
10813 #[serde(rename = "diskURI")]
10814 pub disk_uri: String,
10815 /// fsType is Filesystem type to mount.
10816 /// Must be a filesystem type supported by the host operating system.
10817 /// Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified.
10818 #[serde(default, skip_serializing_if = "Option::is_none", rename = "fsType")]
10819 pub fs_type: Option<String>,
10820 /// kind expected values are Shared: multiple blob disks per storage account Dedicated: single blob disk per storage account Managed: azure managed data disk (only in managed availability set). defaults to shared
10821 #[serde(default, skip_serializing_if = "Option::is_none")]
10822 pub kind: Option<String>,
10823 /// readOnly Defaults to false (read/write). ReadOnly here will force
10824 /// the ReadOnly setting in VolumeMounts.
10825 #[serde(default, skip_serializing_if = "Option::is_none", rename = "readOnly")]
10826 pub read_only: Option<bool>,
10827}
10828
10829/// azureFile represents an Azure File Service mount on the host and bind mount to the pod.
10830#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
10831pub struct ComponentDefinitionRuntimeVolumesAzureFile {
10832 /// readOnly defaults to false (read/write). ReadOnly here will force
10833 /// the ReadOnly setting in VolumeMounts.
10834 #[serde(default, skip_serializing_if = "Option::is_none", rename = "readOnly")]
10835 pub read_only: Option<bool>,
10836 /// secretName is the name of secret that contains Azure Storage Account Name and Key
10837 #[serde(rename = "secretName")]
10838 pub secret_name: String,
10839 /// shareName is the azure share Name
10840 #[serde(rename = "shareName")]
10841 pub share_name: String,
10842}
10843
10844/// cephFS represents a Ceph FS mount on the host that shares a pod's lifetime
10845#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
10846pub struct ComponentDefinitionRuntimeVolumesCephfs {
10847 /// monitors is Required: Monitors is a collection of Ceph monitors
10848 /// More info: <https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it>
10849 pub monitors: Vec<String>,
10850 /// path is Optional: Used as the mounted root, rather than the full Ceph tree, default is /
10851 #[serde(default, skip_serializing_if = "Option::is_none")]
10852 pub path: Option<String>,
10853 /// readOnly is Optional: Defaults to false (read/write). ReadOnly here will force
10854 /// the ReadOnly setting in VolumeMounts.
10855 /// More info: <https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it>
10856 #[serde(default, skip_serializing_if = "Option::is_none", rename = "readOnly")]
10857 pub read_only: Option<bool>,
10858 /// secretFile is Optional: SecretFile is the path to key ring for User, default is /etc/ceph/user.secret
10859 /// More info: <https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it>
10860 #[serde(default, skip_serializing_if = "Option::is_none", rename = "secretFile")]
10861 pub secret_file: Option<String>,
10862 /// secretRef is Optional: SecretRef is reference to the authentication secret for User, default is empty.
10863 /// More info: <https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it>
10864 #[serde(default, skip_serializing_if = "Option::is_none", rename = "secretRef")]
10865 pub secret_ref: Option<ComponentDefinitionRuntimeVolumesCephfsSecretRef>,
10866 /// user is optional: User is the rados user name, default is admin
10867 /// More info: <https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it>
10868 #[serde(default, skip_serializing_if = "Option::is_none")]
10869 pub user: Option<String>,
10870}
10871
10872/// secretRef is Optional: SecretRef is reference to the authentication secret for User, default is empty.
10873/// More info: <https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it>
10874#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
10875pub struct ComponentDefinitionRuntimeVolumesCephfsSecretRef {
10876 /// Name of the referent.
10877 /// More info: <https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names>
10878 #[serde(default, skip_serializing_if = "Option::is_none")]
10879 pub name: Option<String>,
10880}
10881
10882/// cinder represents a cinder volume attached and mounted on kubelets host machine.
10883/// More info: <https://examples.k8s.io/mysql-cinder-pd/README.md>
10884#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
10885pub struct ComponentDefinitionRuntimeVolumesCinder {
10886 /// fsType is the filesystem type to mount.
10887 /// Must be a filesystem type supported by the host operating system.
10888 /// Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified.
10889 /// More info: <https://examples.k8s.io/mysql-cinder-pd/README.md>
10890 #[serde(default, skip_serializing_if = "Option::is_none", rename = "fsType")]
10891 pub fs_type: Option<String>,
10892 /// readOnly defaults to false (read/write). ReadOnly here will force
10893 /// the ReadOnly setting in VolumeMounts.
10894 /// More info: <https://examples.k8s.io/mysql-cinder-pd/README.md>
10895 #[serde(default, skip_serializing_if = "Option::is_none", rename = "readOnly")]
10896 pub read_only: Option<bool>,
10897 /// secretRef is optional: points to a secret object containing parameters used to connect
10898 /// to OpenStack.
10899 #[serde(default, skip_serializing_if = "Option::is_none", rename = "secretRef")]
10900 pub secret_ref: Option<ComponentDefinitionRuntimeVolumesCinderSecretRef>,
10901 /// volumeID used to identify the volume in cinder.
10902 /// More info: <https://examples.k8s.io/mysql-cinder-pd/README.md>
10903 #[serde(rename = "volumeID")]
10904 pub volume_id: String,
10905}
10906
10907/// secretRef is optional: points to a secret object containing parameters used to connect
10908/// to OpenStack.
10909#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
10910pub struct ComponentDefinitionRuntimeVolumesCinderSecretRef {
10911 /// Name of the referent.
10912 /// More info: <https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names>
10913 #[serde(default, skip_serializing_if = "Option::is_none")]
10914 pub name: Option<String>,
10915}
10916
10917/// configMap represents a configMap that should populate this volume
10918#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
10919pub struct ComponentDefinitionRuntimeVolumesConfigMap {
10920 /// defaultMode is optional: mode bits used to set permissions on created files by default.
10921 /// Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511.
10922 /// YAML accepts both octal and decimal values, JSON requires decimal values for mode bits.
10923 /// Defaults to 0644.
10924 /// Directories within the path are not affected by this setting.
10925 /// This might be in conflict with other options that affect the file
10926 /// mode, like fsGroup, and the result can be other mode bits set.
10927 #[serde(default, skip_serializing_if = "Option::is_none", rename = "defaultMode")]
10928 pub default_mode: Option<i32>,
10929 /// items if unspecified, each key-value pair in the Data field of the referenced
10930 /// ConfigMap will be projected into the volume as a file whose name is the
10931 /// key and content is the value. If specified, the listed keys will be
10932 /// projected into the specified paths, and unlisted keys will not be
10933 /// present. If a key is specified which is not present in the ConfigMap,
10934 /// the volume setup will error unless it is marked optional. Paths must be
10935 /// relative and may not contain the '..' path or start with '..'.
10936 #[serde(default, skip_serializing_if = "Option::is_none")]
10937 pub items: Option<Vec<ComponentDefinitionRuntimeVolumesConfigMapItems>>,
10938 /// Name of the referent.
10939 /// More info: <https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names>
10940 #[serde(default, skip_serializing_if = "Option::is_none")]
10941 pub name: Option<String>,
10942 /// optional specify whether the ConfigMap or its keys must be defined
10943 #[serde(default, skip_serializing_if = "Option::is_none")]
10944 pub optional: Option<bool>,
10945}
10946
10947/// Maps a string key to a path within a volume.
10948#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
10949pub struct ComponentDefinitionRuntimeVolumesConfigMapItems {
10950 /// key is the key to project.
10951 pub key: String,
10952 /// mode is Optional: mode bits used to set permissions on this file.
10953 /// Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511.
10954 /// YAML accepts both octal and decimal values, JSON requires decimal values for mode bits.
10955 /// If not specified, the volume defaultMode will be used.
10956 /// This might be in conflict with other options that affect the file
10957 /// mode, like fsGroup, and the result can be other mode bits set.
10958 #[serde(default, skip_serializing_if = "Option::is_none")]
10959 pub mode: Option<i32>,
10960 /// path is the relative path of the file to map the key to.
10961 /// May not be an absolute path.
10962 /// May not contain the path element '..'.
10963 /// May not start with the string '..'.
10964 pub path: String,
10965}
10966
10967/// csi (Container Storage Interface) represents ephemeral storage that is handled by certain external CSI drivers (Beta feature).
10968#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
10969pub struct ComponentDefinitionRuntimeVolumesCsi {
10970 /// driver is the name of the CSI driver that handles this volume.
10971 /// Consult with your admin for the correct name as registered in the cluster.
10972 pub driver: String,
10973 /// fsType to mount. Ex. "ext4", "xfs", "ntfs".
10974 /// If not provided, the empty value is passed to the associated CSI driver
10975 /// which will determine the default filesystem to apply.
10976 #[serde(default, skip_serializing_if = "Option::is_none", rename = "fsType")]
10977 pub fs_type: Option<String>,
10978 /// nodePublishSecretRef is a reference to the secret object containing
10979 /// sensitive information to pass to the CSI driver to complete the CSI
10980 /// NodePublishVolume and NodeUnpublishVolume calls.
10981 /// This field is optional, and may be empty if no secret is required. If the
10982 /// secret object contains more than one secret, all secret references are passed.
10983 #[serde(default, skip_serializing_if = "Option::is_none", rename = "nodePublishSecretRef")]
10984 pub node_publish_secret_ref: Option<ComponentDefinitionRuntimeVolumesCsiNodePublishSecretRef>,
10985 /// readOnly specifies a read-only configuration for the volume.
10986 /// Defaults to false (read/write).
10987 #[serde(default, skip_serializing_if = "Option::is_none", rename = "readOnly")]
10988 pub read_only: Option<bool>,
10989 /// volumeAttributes stores driver-specific properties that are passed to the CSI
10990 /// driver. Consult your driver's documentation for supported values.
10991 #[serde(default, skip_serializing_if = "Option::is_none", rename = "volumeAttributes")]
10992 pub volume_attributes: Option<BTreeMap<String, String>>,
10993}
10994
10995/// nodePublishSecretRef is a reference to the secret object containing
10996/// sensitive information to pass to the CSI driver to complete the CSI
10997/// NodePublishVolume and NodeUnpublishVolume calls.
10998/// This field is optional, and may be empty if no secret is required. If the
10999/// secret object contains more than one secret, all secret references are passed.
11000#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
11001pub struct ComponentDefinitionRuntimeVolumesCsiNodePublishSecretRef {
11002 /// Name of the referent.
11003 /// More info: <https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names>
11004 #[serde(default, skip_serializing_if = "Option::is_none")]
11005 pub name: Option<String>,
11006}
11007
11008/// downwardAPI represents downward API about the pod that should populate this volume
11009#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
11010pub struct ComponentDefinitionRuntimeVolumesDownwardApi {
11011 /// Optional: mode bits to use on created files by default. Must be a
11012 /// Optional: mode bits used to set permissions on created files by default.
11013 /// Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511.
11014 /// YAML accepts both octal and decimal values, JSON requires decimal values for mode bits.
11015 /// Defaults to 0644.
11016 /// Directories within the path are not affected by this setting.
11017 /// This might be in conflict with other options that affect the file
11018 /// mode, like fsGroup, and the result can be other mode bits set.
11019 #[serde(default, skip_serializing_if = "Option::is_none", rename = "defaultMode")]
11020 pub default_mode: Option<i32>,
11021 /// Items is a list of downward API volume file
11022 #[serde(default, skip_serializing_if = "Option::is_none")]
11023 pub items: Option<Vec<ComponentDefinitionRuntimeVolumesDownwardApiItems>>,
11024}
11025
11026/// DownwardAPIVolumeFile represents information to create the file containing the pod field
11027#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
11028pub struct ComponentDefinitionRuntimeVolumesDownwardApiItems {
11029 /// Required: Selects a field of the pod: only annotations, labels, name and namespace are supported.
11030 #[serde(default, skip_serializing_if = "Option::is_none", rename = "fieldRef")]
11031 pub field_ref: Option<ComponentDefinitionRuntimeVolumesDownwardApiItemsFieldRef>,
11032 /// Optional: mode bits used to set permissions on this file, must be an octal value
11033 /// between 0000 and 0777 or a decimal value between 0 and 511.
11034 /// YAML accepts both octal and decimal values, JSON requires decimal values for mode bits.
11035 /// If not specified, the volume defaultMode will be used.
11036 /// This might be in conflict with other options that affect the file
11037 /// mode, like fsGroup, and the result can be other mode bits set.
11038 #[serde(default, skip_serializing_if = "Option::is_none")]
11039 pub mode: Option<i32>,
11040 /// Required: Path is the relative path name of the file to be created. Must not be absolute or contain the '..' path. Must be utf-8 encoded. The first item of the relative path must not start with '..'
11041 pub path: String,
11042 /// Selects a resource of the container: only resources limits and requests
11043 /// (limits.cpu, limits.memory, requests.cpu and requests.memory) are currently supported.
11044 #[serde(default, skip_serializing_if = "Option::is_none", rename = "resourceFieldRef")]
11045 pub resource_field_ref: Option<ComponentDefinitionRuntimeVolumesDownwardApiItemsResourceFieldRef>,
11046}
11047
11048/// Required: Selects a field of the pod: only annotations, labels, name and namespace are supported.
11049#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
11050pub struct ComponentDefinitionRuntimeVolumesDownwardApiItemsFieldRef {
11051 /// Version of the schema the FieldPath is written in terms of, defaults to "v1".
11052 #[serde(default, skip_serializing_if = "Option::is_none", rename = "apiVersion")]
11053 pub api_version: Option<String>,
11054 /// Path of the field to select in the specified API version.
11055 #[serde(rename = "fieldPath")]
11056 pub field_path: String,
11057}
11058
11059/// Selects a resource of the container: only resources limits and requests
11060/// (limits.cpu, limits.memory, requests.cpu and requests.memory) are currently supported.
11061#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
11062pub struct ComponentDefinitionRuntimeVolumesDownwardApiItemsResourceFieldRef {
11063 /// Container name: required for volumes, optional for env vars
11064 #[serde(default, skip_serializing_if = "Option::is_none", rename = "containerName")]
11065 pub container_name: Option<String>,
11066 /// Specifies the output format of the exposed resources, defaults to "1"
11067 #[serde(default, skip_serializing_if = "Option::is_none")]
11068 pub divisor: Option<IntOrString>,
11069 /// Required: resource to select
11070 pub resource: String,
11071}
11072
11073/// emptyDir represents a temporary directory that shares a pod's lifetime.
11074/// More info: <https://kubernetes.io/docs/concepts/storage/volumes#emptydir>
11075#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
11076pub struct ComponentDefinitionRuntimeVolumesEmptyDir {
11077 /// medium represents what type of storage medium should back this directory.
11078 /// The default is "" which means to use the node's default medium.
11079 /// Must be an empty string (default) or Memory.
11080 /// More info: <https://kubernetes.io/docs/concepts/storage/volumes#emptydir>
11081 #[serde(default, skip_serializing_if = "Option::is_none")]
11082 pub medium: Option<String>,
11083 /// sizeLimit is the total amount of local storage required for this EmptyDir volume.
11084 /// The size limit is also applicable for memory medium.
11085 /// The maximum usage on memory medium EmptyDir would be the minimum value between
11086 /// the SizeLimit specified here and the sum of memory limits of all containers in a pod.
11087 /// The default is nil which means that the limit is undefined.
11088 /// More info: <https://kubernetes.io/docs/concepts/storage/volumes#emptydir>
11089 #[serde(default, skip_serializing_if = "Option::is_none", rename = "sizeLimit")]
11090 pub size_limit: Option<IntOrString>,
11091}
11092
11093/// ephemeral represents a volume that is handled by a cluster storage driver.
11094/// The volume's lifecycle is tied to the pod that defines it - it will be created before the pod starts,
11095/// and deleted when the pod is removed.
11096///
11097/// Use this if:
11098/// a) the volume is only needed while the pod runs,
11099/// b) features of normal volumes like restoring from snapshot or capacity
11100/// tracking are needed,
11101/// c) the storage driver is specified through a storage class, and
11102/// d) the storage driver supports dynamic volume provisioning through
11103/// a PersistentVolumeClaim (see EphemeralVolumeSource for more
11104/// information on the connection between this volume type
11105/// and PersistentVolumeClaim).
11106///
11107/// Use PersistentVolumeClaim or one of the vendor-specific
11108/// APIs for volumes that persist for longer than the lifecycle
11109/// of an individual pod.
11110///
11111/// Use CSI for light-weight local ephemeral volumes if the CSI driver is meant to
11112/// be used that way - see the documentation of the driver for
11113/// more information.
11114///
11115/// A pod can use both types of ephemeral volumes and
11116/// persistent volumes at the same time.
11117#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
11118pub struct ComponentDefinitionRuntimeVolumesEphemeral {
11119 /// Will be used to create a stand-alone PVC to provision the volume.
11120 /// The pod in which this EphemeralVolumeSource is embedded will be the
11121 /// owner of the PVC, i.e. the PVC will be deleted together with the
11122 /// pod. The name of the PVC will be `<pod name>-<volume name>` where
11123 /// `<volume name>` is the name from the `PodSpec.Volumes` array
11124 /// entry. Pod validation will reject the pod if the concatenated name
11125 /// is not valid for a PVC (for example, too long).
11126 ///
11127 /// An existing PVC with that name that is not owned by the pod
11128 /// will *not* be used for the pod to avoid using an unrelated
11129 /// volume by mistake. Starting the pod is then blocked until
11130 /// the unrelated PVC is removed. If such a pre-created PVC is
11131 /// meant to be used by the pod, the PVC has to updated with an
11132 /// owner reference to the pod once the pod exists. Normally
11133 /// this should not be necessary, but it may be useful when
11134 /// manually reconstructing a broken cluster.
11135 ///
11136 /// This field is read-only and no changes will be made by Kubernetes
11137 /// to the PVC after it has been created.
11138 ///
11139 /// Required, must not be nil.
11140 #[serde(default, skip_serializing_if = "Option::is_none", rename = "volumeClaimTemplate")]
11141 pub volume_claim_template: Option<ComponentDefinitionRuntimeVolumesEphemeralVolumeClaimTemplate>,
11142}
11143
11144/// Will be used to create a stand-alone PVC to provision the volume.
11145/// The pod in which this EphemeralVolumeSource is embedded will be the
11146/// owner of the PVC, i.e. the PVC will be deleted together with the
11147/// pod. The name of the PVC will be `<pod name>-<volume name>` where
11148/// `<volume name>` is the name from the `PodSpec.Volumes` array
11149/// entry. Pod validation will reject the pod if the concatenated name
11150/// is not valid for a PVC (for example, too long).
11151///
11152/// An existing PVC with that name that is not owned by the pod
11153/// will *not* be used for the pod to avoid using an unrelated
11154/// volume by mistake. Starting the pod is then blocked until
11155/// the unrelated PVC is removed. If such a pre-created PVC is
11156/// meant to be used by the pod, the PVC has to updated with an
11157/// owner reference to the pod once the pod exists. Normally
11158/// this should not be necessary, but it may be useful when
11159/// manually reconstructing a broken cluster.
11160///
11161/// This field is read-only and no changes will be made by Kubernetes
11162/// to the PVC after it has been created.
11163///
11164/// Required, must not be nil.
11165#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
11166pub struct ComponentDefinitionRuntimeVolumesEphemeralVolumeClaimTemplate {
11167 /// May contain labels and annotations that will be copied into the PVC
11168 /// when creating it. No other fields are allowed and will be rejected during
11169 /// validation.
11170 #[serde(default, skip_serializing_if = "Option::is_none")]
11171 pub metadata: Option<ComponentDefinitionRuntimeVolumesEphemeralVolumeClaimTemplateMetadata>,
11172 /// The specification for the PersistentVolumeClaim. The entire content is
11173 /// copied unchanged into the PVC that gets created from this
11174 /// template. The same fields as in a PersistentVolumeClaim
11175 /// are also valid here.
11176 pub spec: ComponentDefinitionRuntimeVolumesEphemeralVolumeClaimTemplateSpec,
11177}
11178
11179/// May contain labels and annotations that will be copied into the PVC
11180/// when creating it. No other fields are allowed and will be rejected during
11181/// validation.
11182#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
11183pub struct ComponentDefinitionRuntimeVolumesEphemeralVolumeClaimTemplateMetadata {
11184 #[serde(default, skip_serializing_if = "Option::is_none")]
11185 pub annotations: Option<BTreeMap<String, String>>,
11186 #[serde(default, skip_serializing_if = "Option::is_none")]
11187 pub finalizers: Option<Vec<String>>,
11188 #[serde(default, skip_serializing_if = "Option::is_none")]
11189 pub labels: Option<BTreeMap<String, String>>,
11190 #[serde(default, skip_serializing_if = "Option::is_none")]
11191 pub name: Option<String>,
11192 #[serde(default, skip_serializing_if = "Option::is_none")]
11193 pub namespace: Option<String>,
11194}
11195
11196/// The specification for the PersistentVolumeClaim. The entire content is
11197/// copied unchanged into the PVC that gets created from this
11198/// template. The same fields as in a PersistentVolumeClaim
11199/// are also valid here.
11200#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
11201pub struct ComponentDefinitionRuntimeVolumesEphemeralVolumeClaimTemplateSpec {
11202 /// accessModes contains the desired access modes the volume should have.
11203 /// More info: <https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes-1>
11204 #[serde(default, skip_serializing_if = "Option::is_none", rename = "accessModes")]
11205 pub access_modes: Option<Vec<String>>,
11206 /// dataSource field can be used to specify either:
11207 /// * An existing VolumeSnapshot object (snapshot.storage.k8s.io/VolumeSnapshot)
11208 /// * An existing PVC (PersistentVolumeClaim)
11209 /// If the provisioner or an external controller can support the specified data source,
11210 /// it will create a new volume based on the contents of the specified data source.
11211 /// When the AnyVolumeDataSource feature gate is enabled, dataSource contents will be copied to dataSourceRef,
11212 /// and dataSourceRef contents will be copied to dataSource when dataSourceRef.namespace is not specified.
11213 /// If the namespace is specified, then dataSourceRef will not be copied to dataSource.
11214 #[serde(default, skip_serializing_if = "Option::is_none", rename = "dataSource")]
11215 pub data_source: Option<ComponentDefinitionRuntimeVolumesEphemeralVolumeClaimTemplateSpecDataSource>,
11216 /// dataSourceRef specifies the object from which to populate the volume with data, if a non-empty
11217 /// volume is desired. This may be any object from a non-empty API group (non
11218 /// core object) or a PersistentVolumeClaim object.
11219 /// When this field is specified, volume binding will only succeed if the type of
11220 /// the specified object matches some installed volume populator or dynamic
11221 /// provisioner.
11222 /// This field will replace the functionality of the dataSource field and as such
11223 /// if both fields are non-empty, they must have the same value. For backwards
11224 /// compatibility, when namespace isn't specified in dataSourceRef,
11225 /// both fields (dataSource and dataSourceRef) will be set to the same
11226 /// value automatically if one of them is empty and the other is non-empty.
11227 /// When namespace is specified in dataSourceRef,
11228 /// dataSource isn't set to the same value and must be empty.
11229 /// There are three important differences between dataSource and dataSourceRef:
11230 /// * While dataSource only allows two specific types of objects, dataSourceRef
11231 /// allows any non-core object, as well as PersistentVolumeClaim objects.
11232 /// * While dataSource ignores disallowed values (dropping them), dataSourceRef
11233 /// preserves all values, and generates an error if a disallowed value is
11234 /// specified.
11235 /// * While dataSource only allows local objects, dataSourceRef allows objects
11236 /// in any namespaces.
11237 /// (Beta) Using this field requires the AnyVolumeDataSource feature gate to be enabled.
11238 /// (Alpha) Using the namespace field of dataSourceRef requires the CrossNamespaceVolumeDataSource feature gate to be enabled.
11239 #[serde(default, skip_serializing_if = "Option::is_none", rename = "dataSourceRef")]
11240 pub data_source_ref: Option<ComponentDefinitionRuntimeVolumesEphemeralVolumeClaimTemplateSpecDataSourceRef>,
11241 /// resources represents the minimum resources the volume should have.
11242 /// If RecoverVolumeExpansionFailure feature is enabled users are allowed to specify resource requirements
11243 /// that are lower than previous value but must still be higher than capacity recorded in the
11244 /// status field of the claim.
11245 /// More info: <https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources>
11246 #[serde(default, skip_serializing_if = "Option::is_none")]
11247 pub resources: Option<ComponentDefinitionRuntimeVolumesEphemeralVolumeClaimTemplateSpecResources>,
11248 /// selector is a label query over volumes to consider for binding.
11249 #[serde(default, skip_serializing_if = "Option::is_none")]
11250 pub selector: Option<ComponentDefinitionRuntimeVolumesEphemeralVolumeClaimTemplateSpecSelector>,
11251 /// storageClassName is the name of the StorageClass required by the claim.
11252 /// More info: <https://kubernetes.io/docs/concepts/storage/persistent-volumes#class-1>
11253 #[serde(default, skip_serializing_if = "Option::is_none", rename = "storageClassName")]
11254 pub storage_class_name: Option<String>,
11255 /// volumeAttributesClassName may be used to set the VolumeAttributesClass used by this claim.
11256 /// If specified, the CSI driver will create or update the volume with the attributes defined
11257 /// in the corresponding VolumeAttributesClass. This has a different purpose than storageClassName,
11258 /// it can be changed after the claim is created. An empty string value means that no VolumeAttributesClass
11259 /// will be applied to the claim but it's not allowed to reset this field to empty string once it is set.
11260 /// If unspecified and the PersistentVolumeClaim is unbound, the default VolumeAttributesClass
11261 /// will be set by the persistentvolume controller if it exists.
11262 /// If the resource referred to by volumeAttributesClass does not exist, this PersistentVolumeClaim will be
11263 /// set to a Pending state, as reflected by the modifyVolumeStatus field, until such as a resource
11264 /// exists.
11265 /// More info: <https://kubernetes.io/docs/concepts/storage/persistent-volumes#volumeattributesclass>
11266 /// (Alpha) Using this field requires the VolumeAttributesClass feature gate to be enabled.
11267 #[serde(default, skip_serializing_if = "Option::is_none", rename = "volumeAttributesClassName")]
11268 pub volume_attributes_class_name: Option<String>,
11269 /// volumeMode defines what type of volume is required by the claim.
11270 /// Value of Filesystem is implied when not included in claim spec.
11271 #[serde(default, skip_serializing_if = "Option::is_none", rename = "volumeMode")]
11272 pub volume_mode: Option<String>,
11273 /// volumeName is the binding reference to the PersistentVolume backing this claim.
11274 #[serde(default, skip_serializing_if = "Option::is_none", rename = "volumeName")]
11275 pub volume_name: Option<String>,
11276}
11277
11278/// dataSource field can be used to specify either:
11279/// * An existing VolumeSnapshot object (snapshot.storage.k8s.io/VolumeSnapshot)
11280/// * An existing PVC (PersistentVolumeClaim)
11281/// If the provisioner or an external controller can support the specified data source,
11282/// it will create a new volume based on the contents of the specified data source.
11283/// When the AnyVolumeDataSource feature gate is enabled, dataSource contents will be copied to dataSourceRef,
11284/// and dataSourceRef contents will be copied to dataSource when dataSourceRef.namespace is not specified.
11285/// If the namespace is specified, then dataSourceRef will not be copied to dataSource.
11286#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
11287pub struct ComponentDefinitionRuntimeVolumesEphemeralVolumeClaimTemplateSpecDataSource {
11288 /// APIGroup is the group for the resource being referenced.
11289 /// If APIGroup is not specified, the specified Kind must be in the core API group.
11290 /// For any other third-party types, APIGroup is required.
11291 #[serde(default, skip_serializing_if = "Option::is_none", rename = "apiGroup")]
11292 pub api_group: Option<String>,
11293 /// Kind is the type of resource being referenced
11294 pub kind: String,
11295 /// Name is the name of resource being referenced
11296 pub name: String,
11297}
11298
11299/// dataSourceRef specifies the object from which to populate the volume with data, if a non-empty
11300/// volume is desired. This may be any object from a non-empty API group (non
11301/// core object) or a PersistentVolumeClaim object.
11302/// When this field is specified, volume binding will only succeed if the type of
11303/// the specified object matches some installed volume populator or dynamic
11304/// provisioner.
11305/// This field will replace the functionality of the dataSource field and as such
11306/// if both fields are non-empty, they must have the same value. For backwards
11307/// compatibility, when namespace isn't specified in dataSourceRef,
11308/// both fields (dataSource and dataSourceRef) will be set to the same
11309/// value automatically if one of them is empty and the other is non-empty.
11310/// When namespace is specified in dataSourceRef,
11311/// dataSource isn't set to the same value and must be empty.
11312/// There are three important differences between dataSource and dataSourceRef:
11313/// * While dataSource only allows two specific types of objects, dataSourceRef
11314/// allows any non-core object, as well as PersistentVolumeClaim objects.
11315/// * While dataSource ignores disallowed values (dropping them), dataSourceRef
11316/// preserves all values, and generates an error if a disallowed value is
11317/// specified.
11318/// * While dataSource only allows local objects, dataSourceRef allows objects
11319/// in any namespaces.
11320/// (Beta) Using this field requires the AnyVolumeDataSource feature gate to be enabled.
11321/// (Alpha) Using the namespace field of dataSourceRef requires the CrossNamespaceVolumeDataSource feature gate to be enabled.
11322#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
11323pub struct ComponentDefinitionRuntimeVolumesEphemeralVolumeClaimTemplateSpecDataSourceRef {
11324 /// APIGroup is the group for the resource being referenced.
11325 /// If APIGroup is not specified, the specified Kind must be in the core API group.
11326 /// For any other third-party types, APIGroup is required.
11327 #[serde(default, skip_serializing_if = "Option::is_none", rename = "apiGroup")]
11328 pub api_group: Option<String>,
11329 /// Kind is the type of resource being referenced
11330 pub kind: String,
11331 /// Name is the name of resource being referenced
11332 pub name: String,
11333 /// Namespace is the namespace of resource being referenced
11334 /// Note that when a namespace is specified, a gateway.networking.k8s.io/ReferenceGrant object is required in the referent namespace to allow that namespace's owner to accept the reference. See the ReferenceGrant documentation for details.
11335 /// (Alpha) This field requires the CrossNamespaceVolumeDataSource feature gate to be enabled.
11336 #[serde(default, skip_serializing_if = "Option::is_none")]
11337 pub namespace: Option<String>,
11338}
11339
11340/// resources represents the minimum resources the volume should have.
11341/// If RecoverVolumeExpansionFailure feature is enabled users are allowed to specify resource requirements
11342/// that are lower than previous value but must still be higher than capacity recorded in the
11343/// status field of the claim.
11344/// More info: <https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources>
11345#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
11346pub struct ComponentDefinitionRuntimeVolumesEphemeralVolumeClaimTemplateSpecResources {
11347 /// Limits describes the maximum amount of compute resources allowed.
11348 /// More info: <https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/>
11349 #[serde(default, skip_serializing_if = "Option::is_none")]
11350 pub limits: Option<BTreeMap<String, IntOrString>>,
11351 /// Requests describes the minimum amount of compute resources required.
11352 /// If Requests is omitted for a container, it defaults to Limits if that is explicitly specified,
11353 /// otherwise to an implementation-defined value. Requests cannot exceed Limits.
11354 /// More info: <https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/>
11355 #[serde(default, skip_serializing_if = "Option::is_none")]
11356 pub requests: Option<BTreeMap<String, IntOrString>>,
11357}
11358
11359/// selector is a label query over volumes to consider for binding.
11360#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
11361pub struct ComponentDefinitionRuntimeVolumesEphemeralVolumeClaimTemplateSpecSelector {
11362 /// matchExpressions is a list of label selector requirements. The requirements are ANDed.
11363 #[serde(default, skip_serializing_if = "Option::is_none", rename = "matchExpressions")]
11364 pub match_expressions: Option<Vec<ComponentDefinitionRuntimeVolumesEphemeralVolumeClaimTemplateSpecSelectorMatchExpressions>>,
11365 /// matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
11366 /// map is equivalent to an element of matchExpressions, whose key field is "key", the
11367 /// operator is "In", and the values array contains only "value". The requirements are ANDed.
11368 #[serde(default, skip_serializing_if = "Option::is_none", rename = "matchLabels")]
11369 pub match_labels: Option<BTreeMap<String, String>>,
11370}
11371
11372/// A label selector requirement is a selector that contains values, a key, and an operator that
11373/// relates the key and values.
11374#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
11375pub struct ComponentDefinitionRuntimeVolumesEphemeralVolumeClaimTemplateSpecSelectorMatchExpressions {
11376 /// key is the label key that the selector applies to.
11377 pub key: String,
11378 /// operator represents a key's relationship to a set of values.
11379 /// Valid operators are In, NotIn, Exists and DoesNotExist.
11380 pub operator: String,
11381 /// values is an array of string values. If the operator is In or NotIn,
11382 /// the values array must be non-empty. If the operator is Exists or DoesNotExist,
11383 /// the values array must be empty. This array is replaced during a strategic
11384 /// merge patch.
11385 #[serde(default, skip_serializing_if = "Option::is_none")]
11386 pub values: Option<Vec<String>>,
11387}
11388
11389/// fc represents a Fibre Channel resource that is attached to a kubelet's host machine and then exposed to the pod.
11390#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
11391pub struct ComponentDefinitionRuntimeVolumesFc {
11392 /// fsType is the filesystem type to mount.
11393 /// Must be a filesystem type supported by the host operating system.
11394 /// Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified.
11395 #[serde(default, skip_serializing_if = "Option::is_none", rename = "fsType")]
11396 pub fs_type: Option<String>,
11397 /// lun is Optional: FC target lun number
11398 #[serde(default, skip_serializing_if = "Option::is_none")]
11399 pub lun: Option<i32>,
11400 /// readOnly is Optional: Defaults to false (read/write). ReadOnly here will force
11401 /// the ReadOnly setting in VolumeMounts.
11402 #[serde(default, skip_serializing_if = "Option::is_none", rename = "readOnly")]
11403 pub read_only: Option<bool>,
11404 /// targetWWNs is Optional: FC target worldwide names (WWNs)
11405 #[serde(default, skip_serializing_if = "Option::is_none", rename = "targetWWNs")]
11406 pub target_ww_ns: Option<Vec<String>>,
11407 /// wwids Optional: FC volume world wide identifiers (wwids)
11408 /// Either wwids or combination of targetWWNs and lun must be set, but not both simultaneously.
11409 #[serde(default, skip_serializing_if = "Option::is_none")]
11410 pub wwids: Option<Vec<String>>,
11411}
11412
11413/// flexVolume represents a generic volume resource that is
11414/// provisioned/attached using an exec based plugin.
11415#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
11416pub struct ComponentDefinitionRuntimeVolumesFlexVolume {
11417 /// driver is the name of the driver to use for this volume.
11418 pub driver: String,
11419 /// fsType is the filesystem type to mount.
11420 /// Must be a filesystem type supported by the host operating system.
11421 /// Ex. "ext4", "xfs", "ntfs". The default filesystem depends on FlexVolume script.
11422 #[serde(default, skip_serializing_if = "Option::is_none", rename = "fsType")]
11423 pub fs_type: Option<String>,
11424 /// options is Optional: this field holds extra command options if any.
11425 #[serde(default, skip_serializing_if = "Option::is_none")]
11426 pub options: Option<BTreeMap<String, String>>,
11427 /// readOnly is Optional: defaults to false (read/write). ReadOnly here will force
11428 /// the ReadOnly setting in VolumeMounts.
11429 #[serde(default, skip_serializing_if = "Option::is_none", rename = "readOnly")]
11430 pub read_only: Option<bool>,
11431 /// secretRef is Optional: secretRef is reference to the secret object containing
11432 /// sensitive information to pass to the plugin scripts. This may be
11433 /// empty if no secret object is specified. If the secret object
11434 /// contains more than one secret, all secrets are passed to the plugin
11435 /// scripts.
11436 #[serde(default, skip_serializing_if = "Option::is_none", rename = "secretRef")]
11437 pub secret_ref: Option<ComponentDefinitionRuntimeVolumesFlexVolumeSecretRef>,
11438}
11439
11440/// secretRef is Optional: secretRef is reference to the secret object containing
11441/// sensitive information to pass to the plugin scripts. This may be
11442/// empty if no secret object is specified. If the secret object
11443/// contains more than one secret, all secrets are passed to the plugin
11444/// scripts.
11445#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
11446pub struct ComponentDefinitionRuntimeVolumesFlexVolumeSecretRef {
11447 /// Name of the referent.
11448 /// More info: <https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names>
11449 #[serde(default, skip_serializing_if = "Option::is_none")]
11450 pub name: Option<String>,
11451}
11452
11453/// flocker represents a Flocker volume attached to a kubelet's host machine. This depends on the Flocker control service being running
11454#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
11455pub struct ComponentDefinitionRuntimeVolumesFlocker {
11456 /// datasetName is Name of the dataset stored as metadata -> name on the dataset for Flocker
11457 /// should be considered as deprecated
11458 #[serde(default, skip_serializing_if = "Option::is_none", rename = "datasetName")]
11459 pub dataset_name: Option<String>,
11460 /// datasetUUID is the UUID of the dataset. This is unique identifier of a Flocker dataset
11461 #[serde(default, skip_serializing_if = "Option::is_none", rename = "datasetUUID")]
11462 pub dataset_uuid: Option<String>,
11463}
11464
11465/// gcePersistentDisk represents a GCE Disk resource that is attached to a
11466/// kubelet's host machine and then exposed to the pod.
11467/// More info: <https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk>
11468#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
11469pub struct ComponentDefinitionRuntimeVolumesGcePersistentDisk {
11470 /// fsType is filesystem type of the volume that you want to mount.
11471 /// Tip: Ensure that the filesystem type is supported by the host operating system.
11472 /// Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified.
11473 /// More info: <https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk>
11474 #[serde(default, skip_serializing_if = "Option::is_none", rename = "fsType")]
11475 pub fs_type: Option<String>,
11476 /// partition is the partition in the volume that you want to mount.
11477 /// If omitted, the default is to mount by volume name.
11478 /// Examples: For volume /dev/sda1, you specify the partition as "1".
11479 /// Similarly, the volume partition for /dev/sda is "0" (or you can leave the property empty).
11480 /// More info: <https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk>
11481 #[serde(default, skip_serializing_if = "Option::is_none")]
11482 pub partition: Option<i32>,
11483 /// pdName is unique name of the PD resource in GCE. Used to identify the disk in GCE.
11484 /// More info: <https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk>
11485 #[serde(rename = "pdName")]
11486 pub pd_name: String,
11487 /// readOnly here will force the ReadOnly setting in VolumeMounts.
11488 /// Defaults to false.
11489 /// More info: <https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk>
11490 #[serde(default, skip_serializing_if = "Option::is_none", rename = "readOnly")]
11491 pub read_only: Option<bool>,
11492}
11493
11494/// gitRepo represents a git repository at a particular revision.
11495/// DEPRECATED: GitRepo is deprecated. To provision a container with a git repo, mount an
11496/// EmptyDir into an InitContainer that clones the repo using git, then mount the EmptyDir
11497/// into the Pod's container.
11498#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
11499pub struct ComponentDefinitionRuntimeVolumesGitRepo {
11500 /// directory is the target directory name.
11501 /// Must not contain or start with '..'. If '.' is supplied, the volume directory will be the
11502 /// git repository. Otherwise, if specified, the volume will contain the git repository in
11503 /// the subdirectory with the given name.
11504 #[serde(default, skip_serializing_if = "Option::is_none")]
11505 pub directory: Option<String>,
11506 /// repository is the URL
11507 pub repository: String,
11508 /// revision is the commit hash for the specified revision.
11509 #[serde(default, skip_serializing_if = "Option::is_none")]
11510 pub revision: Option<String>,
11511}
11512
11513/// glusterfs represents a Glusterfs mount on the host that shares a pod's lifetime.
11514/// More info: <https://examples.k8s.io/volumes/glusterfs/README.md>
11515#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
11516pub struct ComponentDefinitionRuntimeVolumesGlusterfs {
11517 /// endpoints is the endpoint name that details Glusterfs topology.
11518 /// More info: <https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod>
11519 pub endpoints: String,
11520 /// path is the Glusterfs volume path.
11521 /// More info: <https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod>
11522 pub path: String,
11523 /// readOnly here will force the Glusterfs volume to be mounted with read-only permissions.
11524 /// Defaults to false.
11525 /// More info: <https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod>
11526 #[serde(default, skip_serializing_if = "Option::is_none", rename = "readOnly")]
11527 pub read_only: Option<bool>,
11528}
11529
11530/// hostPath represents a pre-existing file or directory on the host
11531/// machine that is directly exposed to the container. This is generally
11532/// used for system agents or other privileged things that are allowed
11533/// to see the host machine. Most containers will NOT need this.
11534/// More info: <https://kubernetes.io/docs/concepts/storage/volumes#hostpath>
11535#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
11536pub struct ComponentDefinitionRuntimeVolumesHostPath {
11537 /// path of the directory on the host.
11538 /// If the path is a symlink, it will follow the link to the real path.
11539 /// More info: <https://kubernetes.io/docs/concepts/storage/volumes#hostpath>
11540 pub path: String,
11541 /// type for HostPath Volume
11542 /// Defaults to ""
11543 /// More info: <https://kubernetes.io/docs/concepts/storage/volumes#hostpath>
11544 #[serde(default, skip_serializing_if = "Option::is_none", rename = "type")]
11545 pub r#type: Option<String>,
11546}
11547
11548/// iscsi represents an ISCSI Disk resource that is attached to a
11549/// kubelet's host machine and then exposed to the pod.
11550/// More info: <https://examples.k8s.io/volumes/iscsi/README.md>
11551#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
11552pub struct ComponentDefinitionRuntimeVolumesIscsi {
11553 /// chapAuthDiscovery defines whether support iSCSI Discovery CHAP authentication
11554 #[serde(default, skip_serializing_if = "Option::is_none", rename = "chapAuthDiscovery")]
11555 pub chap_auth_discovery: Option<bool>,
11556 /// chapAuthSession defines whether support iSCSI Session CHAP authentication
11557 #[serde(default, skip_serializing_if = "Option::is_none", rename = "chapAuthSession")]
11558 pub chap_auth_session: Option<bool>,
11559 /// fsType is the filesystem type of the volume that you want to mount.
11560 /// Tip: Ensure that the filesystem type is supported by the host operating system.
11561 /// Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified.
11562 /// More info: <https://kubernetes.io/docs/concepts/storage/volumes#iscsi>
11563 #[serde(default, skip_serializing_if = "Option::is_none", rename = "fsType")]
11564 pub fs_type: Option<String>,
11565 /// initiatorName is the custom iSCSI Initiator Name.
11566 /// If initiatorName is specified with iscsiInterface simultaneously, new iSCSI interface
11567 /// <target portal>:<volume name> will be created for the connection.
11568 #[serde(default, skip_serializing_if = "Option::is_none", rename = "initiatorName")]
11569 pub initiator_name: Option<String>,
11570 /// iqn is the target iSCSI Qualified Name.
11571 pub iqn: String,
11572 /// iscsiInterface is the interface Name that uses an iSCSI transport.
11573 /// Defaults to 'default' (tcp).
11574 #[serde(default, skip_serializing_if = "Option::is_none", rename = "iscsiInterface")]
11575 pub iscsi_interface: Option<String>,
11576 /// lun represents iSCSI Target Lun number.
11577 pub lun: i32,
11578 /// portals is the iSCSI Target Portal List. The portal is either an IP or ip_addr:port if the port
11579 /// is other than default (typically TCP ports 860 and 3260).
11580 #[serde(default, skip_serializing_if = "Option::is_none")]
11581 pub portals: Option<Vec<String>>,
11582 /// readOnly here will force the ReadOnly setting in VolumeMounts.
11583 /// Defaults to false.
11584 #[serde(default, skip_serializing_if = "Option::is_none", rename = "readOnly")]
11585 pub read_only: Option<bool>,
11586 /// secretRef is the CHAP Secret for iSCSI target and initiator authentication
11587 #[serde(default, skip_serializing_if = "Option::is_none", rename = "secretRef")]
11588 pub secret_ref: Option<ComponentDefinitionRuntimeVolumesIscsiSecretRef>,
11589 /// targetPortal is iSCSI Target Portal. The Portal is either an IP or ip_addr:port if the port
11590 /// is other than default (typically TCP ports 860 and 3260).
11591 #[serde(rename = "targetPortal")]
11592 pub target_portal: String,
11593}
11594
11595/// secretRef is the CHAP Secret for iSCSI target and initiator authentication
11596#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
11597pub struct ComponentDefinitionRuntimeVolumesIscsiSecretRef {
11598 /// Name of the referent.
11599 /// More info: <https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names>
11600 #[serde(default, skip_serializing_if = "Option::is_none")]
11601 pub name: Option<String>,
11602}
11603
11604/// nfs represents an NFS mount on the host that shares a pod's lifetime
11605/// More info: <https://kubernetes.io/docs/concepts/storage/volumes#nfs>
11606#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
11607pub struct ComponentDefinitionRuntimeVolumesNfs {
11608 /// path that is exported by the NFS server.
11609 /// More info: <https://kubernetes.io/docs/concepts/storage/volumes#nfs>
11610 pub path: String,
11611 /// readOnly here will force the NFS export to be mounted with read-only permissions.
11612 /// Defaults to false.
11613 /// More info: <https://kubernetes.io/docs/concepts/storage/volumes#nfs>
11614 #[serde(default, skip_serializing_if = "Option::is_none", rename = "readOnly")]
11615 pub read_only: Option<bool>,
11616 /// server is the hostname or IP address of the NFS server.
11617 /// More info: <https://kubernetes.io/docs/concepts/storage/volumes#nfs>
11618 pub server: String,
11619}
11620
11621/// persistentVolumeClaimVolumeSource represents a reference to a
11622/// PersistentVolumeClaim in the same namespace.
11623/// More info: <https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims>
11624#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
11625pub struct ComponentDefinitionRuntimeVolumesPersistentVolumeClaim {
11626 /// claimName is the name of a PersistentVolumeClaim in the same namespace as the pod using this volume.
11627 /// More info: <https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims>
11628 #[serde(rename = "claimName")]
11629 pub claim_name: String,
11630 /// readOnly Will force the ReadOnly setting in VolumeMounts.
11631 /// Default false.
11632 #[serde(default, skip_serializing_if = "Option::is_none", rename = "readOnly")]
11633 pub read_only: Option<bool>,
11634}
11635
11636/// photonPersistentDisk represents a PhotonController persistent disk attached and mounted on kubelets host machine
11637#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
11638pub struct ComponentDefinitionRuntimeVolumesPhotonPersistentDisk {
11639 /// fsType is the filesystem type to mount.
11640 /// Must be a filesystem type supported by the host operating system.
11641 /// Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified.
11642 #[serde(default, skip_serializing_if = "Option::is_none", rename = "fsType")]
11643 pub fs_type: Option<String>,
11644 /// pdID is the ID that identifies Photon Controller persistent disk
11645 #[serde(rename = "pdID")]
11646 pub pd_id: String,
11647}
11648
11649/// portworxVolume represents a portworx volume attached and mounted on kubelets host machine
11650#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
11651pub struct ComponentDefinitionRuntimeVolumesPortworxVolume {
11652 /// fSType represents the filesystem type to mount
11653 /// Must be a filesystem type supported by the host operating system.
11654 /// Ex. "ext4", "xfs". Implicitly inferred to be "ext4" if unspecified.
11655 #[serde(default, skip_serializing_if = "Option::is_none", rename = "fsType")]
11656 pub fs_type: Option<String>,
11657 /// readOnly defaults to false (read/write). ReadOnly here will force
11658 /// the ReadOnly setting in VolumeMounts.
11659 #[serde(default, skip_serializing_if = "Option::is_none", rename = "readOnly")]
11660 pub read_only: Option<bool>,
11661 /// volumeID uniquely identifies a Portworx volume
11662 #[serde(rename = "volumeID")]
11663 pub volume_id: String,
11664}
11665
11666/// projected items for all in one resources secrets, configmaps, and downward API
11667#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
11668pub struct ComponentDefinitionRuntimeVolumesProjected {
11669 /// defaultMode are the mode bits used to set permissions on created files by default.
11670 /// Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511.
11671 /// YAML accepts both octal and decimal values, JSON requires decimal values for mode bits.
11672 /// Directories within the path are not affected by this setting.
11673 /// This might be in conflict with other options that affect the file
11674 /// mode, like fsGroup, and the result can be other mode bits set.
11675 #[serde(default, skip_serializing_if = "Option::is_none", rename = "defaultMode")]
11676 pub default_mode: Option<i32>,
11677 /// sources is the list of volume projections
11678 #[serde(default, skip_serializing_if = "Option::is_none")]
11679 pub sources: Option<Vec<ComponentDefinitionRuntimeVolumesProjectedSources>>,
11680}
11681
11682/// Projection that may be projected along with other supported volume types
11683#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
11684pub struct ComponentDefinitionRuntimeVolumesProjectedSources {
11685 /// ClusterTrustBundle allows a pod to access the `.spec.trustBundle` field
11686 /// of ClusterTrustBundle objects in an auto-updating file.
11687 ///
11688 /// Alpha, gated by the ClusterTrustBundleProjection feature gate.
11689 ///
11690 /// ClusterTrustBundle objects can either be selected by name, or by the
11691 /// combination of signer name and a label selector.
11692 ///
11693 /// Kubelet performs aggressive normalization of the PEM contents written
11694 /// into the pod filesystem. Esoteric PEM features such as inter-block
11695 /// comments and block headers are stripped. Certificates are deduplicated.
11696 /// The ordering of certificates within the file is arbitrary, and Kubelet
11697 /// may change the order over time.
11698 #[serde(default, skip_serializing_if = "Option::is_none", rename = "clusterTrustBundle")]
11699 pub cluster_trust_bundle: Option<ComponentDefinitionRuntimeVolumesProjectedSourcesClusterTrustBundle>,
11700 /// configMap information about the configMap data to project
11701 #[serde(default, skip_serializing_if = "Option::is_none", rename = "configMap")]
11702 pub config_map: Option<ComponentDefinitionRuntimeVolumesProjectedSourcesConfigMap>,
11703 /// downwardAPI information about the downwardAPI data to project
11704 #[serde(default, skip_serializing_if = "Option::is_none", rename = "downwardAPI")]
11705 pub downward_api: Option<ComponentDefinitionRuntimeVolumesProjectedSourcesDownwardApi>,
11706 /// secret information about the secret data to project
11707 #[serde(default, skip_serializing_if = "Option::is_none")]
11708 pub secret: Option<ComponentDefinitionRuntimeVolumesProjectedSourcesSecret>,
11709 /// serviceAccountToken is information about the serviceAccountToken data to project
11710 #[serde(default, skip_serializing_if = "Option::is_none", rename = "serviceAccountToken")]
11711 pub service_account_token: Option<ComponentDefinitionRuntimeVolumesProjectedSourcesServiceAccountToken>,
11712}
11713
11714/// ClusterTrustBundle allows a pod to access the `.spec.trustBundle` field
11715/// of ClusterTrustBundle objects in an auto-updating file.
11716///
11717/// Alpha, gated by the ClusterTrustBundleProjection feature gate.
11718///
11719/// ClusterTrustBundle objects can either be selected by name, or by the
11720/// combination of signer name and a label selector.
11721///
11722/// Kubelet performs aggressive normalization of the PEM contents written
11723/// into the pod filesystem. Esoteric PEM features such as inter-block
11724/// comments and block headers are stripped. Certificates are deduplicated.
11725/// The ordering of certificates within the file is arbitrary, and Kubelet
11726/// may change the order over time.
11727#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
11728pub struct ComponentDefinitionRuntimeVolumesProjectedSourcesClusterTrustBundle {
11729 /// Select all ClusterTrustBundles that match this label selector. Only has
11730 /// effect if signerName is set. Mutually-exclusive with name. If unset,
11731 /// interpreted as "match nothing". If set but empty, interpreted as "match
11732 /// everything".
11733 #[serde(default, skip_serializing_if = "Option::is_none", rename = "labelSelector")]
11734 pub label_selector: Option<ComponentDefinitionRuntimeVolumesProjectedSourcesClusterTrustBundleLabelSelector>,
11735 /// Select a single ClusterTrustBundle by object name. Mutually-exclusive
11736 /// with signerName and labelSelector.
11737 #[serde(default, skip_serializing_if = "Option::is_none")]
11738 pub name: Option<String>,
11739 /// If true, don't block pod startup if the referenced ClusterTrustBundle(s)
11740 /// aren't available. If using name, then the named ClusterTrustBundle is
11741 /// allowed not to exist. If using signerName, then the combination of
11742 /// signerName and labelSelector is allowed to match zero
11743 /// ClusterTrustBundles.
11744 #[serde(default, skip_serializing_if = "Option::is_none")]
11745 pub optional: Option<bool>,
11746 /// Relative path from the volume root to write the bundle.
11747 pub path: String,
11748 /// Select all ClusterTrustBundles that match this signer name.
11749 /// Mutually-exclusive with name. The contents of all selected
11750 /// ClusterTrustBundles will be unified and deduplicated.
11751 #[serde(default, skip_serializing_if = "Option::is_none", rename = "signerName")]
11752 pub signer_name: Option<String>,
11753}
11754
11755/// Select all ClusterTrustBundles that match this label selector. Only has
11756/// effect if signerName is set. Mutually-exclusive with name. If unset,
11757/// interpreted as "match nothing". If set but empty, interpreted as "match
11758/// everything".
11759#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
11760pub struct ComponentDefinitionRuntimeVolumesProjectedSourcesClusterTrustBundleLabelSelector {
11761 /// matchExpressions is a list of label selector requirements. The requirements are ANDed.
11762 #[serde(default, skip_serializing_if = "Option::is_none", rename = "matchExpressions")]
11763 pub match_expressions: Option<Vec<ComponentDefinitionRuntimeVolumesProjectedSourcesClusterTrustBundleLabelSelectorMatchExpressions>>,
11764 /// matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
11765 /// map is equivalent to an element of matchExpressions, whose key field is "key", the
11766 /// operator is "In", and the values array contains only "value". The requirements are ANDed.
11767 #[serde(default, skip_serializing_if = "Option::is_none", rename = "matchLabels")]
11768 pub match_labels: Option<BTreeMap<String, String>>,
11769}
11770
11771/// A label selector requirement is a selector that contains values, a key, and an operator that
11772/// relates the key and values.
11773#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
11774pub struct ComponentDefinitionRuntimeVolumesProjectedSourcesClusterTrustBundleLabelSelectorMatchExpressions {
11775 /// key is the label key that the selector applies to.
11776 pub key: String,
11777 /// operator represents a key's relationship to a set of values.
11778 /// Valid operators are In, NotIn, Exists and DoesNotExist.
11779 pub operator: String,
11780 /// values is an array of string values. If the operator is In or NotIn,
11781 /// the values array must be non-empty. If the operator is Exists or DoesNotExist,
11782 /// the values array must be empty. This array is replaced during a strategic
11783 /// merge patch.
11784 #[serde(default, skip_serializing_if = "Option::is_none")]
11785 pub values: Option<Vec<String>>,
11786}
11787
11788/// configMap information about the configMap data to project
11789#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
11790pub struct ComponentDefinitionRuntimeVolumesProjectedSourcesConfigMap {
11791 /// items if unspecified, each key-value pair in the Data field of the referenced
11792 /// ConfigMap will be projected into the volume as a file whose name is the
11793 /// key and content is the value. If specified, the listed keys will be
11794 /// projected into the specified paths, and unlisted keys will not be
11795 /// present. If a key is specified which is not present in the ConfigMap,
11796 /// the volume setup will error unless it is marked optional. Paths must be
11797 /// relative and may not contain the '..' path or start with '..'.
11798 #[serde(default, skip_serializing_if = "Option::is_none")]
11799 pub items: Option<Vec<ComponentDefinitionRuntimeVolumesProjectedSourcesConfigMapItems>>,
11800 /// Name of the referent.
11801 /// More info: <https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names>
11802 #[serde(default, skip_serializing_if = "Option::is_none")]
11803 pub name: Option<String>,
11804 /// optional specify whether the ConfigMap or its keys must be defined
11805 #[serde(default, skip_serializing_if = "Option::is_none")]
11806 pub optional: Option<bool>,
11807}
11808
11809/// Maps a string key to a path within a volume.
11810#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
11811pub struct ComponentDefinitionRuntimeVolumesProjectedSourcesConfigMapItems {
11812 /// key is the key to project.
11813 pub key: String,
11814 /// mode is Optional: mode bits used to set permissions on this file.
11815 /// Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511.
11816 /// YAML accepts both octal and decimal values, JSON requires decimal values for mode bits.
11817 /// If not specified, the volume defaultMode will be used.
11818 /// This might be in conflict with other options that affect the file
11819 /// mode, like fsGroup, and the result can be other mode bits set.
11820 #[serde(default, skip_serializing_if = "Option::is_none")]
11821 pub mode: Option<i32>,
11822 /// path is the relative path of the file to map the key to.
11823 /// May not be an absolute path.
11824 /// May not contain the path element '..'.
11825 /// May not start with the string '..'.
11826 pub path: String,
11827}
11828
11829/// downwardAPI information about the downwardAPI data to project
11830#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
11831pub struct ComponentDefinitionRuntimeVolumesProjectedSourcesDownwardApi {
11832 /// Items is a list of DownwardAPIVolume file
11833 #[serde(default, skip_serializing_if = "Option::is_none")]
11834 pub items: Option<Vec<ComponentDefinitionRuntimeVolumesProjectedSourcesDownwardApiItems>>,
11835}
11836
11837/// DownwardAPIVolumeFile represents information to create the file containing the pod field
11838#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
11839pub struct ComponentDefinitionRuntimeVolumesProjectedSourcesDownwardApiItems {
11840 /// Required: Selects a field of the pod: only annotations, labels, name and namespace are supported.
11841 #[serde(default, skip_serializing_if = "Option::is_none", rename = "fieldRef")]
11842 pub field_ref: Option<ComponentDefinitionRuntimeVolumesProjectedSourcesDownwardApiItemsFieldRef>,
11843 /// Optional: mode bits used to set permissions on this file, must be an octal value
11844 /// between 0000 and 0777 or a decimal value between 0 and 511.
11845 /// YAML accepts both octal and decimal values, JSON requires decimal values for mode bits.
11846 /// If not specified, the volume defaultMode will be used.
11847 /// This might be in conflict with other options that affect the file
11848 /// mode, like fsGroup, and the result can be other mode bits set.
11849 #[serde(default, skip_serializing_if = "Option::is_none")]
11850 pub mode: Option<i32>,
11851 /// Required: Path is the relative path name of the file to be created. Must not be absolute or contain the '..' path. Must be utf-8 encoded. The first item of the relative path must not start with '..'
11852 pub path: String,
11853 /// Selects a resource of the container: only resources limits and requests
11854 /// (limits.cpu, limits.memory, requests.cpu and requests.memory) are currently supported.
11855 #[serde(default, skip_serializing_if = "Option::is_none", rename = "resourceFieldRef")]
11856 pub resource_field_ref: Option<ComponentDefinitionRuntimeVolumesProjectedSourcesDownwardApiItemsResourceFieldRef>,
11857}
11858
11859/// Required: Selects a field of the pod: only annotations, labels, name and namespace are supported.
11860#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
11861pub struct ComponentDefinitionRuntimeVolumesProjectedSourcesDownwardApiItemsFieldRef {
11862 /// Version of the schema the FieldPath is written in terms of, defaults to "v1".
11863 #[serde(default, skip_serializing_if = "Option::is_none", rename = "apiVersion")]
11864 pub api_version: Option<String>,
11865 /// Path of the field to select in the specified API version.
11866 #[serde(rename = "fieldPath")]
11867 pub field_path: String,
11868}
11869
11870/// Selects a resource of the container: only resources limits and requests
11871/// (limits.cpu, limits.memory, requests.cpu and requests.memory) are currently supported.
11872#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
11873pub struct ComponentDefinitionRuntimeVolumesProjectedSourcesDownwardApiItemsResourceFieldRef {
11874 /// Container name: required for volumes, optional for env vars
11875 #[serde(default, skip_serializing_if = "Option::is_none", rename = "containerName")]
11876 pub container_name: Option<String>,
11877 /// Specifies the output format of the exposed resources, defaults to "1"
11878 #[serde(default, skip_serializing_if = "Option::is_none")]
11879 pub divisor: Option<IntOrString>,
11880 /// Required: resource to select
11881 pub resource: String,
11882}
11883
11884/// secret information about the secret data to project
11885#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
11886pub struct ComponentDefinitionRuntimeVolumesProjectedSourcesSecret {
11887 /// items if unspecified, each key-value pair in the Data field of the referenced
11888 /// Secret will be projected into the volume as a file whose name is the
11889 /// key and content is the value. If specified, the listed keys will be
11890 /// projected into the specified paths, and unlisted keys will not be
11891 /// present. If a key is specified which is not present in the Secret,
11892 /// the volume setup will error unless it is marked optional. Paths must be
11893 /// relative and may not contain the '..' path or start with '..'.
11894 #[serde(default, skip_serializing_if = "Option::is_none")]
11895 pub items: Option<Vec<ComponentDefinitionRuntimeVolumesProjectedSourcesSecretItems>>,
11896 /// Name of the referent.
11897 /// More info: <https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names>
11898 #[serde(default, skip_serializing_if = "Option::is_none")]
11899 pub name: Option<String>,
11900 /// optional field specify whether the Secret or its key must be defined
11901 #[serde(default, skip_serializing_if = "Option::is_none")]
11902 pub optional: Option<bool>,
11903}
11904
11905/// Maps a string key to a path within a volume.
11906#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
11907pub struct ComponentDefinitionRuntimeVolumesProjectedSourcesSecretItems {
11908 /// key is the key to project.
11909 pub key: String,
11910 /// mode is Optional: mode bits used to set permissions on this file.
11911 /// Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511.
11912 /// YAML accepts both octal and decimal values, JSON requires decimal values for mode bits.
11913 /// If not specified, the volume defaultMode will be used.
11914 /// This might be in conflict with other options that affect the file
11915 /// mode, like fsGroup, and the result can be other mode bits set.
11916 #[serde(default, skip_serializing_if = "Option::is_none")]
11917 pub mode: Option<i32>,
11918 /// path is the relative path of the file to map the key to.
11919 /// May not be an absolute path.
11920 /// May not contain the path element '..'.
11921 /// May not start with the string '..'.
11922 pub path: String,
11923}
11924
11925/// serviceAccountToken is information about the serviceAccountToken data to project
11926#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
11927pub struct ComponentDefinitionRuntimeVolumesProjectedSourcesServiceAccountToken {
11928 /// audience is the intended audience of the token. A recipient of a token
11929 /// must identify itself with an identifier specified in the audience of the
11930 /// token, and otherwise should reject the token. The audience defaults to the
11931 /// identifier of the apiserver.
11932 #[serde(default, skip_serializing_if = "Option::is_none")]
11933 pub audience: Option<String>,
11934 /// expirationSeconds is the requested duration of validity of the service
11935 /// account token. As the token approaches expiration, the kubelet volume
11936 /// plugin will proactively rotate the service account token. The kubelet will
11937 /// start trying to rotate the token if the token is older than 80 percent of
11938 /// its time to live or if the token is older than 24 hours.Defaults to 1 hour
11939 /// and must be at least 10 minutes.
11940 #[serde(default, skip_serializing_if = "Option::is_none", rename = "expirationSeconds")]
11941 pub expiration_seconds: Option<i64>,
11942 /// path is the path relative to the mount point of the file to project the
11943 /// token into.
11944 pub path: String,
11945}
11946
11947/// quobyte represents a Quobyte mount on the host that shares a pod's lifetime
11948#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
11949pub struct ComponentDefinitionRuntimeVolumesQuobyte {
11950 /// group to map volume access to
11951 /// Default is no group
11952 #[serde(default, skip_serializing_if = "Option::is_none")]
11953 pub group: Option<String>,
11954 /// readOnly here will force the Quobyte volume to be mounted with read-only permissions.
11955 /// Defaults to false.
11956 #[serde(default, skip_serializing_if = "Option::is_none", rename = "readOnly")]
11957 pub read_only: Option<bool>,
11958 /// registry represents a single or multiple Quobyte Registry services
11959 /// specified as a string as host:port pair (multiple entries are separated with commas)
11960 /// which acts as the central registry for volumes
11961 pub registry: String,
11962 /// tenant owning the given Quobyte volume in the Backend
11963 /// Used with dynamically provisioned Quobyte volumes, value is set by the plugin
11964 #[serde(default, skip_serializing_if = "Option::is_none")]
11965 pub tenant: Option<String>,
11966 /// user to map volume access to
11967 /// Defaults to serivceaccount user
11968 #[serde(default, skip_serializing_if = "Option::is_none")]
11969 pub user: Option<String>,
11970 /// volume is a string that references an already created Quobyte volume by name.
11971 pub volume: String,
11972}
11973
11974/// rbd represents a Rados Block Device mount on the host that shares a pod's lifetime.
11975/// More info: <https://examples.k8s.io/volumes/rbd/README.md>
11976#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
11977pub struct ComponentDefinitionRuntimeVolumesRbd {
11978 /// fsType is the filesystem type of the volume that you want to mount.
11979 /// Tip: Ensure that the filesystem type is supported by the host operating system.
11980 /// Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified.
11981 /// More info: <https://kubernetes.io/docs/concepts/storage/volumes#rbd>
11982 #[serde(default, skip_serializing_if = "Option::is_none", rename = "fsType")]
11983 pub fs_type: Option<String>,
11984 /// image is the rados image name.
11985 /// More info: <https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it>
11986 pub image: String,
11987 /// keyring is the path to key ring for RBDUser.
11988 /// Default is /etc/ceph/keyring.
11989 /// More info: <https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it>
11990 #[serde(default, skip_serializing_if = "Option::is_none")]
11991 pub keyring: Option<String>,
11992 /// monitors is a collection of Ceph monitors.
11993 /// More info: <https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it>
11994 pub monitors: Vec<String>,
11995 /// pool is the rados pool name.
11996 /// Default is rbd.
11997 /// More info: <https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it>
11998 #[serde(default, skip_serializing_if = "Option::is_none")]
11999 pub pool: Option<String>,
12000 /// readOnly here will force the ReadOnly setting in VolumeMounts.
12001 /// Defaults to false.
12002 /// More info: <https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it>
12003 #[serde(default, skip_serializing_if = "Option::is_none", rename = "readOnly")]
12004 pub read_only: Option<bool>,
12005 /// secretRef is name of the authentication secret for RBDUser. If provided
12006 /// overrides keyring.
12007 /// Default is nil.
12008 /// More info: <https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it>
12009 #[serde(default, skip_serializing_if = "Option::is_none", rename = "secretRef")]
12010 pub secret_ref: Option<ComponentDefinitionRuntimeVolumesRbdSecretRef>,
12011 /// user is the rados user name.
12012 /// Default is admin.
12013 /// More info: <https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it>
12014 #[serde(default, skip_serializing_if = "Option::is_none")]
12015 pub user: Option<String>,
12016}
12017
12018/// secretRef is name of the authentication secret for RBDUser. If provided
12019/// overrides keyring.
12020/// Default is nil.
12021/// More info: <https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it>
12022#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
12023pub struct ComponentDefinitionRuntimeVolumesRbdSecretRef {
12024 /// Name of the referent.
12025 /// More info: <https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names>
12026 #[serde(default, skip_serializing_if = "Option::is_none")]
12027 pub name: Option<String>,
12028}
12029
12030/// scaleIO represents a ScaleIO persistent volume attached and mounted on Kubernetes nodes.
12031#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
12032pub struct ComponentDefinitionRuntimeVolumesScaleIo {
12033 /// fsType is the filesystem type to mount.
12034 /// Must be a filesystem type supported by the host operating system.
12035 /// Ex. "ext4", "xfs", "ntfs".
12036 /// Default is "xfs".
12037 #[serde(default, skip_serializing_if = "Option::is_none", rename = "fsType")]
12038 pub fs_type: Option<String>,
12039 /// gateway is the host address of the ScaleIO API Gateway.
12040 pub gateway: String,
12041 /// protectionDomain is the name of the ScaleIO Protection Domain for the configured storage.
12042 #[serde(default, skip_serializing_if = "Option::is_none", rename = "protectionDomain")]
12043 pub protection_domain: Option<String>,
12044 /// readOnly Defaults to false (read/write). ReadOnly here will force
12045 /// the ReadOnly setting in VolumeMounts.
12046 #[serde(default, skip_serializing_if = "Option::is_none", rename = "readOnly")]
12047 pub read_only: Option<bool>,
12048 /// secretRef references to the secret for ScaleIO user and other
12049 /// sensitive information. If this is not provided, Login operation will fail.
12050 #[serde(rename = "secretRef")]
12051 pub secret_ref: ComponentDefinitionRuntimeVolumesScaleIoSecretRef,
12052 /// sslEnabled Flag enable/disable SSL communication with Gateway, default false
12053 #[serde(default, skip_serializing_if = "Option::is_none", rename = "sslEnabled")]
12054 pub ssl_enabled: Option<bool>,
12055 /// storageMode indicates whether the storage for a volume should be ThickProvisioned or ThinProvisioned.
12056 /// Default is ThinProvisioned.
12057 #[serde(default, skip_serializing_if = "Option::is_none", rename = "storageMode")]
12058 pub storage_mode: Option<String>,
12059 /// storagePool is the ScaleIO Storage Pool associated with the protection domain.
12060 #[serde(default, skip_serializing_if = "Option::is_none", rename = "storagePool")]
12061 pub storage_pool: Option<String>,
12062 /// system is the name of the storage system as configured in ScaleIO.
12063 pub system: String,
12064 /// volumeName is the name of a volume already created in the ScaleIO system
12065 /// that is associated with this volume source.
12066 #[serde(default, skip_serializing_if = "Option::is_none", rename = "volumeName")]
12067 pub volume_name: Option<String>,
12068}
12069
12070/// secretRef references to the secret for ScaleIO user and other
12071/// sensitive information. If this is not provided, Login operation will fail.
12072#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
12073pub struct ComponentDefinitionRuntimeVolumesScaleIoSecretRef {
12074 /// Name of the referent.
12075 /// More info: <https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names>
12076 #[serde(default, skip_serializing_if = "Option::is_none")]
12077 pub name: Option<String>,
12078}
12079
12080/// secret represents a secret that should populate this volume.
12081/// More info: <https://kubernetes.io/docs/concepts/storage/volumes#secret>
12082#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
12083pub struct ComponentDefinitionRuntimeVolumesSecret {
12084 /// defaultMode is Optional: mode bits used to set permissions on created files by default.
12085 /// Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511.
12086 /// YAML accepts both octal and decimal values, JSON requires decimal values
12087 /// for mode bits. Defaults to 0644.
12088 /// Directories within the path are not affected by this setting.
12089 /// This might be in conflict with other options that affect the file
12090 /// mode, like fsGroup, and the result can be other mode bits set.
12091 #[serde(default, skip_serializing_if = "Option::is_none", rename = "defaultMode")]
12092 pub default_mode: Option<i32>,
12093 /// items If unspecified, each key-value pair in the Data field of the referenced
12094 /// Secret will be projected into the volume as a file whose name is the
12095 /// key and content is the value. If specified, the listed keys will be
12096 /// projected into the specified paths, and unlisted keys will not be
12097 /// present. If a key is specified which is not present in the Secret,
12098 /// the volume setup will error unless it is marked optional. Paths must be
12099 /// relative and may not contain the '..' path or start with '..'.
12100 #[serde(default, skip_serializing_if = "Option::is_none")]
12101 pub items: Option<Vec<ComponentDefinitionRuntimeVolumesSecretItems>>,
12102 /// optional field specify whether the Secret or its keys must be defined
12103 #[serde(default, skip_serializing_if = "Option::is_none")]
12104 pub optional: Option<bool>,
12105 /// secretName is the name of the secret in the pod's namespace to use.
12106 /// More info: <https://kubernetes.io/docs/concepts/storage/volumes#secret>
12107 #[serde(default, skip_serializing_if = "Option::is_none", rename = "secretName")]
12108 pub secret_name: Option<String>,
12109}
12110
12111/// Maps a string key to a path within a volume.
12112#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
12113pub struct ComponentDefinitionRuntimeVolumesSecretItems {
12114 /// key is the key to project.
12115 pub key: String,
12116 /// mode is Optional: mode bits used to set permissions on this file.
12117 /// Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511.
12118 /// YAML accepts both octal and decimal values, JSON requires decimal values for mode bits.
12119 /// If not specified, the volume defaultMode will be used.
12120 /// This might be in conflict with other options that affect the file
12121 /// mode, like fsGroup, and the result can be other mode bits set.
12122 #[serde(default, skip_serializing_if = "Option::is_none")]
12123 pub mode: Option<i32>,
12124 /// path is the relative path of the file to map the key to.
12125 /// May not be an absolute path.
12126 /// May not contain the path element '..'.
12127 /// May not start with the string '..'.
12128 pub path: String,
12129}
12130
12131/// storageOS represents a StorageOS volume attached and mounted on Kubernetes nodes.
12132#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
12133pub struct ComponentDefinitionRuntimeVolumesStorageos {
12134 /// fsType is the filesystem type to mount.
12135 /// Must be a filesystem type supported by the host operating system.
12136 /// Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified.
12137 #[serde(default, skip_serializing_if = "Option::is_none", rename = "fsType")]
12138 pub fs_type: Option<String>,
12139 /// readOnly defaults to false (read/write). ReadOnly here will force
12140 /// the ReadOnly setting in VolumeMounts.
12141 #[serde(default, skip_serializing_if = "Option::is_none", rename = "readOnly")]
12142 pub read_only: Option<bool>,
12143 /// secretRef specifies the secret to use for obtaining the StorageOS API
12144 /// credentials. If not specified, default values will be attempted.
12145 #[serde(default, skip_serializing_if = "Option::is_none", rename = "secretRef")]
12146 pub secret_ref: Option<ComponentDefinitionRuntimeVolumesStorageosSecretRef>,
12147 /// volumeName is the human-readable name of the StorageOS volume. Volume
12148 /// names are only unique within a namespace.
12149 #[serde(default, skip_serializing_if = "Option::is_none", rename = "volumeName")]
12150 pub volume_name: Option<String>,
12151 /// volumeNamespace specifies the scope of the volume within StorageOS. If no
12152 /// namespace is specified then the Pod's namespace will be used. This allows the
12153 /// Kubernetes name scoping to be mirrored within StorageOS for tighter integration.
12154 /// Set VolumeName to any name to override the default behaviour.
12155 /// Set to "default" if you are not using namespaces within StorageOS.
12156 /// Namespaces that do not pre-exist within StorageOS will be created.
12157 #[serde(default, skip_serializing_if = "Option::is_none", rename = "volumeNamespace")]
12158 pub volume_namespace: Option<String>,
12159}
12160
12161/// secretRef specifies the secret to use for obtaining the StorageOS API
12162/// credentials. If not specified, default values will be attempted.
12163#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
12164pub struct ComponentDefinitionRuntimeVolumesStorageosSecretRef {
12165 /// Name of the referent.
12166 /// More info: <https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names>
12167 #[serde(default, skip_serializing_if = "Option::is_none")]
12168 pub name: Option<String>,
12169}
12170
12171/// vsphereVolume represents a vSphere volume attached and mounted on kubelets host machine
12172#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
12173pub struct ComponentDefinitionRuntimeVolumesVsphereVolume {
12174 /// fsType is filesystem type to mount.
12175 /// Must be a filesystem type supported by the host operating system.
12176 /// Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified.
12177 #[serde(default, skip_serializing_if = "Option::is_none", rename = "fsType")]
12178 pub fs_type: Option<String>,
12179 /// storagePolicyID is the storage Policy Based Management (SPBM) profile ID associated with the StoragePolicyName.
12180 #[serde(default, skip_serializing_if = "Option::is_none", rename = "storagePolicyID")]
12181 pub storage_policy_id: Option<String>,
12182 /// storagePolicyName is the storage Policy Based Management (SPBM) profile name.
12183 #[serde(default, skip_serializing_if = "Option::is_none", rename = "storagePolicyName")]
12184 pub storage_policy_name: Option<String>,
12185 /// volumePath is the path that identifies vSphere volume vmdk
12186 #[serde(rename = "volumePath")]
12187 pub volume_path: String,
12188}
12189
12190#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
12191pub struct ComponentDefinitionScripts {
12192 /// The operator attempts to set default file permissions for scripts (0555) and configurations (0444).
12193 /// However, certain database engines may require different file permissions.
12194 /// You can specify the desired file permissions here.
12195 ///
12196 /// Must be specified as an octal value between 0000 and 0777 (inclusive),
12197 /// or as a decimal value between 0 and 511 (inclusive).
12198 /// YAML supports both octal and decimal values for file permissions.
12199 ///
12200 /// Please note that this setting only affects the permissions of the files themselves.
12201 /// Directories within the specified path are not impacted by this setting.
12202 /// It's important to be aware that this setting might conflict with other options
12203 /// that influence the file mode, such as fsGroup.
12204 /// In such cases, the resulting file mode may have additional bits set.
12205 /// Refers to documents of k8s.ConfigMapVolumeSource.defaultMode for more information.
12206 #[serde(default, skip_serializing_if = "Option::is_none", rename = "defaultMode")]
12207 pub default_mode: Option<i32>,
12208 /// Specifies the name of the configuration template.
12209 pub name: String,
12210 /// Specifies the namespace of the referenced configuration template ConfigMap object.
12211 /// An empty namespace is equivalent to the "default" namespace.
12212 #[serde(default, skip_serializing_if = "Option::is_none")]
12213 pub namespace: Option<String>,
12214 /// Specifies the name of the referenced configuration template ConfigMap object.
12215 #[serde(default, skip_serializing_if = "Option::is_none", rename = "templateRef")]
12216 pub template_ref: Option<String>,
12217 /// Refers to the volume name of PodTemplate. The configuration file produced through the configuration
12218 /// template will be mounted to the corresponding volume. Must be a DNS_LABEL name.
12219 /// The volume name must be defined in podSpec.containers[*].volumeMounts.
12220 #[serde(default, skip_serializing_if = "Option::is_none", rename = "volumeName")]
12221 pub volume_name: Option<String>,
12222}
12223
12224/// ServiceRefDeclaration represents a reference to a service that can be either provided by a KubeBlocks Cluster
12225/// or an external service.
12226/// It acts as a placeholder for the actual service reference, which is determined later when a Cluster is created.
12227///
12228/// The purpose of ServiceRefDeclaration is to declare a service dependency without specifying the concrete details
12229/// of the service.
12230/// It allows for flexibility and abstraction in defining service references within a Component.
12231/// By using ServiceRefDeclaration, you can define service dependencies in a declarative manner, enabling loose coupling
12232/// and easier management of service references across different components and clusters.
12233///
12234/// Upon Cluster creation, the ServiceRefDeclaration is bound to an actual service through the ServiceRef field,
12235/// effectively resolving and connecting to the specified service.
12236#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
12237pub struct ComponentDefinitionServiceRefDeclarations {
12238 /// Specifies the name of the ServiceRefDeclaration.
12239 pub name: String,
12240 /// Specifies whether the service reference can be optional.
12241 ///
12242 /// For an optional service-ref, the component can still be created even if the service-ref is not provided.
12243 #[serde(default, skip_serializing_if = "Option::is_none")]
12244 pub optional: Option<bool>,
12245 /// Defines a list of constraints and requirements for services that can be bound to this ServiceRefDeclaration
12246 /// upon Cluster creation.
12247 /// Each ServiceRefDeclarationSpec defines a ServiceKind and ServiceVersion,
12248 /// outlining the acceptable service types and versions that are compatible.
12249 ///
12250 /// This flexibility allows a ServiceRefDeclaration to be fulfilled by any one of the provided specs.
12251 /// For example, if it requires an OLTP database, specs for both MySQL and PostgreSQL are listed,
12252 /// either MySQL or PostgreSQL services can be used when binding.
12253 #[serde(rename = "serviceRefDeclarationSpecs")]
12254 pub service_ref_declaration_specs: Vec<ComponentDefinitionServiceRefDeclarationsServiceRefDeclarationSpecs>,
12255}
12256
12257#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
12258pub struct ComponentDefinitionServiceRefDeclarationsServiceRefDeclarationSpecs {
12259 /// Specifies the type or nature of the service. This should be a well-known application cluster type, such as
12260 /// {mysql, redis, mongodb}.
12261 /// The field is case-insensitive and supports abbreviations for some well-known databases.
12262 /// For instance, both `zk` and `zookeeper` are considered as a ZooKeeper cluster, while `pg`, `postgres`, `postgresql`
12263 /// are all recognized as a PostgreSQL cluster.
12264 #[serde(rename = "serviceKind")]
12265 pub service_kind: String,
12266 /// Defines the service version of the service reference. This is a regular expression that matches a version number pattern.
12267 /// For instance, `^8.0.8$`, `8.0.\d{1,2}$`, `^[v\-]*?(\d{1,2}\.){0,3}\d{1,2}$` are all valid patterns.
12268 #[serde(rename = "serviceVersion")]
12269 pub service_version: String,
12270}
12271
12272/// ComponentService defines a service that would be exposed as an inter-component service within a Cluster.
12273/// A Service defined in the ComponentService is expected to be accessed by other Components within the same Cluster.
12274///
12275/// When a Component needs to use a ComponentService provided by another Component within the same Cluster,
12276/// it can declare a variable in the `componentDefinition.spec.vars` section and bind it to the specific exposed address
12277/// of the ComponentService using the `serviceVarRef` field.
12278#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
12279pub struct ComponentDefinitionServices {
12280 /// If ServiceType is LoadBalancer, cloud provider related parameters can be put here
12281 /// More info: <https://kubernetes.io/docs/concepts/services-networking/service/#loadbalancer.>
12282 #[serde(default, skip_serializing_if = "Option::is_none")]
12283 pub annotations: Option<BTreeMap<String, String>>,
12284 /// Indicates whether the automatic provisioning of the service should be disabled.
12285 ///
12286 /// If set to true, the service will not be automatically created at the component provisioning.
12287 /// Instead, you can enable the creation of this service by specifying it explicitly in the cluster API.
12288 #[serde(default, skip_serializing_if = "Option::is_none", rename = "disableAutoProvision")]
12289 pub disable_auto_provision: Option<bool>,
12290 /// Name defines the name of the service.
12291 /// otherwise, it indicates the name of the service.
12292 /// Others can refer to this service by its name. (e.g., connection credential)
12293 /// Cannot be updated.
12294 pub name: String,
12295 /// Indicates whether to create a corresponding Service for each Pod of the selected Component.
12296 /// When set to true, a set of Services will be automatically generated for each Pod,
12297 /// and the `roleSelector` field will be ignored.
12298 ///
12299 /// The names of the generated Services will follow the same suffix naming pattern: `$(serviceName)-$(podOrdinal)`.
12300 /// The total number of generated Services will be equal to the number of replicas specified for the Component.
12301 ///
12302 /// Example usage:
12303 ///
12304 /// ```text
12305 /// name: my-service
12306 /// serviceName: my-service
12307 /// podService: true
12308 /// disableAutoProvision: true
12309 /// spec:
12310 /// type: NodePort
12311 /// ports:
12312 /// - name: http
12313 /// port: 80
12314 /// targetPort: 8080
12315 /// ```
12316 ///
12317 /// In this example, if the Component has 3 replicas, three Services will be generated:
12318 /// - my-service-0: Points to the first Pod (podOrdinal: 0)
12319 /// - my-service-1: Points to the second Pod (podOrdinal: 1)
12320 /// - my-service-2: Points to the third Pod (podOrdinal: 2)
12321 ///
12322 /// Each generated Service will have the specified spec configuration and will target its respective Pod.
12323 ///
12324 /// This feature is useful when you need to expose each Pod of a Component individually, allowing external access
12325 /// to specific instances of the Component.
12326 #[serde(default, skip_serializing_if = "Option::is_none", rename = "podService")]
12327 pub pod_service: Option<bool>,
12328 /// Extends the above `serviceSpec.selector` by allowing you to specify defined role as selector for the service.
12329 /// When `roleSelector` is set, it adds a label selector "kubeblocks.io/role: {roleSelector}"
12330 /// to the `serviceSpec.selector`.
12331 /// Example usage:
12332 ///
12333 /// roleSelector: "leader"
12334 ///
12335 /// In this example, setting `roleSelector` to "leader" will add a label selector
12336 /// "kubeblocks.io/role: leader" to the `serviceSpec.selector`.
12337 /// This means that the service will select and route traffic to Pods with the label
12338 /// "kubeblocks.io/role" set to "leader".
12339 ///
12340 /// Note that if `podService` sets to true, RoleSelector will be ignored.
12341 /// The `podService` flag takes precedence over `roleSelector` and generates a service for each Pod.
12342 #[serde(default, skip_serializing_if = "Option::is_none", rename = "roleSelector")]
12343 pub role_selector: Option<String>,
12344 /// ServiceName defines the name of the underlying service object.
12345 /// If not specified, the default service name with different patterns will be used:
12346 ///
12347 /// - CLUSTER_NAME: for cluster-level services
12348 /// - CLUSTER_NAME-COMPONENT_NAME: for component-level services
12349 ///
12350 /// Only one default service name is allowed.
12351 /// Cannot be updated.
12352 #[serde(default, skip_serializing_if = "Option::is_none", rename = "serviceName")]
12353 pub service_name: Option<String>,
12354 /// Spec defines the behavior of a service.
12355 /// <https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status>
12356 #[serde(default, skip_serializing_if = "Option::is_none")]
12357 pub spec: Option<ComponentDefinitionServicesSpec>,
12358}
12359
12360/// Spec defines the behavior of a service.
12361/// <https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status>
12362#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
12363pub struct ComponentDefinitionServicesSpec {
12364 /// allocateLoadBalancerNodePorts defines if NodePorts will be automatically
12365 /// allocated for services with type LoadBalancer. Default is "true". It
12366 /// may be set to "false" if the cluster load-balancer does not rely on
12367 /// NodePorts. If the caller requests specific NodePorts (by specifying a
12368 /// value), those requests will be respected, regardless of this field.
12369 /// This field may only be set for services with type LoadBalancer and will
12370 /// be cleared if the type is changed to any other type.
12371 #[serde(default, skip_serializing_if = "Option::is_none", rename = "allocateLoadBalancerNodePorts")]
12372 pub allocate_load_balancer_node_ports: Option<bool>,
12373 /// clusterIP is the IP address of the service and is usually assigned
12374 /// randomly. If an address is specified manually, is in-range (as per
12375 /// system configuration), and is not in use, it will be allocated to the
12376 /// service; otherwise creation of the service will fail. This field may not
12377 /// be changed through updates unless the type field is also being changed
12378 /// to ExternalName (which requires this field to be blank) or the type
12379 /// field is being changed from ExternalName (in which case this field may
12380 /// optionally be specified, as describe above). Valid values are "None",
12381 /// empty string (""), or a valid IP address. Setting this to "None" makes a
12382 /// "headless service" (no virtual IP), which is useful when direct endpoint
12383 /// connections are preferred and proxying is not required. Only applies to
12384 /// types ClusterIP, NodePort, and LoadBalancer. If this field is specified
12385 /// when creating a Service of type ExternalName, creation will fail. This
12386 /// field will be wiped when updating a Service to type ExternalName.
12387 /// More info: <https://kubernetes.io/docs/concepts/services-networking/service/#virtual-ips-and-service-proxies>
12388 #[serde(default, skip_serializing_if = "Option::is_none", rename = "clusterIP")]
12389 pub cluster_ip: Option<String>,
12390 /// ClusterIPs is a list of IP addresses assigned to this service, and are
12391 /// usually assigned randomly. If an address is specified manually, is
12392 /// in-range (as per system configuration), and is not in use, it will be
12393 /// allocated to the service; otherwise creation of the service will fail.
12394 /// This field may not be changed through updates unless the type field is
12395 /// also being changed to ExternalName (which requires this field to be
12396 /// empty) or the type field is being changed from ExternalName (in which
12397 /// case this field may optionally be specified, as describe above). Valid
12398 /// values are "None", empty string (""), or a valid IP address. Setting
12399 /// this to "None" makes a "headless service" (no virtual IP), which is
12400 /// useful when direct endpoint connections are preferred and proxying is
12401 /// not required. Only applies to types ClusterIP, NodePort, and
12402 /// LoadBalancer. If this field is specified when creating a Service of type
12403 /// ExternalName, creation will fail. This field will be wiped when updating
12404 /// a Service to type ExternalName. If this field is not specified, it will
12405 /// be initialized from the clusterIP field. If this field is specified,
12406 /// clients must ensure that clusterIPs[0] and clusterIP have the same
12407 /// value.
12408 ///
12409 /// This field may hold a maximum of two entries (dual-stack IPs, in either order).
12410 /// These IPs must correspond to the values of the ipFamilies field. Both
12411 /// clusterIPs and ipFamilies are governed by the ipFamilyPolicy field.
12412 /// More info: <https://kubernetes.io/docs/concepts/services-networking/service/#virtual-ips-and-service-proxies>
12413 #[serde(default, skip_serializing_if = "Option::is_none", rename = "clusterIPs")]
12414 pub cluster_i_ps: Option<Vec<String>>,
12415 /// externalIPs is a list of IP addresses for which nodes in the cluster
12416 /// will also accept traffic for this service. These IPs are not managed by
12417 /// Kubernetes. The user is responsible for ensuring that traffic arrives
12418 /// at a node with this IP. A common example is external load-balancers
12419 /// that are not part of the Kubernetes system.
12420 #[serde(default, skip_serializing_if = "Option::is_none", rename = "externalIPs")]
12421 pub external_i_ps: Option<Vec<String>>,
12422 /// externalName is the external reference that discovery mechanisms will
12423 /// return as an alias for this service (e.g. a DNS CNAME record). No
12424 /// proxying will be involved. Must be a lowercase RFC-1123 hostname
12425 /// (<https://tools.ietf.org/html/rfc1123)> and requires `type` to be "ExternalName".
12426 #[serde(default, skip_serializing_if = "Option::is_none", rename = "externalName")]
12427 pub external_name: Option<String>,
12428 /// externalTrafficPolicy describes how nodes distribute service traffic they
12429 /// receive on one of the Service's "externally-facing" addresses (NodePorts,
12430 /// ExternalIPs, and LoadBalancer IPs). If set to "Local", the proxy will configure
12431 /// the service in a way that assumes that external load balancers will take care
12432 /// of balancing the service traffic between nodes, and so each node will deliver
12433 /// traffic only to the node-local endpoints of the service, without masquerading
12434 /// the client source IP. (Traffic mistakenly sent to a node with no endpoints will
12435 /// be dropped.) The default value, "Cluster", uses the standard behavior of
12436 /// routing to all endpoints evenly (possibly modified by topology and other
12437 /// features). Note that traffic sent to an External IP or LoadBalancer IP from
12438 /// within the cluster will always get "Cluster" semantics, but clients sending to
12439 /// a NodePort from within the cluster may need to take traffic policy into account
12440 /// when picking a node.
12441 #[serde(default, skip_serializing_if = "Option::is_none", rename = "externalTrafficPolicy")]
12442 pub external_traffic_policy: Option<String>,
12443 /// healthCheckNodePort specifies the healthcheck nodePort for the service.
12444 /// This only applies when type is set to LoadBalancer and
12445 /// externalTrafficPolicy is set to Local. If a value is specified, is
12446 /// in-range, and is not in use, it will be used. If not specified, a value
12447 /// will be automatically allocated. External systems (e.g. load-balancers)
12448 /// can use this port to determine if a given node holds endpoints for this
12449 /// service or not. If this field is specified when creating a Service
12450 /// which does not need it, creation will fail. This field will be wiped
12451 /// when updating a Service to no longer need it (e.g. changing type).
12452 /// This field cannot be updated once set.
12453 #[serde(default, skip_serializing_if = "Option::is_none", rename = "healthCheckNodePort")]
12454 pub health_check_node_port: Option<i32>,
12455 /// InternalTrafficPolicy describes how nodes distribute service traffic they
12456 /// receive on the ClusterIP. If set to "Local", the proxy will assume that pods
12457 /// only want to talk to endpoints of the service on the same node as the pod,
12458 /// dropping the traffic if there are no local endpoints. The default value,
12459 /// "Cluster", uses the standard behavior of routing to all endpoints evenly
12460 /// (possibly modified by topology and other features).
12461 #[serde(default, skip_serializing_if = "Option::is_none", rename = "internalTrafficPolicy")]
12462 pub internal_traffic_policy: Option<String>,
12463 /// IPFamilies is a list of IP families (e.g. IPv4, IPv6) assigned to this
12464 /// service. This field is usually assigned automatically based on cluster
12465 /// configuration and the ipFamilyPolicy field. If this field is specified
12466 /// manually, the requested family is available in the cluster,
12467 /// and ipFamilyPolicy allows it, it will be used; otherwise creation of
12468 /// the service will fail. This field is conditionally mutable: it allows
12469 /// for adding or removing a secondary IP family, but it does not allow
12470 /// changing the primary IP family of the Service. Valid values are "IPv4"
12471 /// and "IPv6". This field only applies to Services of types ClusterIP,
12472 /// NodePort, and LoadBalancer, and does apply to "headless" services.
12473 /// This field will be wiped when updating a Service to type ExternalName.
12474 ///
12475 /// This field may hold a maximum of two entries (dual-stack families, in
12476 /// either order). These families must correspond to the values of the
12477 /// clusterIPs field, if specified. Both clusterIPs and ipFamilies are
12478 /// governed by the ipFamilyPolicy field.
12479 #[serde(default, skip_serializing_if = "Option::is_none", rename = "ipFamilies")]
12480 pub ip_families: Option<Vec<String>>,
12481 /// IPFamilyPolicy represents the dual-stack-ness requested or required by
12482 /// this Service. If there is no value provided, then this field will be set
12483 /// to SingleStack. Services can be "SingleStack" (a single IP family),
12484 /// "PreferDualStack" (two IP families on dual-stack configured clusters or
12485 /// a single IP family on single-stack clusters), or "RequireDualStack"
12486 /// (two IP families on dual-stack configured clusters, otherwise fail). The
12487 /// ipFamilies and clusterIPs fields depend on the value of this field. This
12488 /// field will be wiped when updating a service to type ExternalName.
12489 #[serde(default, skip_serializing_if = "Option::is_none", rename = "ipFamilyPolicy")]
12490 pub ip_family_policy: Option<String>,
12491 /// loadBalancerClass is the class of the load balancer implementation this Service belongs to.
12492 /// If specified, the value of this field must be a label-style identifier, with an optional prefix,
12493 /// e.g. "internal-vip" or "example.com/internal-vip". Unprefixed names are reserved for end-users.
12494 /// This field can only be set when the Service type is 'LoadBalancer'. If not set, the default load
12495 /// balancer implementation is used, today this is typically done through the cloud provider integration,
12496 /// but should apply for any default implementation. If set, it is assumed that a load balancer
12497 /// implementation is watching for Services with a matching class. Any default load balancer
12498 /// implementation (e.g. cloud providers) should ignore Services that set this field.
12499 /// This field can only be set when creating or updating a Service to type 'LoadBalancer'.
12500 /// Once set, it can not be changed. This field will be wiped when a service is updated to a non 'LoadBalancer' type.
12501 #[serde(default, skip_serializing_if = "Option::is_none", rename = "loadBalancerClass")]
12502 pub load_balancer_class: Option<String>,
12503 /// Only applies to Service Type: LoadBalancer.
12504 /// This feature depends on whether the underlying cloud-provider supports specifying
12505 /// the loadBalancerIP when a load balancer is created.
12506 /// This field will be ignored if the cloud-provider does not support the feature.
12507 /// Deprecated: This field was under-specified and its meaning varies across implementations.
12508 /// Using it is non-portable and it may not support dual-stack.
12509 /// Users are encouraged to use implementation-specific annotations when available.
12510 #[serde(default, skip_serializing_if = "Option::is_none", rename = "loadBalancerIP")]
12511 pub load_balancer_ip: Option<String>,
12512 /// If specified and supported by the platform, this will restrict traffic through the cloud-provider
12513 /// load-balancer will be restricted to the specified client IPs. This field will be ignored if the
12514 /// cloud-provider does not support the feature."
12515 /// More info: <https://kubernetes.io/docs/tasks/access-application-cluster/create-external-load-balancer/>
12516 #[serde(default, skip_serializing_if = "Option::is_none", rename = "loadBalancerSourceRanges")]
12517 pub load_balancer_source_ranges: Option<Vec<String>>,
12518 /// The list of ports that are exposed by this service.
12519 /// More info: <https://kubernetes.io/docs/concepts/services-networking/service/#virtual-ips-and-service-proxies>
12520 #[serde(default, skip_serializing_if = "Option::is_none")]
12521 pub ports: Option<Vec<ComponentDefinitionServicesSpecPorts>>,
12522 /// publishNotReadyAddresses indicates that any agent which deals with endpoints for this
12523 /// Service should disregard any indications of ready/not-ready.
12524 /// The primary use case for setting this field is for a StatefulSet's Headless Service to
12525 /// propagate SRV DNS records for its Pods for the purpose of peer discovery.
12526 /// The Kubernetes controllers that generate Endpoints and EndpointSlice resources for
12527 /// Services interpret this to mean that all endpoints are considered "ready" even if the
12528 /// Pods themselves are not. Agents which consume only Kubernetes generated endpoints
12529 /// through the Endpoints or EndpointSlice resources can safely assume this behavior.
12530 #[serde(default, skip_serializing_if = "Option::is_none", rename = "publishNotReadyAddresses")]
12531 pub publish_not_ready_addresses: Option<bool>,
12532 /// Route service traffic to pods with label keys and values matching this
12533 /// selector. If empty or not present, the service is assumed to have an
12534 /// external process managing its endpoints, which Kubernetes will not
12535 /// modify. Only applies to types ClusterIP, NodePort, and LoadBalancer.
12536 /// Ignored if type is ExternalName.
12537 /// More info: <https://kubernetes.io/docs/concepts/services-networking/service/>
12538 #[serde(default, skip_serializing_if = "Option::is_none")]
12539 pub selector: Option<BTreeMap<String, String>>,
12540 /// Supports "ClientIP" and "None". Used to maintain session affinity.
12541 /// Enable client IP based session affinity.
12542 /// Must be ClientIP or None.
12543 /// Defaults to None.
12544 /// More info: <https://kubernetes.io/docs/concepts/services-networking/service/#virtual-ips-and-service-proxies>
12545 #[serde(default, skip_serializing_if = "Option::is_none", rename = "sessionAffinity")]
12546 pub session_affinity: Option<String>,
12547 /// sessionAffinityConfig contains the configurations of session affinity.
12548 #[serde(default, skip_serializing_if = "Option::is_none", rename = "sessionAffinityConfig")]
12549 pub session_affinity_config: Option<ComponentDefinitionServicesSpecSessionAffinityConfig>,
12550 /// type determines how the Service is exposed. Defaults to ClusterIP. Valid
12551 /// options are ExternalName, ClusterIP, NodePort, and LoadBalancer.
12552 /// "ClusterIP" allocates a cluster-internal IP address for load-balancing
12553 /// to endpoints. Endpoints are determined by the selector or if that is not
12554 /// specified, by manual construction of an Endpoints object or
12555 /// EndpointSlice objects. If clusterIP is "None", no virtual IP is
12556 /// allocated and the endpoints are published as a set of endpoints rather
12557 /// than a virtual IP.
12558 /// "NodePort" builds on ClusterIP and allocates a port on every node which
12559 /// routes to the same endpoints as the clusterIP.
12560 /// "LoadBalancer" builds on NodePort and creates an external load-balancer
12561 /// (if supported in the current cloud) which routes to the same endpoints
12562 /// as the clusterIP.
12563 /// "ExternalName" aliases this service to the specified externalName.
12564 /// Several other fields do not apply to ExternalName services.
12565 /// More info: <https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services-service-types>
12566 #[serde(default, skip_serializing_if = "Option::is_none", rename = "type")]
12567 pub r#type: Option<String>,
12568}
12569
12570/// ServicePort contains information on service's port.
12571#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
12572pub struct ComponentDefinitionServicesSpecPorts {
12573 /// The application protocol for this port.
12574 /// This is used as a hint for implementations to offer richer behavior for protocols that they understand.
12575 /// This field follows standard Kubernetes label syntax.
12576 /// Valid values are either:
12577 ///
12578 /// * Un-prefixed protocol names - reserved for IANA standard service names (as per
12579 /// RFC-6335 and <https://www.iana.org/assignments/service-names).>
12580 ///
12581 /// * Kubernetes-defined prefixed names:
12582 /// * 'kubernetes.io/h2c' - HTTP/2 prior knowledge over cleartext as described in <https://www.rfc-editor.org/rfc/rfc9113.html#name-starting-http-2-with-prior->
12583 /// * 'kubernetes.io/ws' - WebSocket over cleartext as described in <https://www.rfc-editor.org/rfc/rfc6455>
12584 /// * 'kubernetes.io/wss' - WebSocket over TLS as described in <https://www.rfc-editor.org/rfc/rfc6455>
12585 ///
12586 /// * Other protocols should use implementation-defined prefixed names such as
12587 /// mycompany.com/my-custom-protocol.
12588 #[serde(default, skip_serializing_if = "Option::is_none", rename = "appProtocol")]
12589 pub app_protocol: Option<String>,
12590 /// The name of this port within the service. This must be a DNS_LABEL.
12591 /// All ports within a ServiceSpec must have unique names. When considering
12592 /// the endpoints for a Service, this must match the 'name' field in the
12593 /// EndpointPort.
12594 /// Optional if only one ServicePort is defined on this service.
12595 #[serde(default, skip_serializing_if = "Option::is_none")]
12596 pub name: Option<String>,
12597 /// The port on each node on which this service is exposed when type is
12598 /// NodePort or LoadBalancer. Usually assigned by the system. If a value is
12599 /// specified, in-range, and not in use it will be used, otherwise the
12600 /// operation will fail. If not specified, a port will be allocated if this
12601 /// Service requires one. If this field is specified when creating a
12602 /// Service which does not need it, creation will fail. This field will be
12603 /// wiped when updating a Service to no longer need it (e.g. changing type
12604 /// from NodePort to ClusterIP).
12605 /// More info: <https://kubernetes.io/docs/concepts/services-networking/service/#type-nodeport>
12606 #[serde(default, skip_serializing_if = "Option::is_none", rename = "nodePort")]
12607 pub node_port: Option<i32>,
12608 /// The port that will be exposed by this service.
12609 pub port: i32,
12610 /// The IP protocol for this port. Supports "TCP", "UDP", and "SCTP".
12611 /// Default is TCP.
12612 #[serde(default, skip_serializing_if = "Option::is_none")]
12613 pub protocol: Option<String>,
12614 /// Number or name of the port to access on the pods targeted by the service.
12615 /// Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME.
12616 /// If this is a string, it will be looked up as a named port in the
12617 /// target Pod's container ports. If this is not specified, the value
12618 /// of the 'port' field is used (an identity map).
12619 /// This field is ignored for services with clusterIP=None, and should be
12620 /// omitted or set equal to the 'port' field.
12621 /// More info: <https://kubernetes.io/docs/concepts/services-networking/service/#defining-a-service>
12622 #[serde(default, skip_serializing_if = "Option::is_none", rename = "targetPort")]
12623 pub target_port: Option<IntOrString>,
12624}
12625
12626/// sessionAffinityConfig contains the configurations of session affinity.
12627#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
12628pub struct ComponentDefinitionServicesSpecSessionAffinityConfig {
12629 /// clientIP contains the configurations of Client IP based session affinity.
12630 #[serde(default, skip_serializing_if = "Option::is_none", rename = "clientIP")]
12631 pub client_ip: Option<ComponentDefinitionServicesSpecSessionAffinityConfigClientIp>,
12632}
12633
12634/// clientIP contains the configurations of Client IP based session affinity.
12635#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
12636pub struct ComponentDefinitionServicesSpecSessionAffinityConfigClientIp {
12637 /// timeoutSeconds specifies the seconds of ClientIP type session sticky time.
12638 /// The value must be >0 && <=86400(for 1 day) if ServiceAffinity == "ClientIP".
12639 /// Default value is 10800(for 3 hours).
12640 #[serde(default, skip_serializing_if = "Option::is_none", rename = "timeoutSeconds")]
12641 pub timeout_seconds: Option<i32>,
12642}
12643
12644#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
12645pub struct ComponentDefinitionSystemAccounts {
12646 /// Indicates if this account is a system initialization account (e.g., MySQL root).
12647 ///
12648 /// This field is immutable once set.
12649 #[serde(default, skip_serializing_if = "Option::is_none", rename = "initAccount")]
12650 pub init_account: Option<bool>,
12651 /// Specifies the unique identifier for the account. This name is used by other entities to reference the account.
12652 ///
12653 /// This field is immutable once set.
12654 pub name: String,
12655 /// Specifies the policy for generating the account's password.
12656 ///
12657 /// This field is immutable once set.
12658 #[serde(default, skip_serializing_if = "Option::is_none", rename = "passwordGenerationPolicy")]
12659 pub password_generation_policy: Option<ComponentDefinitionSystemAccountsPasswordGenerationPolicy>,
12660 /// Refers to the secret from which data will be copied to create the new account.
12661 ///
12662 /// This field is immutable once set.
12663 #[serde(default, skip_serializing_if = "Option::is_none", rename = "secretRef")]
12664 pub secret_ref: Option<ComponentDefinitionSystemAccountsSecretRef>,
12665 /// Defines the statement used to create the account with the necessary privileges.
12666 ///
12667 /// This field is immutable once set.
12668 #[serde(default, skip_serializing_if = "Option::is_none")]
12669 pub statement: Option<String>,
12670}
12671
12672/// Specifies the policy for generating the account's password.
12673///
12674/// This field is immutable once set.
12675#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
12676pub struct ComponentDefinitionSystemAccountsPasswordGenerationPolicy {
12677 /// The length of the password.
12678 #[serde(default, skip_serializing_if = "Option::is_none")]
12679 pub length: Option<i32>,
12680 /// The case of the letters in the password.
12681 #[serde(default, skip_serializing_if = "Option::is_none", rename = "letterCase")]
12682 pub letter_case: Option<ComponentDefinitionSystemAccountsPasswordGenerationPolicyLetterCase>,
12683 /// The number of digits in the password.
12684 #[serde(default, skip_serializing_if = "Option::is_none", rename = "numDigits")]
12685 pub num_digits: Option<i32>,
12686 /// The number of symbols in the password.
12687 #[serde(default, skip_serializing_if = "Option::is_none", rename = "numSymbols")]
12688 pub num_symbols: Option<i32>,
12689 /// Seed to generate the account's password.
12690 /// Cannot be updated.
12691 #[serde(default, skip_serializing_if = "Option::is_none")]
12692 pub seed: Option<String>,
12693}
12694
12695/// Specifies the policy for generating the account's password.
12696///
12697/// This field is immutable once set.
12698#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
12699pub enum ComponentDefinitionSystemAccountsPasswordGenerationPolicyLetterCase {
12700 LowerCases,
12701 UpperCases,
12702 MixedCases,
12703}
12704
12705/// Refers to the secret from which data will be copied to create the new account.
12706///
12707/// This field is immutable once set.
12708#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
12709pub struct ComponentDefinitionSystemAccountsSecretRef {
12710 /// The unique identifier of the secret.
12711 pub name: String,
12712 /// The namespace where the secret is located.
12713 pub namespace: String,
12714}
12715
12716#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
12717pub enum ComponentDefinitionUpdateStrategy {
12718 Serial,
12719 BestEffortParallel,
12720 Parallel,
12721}
12722
12723/// EnvVar represents a variable present in the env of Pod/Action or the template of config/script.
12724#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
12725pub struct ComponentDefinitionVars {
12726 /// A Go template expression that will be applied to the resolved value of the var.
12727 ///
12728 /// The expression will only be evaluated if the var is successfully resolved to a non-credential value.
12729 ///
12730 /// The resolved value can be accessed by its name within the expression, system vars and other user-defined
12731 /// non-credential vars can be used within the expression in the same way.
12732 /// Notice that, when accessing vars by its name, you should replace all the "-" in the name with "_", because of
12733 /// that "-" is not a valid identifier in Go.
12734 ///
12735 /// All expressions are evaluated in the order the vars are defined. If a var depends on any vars that also
12736 /// have expressions defined, be careful about the evaluation order as it may use intermediate values.
12737 ///
12738 /// The result of evaluation will be used as the final value of the var. If the expression fails to evaluate,
12739 /// the resolving of var will also be considered failed.
12740 #[serde(default, skip_serializing_if = "Option::is_none")]
12741 pub expression: Option<String>,
12742 /// Name of the variable. Must be a C_IDENTIFIER.
12743 pub name: String,
12744 /// Variable references `$(VAR_NAME)` are expanded using the previously defined variables in the current context.
12745 ///
12746 /// If a variable cannot be resolved, the reference in the input string will be unchanged.
12747 /// Double `$$` are reduced to a single `$`, which allows for escaping the `$(VAR_NAME)` syntax: i.e.
12748 ///
12749 /// - `$$(VAR_NAME)` will produce the string literal `$(VAR_NAME)`.
12750 ///
12751 /// Escaped references will never be expanded, regardless of whether the variable exists or not.
12752 /// Defaults to "".
12753 #[serde(default, skip_serializing_if = "Option::is_none")]
12754 pub value: Option<String>,
12755 /// Source for the variable's value. Cannot be used if value is not empty.
12756 #[serde(default, skip_serializing_if = "Option::is_none", rename = "valueFrom")]
12757 pub value_from: Option<ComponentDefinitionVarsValueFrom>,
12758}
12759
12760/// Source for the variable's value. Cannot be used if value is not empty.
12761#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
12762pub struct ComponentDefinitionVarsValueFrom {
12763 /// Selects a defined var of a Component.
12764 #[serde(default, skip_serializing_if = "Option::is_none", rename = "componentVarRef")]
12765 pub component_var_ref: Option<ComponentDefinitionVarsValueFromComponentVarRef>,
12766 /// Selects a key of a ConfigMap.
12767 #[serde(default, skip_serializing_if = "Option::is_none", rename = "configMapKeyRef")]
12768 pub config_map_key_ref: Option<ComponentDefinitionVarsValueFromConfigMapKeyRef>,
12769 /// Selects a defined var of a Credential (SystemAccount).
12770 #[serde(default, skip_serializing_if = "Option::is_none", rename = "credentialVarRef")]
12771 pub credential_var_ref: Option<ComponentDefinitionVarsValueFromCredentialVarRef>,
12772 /// Selects a defined var of host-network resources.
12773 #[serde(default, skip_serializing_if = "Option::is_none", rename = "hostNetworkVarRef")]
12774 pub host_network_var_ref: Option<ComponentDefinitionVarsValueFromHostNetworkVarRef>,
12775 /// Selects a key of a Secret.
12776 #[serde(default, skip_serializing_if = "Option::is_none", rename = "secretKeyRef")]
12777 pub secret_key_ref: Option<ComponentDefinitionVarsValueFromSecretKeyRef>,
12778 /// Selects a defined var of a ServiceRef.
12779 #[serde(default, skip_serializing_if = "Option::is_none", rename = "serviceRefVarRef")]
12780 pub service_ref_var_ref: Option<ComponentDefinitionVarsValueFromServiceRefVarRef>,
12781 /// Selects a defined var of a Service.
12782 #[serde(default, skip_serializing_if = "Option::is_none", rename = "serviceVarRef")]
12783 pub service_var_ref: Option<ComponentDefinitionVarsValueFromServiceVarRef>,
12784}
12785
12786/// Selects a defined var of a Component.
12787#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
12788pub struct ComponentDefinitionVarsValueFromComponentVarRef {
12789 /// Specifies the exact name, name prefix, or regular expression pattern for matching the name of the ComponentDefinition
12790 /// custom resource (CR) used by the component that the referent object resident in.
12791 ///
12792 /// If not specified, the component itself will be used.
12793 #[serde(default, skip_serializing_if = "Option::is_none", rename = "compDef")]
12794 pub comp_def: Option<String>,
12795 /// Reference to the name of the Component object.
12796 #[serde(default, skip_serializing_if = "Option::is_none", rename = "componentName")]
12797 pub component_name: Option<ComponentDefinitionVarsValueFromComponentVarRefComponentName>,
12798 /// Reference to the pod name list of the component.
12799 /// and the value will be presented in the following format: name1,name2,...
12800 #[serde(default, skip_serializing_if = "Option::is_none", rename = "instanceNames")]
12801 pub instance_names: Option<ComponentDefinitionVarsValueFromComponentVarRefInstanceNames>,
12802 /// This option defines the behavior when multiple component objects match the specified @CompDef.
12803 /// If not provided, an error will be raised when handling multiple matches.
12804 #[serde(default, skip_serializing_if = "Option::is_none", rename = "multipleClusterObjectOption")]
12805 pub multiple_cluster_object_option: Option<ComponentDefinitionVarsValueFromComponentVarRefMultipleClusterObjectOption>,
12806 /// Name of the referent object.
12807 #[serde(default, skip_serializing_if = "Option::is_none")]
12808 pub name: Option<String>,
12809 /// Specify whether the object must be defined.
12810 #[serde(default, skip_serializing_if = "Option::is_none")]
12811 pub optional: Option<bool>,
12812 /// Reference to the pod FQDN list of the component.
12813 /// The value will be presented in the following format: FQDN1,FQDN2,...
12814 #[serde(default, skip_serializing_if = "Option::is_none", rename = "podFQDNs")]
12815 pub pod_fqd_ns: Option<ComponentDefinitionVarsValueFromComponentVarRefPodFqdNs>,
12816 /// Reference to the replicas of the component.
12817 #[serde(default, skip_serializing_if = "Option::is_none")]
12818 pub replicas: Option<ComponentDefinitionVarsValueFromComponentVarRefReplicas>,
12819}
12820
12821/// Selects a defined var of a Component.
12822#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
12823pub enum ComponentDefinitionVarsValueFromComponentVarRefComponentName {
12824 Required,
12825 Optional,
12826}
12827
12828/// Selects a defined var of a Component.
12829#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
12830pub enum ComponentDefinitionVarsValueFromComponentVarRefInstanceNames {
12831 Required,
12832 Optional,
12833}
12834
12835/// This option defines the behavior when multiple component objects match the specified @CompDef.
12836/// If not provided, an error will be raised when handling multiple matches.
12837#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
12838pub struct ComponentDefinitionVarsValueFromComponentVarRefMultipleClusterObjectOption {
12839 /// Define the options for handling combined variables.
12840 /// Valid only when the strategy is set to "combined".
12841 #[serde(default, skip_serializing_if = "Option::is_none", rename = "combinedOption")]
12842 pub combined_option: Option<ComponentDefinitionVarsValueFromComponentVarRefMultipleClusterObjectOptionCombinedOption>,
12843 /// RequireAllComponentObjects controls whether all component objects must exist before resolving.
12844 /// If set to true, resolving will only proceed if all component objects are present.
12845 #[serde(default, skip_serializing_if = "Option::is_none", rename = "requireAllComponentObjects")]
12846 pub require_all_component_objects: Option<bool>,
12847 /// Define the strategy for handling multiple cluster objects.
12848 pub strategy: ComponentDefinitionVarsValueFromComponentVarRefMultipleClusterObjectOptionStrategy,
12849}
12850
12851/// Define the options for handling combined variables.
12852/// Valid only when the strategy is set to "combined".
12853#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
12854pub struct ComponentDefinitionVarsValueFromComponentVarRefMultipleClusterObjectOptionCombinedOption {
12855 /// The flatten format, default is: $(comp-name-1):value,$(comp-name-2):value.
12856 #[serde(default, skip_serializing_if = "Option::is_none", rename = "flattenFormat")]
12857 pub flatten_format: Option<ComponentDefinitionVarsValueFromComponentVarRefMultipleClusterObjectOptionCombinedOptionFlattenFormat>,
12858 /// If set, the existing variable will be kept, and a new variable will be defined with the specified suffix
12859 /// in pattern: $(var.name)_$(suffix).
12860 /// The new variable will be auto-created and placed behind the existing one.
12861 /// If not set, the existing variable will be reused with the value format defined below.
12862 #[serde(default, skip_serializing_if = "Option::is_none", rename = "newVarSuffix")]
12863 pub new_var_suffix: Option<String>,
12864 /// The format of the value that the operator will use to compose values from multiple components.
12865 #[serde(default, skip_serializing_if = "Option::is_none", rename = "valueFormat")]
12866 pub value_format: Option<String>,
12867}
12868
12869/// The flatten format, default is: $(comp-name-1):value,$(comp-name-2):value.
12870#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
12871pub struct ComponentDefinitionVarsValueFromComponentVarRefMultipleClusterObjectOptionCombinedOptionFlattenFormat {
12872 /// Pair delimiter.
12873 pub delimiter: String,
12874 /// Key-value delimiter.
12875 #[serde(rename = "keyValueDelimiter")]
12876 pub key_value_delimiter: String,
12877}
12878
12879/// This option defines the behavior when multiple component objects match the specified @CompDef.
12880/// If not provided, an error will be raised when handling multiple matches.
12881#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
12882pub enum ComponentDefinitionVarsValueFromComponentVarRefMultipleClusterObjectOptionStrategy {
12883 #[serde(rename = "individual")]
12884 Individual,
12885 #[serde(rename = "combined")]
12886 Combined,
12887}
12888
12889/// Selects a defined var of a Component.
12890#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
12891pub enum ComponentDefinitionVarsValueFromComponentVarRefPodFqdNs {
12892 Required,
12893 Optional,
12894}
12895
12896/// Selects a defined var of a Component.
12897#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
12898pub enum ComponentDefinitionVarsValueFromComponentVarRefReplicas {
12899 Required,
12900 Optional,
12901}
12902
12903/// Selects a key of a ConfigMap.
12904#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
12905pub struct ComponentDefinitionVarsValueFromConfigMapKeyRef {
12906 /// The key to select.
12907 pub key: String,
12908 /// Name of the referent.
12909 /// More info: <https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names>
12910 #[serde(default, skip_serializing_if = "Option::is_none")]
12911 pub name: Option<String>,
12912 /// Specify whether the ConfigMap or its key must be defined
12913 #[serde(default, skip_serializing_if = "Option::is_none")]
12914 pub optional: Option<bool>,
12915}
12916
12917/// Selects a defined var of a Credential (SystemAccount).
12918#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
12919pub struct ComponentDefinitionVarsValueFromCredentialVarRef {
12920 /// Specifies the exact name, name prefix, or regular expression pattern for matching the name of the ComponentDefinition
12921 /// custom resource (CR) used by the component that the referent object resident in.
12922 ///
12923 /// If not specified, the component itself will be used.
12924 #[serde(default, skip_serializing_if = "Option::is_none", rename = "compDef")]
12925 pub comp_def: Option<String>,
12926 /// This option defines the behavior when multiple component objects match the specified @CompDef.
12927 /// If not provided, an error will be raised when handling multiple matches.
12928 #[serde(default, skip_serializing_if = "Option::is_none", rename = "multipleClusterObjectOption")]
12929 pub multiple_cluster_object_option: Option<ComponentDefinitionVarsValueFromCredentialVarRefMultipleClusterObjectOption>,
12930 /// Name of the referent object.
12931 #[serde(default, skip_serializing_if = "Option::is_none")]
12932 pub name: Option<String>,
12933 /// Specify whether the object must be defined.
12934 #[serde(default, skip_serializing_if = "Option::is_none")]
12935 pub optional: Option<bool>,
12936 /// VarOption defines whether a variable is required or optional.
12937 #[serde(default, skip_serializing_if = "Option::is_none")]
12938 pub password: Option<ComponentDefinitionVarsValueFromCredentialVarRefPassword>,
12939 /// VarOption defines whether a variable is required or optional.
12940 #[serde(default, skip_serializing_if = "Option::is_none")]
12941 pub username: Option<ComponentDefinitionVarsValueFromCredentialVarRefUsername>,
12942}
12943
12944/// This option defines the behavior when multiple component objects match the specified @CompDef.
12945/// If not provided, an error will be raised when handling multiple matches.
12946#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
12947pub struct ComponentDefinitionVarsValueFromCredentialVarRefMultipleClusterObjectOption {
12948 /// Define the options for handling combined variables.
12949 /// Valid only when the strategy is set to "combined".
12950 #[serde(default, skip_serializing_if = "Option::is_none", rename = "combinedOption")]
12951 pub combined_option: Option<ComponentDefinitionVarsValueFromCredentialVarRefMultipleClusterObjectOptionCombinedOption>,
12952 /// RequireAllComponentObjects controls whether all component objects must exist before resolving.
12953 /// If set to true, resolving will only proceed if all component objects are present.
12954 #[serde(default, skip_serializing_if = "Option::is_none", rename = "requireAllComponentObjects")]
12955 pub require_all_component_objects: Option<bool>,
12956 /// Define the strategy for handling multiple cluster objects.
12957 pub strategy: ComponentDefinitionVarsValueFromCredentialVarRefMultipleClusterObjectOptionStrategy,
12958}
12959
12960/// Define the options for handling combined variables.
12961/// Valid only when the strategy is set to "combined".
12962#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
12963pub struct ComponentDefinitionVarsValueFromCredentialVarRefMultipleClusterObjectOptionCombinedOption {
12964 /// The flatten format, default is: $(comp-name-1):value,$(comp-name-2):value.
12965 #[serde(default, skip_serializing_if = "Option::is_none", rename = "flattenFormat")]
12966 pub flatten_format: Option<ComponentDefinitionVarsValueFromCredentialVarRefMultipleClusterObjectOptionCombinedOptionFlattenFormat>,
12967 /// If set, the existing variable will be kept, and a new variable will be defined with the specified suffix
12968 /// in pattern: $(var.name)_$(suffix).
12969 /// The new variable will be auto-created and placed behind the existing one.
12970 /// If not set, the existing variable will be reused with the value format defined below.
12971 #[serde(default, skip_serializing_if = "Option::is_none", rename = "newVarSuffix")]
12972 pub new_var_suffix: Option<String>,
12973 /// The format of the value that the operator will use to compose values from multiple components.
12974 #[serde(default, skip_serializing_if = "Option::is_none", rename = "valueFormat")]
12975 pub value_format: Option<String>,
12976}
12977
12978/// The flatten format, default is: $(comp-name-1):value,$(comp-name-2):value.
12979#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
12980pub struct ComponentDefinitionVarsValueFromCredentialVarRefMultipleClusterObjectOptionCombinedOptionFlattenFormat {
12981 /// Pair delimiter.
12982 pub delimiter: String,
12983 /// Key-value delimiter.
12984 #[serde(rename = "keyValueDelimiter")]
12985 pub key_value_delimiter: String,
12986}
12987
12988/// This option defines the behavior when multiple component objects match the specified @CompDef.
12989/// If not provided, an error will be raised when handling multiple matches.
12990#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
12991pub enum ComponentDefinitionVarsValueFromCredentialVarRefMultipleClusterObjectOptionStrategy {
12992 #[serde(rename = "individual")]
12993 Individual,
12994 #[serde(rename = "combined")]
12995 Combined,
12996}
12997
12998/// Selects a defined var of a Credential (SystemAccount).
12999#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
13000pub enum ComponentDefinitionVarsValueFromCredentialVarRefPassword {
13001 Required,
13002 Optional,
13003}
13004
13005/// Selects a defined var of a Credential (SystemAccount).
13006#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
13007pub enum ComponentDefinitionVarsValueFromCredentialVarRefUsername {
13008 Required,
13009 Optional,
13010}
13011
13012/// Selects a defined var of host-network resources.
13013#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
13014pub struct ComponentDefinitionVarsValueFromHostNetworkVarRef {
13015 /// Specifies the exact name, name prefix, or regular expression pattern for matching the name of the ComponentDefinition
13016 /// custom resource (CR) used by the component that the referent object resident in.
13017 ///
13018 /// If not specified, the component itself will be used.
13019 #[serde(default, skip_serializing_if = "Option::is_none", rename = "compDef")]
13020 pub comp_def: Option<String>,
13021 /// ContainerVars defines the vars that can be referenced from a Container.
13022 #[serde(default, skip_serializing_if = "Option::is_none")]
13023 pub container: Option<ComponentDefinitionVarsValueFromHostNetworkVarRefContainer>,
13024 /// This option defines the behavior when multiple component objects match the specified @CompDef.
13025 /// If not provided, an error will be raised when handling multiple matches.
13026 #[serde(default, skip_serializing_if = "Option::is_none", rename = "multipleClusterObjectOption")]
13027 pub multiple_cluster_object_option: Option<ComponentDefinitionVarsValueFromHostNetworkVarRefMultipleClusterObjectOption>,
13028 /// Name of the referent object.
13029 #[serde(default, skip_serializing_if = "Option::is_none")]
13030 pub name: Option<String>,
13031 /// Specify whether the object must be defined.
13032 #[serde(default, skip_serializing_if = "Option::is_none")]
13033 pub optional: Option<bool>,
13034}
13035
13036/// ContainerVars defines the vars that can be referenced from a Container.
13037#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
13038pub struct ComponentDefinitionVarsValueFromHostNetworkVarRefContainer {
13039 /// The name of the container.
13040 pub name: String,
13041 /// Container port to reference.
13042 #[serde(default, skip_serializing_if = "Option::is_none")]
13043 pub port: Option<ComponentDefinitionVarsValueFromHostNetworkVarRefContainerPort>,
13044}
13045
13046/// Container port to reference.
13047#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
13048pub struct ComponentDefinitionVarsValueFromHostNetworkVarRefContainerPort {
13049 #[serde(default, skip_serializing_if = "Option::is_none")]
13050 pub name: Option<String>,
13051 /// VarOption defines whether a variable is required or optional.
13052 #[serde(default, skip_serializing_if = "Option::is_none")]
13053 pub option: Option<ComponentDefinitionVarsValueFromHostNetworkVarRefContainerPortOption>,
13054}
13055
13056/// Container port to reference.
13057#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
13058pub enum ComponentDefinitionVarsValueFromHostNetworkVarRefContainerPortOption {
13059 Required,
13060 Optional,
13061}
13062
13063/// This option defines the behavior when multiple component objects match the specified @CompDef.
13064/// If not provided, an error will be raised when handling multiple matches.
13065#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
13066pub struct ComponentDefinitionVarsValueFromHostNetworkVarRefMultipleClusterObjectOption {
13067 /// Define the options for handling combined variables.
13068 /// Valid only when the strategy is set to "combined".
13069 #[serde(default, skip_serializing_if = "Option::is_none", rename = "combinedOption")]
13070 pub combined_option: Option<ComponentDefinitionVarsValueFromHostNetworkVarRefMultipleClusterObjectOptionCombinedOption>,
13071 /// RequireAllComponentObjects controls whether all component objects must exist before resolving.
13072 /// If set to true, resolving will only proceed if all component objects are present.
13073 #[serde(default, skip_serializing_if = "Option::is_none", rename = "requireAllComponentObjects")]
13074 pub require_all_component_objects: Option<bool>,
13075 /// Define the strategy for handling multiple cluster objects.
13076 pub strategy: ComponentDefinitionVarsValueFromHostNetworkVarRefMultipleClusterObjectOptionStrategy,
13077}
13078
13079/// Define the options for handling combined variables.
13080/// Valid only when the strategy is set to "combined".
13081#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
13082pub struct ComponentDefinitionVarsValueFromHostNetworkVarRefMultipleClusterObjectOptionCombinedOption {
13083 /// The flatten format, default is: $(comp-name-1):value,$(comp-name-2):value.
13084 #[serde(default, skip_serializing_if = "Option::is_none", rename = "flattenFormat")]
13085 pub flatten_format: Option<ComponentDefinitionVarsValueFromHostNetworkVarRefMultipleClusterObjectOptionCombinedOptionFlattenFormat>,
13086 /// If set, the existing variable will be kept, and a new variable will be defined with the specified suffix
13087 /// in pattern: $(var.name)_$(suffix).
13088 /// The new variable will be auto-created and placed behind the existing one.
13089 /// If not set, the existing variable will be reused with the value format defined below.
13090 #[serde(default, skip_serializing_if = "Option::is_none", rename = "newVarSuffix")]
13091 pub new_var_suffix: Option<String>,
13092 /// The format of the value that the operator will use to compose values from multiple components.
13093 #[serde(default, skip_serializing_if = "Option::is_none", rename = "valueFormat")]
13094 pub value_format: Option<String>,
13095}
13096
13097/// The flatten format, default is: $(comp-name-1):value,$(comp-name-2):value.
13098#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
13099pub struct ComponentDefinitionVarsValueFromHostNetworkVarRefMultipleClusterObjectOptionCombinedOptionFlattenFormat {
13100 /// Pair delimiter.
13101 pub delimiter: String,
13102 /// Key-value delimiter.
13103 #[serde(rename = "keyValueDelimiter")]
13104 pub key_value_delimiter: String,
13105}
13106
13107/// This option defines the behavior when multiple component objects match the specified @CompDef.
13108/// If not provided, an error will be raised when handling multiple matches.
13109#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
13110pub enum ComponentDefinitionVarsValueFromHostNetworkVarRefMultipleClusterObjectOptionStrategy {
13111 #[serde(rename = "individual")]
13112 Individual,
13113 #[serde(rename = "combined")]
13114 Combined,
13115}
13116
13117/// Selects a key of a Secret.
13118#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
13119pub struct ComponentDefinitionVarsValueFromSecretKeyRef {
13120 /// The key of the secret to select from. Must be a valid secret key.
13121 pub key: String,
13122 /// Name of the referent.
13123 /// More info: <https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names>
13124 #[serde(default, skip_serializing_if = "Option::is_none")]
13125 pub name: Option<String>,
13126 /// Specify whether the Secret or its key must be defined
13127 #[serde(default, skip_serializing_if = "Option::is_none")]
13128 pub optional: Option<bool>,
13129}
13130
13131/// Selects a defined var of a ServiceRef.
13132#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
13133pub struct ComponentDefinitionVarsValueFromServiceRefVarRef {
13134 /// Specifies the exact name, name prefix, or regular expression pattern for matching the name of the ComponentDefinition
13135 /// custom resource (CR) used by the component that the referent object resident in.
13136 ///
13137 /// If not specified, the component itself will be used.
13138 #[serde(default, skip_serializing_if = "Option::is_none", rename = "compDef")]
13139 pub comp_def: Option<String>,
13140 /// VarOption defines whether a variable is required or optional.
13141 #[serde(default, skip_serializing_if = "Option::is_none")]
13142 pub endpoint: Option<ComponentDefinitionVarsValueFromServiceRefVarRefEndpoint>,
13143 /// VarOption defines whether a variable is required or optional.
13144 #[serde(default, skip_serializing_if = "Option::is_none")]
13145 pub host: Option<ComponentDefinitionVarsValueFromServiceRefVarRefHost>,
13146 /// This option defines the behavior when multiple component objects match the specified @CompDef.
13147 /// If not provided, an error will be raised when handling multiple matches.
13148 #[serde(default, skip_serializing_if = "Option::is_none", rename = "multipleClusterObjectOption")]
13149 pub multiple_cluster_object_option: Option<ComponentDefinitionVarsValueFromServiceRefVarRefMultipleClusterObjectOption>,
13150 /// Name of the referent object.
13151 #[serde(default, skip_serializing_if = "Option::is_none")]
13152 pub name: Option<String>,
13153 /// Specify whether the object must be defined.
13154 #[serde(default, skip_serializing_if = "Option::is_none")]
13155 pub optional: Option<bool>,
13156 /// VarOption defines whether a variable is required or optional.
13157 #[serde(default, skip_serializing_if = "Option::is_none")]
13158 pub password: Option<ComponentDefinitionVarsValueFromServiceRefVarRefPassword>,
13159 /// VarOption defines whether a variable is required or optional.
13160 #[serde(default, skip_serializing_if = "Option::is_none")]
13161 pub port: Option<ComponentDefinitionVarsValueFromServiceRefVarRefPort>,
13162 /// VarOption defines whether a variable is required or optional.
13163 #[serde(default, skip_serializing_if = "Option::is_none")]
13164 pub username: Option<ComponentDefinitionVarsValueFromServiceRefVarRefUsername>,
13165}
13166
13167/// Selects a defined var of a ServiceRef.
13168#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
13169pub enum ComponentDefinitionVarsValueFromServiceRefVarRefEndpoint {
13170 Required,
13171 Optional,
13172}
13173
13174/// Selects a defined var of a ServiceRef.
13175#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
13176pub enum ComponentDefinitionVarsValueFromServiceRefVarRefHost {
13177 Required,
13178 Optional,
13179}
13180
13181/// This option defines the behavior when multiple component objects match the specified @CompDef.
13182/// If not provided, an error will be raised when handling multiple matches.
13183#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
13184pub struct ComponentDefinitionVarsValueFromServiceRefVarRefMultipleClusterObjectOption {
13185 /// Define the options for handling combined variables.
13186 /// Valid only when the strategy is set to "combined".
13187 #[serde(default, skip_serializing_if = "Option::is_none", rename = "combinedOption")]
13188 pub combined_option: Option<ComponentDefinitionVarsValueFromServiceRefVarRefMultipleClusterObjectOptionCombinedOption>,
13189 /// RequireAllComponentObjects controls whether all component objects must exist before resolving.
13190 /// If set to true, resolving will only proceed if all component objects are present.
13191 #[serde(default, skip_serializing_if = "Option::is_none", rename = "requireAllComponentObjects")]
13192 pub require_all_component_objects: Option<bool>,
13193 /// Define the strategy for handling multiple cluster objects.
13194 pub strategy: ComponentDefinitionVarsValueFromServiceRefVarRefMultipleClusterObjectOptionStrategy,
13195}
13196
13197/// Define the options for handling combined variables.
13198/// Valid only when the strategy is set to "combined".
13199#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
13200pub struct ComponentDefinitionVarsValueFromServiceRefVarRefMultipleClusterObjectOptionCombinedOption {
13201 /// The flatten format, default is: $(comp-name-1):value,$(comp-name-2):value.
13202 #[serde(default, skip_serializing_if = "Option::is_none", rename = "flattenFormat")]
13203 pub flatten_format: Option<ComponentDefinitionVarsValueFromServiceRefVarRefMultipleClusterObjectOptionCombinedOptionFlattenFormat>,
13204 /// If set, the existing variable will be kept, and a new variable will be defined with the specified suffix
13205 /// in pattern: $(var.name)_$(suffix).
13206 /// The new variable will be auto-created and placed behind the existing one.
13207 /// If not set, the existing variable will be reused with the value format defined below.
13208 #[serde(default, skip_serializing_if = "Option::is_none", rename = "newVarSuffix")]
13209 pub new_var_suffix: Option<String>,
13210 /// The format of the value that the operator will use to compose values from multiple components.
13211 #[serde(default, skip_serializing_if = "Option::is_none", rename = "valueFormat")]
13212 pub value_format: Option<String>,
13213}
13214
13215/// The flatten format, default is: $(comp-name-1):value,$(comp-name-2):value.
13216#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
13217pub struct ComponentDefinitionVarsValueFromServiceRefVarRefMultipleClusterObjectOptionCombinedOptionFlattenFormat {
13218 /// Pair delimiter.
13219 pub delimiter: String,
13220 /// Key-value delimiter.
13221 #[serde(rename = "keyValueDelimiter")]
13222 pub key_value_delimiter: String,
13223}
13224
13225/// This option defines the behavior when multiple component objects match the specified @CompDef.
13226/// If not provided, an error will be raised when handling multiple matches.
13227#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
13228pub enum ComponentDefinitionVarsValueFromServiceRefVarRefMultipleClusterObjectOptionStrategy {
13229 #[serde(rename = "individual")]
13230 Individual,
13231 #[serde(rename = "combined")]
13232 Combined,
13233}
13234
13235/// Selects a defined var of a ServiceRef.
13236#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
13237pub enum ComponentDefinitionVarsValueFromServiceRefVarRefPassword {
13238 Required,
13239 Optional,
13240}
13241
13242/// Selects a defined var of a ServiceRef.
13243#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
13244pub enum ComponentDefinitionVarsValueFromServiceRefVarRefPort {
13245 Required,
13246 Optional,
13247}
13248
13249/// Selects a defined var of a ServiceRef.
13250#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
13251pub enum ComponentDefinitionVarsValueFromServiceRefVarRefUsername {
13252 Required,
13253 Optional,
13254}
13255
13256/// Selects a defined var of a Service.
13257#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
13258pub struct ComponentDefinitionVarsValueFromServiceVarRef {
13259 /// Specifies the exact name, name prefix, or regular expression pattern for matching the name of the ComponentDefinition
13260 /// custom resource (CR) used by the component that the referent object resident in.
13261 ///
13262 /// If not specified, the component itself will be used.
13263 #[serde(default, skip_serializing_if = "Option::is_none", rename = "compDef")]
13264 pub comp_def: Option<String>,
13265 /// VarOption defines whether a variable is required or optional.
13266 #[serde(default, skip_serializing_if = "Option::is_none")]
13267 pub host: Option<ComponentDefinitionVarsValueFromServiceVarRefHost>,
13268 /// LoadBalancer represents the LoadBalancer ingress point of the service.
13269 ///
13270 /// If multiple ingress points are available, the first one will be used automatically, choosing between IP and Hostname.
13271 #[serde(default, skip_serializing_if = "Option::is_none", rename = "loadBalancer")]
13272 pub load_balancer: Option<ComponentDefinitionVarsValueFromServiceVarRefLoadBalancer>,
13273 /// This option defines the behavior when multiple component objects match the specified @CompDef.
13274 /// If not provided, an error will be raised when handling multiple matches.
13275 #[serde(default, skip_serializing_if = "Option::is_none", rename = "multipleClusterObjectOption")]
13276 pub multiple_cluster_object_option: Option<ComponentDefinitionVarsValueFromServiceVarRefMultipleClusterObjectOption>,
13277 /// Name of the referent object.
13278 #[serde(default, skip_serializing_if = "Option::is_none")]
13279 pub name: Option<String>,
13280 /// Specify whether the object must be defined.
13281 #[serde(default, skip_serializing_if = "Option::is_none")]
13282 pub optional: Option<bool>,
13283 /// Port references a port or node-port defined in the service.
13284 ///
13285 /// If the referenced service is a pod-service, there will be multiple service objects matched,
13286 /// and the value will be presented in the following format: service1.name:port1,service2.name:port2...
13287 #[serde(default, skip_serializing_if = "Option::is_none")]
13288 pub port: Option<ComponentDefinitionVarsValueFromServiceVarRefPort>,
13289}
13290
13291/// Selects a defined var of a Service.
13292#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
13293pub enum ComponentDefinitionVarsValueFromServiceVarRefHost {
13294 Required,
13295 Optional,
13296}
13297
13298/// Selects a defined var of a Service.
13299#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
13300pub enum ComponentDefinitionVarsValueFromServiceVarRefLoadBalancer {
13301 Required,
13302 Optional,
13303}
13304
13305/// This option defines the behavior when multiple component objects match the specified @CompDef.
13306/// If not provided, an error will be raised when handling multiple matches.
13307#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
13308pub struct ComponentDefinitionVarsValueFromServiceVarRefMultipleClusterObjectOption {
13309 /// Define the options for handling combined variables.
13310 /// Valid only when the strategy is set to "combined".
13311 #[serde(default, skip_serializing_if = "Option::is_none", rename = "combinedOption")]
13312 pub combined_option: Option<ComponentDefinitionVarsValueFromServiceVarRefMultipleClusterObjectOptionCombinedOption>,
13313 /// RequireAllComponentObjects controls whether all component objects must exist before resolving.
13314 /// If set to true, resolving will only proceed if all component objects are present.
13315 #[serde(default, skip_serializing_if = "Option::is_none", rename = "requireAllComponentObjects")]
13316 pub require_all_component_objects: Option<bool>,
13317 /// Define the strategy for handling multiple cluster objects.
13318 pub strategy: ComponentDefinitionVarsValueFromServiceVarRefMultipleClusterObjectOptionStrategy,
13319}
13320
13321/// Define the options for handling combined variables.
13322/// Valid only when the strategy is set to "combined".
13323#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
13324pub struct ComponentDefinitionVarsValueFromServiceVarRefMultipleClusterObjectOptionCombinedOption {
13325 /// The flatten format, default is: $(comp-name-1):value,$(comp-name-2):value.
13326 #[serde(default, skip_serializing_if = "Option::is_none", rename = "flattenFormat")]
13327 pub flatten_format: Option<ComponentDefinitionVarsValueFromServiceVarRefMultipleClusterObjectOptionCombinedOptionFlattenFormat>,
13328 /// If set, the existing variable will be kept, and a new variable will be defined with the specified suffix
13329 /// in pattern: $(var.name)_$(suffix).
13330 /// The new variable will be auto-created and placed behind the existing one.
13331 /// If not set, the existing variable will be reused with the value format defined below.
13332 #[serde(default, skip_serializing_if = "Option::is_none", rename = "newVarSuffix")]
13333 pub new_var_suffix: Option<String>,
13334 /// The format of the value that the operator will use to compose values from multiple components.
13335 #[serde(default, skip_serializing_if = "Option::is_none", rename = "valueFormat")]
13336 pub value_format: Option<String>,
13337}
13338
13339/// The flatten format, default is: $(comp-name-1):value,$(comp-name-2):value.
13340#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
13341pub struct ComponentDefinitionVarsValueFromServiceVarRefMultipleClusterObjectOptionCombinedOptionFlattenFormat {
13342 /// Pair delimiter.
13343 pub delimiter: String,
13344 /// Key-value delimiter.
13345 #[serde(rename = "keyValueDelimiter")]
13346 pub key_value_delimiter: String,
13347}
13348
13349/// This option defines the behavior when multiple component objects match the specified @CompDef.
13350/// If not provided, an error will be raised when handling multiple matches.
13351#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
13352pub enum ComponentDefinitionVarsValueFromServiceVarRefMultipleClusterObjectOptionStrategy {
13353 #[serde(rename = "individual")]
13354 Individual,
13355 #[serde(rename = "combined")]
13356 Combined,
13357}
13358
13359/// Port references a port or node-port defined in the service.
13360///
13361/// If the referenced service is a pod-service, there will be multiple service objects matched,
13362/// and the value will be presented in the following format: service1.name:port1,service2.name:port2...
13363#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
13364pub struct ComponentDefinitionVarsValueFromServiceVarRefPort {
13365 #[serde(default, skip_serializing_if = "Option::is_none")]
13366 pub name: Option<String>,
13367 /// VarOption defines whether a variable is required or optional.
13368 #[serde(default, skip_serializing_if = "Option::is_none")]
13369 pub option: Option<ComponentDefinitionVarsValueFromServiceVarRefPortOption>,
13370}
13371
13372/// Port references a port or node-port defined in the service.
13373///
13374/// If the referenced service is a pod-service, there will be multiple service objects matched,
13375/// and the value will be presented in the following format: service1.name:port1,service2.name:port2...
13376#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
13377pub enum ComponentDefinitionVarsValueFromServiceVarRefPortOption {
13378 Required,
13379 Optional,
13380}
13381
13382#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
13383pub struct ComponentDefinitionVolumes {
13384 /// Sets the critical threshold for volume space utilization as a percentage (0-100).
13385 ///
13386 /// Exceeding this percentage triggers the system to switch the volume to read-only mode as specified in
13387 /// `componentDefinition.spec.lifecycleActions.readOnly`.
13388 /// This precaution helps prevent space depletion while maintaining read-only access.
13389 /// If the space utilization later falls below this threshold, the system reverts the volume to read-write mode
13390 /// as defined in `componentDefinition.spec.lifecycleActions.readWrite`, restoring full functionality.
13391 ///
13392 /// Note: This field cannot be updated.
13393 #[serde(default, skip_serializing_if = "Option::is_none", rename = "highWatermark")]
13394 pub high_watermark: Option<i64>,
13395 /// Specifies the name of the volume.
13396 /// It must be a DNS_LABEL and unique within the pod.
13397 /// More info can be found at: <https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names>
13398 /// Note: This field cannot be updated.
13399 pub name: String,
13400 /// Specifies whether the creation of a snapshot of this volume is necessary when performing a backup of the Component.
13401 ///
13402 /// Note: This field cannot be updated.
13403 #[serde(default, skip_serializing_if = "Option::is_none", rename = "needSnapshot")]
13404 pub need_snapshot: Option<bool>,
13405}
13406
13407/// ComponentDefinitionStatus defines the observed state of ComponentDefinition.
13408#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
13409pub struct ComponentDefinitionStatus {
13410 /// Provides additional information about the current phase.
13411 #[serde(default, skip_serializing_if = "Option::is_none")]
13412 pub message: Option<String>,
13413 /// Refers to the most recent generation that has been observed for the ComponentDefinition.
13414 #[serde(default, skip_serializing_if = "Option::is_none", rename = "observedGeneration")]
13415 pub observed_generation: Option<i64>,
13416 /// Represents the current status of the ComponentDefinition. Valid values include ``, `Available`, and `Unavailable`.
13417 /// When the status is `Available`, the ComponentDefinition is ready and can be utilized by related objects.
13418 #[serde(default, skip_serializing_if = "Option::is_none")]
13419 pub phase: Option<ComponentDefinitionStatusPhase>,
13420}
13421
13422/// ComponentDefinitionStatus defines the observed state of ComponentDefinition.
13423#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
13424pub enum ComponentDefinitionStatusPhase {
13425 Available,
13426 Unavailable,
13427}
13428