// WARNING: generated by kopium - manual changes will be overwritten
// kopium command: kopium -D Default -D PartialEq -A -d kubeadmcontrolplanetemplates.controlplane.cluster.x-k8s.io
// kopium version: 0.21.1

#[allow(unused_imports)]
mod prelude {
    pub use k8s_openapi::apimachinery::pkg::util::intstr::IntOrString;
    pub use kube::CustomResource;
    pub use schemars::JsonSchema;
    pub use serde::{Deserialize, Serialize};
    pub use std::collections::BTreeMap;
}
use self::prelude::*;

/// KubeadmControlPlaneTemplateSpec defines the desired state of KubeadmControlPlaneTemplate.
#[derive(CustomResource, Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
#[kube(
    group = "controlplane.cluster.x-k8s.io",
    version = "v1beta1",
    kind = "KubeadmControlPlaneTemplate",
    plural = "kubeadmcontrolplanetemplates"
)]
#[kube(namespaced)]
#[kube(derive = "Default")]
#[kube(derive = "PartialEq")]
pub struct KubeadmControlPlaneTemplateSpec {
    /// KubeadmControlPlaneTemplateResource describes the data needed to create a KubeadmControlPlane from a template.
    pub template: KubeadmControlPlaneTemplateTemplate,
}

/// KubeadmControlPlaneTemplateResource describes the data needed to create a KubeadmControlPlane from a template.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
pub struct KubeadmControlPlaneTemplateTemplate {
    /// Standard object's metadata.
    /// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub metadata: Option<KubeadmControlPlaneTemplateTemplateMetadata>,
    /// KubeadmControlPlaneTemplateResourceSpec defines the desired state of KubeadmControlPlane.
    /// NOTE: KubeadmControlPlaneTemplateResourceSpec is similar to KubeadmControlPlaneSpec but
    /// omits Replicas and Version fields. These fields do not make sense on the KubeadmControlPlaneTemplate,
    /// because they are calculated by the Cluster topology reconciler during reconciliation and thus cannot
    /// be configured on the KubeadmControlPlaneTemplate.
    pub spec: KubeadmControlPlaneTemplateTemplateSpec,
}

/// Standard object's metadata.
/// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
pub struct KubeadmControlPlaneTemplateTemplateMetadata {
    /// Annotations is an unstructured key value map stored with a resource that may be
    /// set by external tools to store and retrieve arbitrary metadata. They are not
    /// queryable and should be preserved when modifying objects.
    /// More info: http://kubernetes.io/docs/user-guide/annotations
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub annotations: Option<BTreeMap<String, String>>,
    /// Map of string keys and values that can be used to organize and categorize
    /// (scope and select) objects. May match selectors of replication controllers
    /// and services.
    /// More info: http://kubernetes.io/docs/user-guide/labels
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub labels: Option<BTreeMap<String, String>>,
}

/// KubeadmControlPlaneTemplateResourceSpec defines the desired state of KubeadmControlPlane.
/// NOTE: KubeadmControlPlaneTemplateResourceSpec is similar to KubeadmControlPlaneSpec but
/// omits Replicas and Version fields. These fields do not make sense on the KubeadmControlPlaneTemplate,
/// because they are calculated by the Cluster topology reconciler during reconciliation and thus cannot
/// be configured on the KubeadmControlPlaneTemplate.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
pub struct KubeadmControlPlaneTemplateTemplateSpec {
    /// KubeadmConfigSpec is a KubeadmConfigSpec
    /// to use for initializing and joining machines to the control plane.
    #[serde(rename = "kubeadmConfigSpec")]
    pub kubeadm_config_spec: KubeadmControlPlaneTemplateTemplateSpecKubeadmConfigSpec,
    /// MachineTemplate contains information about how machines
    /// should be shaped when creating or updating a control plane.
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "machineTemplate"
    )]
    pub machine_template: Option<KubeadmControlPlaneTemplateTemplateSpecMachineTemplate>,
    /// The RemediationStrategy that controls how control plane machine remediation happens.
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "remediationStrategy"
    )]
    pub remediation_strategy: Option<KubeadmControlPlaneTemplateTemplateSpecRemediationStrategy>,
    /// RolloutAfter is a field to indicate a rollout should be performed
    /// after the specified time even if no changes have been made to the
    /// KubeadmControlPlane.
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "rolloutAfter"
    )]
    pub rollout_after: Option<String>,
    /// RolloutBefore is a field to indicate a rollout should be performed
    /// if the specified criteria is met.
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "rolloutBefore"
    )]
    pub rollout_before: Option<KubeadmControlPlaneTemplateTemplateSpecRolloutBefore>,
    /// The RolloutStrategy to use to replace control plane machines with
    /// new ones.
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "rolloutStrategy"
    )]
    pub rollout_strategy: Option<KubeadmControlPlaneTemplateTemplateSpecRolloutStrategy>,
}

/// KubeadmConfigSpec is a KubeadmConfigSpec
/// to use for initializing and joining machines to the control plane.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
pub struct KubeadmControlPlaneTemplateTemplateSpecKubeadmConfigSpec {
    /// ClusterConfiguration along with InitConfiguration are the configurations necessary for the init command
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "clusterConfiguration"
    )]
    pub cluster_configuration:
        Option<KubeadmControlPlaneTemplateTemplateSpecKubeadmConfigSpecClusterConfiguration>,
    /// DiskSetup specifies options for the creation of partition tables and file systems on devices.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "diskSetup")]
    pub disk_setup: Option<KubeadmControlPlaneTemplateTemplateSpecKubeadmConfigSpecDiskSetup>,
    /// Files specifies extra files to be passed to user_data upon creation.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub files: Option<Vec<KubeadmControlPlaneTemplateTemplateSpecKubeadmConfigSpecFiles>>,
    /// Format specifies the output format of the bootstrap data
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub format: Option<KubeadmControlPlaneTemplateTemplateSpecKubeadmConfigSpecFormat>,
    /// Ignition contains Ignition specific configuration.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub ignition: Option<KubeadmControlPlaneTemplateTemplateSpecKubeadmConfigSpecIgnition>,
    /// InitConfiguration along with ClusterConfiguration are the configurations necessary for the init command
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "initConfiguration"
    )]
    pub init_configuration:
        Option<KubeadmControlPlaneTemplateTemplateSpecKubeadmConfigSpecInitConfiguration>,
    /// JoinConfiguration is the kubeadm configuration for the join command
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "joinConfiguration"
    )]
    pub join_configuration:
        Option<KubeadmControlPlaneTemplateTemplateSpecKubeadmConfigSpecJoinConfiguration>,
    /// Mounts specifies a list of mount points to be setup.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub mounts: Option<Vec<Vec<String>>>,
    /// NTP specifies NTP configuration
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub ntp: Option<KubeadmControlPlaneTemplateTemplateSpecKubeadmConfigSpecNtp>,
    /// PostKubeadmCommands specifies extra commands to run after kubeadm runs
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "postKubeadmCommands"
    )]
    pub post_kubeadm_commands: Option<Vec<String>>,
    /// PreKubeadmCommands specifies extra commands to run before kubeadm runs
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "preKubeadmCommands"
    )]
    pub pre_kubeadm_commands: Option<Vec<String>>,
    /// UseExperimentalRetryJoin replaces a basic kubeadm command with a shell
    /// script with retries for joins.
    ///
    ///
    /// This is meant to be an experimental temporary workaround on some environments
    /// where joins fail due to timing (and other issues). The long term goal is to add retries to
    /// kubeadm proper and use that functionality.
    ///
    ///
    /// This will add about 40KB to userdata
    ///
    ///
    /// For more information, refer to https://github.com/kubernetes-sigs/cluster-api/pull/2763#discussion_r397306055.
    ///
    ///
    /// Deprecated: This experimental fix is no longer needed and this field will be removed in a future release.
    /// When removing also remove from staticcheck exclude-rules for SA1019 in golangci.yml
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "useExperimentalRetryJoin"
    )]
    pub use_experimental_retry_join: Option<bool>,
    /// Users specifies extra users to add
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub users: Option<Vec<KubeadmControlPlaneTemplateTemplateSpecKubeadmConfigSpecUsers>>,
    /// Verbosity is the number for the kubeadm log level verbosity.
    /// It overrides the `--v` flag in kubeadm commands.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub verbosity: Option<i32>,
}

/// ClusterConfiguration along with InitConfiguration are the configurations necessary for the init command
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
pub struct KubeadmControlPlaneTemplateTemplateSpecKubeadmConfigSpecClusterConfiguration {
    /// APIServer contains extra settings for the API server control plane component
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "apiServer")]
    pub api_server: Option<KubeadmControlPlaneTemplateTemplateSpecKubeadmConfigSpecClusterConfigurationApiServer>,
    /// APIVersion defines the versioned schema of this representation of an object.
    /// Servers should convert recognized schemas to the latest internal value, and
    /// may reject unrecognized values.
    /// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "apiVersion")]
    pub api_version: Option<String>,
    /// CertificatesDir specifies where to store or look for all required certificates.
    /// NB: if not provided, this will default to `/etc/kubernetes/pki`
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "certificatesDir")]
    pub certificates_dir: Option<String>,
    /// The cluster name
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "clusterName")]
    pub cluster_name: Option<String>,
    /// ControlPlaneEndpoint sets a stable IP address or DNS name for the control plane; it
    /// can be a valid IP address or a RFC-1123 DNS subdomain, both with optional TCP port.
    /// In case the ControlPlaneEndpoint is not specified, the AdvertiseAddress + BindPort
    /// are used; in case the ControlPlaneEndpoint is specified but without a TCP port,
    /// the BindPort is used.
    /// Possible usages are:
    /// e.g. In a cluster with more than one control plane instances, this field should be
    /// assigned the address of the external load balancer in front of the
    /// control plane instances.
    /// e.g.  in environments with enforced node recycling, the ControlPlaneEndpoint
    /// could be used for assigning a stable DNS to the control plane.
    /// NB: This value defaults to the first value in the Cluster object status.apiEndpoints array.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "controlPlaneEndpoint")]
    pub control_plane_endpoint: Option<String>,
    /// ControllerManager contains extra settings for the controller manager control plane component
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "controllerManager")]
    pub controller_manager: Option<KubeadmControlPlaneTemplateTemplateSpecKubeadmConfigSpecClusterConfigurationControllerManager>,
    /// DNS defines the options for the DNS add-on installed in the cluster.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub dns: Option<KubeadmControlPlaneTemplateTemplateSpecKubeadmConfigSpecClusterConfigurationDns>,
    /// Etcd holds configuration for etcd.
    /// NB: This value defaults to a Local (stacked) etcd
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub etcd: Option<KubeadmControlPlaneTemplateTemplateSpecKubeadmConfigSpecClusterConfigurationEtcd>,
    /// FeatureGates enabled by the user.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "featureGates")]
    pub feature_gates: Option<BTreeMap<String, bool>>,
    /// ImageRepository sets the container registry to pull images from.
    /// * If not set, the default registry of kubeadm will be used, i.e.
    ///   * registry.k8s.io (new registry): >= v1.22.17, >= v1.23.15, >= v1.24.9, >= v1.25.0
    ///   * k8s.gcr.io (old registry): all older versions
    ///   Please note that when imageRepository is not set we don't allow upgrades to
    ///   versions >= v1.22.0 which use the old registry (k8s.gcr.io). Please use
    ///   a newer patch version with the new registry instead (i.e. >= v1.22.17,
    ///   >= v1.23.15, >= v1.24.9, >= v1.25.0).
    /// * If the version is a CI build (kubernetes version starts with `ci/` or `ci-cross/`)
    ///  `gcr.io/k8s-staging-ci-images` will be used as a default for control plane components
    ///   and for kube-proxy, while `registry.k8s.io` will be used for all the other images.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "imageRepository")]
    pub image_repository: Option<String>,
    /// Kind is a string value representing the REST resource this object represents.
    /// Servers may infer this from the endpoint the client submits requests to.
    /// Cannot be updated.
    /// In CamelCase.
    /// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub kind: Option<String>,
    /// KubernetesVersion is the target version of the control plane.
    /// NB: This value defaults to the Machine object spec.version
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "kubernetesVersion")]
    pub kubernetes_version: Option<String>,
    /// Networking holds configuration for the networking topology of the cluster.
    /// NB: This value defaults to the Cluster object spec.clusterNetwork.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub networking: Option<KubeadmControlPlaneTemplateTemplateSpecKubeadmConfigSpecClusterConfigurationNetworking>,
    /// Scheduler contains extra settings for the scheduler control plane component
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub scheduler: Option<KubeadmControlPlaneTemplateTemplateSpecKubeadmConfigSpecClusterConfigurationScheduler>,
}

/// APIServer contains extra settings for the API server control plane component
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
pub struct KubeadmControlPlaneTemplateTemplateSpecKubeadmConfigSpecClusterConfigurationApiServer {
    /// CertSANs sets extra Subject Alternative Names for the API Server signing cert.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "certSANs")]
    pub cert_sa_ns: Option<Vec<String>>,
    /// ExtraArgs is an extra set of flags to pass to the control plane component.
    /// TODO: This is temporary and ideally we would like to switch all components to
    /// use ComponentConfig + ConfigMaps.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "extraArgs")]
    pub extra_args: Option<BTreeMap<String, String>>,
    /// ExtraEnvs is an extra set of environment variables to pass to the control plane component.
    /// Environment variables passed using ExtraEnvs will override any existing environment variables, or *_proxy environment variables that kubeadm adds by default.
    /// This option takes effect only on Kubernetes >=1.31.0.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "extraEnvs")]
    pub extra_envs: Option<Vec<KubeadmControlPlaneTemplateTemplateSpecKubeadmConfigSpecClusterConfigurationApiServerExtraEnvs>>,
    /// ExtraVolumes is an extra set of host volumes, mounted to the control plane component.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "extraVolumes")]
    pub extra_volumes: Option<Vec<KubeadmControlPlaneTemplateTemplateSpecKubeadmConfigSpecClusterConfigurationApiServerExtraVolumes>>,
    /// TimeoutForControlPlane controls the timeout that we use for API server to appear
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "timeoutForControlPlane")]
    pub timeout_for_control_plane: Option<String>,
}

/// EnvVar represents an environment variable present in a Container.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
pub struct KubeadmControlPlaneTemplateTemplateSpecKubeadmConfigSpecClusterConfigurationApiServerExtraEnvs {
    /// Name of the environment variable. Must be a C_IDENTIFIER.
    pub name: String,
    /// Variable references $(VAR_NAME) are expanded
    /// using the previously defined environment variables in the container and
    /// any service environment variables. If a variable cannot be resolved,
    /// the reference in the input string will be unchanged. Double $ are reduced
    /// to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e.
    /// "$(VAR_NAME)" will produce the string literal "$(VAR_NAME)".
    /// Escaped references will never be expanded, regardless of whether the variable
    /// exists or not.
    /// Defaults to "".
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub value: Option<String>,
    /// Source for the environment variable's value. Cannot be used if value is not empty.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "valueFrom")]
    pub value_from: Option<KubeadmControlPlaneTemplateTemplateSpecKubeadmConfigSpecClusterConfigurationApiServerExtraEnvsValueFrom>,
}

/// Source for the environment variable's value. Cannot be used if value is not empty.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
pub struct KubeadmControlPlaneTemplateTemplateSpecKubeadmConfigSpecClusterConfigurationApiServerExtraEnvsValueFrom {
    /// Selects a key of a ConfigMap.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "configMapKeyRef")]
    pub config_map_key_ref: Option<KubeadmControlPlaneTemplateTemplateSpecKubeadmConfigSpecClusterConfigurationApiServerExtraEnvsValueFromConfigMapKeyRef>,
    /// Selects a field of the pod: supports metadata.name, metadata.namespace, `metadata.labels['<KEY>']`, `metadata.annotations['<KEY>']`,
    /// spec.nodeName, spec.serviceAccountName, status.hostIP, status.podIP, status.podIPs.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "fieldRef")]
    pub field_ref: Option<KubeadmControlPlaneTemplateTemplateSpecKubeadmConfigSpecClusterConfigurationApiServerExtraEnvsValueFromFieldRef>,
    /// Selects a resource of the container: only resources limits and requests
    /// (limits.cpu, limits.memory, limits.ephemeral-storage, requests.cpu, requests.memory and requests.ephemeral-storage) are currently supported.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "resourceFieldRef")]
    pub resource_field_ref: Option<KubeadmControlPlaneTemplateTemplateSpecKubeadmConfigSpecClusterConfigurationApiServerExtraEnvsValueFromResourceFieldRef>,
    /// Selects a key of a secret in the pod's namespace
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "secretKeyRef")]
    pub secret_key_ref: Option<KubeadmControlPlaneTemplateTemplateSpecKubeadmConfigSpecClusterConfigurationApiServerExtraEnvsValueFromSecretKeyRef>,
}

/// Selects a key of a ConfigMap.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
pub struct KubeadmControlPlaneTemplateTemplateSpecKubeadmConfigSpecClusterConfigurationApiServerExtraEnvsValueFromConfigMapKeyRef
{
    /// The key to select.
    pub key: String,
    /// Name of the referent.
    /// This field is effectively required, but due to backwards compatibility is
    /// allowed to be empty. Instances of this type with an empty value here are
    /// almost certainly wrong.
    /// TODO: Add other useful fields. apiVersion, kind, uid?
    /// More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
    /// TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,
    /// Specify whether the ConfigMap or its key must be defined
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub optional: Option<bool>,
}

/// Selects a field of the pod: supports metadata.name, metadata.namespace, `metadata.labels['<KEY>']`, `metadata.annotations['<KEY>']`,
/// spec.nodeName, spec.serviceAccountName, status.hostIP, status.podIP, status.podIPs.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
pub struct KubeadmControlPlaneTemplateTemplateSpecKubeadmConfigSpecClusterConfigurationApiServerExtraEnvsValueFromFieldRef
{
    /// Version of the schema the FieldPath is written in terms of, defaults to "v1".
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "apiVersion"
    )]
    pub api_version: Option<String>,
    /// Path of the field to select in the specified API version.
    #[serde(rename = "fieldPath")]
    pub field_path: String,
}

/// Selects a resource of the container: only resources limits and requests
/// (limits.cpu, limits.memory, limits.ephemeral-storage, requests.cpu, requests.memory and requests.ephemeral-storage) are currently supported.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
pub struct KubeadmControlPlaneTemplateTemplateSpecKubeadmConfigSpecClusterConfigurationApiServerExtraEnvsValueFromResourceFieldRef
{
    /// Container name: required for volumes, optional for env vars
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "containerName"
    )]
    pub container_name: Option<String>,
    /// Specifies the output format of the exposed resources, defaults to "1"
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub divisor: Option<IntOrString>,
    /// Required: resource to select
    pub resource: String,
}

/// Selects a key of a secret in the pod's namespace
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
pub struct KubeadmControlPlaneTemplateTemplateSpecKubeadmConfigSpecClusterConfigurationApiServerExtraEnvsValueFromSecretKeyRef
{
    /// The key of the secret to select from.  Must be a valid secret key.
    pub key: String,
    /// Name of the referent.
    /// This field is effectively required, but due to backwards compatibility is
    /// allowed to be empty. Instances of this type with an empty value here are
    /// almost certainly wrong.
    /// TODO: Add other useful fields. apiVersion, kind, uid?
    /// More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
    /// TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,
    /// Specify whether the Secret or its key must be defined
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub optional: Option<bool>,
}

/// HostPathMount contains elements describing volumes that are mounted from the
/// host.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
pub struct KubeadmControlPlaneTemplateTemplateSpecKubeadmConfigSpecClusterConfigurationApiServerExtraVolumes
{
    /// HostPath is the path in the host that will be mounted inside
    /// the pod.
    #[serde(rename = "hostPath")]
    pub host_path: String,
    /// MountPath is the path inside the pod where hostPath will be mounted.
    #[serde(rename = "mountPath")]
    pub mount_path: String,
    /// Name of the volume inside the pod template.
    pub name: String,
    /// PathType is the type of the HostPath.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "pathType")]
    pub path_type: Option<String>,
    /// ReadOnly controls write access to the volume
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "readOnly")]
    pub read_only: Option<bool>,
}

/// ControllerManager contains extra settings for the controller manager control plane component
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
pub struct KubeadmControlPlaneTemplateTemplateSpecKubeadmConfigSpecClusterConfigurationControllerManager {
    /// ExtraArgs is an extra set of flags to pass to the control plane component.
    /// TODO: This is temporary and ideally we would like to switch all components to
    /// use ComponentConfig + ConfigMaps.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "extraArgs")]
    pub extra_args: Option<BTreeMap<String, String>>,
    /// ExtraEnvs is an extra set of environment variables to pass to the control plane component.
    /// Environment variables passed using ExtraEnvs will override any existing environment variables, or *_proxy environment variables that kubeadm adds by default.
    /// This option takes effect only on Kubernetes >=1.31.0.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "extraEnvs")]
    pub extra_envs: Option<Vec<KubeadmControlPlaneTemplateTemplateSpecKubeadmConfigSpecClusterConfigurationControllerManagerExtraEnvs>>,
    /// ExtraVolumes is an extra set of host volumes, mounted to the control plane component.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "extraVolumes")]
    pub extra_volumes: Option<Vec<KubeadmControlPlaneTemplateTemplateSpecKubeadmConfigSpecClusterConfigurationControllerManagerExtraVolumes>>,
}

/// EnvVar represents an environment variable present in a Container.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
pub struct KubeadmControlPlaneTemplateTemplateSpecKubeadmConfigSpecClusterConfigurationControllerManagerExtraEnvs {
    /// Name of the environment variable. Must be a C_IDENTIFIER.
    pub name: String,
    /// Variable references $(VAR_NAME) are expanded
    /// using the previously defined environment variables in the container and
    /// any service environment variables. If a variable cannot be resolved,
    /// the reference in the input string will be unchanged. Double $ are reduced
    /// to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e.
    /// "$(VAR_NAME)" will produce the string literal "$(VAR_NAME)".
    /// Escaped references will never be expanded, regardless of whether the variable
    /// exists or not.
    /// Defaults to "".
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub value: Option<String>,
    /// Source for the environment variable's value. Cannot be used if value is not empty.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "valueFrom")]
    pub value_from: Option<KubeadmControlPlaneTemplateTemplateSpecKubeadmConfigSpecClusterConfigurationControllerManagerExtraEnvsValueFrom>,
}

/// Source for the environment variable's value. Cannot be used if value is not empty.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
pub struct KubeadmControlPlaneTemplateTemplateSpecKubeadmConfigSpecClusterConfigurationControllerManagerExtraEnvsValueFrom {
    /// Selects a key of a ConfigMap.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "configMapKeyRef")]
    pub config_map_key_ref: Option<KubeadmControlPlaneTemplateTemplateSpecKubeadmConfigSpecClusterConfigurationControllerManagerExtraEnvsValueFromConfigMapKeyRef>,
    /// Selects a field of the pod: supports metadata.name, metadata.namespace, `metadata.labels['<KEY>']`, `metadata.annotations['<KEY>']`,
    /// spec.nodeName, spec.serviceAccountName, status.hostIP, status.podIP, status.podIPs.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "fieldRef")]
    pub field_ref: Option<KubeadmControlPlaneTemplateTemplateSpecKubeadmConfigSpecClusterConfigurationControllerManagerExtraEnvsValueFromFieldRef>,
    /// Selects a resource of the container: only resources limits and requests
    /// (limits.cpu, limits.memory, limits.ephemeral-storage, requests.cpu, requests.memory and requests.ephemeral-storage) are currently supported.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "resourceFieldRef")]
    pub resource_field_ref: Option<KubeadmControlPlaneTemplateTemplateSpecKubeadmConfigSpecClusterConfigurationControllerManagerExtraEnvsValueFromResourceFieldRef>,
    /// Selects a key of a secret in the pod's namespace
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "secretKeyRef")]
    pub secret_key_ref: Option<KubeadmControlPlaneTemplateTemplateSpecKubeadmConfigSpecClusterConfigurationControllerManagerExtraEnvsValueFromSecretKeyRef>,
}

/// Selects a key of a ConfigMap.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
pub struct KubeadmControlPlaneTemplateTemplateSpecKubeadmConfigSpecClusterConfigurationControllerManagerExtraEnvsValueFromConfigMapKeyRef
{
    /// The key to select.
    pub key: String,
    /// Name of the referent.
    /// This field is effectively required, but due to backwards compatibility is
    /// allowed to be empty. Instances of this type with an empty value here are
    /// almost certainly wrong.
    /// TODO: Add other useful fields. apiVersion, kind, uid?
    /// More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
    /// TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,
    /// Specify whether the ConfigMap or its key must be defined
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub optional: Option<bool>,
}

/// Selects a field of the pod: supports metadata.name, metadata.namespace, `metadata.labels['<KEY>']`, `metadata.annotations['<KEY>']`,
/// spec.nodeName, spec.serviceAccountName, status.hostIP, status.podIP, status.podIPs.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
pub struct KubeadmControlPlaneTemplateTemplateSpecKubeadmConfigSpecClusterConfigurationControllerManagerExtraEnvsValueFromFieldRef
{
    /// Version of the schema the FieldPath is written in terms of, defaults to "v1".
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "apiVersion"
    )]
    pub api_version: Option<String>,
    /// Path of the field to select in the specified API version.
    #[serde(rename = "fieldPath")]
    pub field_path: String,
}

/// Selects a resource of the container: only resources limits and requests
/// (limits.cpu, limits.memory, limits.ephemeral-storage, requests.cpu, requests.memory and requests.ephemeral-storage) are currently supported.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
pub struct KubeadmControlPlaneTemplateTemplateSpecKubeadmConfigSpecClusterConfigurationControllerManagerExtraEnvsValueFromResourceFieldRef
{
    /// Container name: required for volumes, optional for env vars
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "containerName"
    )]
    pub container_name: Option<String>,
    /// Specifies the output format of the exposed resources, defaults to "1"
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub divisor: Option<IntOrString>,
    /// Required: resource to select
    pub resource: String,
}

/// Selects a key of a secret in the pod's namespace
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
pub struct KubeadmControlPlaneTemplateTemplateSpecKubeadmConfigSpecClusterConfigurationControllerManagerExtraEnvsValueFromSecretKeyRef
{
    /// The key of the secret to select from.  Must be a valid secret key.
    pub key: String,
    /// Name of the referent.
    /// This field is effectively required, but due to backwards compatibility is
    /// allowed to be empty. Instances of this type with an empty value here are
    /// almost certainly wrong.
    /// TODO: Add other useful fields. apiVersion, kind, uid?
    /// More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
    /// TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,
    /// Specify whether the Secret or its key must be defined
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub optional: Option<bool>,
}

/// HostPathMount contains elements describing volumes that are mounted from the
/// host.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
pub struct KubeadmControlPlaneTemplateTemplateSpecKubeadmConfigSpecClusterConfigurationControllerManagerExtraVolumes
{
    /// HostPath is the path in the host that will be mounted inside
    /// the pod.
    #[serde(rename = "hostPath")]
    pub host_path: String,
    /// MountPath is the path inside the pod where hostPath will be mounted.
    #[serde(rename = "mountPath")]
    pub mount_path: String,
    /// Name of the volume inside the pod template.
    pub name: String,
    /// PathType is the type of the HostPath.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "pathType")]
    pub path_type: Option<String>,
    /// ReadOnly controls write access to the volume
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "readOnly")]
    pub read_only: Option<bool>,
}

/// DNS defines the options for the DNS add-on installed in the cluster.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
pub struct KubeadmControlPlaneTemplateTemplateSpecKubeadmConfigSpecClusterConfigurationDns {
    /// ImageRepository sets the container registry to pull images from.
    /// if not set, the ImageRepository defined in ClusterConfiguration will be used instead.
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "imageRepository"
    )]
    pub image_repository: Option<String>,
    /// ImageTag allows to specify a tag for the image.
    /// In case this value is set, kubeadm does not change automatically the version of the above components during upgrades.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "imageTag")]
    pub image_tag: Option<String>,
}

/// Etcd holds configuration for etcd.
/// NB: This value defaults to a Local (stacked) etcd
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
pub struct KubeadmControlPlaneTemplateTemplateSpecKubeadmConfigSpecClusterConfigurationEtcd {
    /// External describes how to connect to an external etcd cluster
    /// Local and External are mutually exclusive
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub external: Option<
        KubeadmControlPlaneTemplateTemplateSpecKubeadmConfigSpecClusterConfigurationEtcdExternal,
    >,
    /// Local provides configuration knobs for configuring the local etcd instance
    /// Local and External are mutually exclusive
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub local: Option<
        KubeadmControlPlaneTemplateTemplateSpecKubeadmConfigSpecClusterConfigurationEtcdLocal,
    >,
}

/// External describes how to connect to an external etcd cluster
/// Local and External are mutually exclusive
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
pub struct KubeadmControlPlaneTemplateTemplateSpecKubeadmConfigSpecClusterConfigurationEtcdExternal
{
    /// CAFile is an SSL Certificate Authority file used to secure etcd communication.
    /// Required if using a TLS connection.
    #[serde(rename = "caFile")]
    pub ca_file: String,
    /// CertFile is an SSL certification file used to secure etcd communication.
    /// Required if using a TLS connection.
    #[serde(rename = "certFile")]
    pub cert_file: String,
    /// Endpoints of etcd members. Required for ExternalEtcd.
    pub endpoints: Vec<String>,
    /// KeyFile is an SSL key file used to secure etcd communication.
    /// Required if using a TLS connection.
    #[serde(rename = "keyFile")]
    pub key_file: String,
}

/// Local provides configuration knobs for configuring the local etcd instance
/// Local and External are mutually exclusive
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
pub struct KubeadmControlPlaneTemplateTemplateSpecKubeadmConfigSpecClusterConfigurationEtcdLocal {
    /// DataDir is the directory etcd will place its data.
    /// Defaults to "/var/lib/etcd".
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "dataDir")]
    pub data_dir: Option<String>,
    /// ExtraArgs are extra arguments provided to the etcd binary
    /// when run inside a static pod.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "extraArgs")]
    pub extra_args: Option<BTreeMap<String, String>>,
    /// ExtraEnvs is an extra set of environment variables to pass to the control plane component.
    /// Environment variables passed using ExtraEnvs will override any existing environment variables, or *_proxy environment variables that kubeadm adds by default.
    /// This option takes effect only on Kubernetes >=1.31.0.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "extraEnvs")]
    pub extra_envs: Option<Vec<KubeadmControlPlaneTemplateTemplateSpecKubeadmConfigSpecClusterConfigurationEtcdLocalExtraEnvs>>,
    /// ImageRepository sets the container registry to pull images from.
    /// if not set, the ImageRepository defined in ClusterConfiguration will be used instead.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "imageRepository")]
    pub image_repository: Option<String>,
    /// ImageTag allows to specify a tag for the image.
    /// In case this value is set, kubeadm does not change automatically the version of the above components during upgrades.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "imageTag")]
    pub image_tag: Option<String>,
    /// PeerCertSANs sets extra Subject Alternative Names for the etcd peer signing cert.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "peerCertSANs")]
    pub peer_cert_sa_ns: Option<Vec<String>>,
    /// ServerCertSANs sets extra Subject Alternative Names for the etcd server signing cert.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "serverCertSANs")]
    pub server_cert_sa_ns: Option<Vec<String>>,
}

/// EnvVar represents an environment variable present in a Container.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
pub struct KubeadmControlPlaneTemplateTemplateSpecKubeadmConfigSpecClusterConfigurationEtcdLocalExtraEnvs {
    /// Name of the environment variable. Must be a C_IDENTIFIER.
    pub name: String,
    /// Variable references $(VAR_NAME) are expanded
    /// using the previously defined environment variables in the container and
    /// any service environment variables. If a variable cannot be resolved,
    /// the reference in the input string will be unchanged. Double $ are reduced
    /// to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e.
    /// "$(VAR_NAME)" will produce the string literal "$(VAR_NAME)".
    /// Escaped references will never be expanded, regardless of whether the variable
    /// exists or not.
    /// Defaults to "".
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub value: Option<String>,
    /// Source for the environment variable's value. Cannot be used if value is not empty.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "valueFrom")]
    pub value_from: Option<KubeadmControlPlaneTemplateTemplateSpecKubeadmConfigSpecClusterConfigurationEtcdLocalExtraEnvsValueFrom>,
}

/// Source for the environment variable's value. Cannot be used if value is not empty.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
pub struct KubeadmControlPlaneTemplateTemplateSpecKubeadmConfigSpecClusterConfigurationEtcdLocalExtraEnvsValueFrom {
    /// Selects a key of a ConfigMap.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "configMapKeyRef")]
    pub config_map_key_ref: Option<KubeadmControlPlaneTemplateTemplateSpecKubeadmConfigSpecClusterConfigurationEtcdLocalExtraEnvsValueFromConfigMapKeyRef>,
    /// Selects a field of the pod: supports metadata.name, metadata.namespace, `metadata.labels['<KEY>']`, `metadata.annotations['<KEY>']`,
    /// spec.nodeName, spec.serviceAccountName, status.hostIP, status.podIP, status.podIPs.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "fieldRef")]
    pub field_ref: Option<KubeadmControlPlaneTemplateTemplateSpecKubeadmConfigSpecClusterConfigurationEtcdLocalExtraEnvsValueFromFieldRef>,
    /// Selects a resource of the container: only resources limits and requests
    /// (limits.cpu, limits.memory, limits.ephemeral-storage, requests.cpu, requests.memory and requests.ephemeral-storage) are currently supported.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "resourceFieldRef")]
    pub resource_field_ref: Option<KubeadmControlPlaneTemplateTemplateSpecKubeadmConfigSpecClusterConfigurationEtcdLocalExtraEnvsValueFromResourceFieldRef>,
    /// Selects a key of a secret in the pod's namespace
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "secretKeyRef")]
    pub secret_key_ref: Option<KubeadmControlPlaneTemplateTemplateSpecKubeadmConfigSpecClusterConfigurationEtcdLocalExtraEnvsValueFromSecretKeyRef>,
}

/// Selects a key of a ConfigMap.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
pub struct KubeadmControlPlaneTemplateTemplateSpecKubeadmConfigSpecClusterConfigurationEtcdLocalExtraEnvsValueFromConfigMapKeyRef
{
    /// The key to select.
    pub key: String,
    /// Name of the referent.
    /// This field is effectively required, but due to backwards compatibility is
    /// allowed to be empty. Instances of this type with an empty value here are
    /// almost certainly wrong.
    /// TODO: Add other useful fields. apiVersion, kind, uid?
    /// More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
    /// TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,
    /// Specify whether the ConfigMap or its key must be defined
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub optional: Option<bool>,
}

/// Selects a field of the pod: supports metadata.name, metadata.namespace, `metadata.labels['<KEY>']`, `metadata.annotations['<KEY>']`,
/// spec.nodeName, spec.serviceAccountName, status.hostIP, status.podIP, status.podIPs.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
pub struct KubeadmControlPlaneTemplateTemplateSpecKubeadmConfigSpecClusterConfigurationEtcdLocalExtraEnvsValueFromFieldRef
{
    /// Version of the schema the FieldPath is written in terms of, defaults to "v1".
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "apiVersion"
    )]
    pub api_version: Option<String>,
    /// Path of the field to select in the specified API version.
    #[serde(rename = "fieldPath")]
    pub field_path: String,
}

/// Selects a resource of the container: only resources limits and requests
/// (limits.cpu, limits.memory, limits.ephemeral-storage, requests.cpu, requests.memory and requests.ephemeral-storage) are currently supported.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
pub struct KubeadmControlPlaneTemplateTemplateSpecKubeadmConfigSpecClusterConfigurationEtcdLocalExtraEnvsValueFromResourceFieldRef
{
    /// Container name: required for volumes, optional for env vars
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "containerName"
    )]
    pub container_name: Option<String>,
    /// Specifies the output format of the exposed resources, defaults to "1"
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub divisor: Option<IntOrString>,
    /// Required: resource to select
    pub resource: String,
}

/// Selects a key of a secret in the pod's namespace
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
pub struct KubeadmControlPlaneTemplateTemplateSpecKubeadmConfigSpecClusterConfigurationEtcdLocalExtraEnvsValueFromSecretKeyRef
{
    /// The key of the secret to select from.  Must be a valid secret key.
    pub key: String,
    /// Name of the referent.
    /// This field is effectively required, but due to backwards compatibility is
    /// allowed to be empty. Instances of this type with an empty value here are
    /// almost certainly wrong.
    /// TODO: Add other useful fields. apiVersion, kind, uid?
    /// More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
    /// TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,
    /// Specify whether the Secret or its key must be defined
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub optional: Option<bool>,
}

/// Networking holds configuration for the networking topology of the cluster.
/// NB: This value defaults to the Cluster object spec.clusterNetwork.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
pub struct KubeadmControlPlaneTemplateTemplateSpecKubeadmConfigSpecClusterConfigurationNetworking {
    /// DNSDomain is the dns domain used by k8s services. Defaults to "cluster.local".
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "dnsDomain")]
    pub dns_domain: Option<String>,
    /// PodSubnet is the subnet used by pods.
    /// If unset, the API server will not allocate CIDR ranges for every node.
    /// Defaults to a comma-delimited string of the Cluster object's spec.clusterNetwork.services.cidrBlocks if that is set
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "podSubnet")]
    pub pod_subnet: Option<String>,
    /// ServiceSubnet is the subnet used by k8s services.
    /// Defaults to a comma-delimited string of the Cluster object's spec.clusterNetwork.pods.cidrBlocks, or
    /// to "10.96.0.0/12" if that's unset.
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "serviceSubnet"
    )]
    pub service_subnet: Option<String>,
}

/// Scheduler contains extra settings for the scheduler control plane component
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
pub struct KubeadmControlPlaneTemplateTemplateSpecKubeadmConfigSpecClusterConfigurationScheduler {
    /// ExtraArgs is an extra set of flags to pass to the control plane component.
    /// TODO: This is temporary and ideally we would like to switch all components to
    /// use ComponentConfig + ConfigMaps.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "extraArgs")]
    pub extra_args: Option<BTreeMap<String, String>>,
    /// ExtraEnvs is an extra set of environment variables to pass to the control plane component.
    /// Environment variables passed using ExtraEnvs will override any existing environment variables, or *_proxy environment variables that kubeadm adds by default.
    /// This option takes effect only on Kubernetes >=1.31.0.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "extraEnvs")]
    pub extra_envs: Option<Vec<KubeadmControlPlaneTemplateTemplateSpecKubeadmConfigSpecClusterConfigurationSchedulerExtraEnvs>>,
    /// ExtraVolumes is an extra set of host volumes, mounted to the control plane component.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "extraVolumes")]
    pub extra_volumes: Option<Vec<KubeadmControlPlaneTemplateTemplateSpecKubeadmConfigSpecClusterConfigurationSchedulerExtraVolumes>>,
}

/// EnvVar represents an environment variable present in a Container.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
pub struct KubeadmControlPlaneTemplateTemplateSpecKubeadmConfigSpecClusterConfigurationSchedulerExtraEnvs {
    /// Name of the environment variable. Must be a C_IDENTIFIER.
    pub name: String,
    /// Variable references $(VAR_NAME) are expanded
    /// using the previously defined environment variables in the container and
    /// any service environment variables. If a variable cannot be resolved,
    /// the reference in the input string will be unchanged. Double $ are reduced
    /// to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e.
    /// "$(VAR_NAME)" will produce the string literal "$(VAR_NAME)".
    /// Escaped references will never be expanded, regardless of whether the variable
    /// exists or not.
    /// Defaults to "".
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub value: Option<String>,
    /// Source for the environment variable's value. Cannot be used if value is not empty.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "valueFrom")]
    pub value_from: Option<KubeadmControlPlaneTemplateTemplateSpecKubeadmConfigSpecClusterConfigurationSchedulerExtraEnvsValueFrom>,
}

/// Source for the environment variable's value. Cannot be used if value is not empty.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
pub struct KubeadmControlPlaneTemplateTemplateSpecKubeadmConfigSpecClusterConfigurationSchedulerExtraEnvsValueFrom {
    /// Selects a key of a ConfigMap.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "configMapKeyRef")]
    pub config_map_key_ref: Option<KubeadmControlPlaneTemplateTemplateSpecKubeadmConfigSpecClusterConfigurationSchedulerExtraEnvsValueFromConfigMapKeyRef>,
    /// Selects a field of the pod: supports metadata.name, metadata.namespace, `metadata.labels['<KEY>']`, `metadata.annotations['<KEY>']`,
    /// spec.nodeName, spec.serviceAccountName, status.hostIP, status.podIP, status.podIPs.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "fieldRef")]
    pub field_ref: Option<KubeadmControlPlaneTemplateTemplateSpecKubeadmConfigSpecClusterConfigurationSchedulerExtraEnvsValueFromFieldRef>,
    /// Selects a resource of the container: only resources limits and requests
    /// (limits.cpu, limits.memory, limits.ephemeral-storage, requests.cpu, requests.memory and requests.ephemeral-storage) are currently supported.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "resourceFieldRef")]
    pub resource_field_ref: Option<KubeadmControlPlaneTemplateTemplateSpecKubeadmConfigSpecClusterConfigurationSchedulerExtraEnvsValueFromResourceFieldRef>,
    /// Selects a key of a secret in the pod's namespace
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "secretKeyRef")]
    pub secret_key_ref: Option<KubeadmControlPlaneTemplateTemplateSpecKubeadmConfigSpecClusterConfigurationSchedulerExtraEnvsValueFromSecretKeyRef>,
}

/// Selects a key of a ConfigMap.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
pub struct KubeadmControlPlaneTemplateTemplateSpecKubeadmConfigSpecClusterConfigurationSchedulerExtraEnvsValueFromConfigMapKeyRef
{
    /// The key to select.
    pub key: String,
    /// Name of the referent.
    /// This field is effectively required, but due to backwards compatibility is
    /// allowed to be empty. Instances of this type with an empty value here are
    /// almost certainly wrong.
    /// TODO: Add other useful fields. apiVersion, kind, uid?
    /// More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
    /// TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,
    /// Specify whether the ConfigMap or its key must be defined
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub optional: Option<bool>,
}

/// Selects a field of the pod: supports metadata.name, metadata.namespace, `metadata.labels['<KEY>']`, `metadata.annotations['<KEY>']`,
/// spec.nodeName, spec.serviceAccountName, status.hostIP, status.podIP, status.podIPs.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
pub struct KubeadmControlPlaneTemplateTemplateSpecKubeadmConfigSpecClusterConfigurationSchedulerExtraEnvsValueFromFieldRef
{
    /// Version of the schema the FieldPath is written in terms of, defaults to "v1".
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "apiVersion"
    )]
    pub api_version: Option<String>,
    /// Path of the field to select in the specified API version.
    #[serde(rename = "fieldPath")]
    pub field_path: String,
}

/// Selects a resource of the container: only resources limits and requests
/// (limits.cpu, limits.memory, limits.ephemeral-storage, requests.cpu, requests.memory and requests.ephemeral-storage) are currently supported.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
pub struct KubeadmControlPlaneTemplateTemplateSpecKubeadmConfigSpecClusterConfigurationSchedulerExtraEnvsValueFromResourceFieldRef
{
    /// Container name: required for volumes, optional for env vars
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "containerName"
    )]
    pub container_name: Option<String>,
    /// Specifies the output format of the exposed resources, defaults to "1"
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub divisor: Option<IntOrString>,
    /// Required: resource to select
    pub resource: String,
}

/// Selects a key of a secret in the pod's namespace
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
pub struct KubeadmControlPlaneTemplateTemplateSpecKubeadmConfigSpecClusterConfigurationSchedulerExtraEnvsValueFromSecretKeyRef
{
    /// The key of the secret to select from.  Must be a valid secret key.
    pub key: String,
    /// Name of the referent.
    /// This field is effectively required, but due to backwards compatibility is
    /// allowed to be empty. Instances of this type with an empty value here are
    /// almost certainly wrong.
    /// TODO: Add other useful fields. apiVersion, kind, uid?
    /// More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
    /// TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,
    /// Specify whether the Secret or its key must be defined
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub optional: Option<bool>,
}

/// HostPathMount contains elements describing volumes that are mounted from the
/// host.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
pub struct KubeadmControlPlaneTemplateTemplateSpecKubeadmConfigSpecClusterConfigurationSchedulerExtraVolumes
{
    /// HostPath is the path in the host that will be mounted inside
    /// the pod.
    #[serde(rename = "hostPath")]
    pub host_path: String,
    /// MountPath is the path inside the pod where hostPath will be mounted.
    #[serde(rename = "mountPath")]
    pub mount_path: String,
    /// Name of the volume inside the pod template.
    pub name: String,
    /// PathType is the type of the HostPath.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "pathType")]
    pub path_type: Option<String>,
    /// ReadOnly controls write access to the volume
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "readOnly")]
    pub read_only: Option<bool>,
}

/// DiskSetup specifies options for the creation of partition tables and file systems on devices.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
pub struct KubeadmControlPlaneTemplateTemplateSpecKubeadmConfigSpecDiskSetup {
    /// Filesystems specifies the list of file systems to setup.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub filesystems:
        Option<Vec<KubeadmControlPlaneTemplateTemplateSpecKubeadmConfigSpecDiskSetupFilesystems>>,
    /// Partitions specifies the list of the partitions to setup.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub partitions:
        Option<Vec<KubeadmControlPlaneTemplateTemplateSpecKubeadmConfigSpecDiskSetupPartitions>>,
}

/// Filesystem defines the file systems to be created.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
pub struct KubeadmControlPlaneTemplateTemplateSpecKubeadmConfigSpecDiskSetupFilesystems {
    /// Device specifies the device name
    pub device: String,
    /// ExtraOpts defined extra options to add to the command for creating the file system.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "extraOpts")]
    pub extra_opts: Option<Vec<String>>,
    /// Filesystem specifies the file system type.
    pub filesystem: String,
    /// Label specifies the file system label to be used. If set to None, no label is used.
    pub label: String,
    /// Overwrite defines whether or not to overwrite any existing filesystem.
    /// If true, any pre-existing file system will be destroyed. Use with Caution.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub overwrite: Option<bool>,
    /// Partition specifies the partition to use. The valid options are: "auto|any", "auto", "any", "none", and <NUM>, where NUM is the actual partition number.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub partition: Option<String>,
    /// ReplaceFS is a special directive, used for Microsoft Azure that instructs cloud-init to replace a file system of <FS_TYPE>.
    /// NOTE: unless you define a label, this requires the use of the 'any' partition directive.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "replaceFS")]
    pub replace_fs: Option<String>,
}

/// Partition defines how to create and layout a partition.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
pub struct KubeadmControlPlaneTemplateTemplateSpecKubeadmConfigSpecDiskSetupPartitions {
    /// Device is the name of the device.
    pub device: String,
    /// Layout specifies the device layout.
    /// If it is true, a single partition will be created for the entire device.
    /// When layout is false, it means don't partition or ignore existing partitioning.
    pub layout: bool,
    /// Overwrite describes whether to skip checks and create the partition if a partition or filesystem is found on the device.
    /// Use with caution. Default is 'false'.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub overwrite: Option<bool>,
    /// TableType specifies the tupe of partition table. The following are supported:
    /// 'mbr': default and setups a MS-DOS partition table
    /// 'gpt': setups a GPT partition table
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "tableType")]
    pub table_type: Option<String>,
}

/// File defines the input for generating write_files in cloud-init.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
pub struct KubeadmControlPlaneTemplateTemplateSpecKubeadmConfigSpecFiles {
    /// Append specifies whether to append Content to existing file if Path exists.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub append: Option<bool>,
    /// Content is the actual content of the file.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub content: Option<String>,
    /// ContentFrom is a referenced source of content to populate the file.
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "contentFrom"
    )]
    pub content_from:
        Option<KubeadmControlPlaneTemplateTemplateSpecKubeadmConfigSpecFilesContentFrom>,
    /// Encoding specifies the encoding of the file contents.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub encoding: Option<KubeadmControlPlaneTemplateTemplateSpecKubeadmConfigSpecFilesEncoding>,
    /// Owner specifies the ownership of the file, e.g. "root:root".
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub owner: Option<String>,
    /// Path specifies the full path on disk where to store the file.
    pub path: String,
    /// Permissions specifies the permissions to assign to the file, e.g. "0640".
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub permissions: Option<String>,
}

/// ContentFrom is a referenced source of content to populate the file.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
pub struct KubeadmControlPlaneTemplateTemplateSpecKubeadmConfigSpecFilesContentFrom {
    /// Secret represents a secret that should populate this file.
    pub secret: KubeadmControlPlaneTemplateTemplateSpecKubeadmConfigSpecFilesContentFromSecret,
}

/// Secret represents a secret that should populate this file.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
pub struct KubeadmControlPlaneTemplateTemplateSpecKubeadmConfigSpecFilesContentFromSecret {
    /// Key is the key in the secret's data map for this value.
    pub key: String,
    /// Name of the secret in the KubeadmBootstrapConfig's namespace to use.
    pub name: String,
}

/// File defines the input for generating write_files in cloud-init.
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
pub enum KubeadmControlPlaneTemplateTemplateSpecKubeadmConfigSpecFilesEncoding {
    #[serde(rename = "base64")]
    Base64,
    #[serde(rename = "gzip")]
    Gzip,
    #[serde(rename = "gzip+base64")]
    GzipBase64,
}

/// KubeadmConfigSpec is a KubeadmConfigSpec
/// to use for initializing and joining machines to the control plane.
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
pub enum KubeadmControlPlaneTemplateTemplateSpecKubeadmConfigSpecFormat {
    #[serde(rename = "cloud-config")]
    CloudConfig,
    #[serde(rename = "ignition")]
    Ignition,
}

/// Ignition contains Ignition specific configuration.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
pub struct KubeadmControlPlaneTemplateTemplateSpecKubeadmConfigSpecIgnition {
    /// ContainerLinuxConfig contains CLC specific configuration.
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "containerLinuxConfig"
    )]
    pub container_linux_config: Option<
        KubeadmControlPlaneTemplateTemplateSpecKubeadmConfigSpecIgnitionContainerLinuxConfig,
    >,
}

/// ContainerLinuxConfig contains CLC specific configuration.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
pub struct KubeadmControlPlaneTemplateTemplateSpecKubeadmConfigSpecIgnitionContainerLinuxConfig {
    /// AdditionalConfig contains additional configuration to be merged with the Ignition
    /// configuration generated by the bootstrapper controller. More info: https://coreos.github.io/ignition/operator-notes/#config-merging
    ///
    ///
    /// The data format is documented here: https://kinvolk.io/docs/flatcar-container-linux/latest/provisioning/cl-config/
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "additionalConfig"
    )]
    pub additional_config: Option<String>,
    /// Strict controls if AdditionalConfig should be strictly parsed. If so, warnings are treated as errors.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub strict: Option<bool>,
}

/// InitConfiguration along with ClusterConfiguration are the configurations necessary for the init command
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
pub struct KubeadmControlPlaneTemplateTemplateSpecKubeadmConfigSpecInitConfiguration {
    /// APIVersion defines the versioned schema of this representation of an object.
    /// Servers should convert recognized schemas to the latest internal value, and
    /// may reject unrecognized values.
    /// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "apiVersion")]
    pub api_version: Option<String>,
    /// BootstrapTokens is respected at `kubeadm init` time and describes a set of Bootstrap Tokens to create.
    /// This information IS NOT uploaded to the kubeadm cluster configmap, partly because of its sensitive nature
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "bootstrapTokens")]
    pub bootstrap_tokens: Option<Vec<KubeadmControlPlaneTemplateTemplateSpecKubeadmConfigSpecInitConfigurationBootstrapTokens>>,
    /// Kind is a string value representing the REST resource this object represents.
    /// Servers may infer this from the endpoint the client submits requests to.
    /// Cannot be updated.
    /// In CamelCase.
    /// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub kind: Option<String>,
    /// LocalAPIEndpoint represents the endpoint of the API server instance that's deployed on this control plane node
    /// In HA setups, this differs from ClusterConfiguration.ControlPlaneEndpoint in the sense that ControlPlaneEndpoint
    /// is the global endpoint for the cluster, which then loadbalances the requests to each individual API server. This
    /// configuration object lets you customize what IP/DNS name and port the local API server advertises it's accessible
    /// on. By default, kubeadm tries to auto-detect the IP of the default interface and use that, but in case that process
    /// fails you may set the desired value here.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "localAPIEndpoint")]
    pub local_api_endpoint: Option<KubeadmControlPlaneTemplateTemplateSpecKubeadmConfigSpecInitConfigurationLocalApiEndpoint>,
    /// NodeRegistration holds fields that relate to registering the new control-plane node to the cluster.
    /// When used in the context of control plane nodes, NodeRegistration should remain consistent
    /// across both InitConfiguration and JoinConfiguration
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "nodeRegistration")]
    pub node_registration: Option<KubeadmControlPlaneTemplateTemplateSpecKubeadmConfigSpecInitConfigurationNodeRegistration>,
    /// Patches contains options related to applying patches to components deployed by kubeadm during
    /// "kubeadm init". The minimum kubernetes version needed to support Patches is v1.22
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub patches: Option<KubeadmControlPlaneTemplateTemplateSpecKubeadmConfigSpecInitConfigurationPatches>,
    /// SkipPhases is a list of phases to skip during command execution.
    /// The list of phases can be obtained with the "kubeadm init --help" command.
    /// This option takes effect only on Kubernetes >=1.22.0.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "skipPhases")]
    pub skip_phases: Option<Vec<String>>,
}

/// BootstrapToken describes one bootstrap token, stored as a Secret in the cluster.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
pub struct KubeadmControlPlaneTemplateTemplateSpecKubeadmConfigSpecInitConfigurationBootstrapTokens
{
    /// Description sets a human-friendly message why this token exists and what it's used
    /// for, so other administrators can know its purpose.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub description: Option<String>,
    /// Expires specifies the timestamp when this token expires. Defaults to being set
    /// dynamically at runtime based on the TTL. Expires and TTL are mutually exclusive.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub expires: Option<String>,
    /// Groups specifies the extra groups that this token will authenticate as when/if
    /// used for authentication
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub groups: Option<Vec<String>>,
    /// Token is used for establishing bidirectional trust between nodes and control-planes.
    /// Used for joining nodes in the cluster.
    pub token: String,
    /// TTL defines the time to live for this token. Defaults to 24h.
    /// Expires and TTL are mutually exclusive.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub ttl: Option<String>,
    /// Usages describes the ways in which this token can be used. Can by default be used
    /// for establishing bidirectional trust, but that can be changed here.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub usages: Option<Vec<String>>,
}

/// LocalAPIEndpoint represents the endpoint of the API server instance that's deployed on this control plane node
/// In HA setups, this differs from ClusterConfiguration.ControlPlaneEndpoint in the sense that ControlPlaneEndpoint
/// is the global endpoint for the cluster, which then loadbalances the requests to each individual API server. This
/// configuration object lets you customize what IP/DNS name and port the local API server advertises it's accessible
/// on. By default, kubeadm tries to auto-detect the IP of the default interface and use that, but in case that process
/// fails you may set the desired value here.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
pub struct KubeadmControlPlaneTemplateTemplateSpecKubeadmConfigSpecInitConfigurationLocalApiEndpoint
{
    /// AdvertiseAddress sets the IP address for the API server to advertise.
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "advertiseAddress"
    )]
    pub advertise_address: Option<String>,
    /// BindPort sets the secure port for the API Server to bind to.
    /// Defaults to 6443.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "bindPort")]
    pub bind_port: Option<i32>,
}

/// NodeRegistration holds fields that relate to registering the new control-plane node to the cluster.
/// When used in the context of control plane nodes, NodeRegistration should remain consistent
/// across both InitConfiguration and JoinConfiguration
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
pub struct KubeadmControlPlaneTemplateTemplateSpecKubeadmConfigSpecInitConfigurationNodeRegistration {
    /// CRISocket is used to retrieve container runtime info. This information will be annotated to the Node API object, for later re-use
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "criSocket")]
    pub cri_socket: Option<String>,
    /// IgnorePreflightErrors provides a slice of pre-flight errors to be ignored when the current node is registered.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "ignorePreflightErrors")]
    pub ignore_preflight_errors: Option<Vec<String>>,
    /// ImagePullPolicy specifies the policy for image pulling
    /// during kubeadm "init" and "join" operations. The value of
    /// this field must be one of "Always", "IfNotPresent" or
    /// "Never". Defaults to "IfNotPresent". This can be used only
    /// with Kubernetes version equal to 1.22 and later.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "imagePullPolicy")]
    pub image_pull_policy: Option<KubeadmControlPlaneTemplateTemplateSpecKubeadmConfigSpecInitConfigurationNodeRegistrationImagePullPolicy>,
    /// ImagePullSerial specifies if image pulling performed by kubeadm must be done serially or in parallel.
    /// This option takes effect only on Kubernetes >=1.31.0.
    /// Default: true (defaulted in kubeadm)
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "imagePullSerial")]
    pub image_pull_serial: Option<bool>,
    /// KubeletExtraArgs passes through extra arguments to the kubelet. The arguments here are passed to the kubelet command line via the environment file
    /// kubeadm writes at runtime for the kubelet to source. This overrides the generic base-level configuration in the kubelet-config-1.X ConfigMap
    /// Flags have higher priority when parsing. These values are local and specific to the node kubeadm is executing on.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "kubeletExtraArgs")]
    pub kubelet_extra_args: Option<BTreeMap<String, String>>,
    /// Name is the `.Metadata.Name` field of the Node API object that will be created in this `kubeadm init` or `kubeadm join` operation.
    /// This field is also used in the CommonName field of the kubelet's client certificate to the API server.
    /// Defaults to the hostname of the node if not provided.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,
    /// Taints specifies the taints the Node API object should be registered with. If this field is unset, i.e. nil, in the `kubeadm init` process
    /// it will be defaulted to []v1.Taint{'node-role.kubernetes.io/master=""'}. If you don't want to taint your control-plane node, set this field to an
    /// empty slice, i.e. `taints: []` in the YAML file. This field is solely used for Node registration.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub taints: Option<Vec<KubeadmControlPlaneTemplateTemplateSpecKubeadmConfigSpecInitConfigurationNodeRegistrationTaints>>,
}

/// NodeRegistration holds fields that relate to registering the new control-plane node to the cluster.
/// When used in the context of control plane nodes, NodeRegistration should remain consistent
/// across both InitConfiguration and JoinConfiguration
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
pub enum KubeadmControlPlaneTemplateTemplateSpecKubeadmConfigSpecInitConfigurationNodeRegistrationImagePullPolicy
{
    Always,
    IfNotPresent,
    Never,
}

/// The node this Taint is attached to has the "effect" on
/// any pod that does not tolerate the Taint.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
pub struct KubeadmControlPlaneTemplateTemplateSpecKubeadmConfigSpecInitConfigurationNodeRegistrationTaints
{
    /// Required. The effect of the taint on pods
    /// that do not tolerate the taint.
    /// Valid effects are NoSchedule, PreferNoSchedule and NoExecute.
    pub effect: String,
    /// Required. The taint key to be applied to a node.
    pub key: String,
    /// TimeAdded represents the time at which the taint was added.
    /// It is only written for NoExecute taints.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "timeAdded")]
    pub time_added: Option<String>,
    /// The taint value corresponding to the taint key.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub value: Option<String>,
}

/// Patches contains options related to applying patches to components deployed by kubeadm during
/// "kubeadm init". The minimum kubernetes version needed to support Patches is v1.22
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
pub struct KubeadmControlPlaneTemplateTemplateSpecKubeadmConfigSpecInitConfigurationPatches {
    /// Directory is a path to a directory that contains files named "target[suffix][+patchtype].extension".
    /// For example, "kube-apiserver0+merge.yaml" or just "etcd.json". "target" can be one of
    /// "kube-apiserver", "kube-controller-manager", "kube-scheduler", "etcd". "patchtype" can be one
    /// of "strategic" "merge" or "json" and they match the patch formats supported by kubectl.
    /// The default "patchtype" is "strategic". "extension" must be either "json" or "yaml".
    /// "suffix" is an optional string that can be used to determine which patches are applied
    /// first alpha-numerically.
    /// These files can be written into the target directory via KubeadmConfig.Files which
    /// specifies additional files to be created on the machine, either with content inline or
    /// by referencing a secret.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub directory: Option<String>,
}

/// JoinConfiguration is the kubeadm configuration for the join command
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
pub struct KubeadmControlPlaneTemplateTemplateSpecKubeadmConfigSpecJoinConfiguration {
    /// APIVersion defines the versioned schema of this representation of an object.
    /// Servers should convert recognized schemas to the latest internal value, and
    /// may reject unrecognized values.
    /// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "apiVersion"
    )]
    pub api_version: Option<String>,
    /// CACertPath is the path to the SSL certificate authority used to
    /// secure comunications between node and control-plane.
    /// Defaults to "/etc/kubernetes/pki/ca.crt".
    /// TODO: revisit when there is defaulting from k/k
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "caCertPath"
    )]
    pub ca_cert_path: Option<String>,
    /// ControlPlane defines the additional control plane instance to be deployed on the joining node.
    /// If nil, no additional control plane instance will be deployed.
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "controlPlane"
    )]
    pub control_plane: Option<
        KubeadmControlPlaneTemplateTemplateSpecKubeadmConfigSpecJoinConfigurationControlPlane,
    >,
    /// Discovery specifies the options for the kubelet to use during the TLS Bootstrap process
    /// TODO: revisit when there is defaulting from k/k
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub discovery:
        Option<KubeadmControlPlaneTemplateTemplateSpecKubeadmConfigSpecJoinConfigurationDiscovery>,
    /// Kind is a string value representing the REST resource this object represents.
    /// Servers may infer this from the endpoint the client submits requests to.
    /// Cannot be updated.
    /// In CamelCase.
    /// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub kind: Option<String>,
    /// NodeRegistration holds fields that relate to registering the new control-plane node to the cluster.
    /// When used in the context of control plane nodes, NodeRegistration should remain consistent
    /// across both InitConfiguration and JoinConfiguration
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "nodeRegistration"
    )]
    pub node_registration: Option<
        KubeadmControlPlaneTemplateTemplateSpecKubeadmConfigSpecJoinConfigurationNodeRegistration,
    >,
    /// Patches contains options related to applying patches to components deployed by kubeadm during
    /// "kubeadm join". The minimum kubernetes version needed to support Patches is v1.22
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub patches:
        Option<KubeadmControlPlaneTemplateTemplateSpecKubeadmConfigSpecJoinConfigurationPatches>,
    /// SkipPhases is a list of phases to skip during command execution.
    /// The list of phases can be obtained with the "kubeadm init --help" command.
    /// This option takes effect only on Kubernetes >=1.22.0.
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "skipPhases"
    )]
    pub skip_phases: Option<Vec<String>>,
}

/// ControlPlane defines the additional control plane instance to be deployed on the joining node.
/// If nil, no additional control plane instance will be deployed.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
pub struct KubeadmControlPlaneTemplateTemplateSpecKubeadmConfigSpecJoinConfigurationControlPlane {
    /// LocalAPIEndpoint represents the endpoint of the API server instance to be deployed on this node.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "localAPIEndpoint")]
    pub local_api_endpoint: Option<KubeadmControlPlaneTemplateTemplateSpecKubeadmConfigSpecJoinConfigurationControlPlaneLocalApiEndpoint>,
}

/// LocalAPIEndpoint represents the endpoint of the API server instance to be deployed on this node.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
pub struct KubeadmControlPlaneTemplateTemplateSpecKubeadmConfigSpecJoinConfigurationControlPlaneLocalApiEndpoint
{
    /// AdvertiseAddress sets the IP address for the API server to advertise.
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "advertiseAddress"
    )]
    pub advertise_address: Option<String>,
    /// BindPort sets the secure port for the API Server to bind to.
    /// Defaults to 6443.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "bindPort")]
    pub bind_port: Option<i32>,
}

/// Discovery specifies the options for the kubelet to use during the TLS Bootstrap process
/// TODO: revisit when there is defaulting from k/k
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
pub struct KubeadmControlPlaneTemplateTemplateSpecKubeadmConfigSpecJoinConfigurationDiscovery {
    /// BootstrapToken is used to set the options for bootstrap token based discovery
    /// BootstrapToken and File are mutually exclusive
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "bootstrapToken")]
    pub bootstrap_token: Option<KubeadmControlPlaneTemplateTemplateSpecKubeadmConfigSpecJoinConfigurationDiscoveryBootstrapToken>,
    /// File is used to specify a file or URL to a kubeconfig file from which to load cluster information
    /// BootstrapToken and File are mutually exclusive
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub file: Option<KubeadmControlPlaneTemplateTemplateSpecKubeadmConfigSpecJoinConfigurationDiscoveryFile>,
    /// Timeout modifies the discovery timeout
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub timeout: Option<String>,
    /// TLSBootstrapToken is a token used for TLS bootstrapping.
    /// If .BootstrapToken is set, this field is defaulted to .BootstrapToken.Token, but can be overridden.
    /// If .File is set, this field **must be set** in case the KubeConfigFile does not contain any other authentication information
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "tlsBootstrapToken")]
    pub tls_bootstrap_token: Option<String>,
}

/// BootstrapToken is used to set the options for bootstrap token based discovery
/// BootstrapToken and File are mutually exclusive
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
pub struct KubeadmControlPlaneTemplateTemplateSpecKubeadmConfigSpecJoinConfigurationDiscoveryBootstrapToken
{
    /// APIServerEndpoint is an IP or domain name to the API server from which info will be fetched.
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "apiServerEndpoint"
    )]
    pub api_server_endpoint: Option<String>,
    /// CACertHashes specifies a set of public key pins to verify
    /// when token-based discovery is used. The root CA found during discovery
    /// must match one of these values. Specifying an empty set disables root CA
    /// pinning, which can be unsafe. Each hash is specified as "<type>:<value>",
    /// where the only currently supported type is "sha256". This is a hex-encoded
    /// SHA-256 hash of the Subject Public Key Info (SPKI) object in DER-encoded
    /// ASN.1. These hashes can be calculated using, for example, OpenSSL:
    /// openssl x509 -pubkey -in ca.crt openssl rsa -pubin -outform der 2>&/dev/null | openssl dgst -sha256 -hex
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "caCertHashes"
    )]
    pub ca_cert_hashes: Option<Vec<String>>,
    /// Token is a token used to validate cluster information
    /// fetched from the control-plane.
    pub token: String,
    /// UnsafeSkipCAVerification allows token-based discovery
    /// without CA verification via CACertHashes. This can weaken
    /// the security of kubeadm since other nodes can impersonate the control-plane.
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "unsafeSkipCAVerification"
    )]
    pub unsafe_skip_ca_verification: Option<bool>,
}

/// File is used to specify a file or URL to a kubeconfig file from which to load cluster information
/// BootstrapToken and File are mutually exclusive
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
pub struct KubeadmControlPlaneTemplateTemplateSpecKubeadmConfigSpecJoinConfigurationDiscoveryFile {
    /// KubeConfig is used (optionally) to generate a KubeConfig based on the KubeadmConfig's information.
    /// The file is generated at the path specified in KubeConfigPath.
    ///
    ///
    /// Host address (server field) information is automatically populated based on the Cluster's ControlPlaneEndpoint.
    /// Certificate Authority (certificate-authority-data field) is gathered from the cluster's CA secret.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "kubeConfig")]
    pub kube_config: Option<KubeadmControlPlaneTemplateTemplateSpecKubeadmConfigSpecJoinConfigurationDiscoveryFileKubeConfig>,
    /// KubeConfigPath is used to specify the actual file path or URL to the kubeconfig file from which to load cluster information
    #[serde(rename = "kubeConfigPath")]
    pub kube_config_path: String,
}

/// KubeConfig is used (optionally) to generate a KubeConfig based on the KubeadmConfig's information.
/// The file is generated at the path specified in KubeConfigPath.
///
///
/// Host address (server field) information is automatically populated based on the Cluster's ControlPlaneEndpoint.
/// Certificate Authority (certificate-authority-data field) is gathered from the cluster's CA secret.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
pub struct KubeadmControlPlaneTemplateTemplateSpecKubeadmConfigSpecJoinConfigurationDiscoveryFileKubeConfig {
    /// Cluster contains information about how to communicate with the kubernetes cluster.
    ///
    ///
    /// By default the following fields are automatically populated:
    /// - Server with the Cluster's ControlPlaneEndpoint.
    /// - CertificateAuthorityData with the Cluster's CA certificate.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub cluster: Option<KubeadmControlPlaneTemplateTemplateSpecKubeadmConfigSpecJoinConfigurationDiscoveryFileKubeConfigCluster>,
    /// User contains information that describes identity information.
    /// This is used to tell the kubernetes cluster who you are.
    pub user: KubeadmControlPlaneTemplateTemplateSpecKubeadmConfigSpecJoinConfigurationDiscoveryFileKubeConfigUser,
}

/// Cluster contains information about how to communicate with the kubernetes cluster.
///
///
/// By default the following fields are automatically populated:
/// - Server with the Cluster's ControlPlaneEndpoint.
/// - CertificateAuthorityData with the Cluster's CA certificate.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
pub struct KubeadmControlPlaneTemplateTemplateSpecKubeadmConfigSpecJoinConfigurationDiscoveryFileKubeConfigCluster
{
    /// CertificateAuthorityData contains PEM-encoded certificate authority certificates.
    ///
    ///
    /// Defaults to the Cluster's CA certificate if empty.
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "certificateAuthorityData"
    )]
    pub certificate_authority_data: Option<String>,
    /// InsecureSkipTLSVerify skips the validity check for the server's certificate. This will make your HTTPS connections insecure.
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "insecureSkipTLSVerify"
    )]
    pub insecure_skip_tls_verify: Option<bool>,
    /// ProxyURL is the URL to the proxy to be used for all requests made by this
    /// client. URLs with "http", "https", and "socks5" schemes are supported.  If
    /// this configuration is not provided or the empty string, the client
    /// attempts to construct a proxy configuration from http_proxy and
    /// https_proxy environment variables. If these environment variables are not
    /// set, the client does not attempt to proxy requests.
    ///
    ///
    /// socks5 proxying does not currently support spdy streaming endpoints (exec,
    /// attach, port forward).
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "proxyURL")]
    pub proxy_url: Option<String>,
    /// Server is the address of the kubernetes cluster (https://hostname:port).
    ///
    ///
    /// Defaults to https:// + Cluster.Spec.ControlPlaneEndpoint.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub server: Option<String>,
    /// TLSServerName is used to check server certificate. If TLSServerName is empty, the hostname used to contact the server is used.
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "tlsServerName"
    )]
    pub tls_server_name: Option<String>,
}

/// User contains information that describes identity information.
/// This is used to tell the kubernetes cluster who you are.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
pub struct KubeadmControlPlaneTemplateTemplateSpecKubeadmConfigSpecJoinConfigurationDiscoveryFileKubeConfigUser {
    /// AuthProvider specifies a custom authentication plugin for the kubernetes cluster.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "authProvider")]
    pub auth_provider: Option<KubeadmControlPlaneTemplateTemplateSpecKubeadmConfigSpecJoinConfigurationDiscoveryFileKubeConfigUserAuthProvider>,
    /// Exec specifies a custom exec-based authentication plugin for the kubernetes cluster.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub exec: Option<KubeadmControlPlaneTemplateTemplateSpecKubeadmConfigSpecJoinConfigurationDiscoveryFileKubeConfigUserExec>,
}

/// AuthProvider specifies a custom authentication plugin for the kubernetes cluster.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
pub struct KubeadmControlPlaneTemplateTemplateSpecKubeadmConfigSpecJoinConfigurationDiscoveryFileKubeConfigUserAuthProvider
{
    /// Config holds the parameters for the authentication plugin.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub config: Option<BTreeMap<String, String>>,
    /// Name is the name of the authentication plugin.
    pub name: String,
}

/// Exec specifies a custom exec-based authentication plugin for the kubernetes cluster.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
pub struct KubeadmControlPlaneTemplateTemplateSpecKubeadmConfigSpecJoinConfigurationDiscoveryFileKubeConfigUserExec {
    /// Preferred input version of the ExecInfo. The returned ExecCredentials MUST use
    /// the same encoding version as the input.
    /// Defaults to client.authentication.k8s.io/v1 if not set.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "apiVersion")]
    pub api_version: Option<String>,
    /// Arguments to pass to the command when executing it.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub args: Option<Vec<String>>,
    /// Command to execute.
    pub command: String,
    /// Env defines additional environment variables to expose to the process. These
    /// are unioned with the host's environment, as well as variables client-go uses
    /// to pass argument to the plugin.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub env: Option<Vec<KubeadmControlPlaneTemplateTemplateSpecKubeadmConfigSpecJoinConfigurationDiscoveryFileKubeConfigUserExecEnv>>,
    /// ProvideClusterInfo determines whether or not to provide cluster information,
    /// which could potentially contain very large CA data, to this exec plugin as a
    /// part of the KUBERNETES_EXEC_INFO environment variable. By default, it is set
    /// to false. Package k8s.io/client-go/tools/auth/exec provides helper methods for
    /// reading this environment variable.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "provideClusterInfo")]
    pub provide_cluster_info: Option<bool>,
}

/// KubeConfigAuthExecEnv is used for setting environment variables when executing an exec-based
/// credential plugin.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
pub struct KubeadmControlPlaneTemplateTemplateSpecKubeadmConfigSpecJoinConfigurationDiscoveryFileKubeConfigUserExecEnv
{
    pub name: String,
    pub value: String,
}

/// NodeRegistration holds fields that relate to registering the new control-plane node to the cluster.
/// When used in the context of control plane nodes, NodeRegistration should remain consistent
/// across both InitConfiguration and JoinConfiguration
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
pub struct KubeadmControlPlaneTemplateTemplateSpecKubeadmConfigSpecJoinConfigurationNodeRegistration {
    /// CRISocket is used to retrieve container runtime info. This information will be annotated to the Node API object, for later re-use
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "criSocket")]
    pub cri_socket: Option<String>,
    /// IgnorePreflightErrors provides a slice of pre-flight errors to be ignored when the current node is registered.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "ignorePreflightErrors")]
    pub ignore_preflight_errors: Option<Vec<String>>,
    /// ImagePullPolicy specifies the policy for image pulling
    /// during kubeadm "init" and "join" operations. The value of
    /// this field must be one of "Always", "IfNotPresent" or
    /// "Never". Defaults to "IfNotPresent". This can be used only
    /// with Kubernetes version equal to 1.22 and later.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "imagePullPolicy")]
    pub image_pull_policy: Option<KubeadmControlPlaneTemplateTemplateSpecKubeadmConfigSpecJoinConfigurationNodeRegistrationImagePullPolicy>,
    /// ImagePullSerial specifies if image pulling performed by kubeadm must be done serially or in parallel.
    /// This option takes effect only on Kubernetes >=1.31.0.
    /// Default: true (defaulted in kubeadm)
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "imagePullSerial")]
    pub image_pull_serial: Option<bool>,
    /// KubeletExtraArgs passes through extra arguments to the kubelet. The arguments here are passed to the kubelet command line via the environment file
    /// kubeadm writes at runtime for the kubelet to source. This overrides the generic base-level configuration in the kubelet-config-1.X ConfigMap
    /// Flags have higher priority when parsing. These values are local and specific to the node kubeadm is executing on.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "kubeletExtraArgs")]
    pub kubelet_extra_args: Option<BTreeMap<String, String>>,
    /// Name is the `.Metadata.Name` field of the Node API object that will be created in this `kubeadm init` or `kubeadm join` operation.
    /// This field is also used in the CommonName field of the kubelet's client certificate to the API server.
    /// Defaults to the hostname of the node if not provided.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,
    /// Taints specifies the taints the Node API object should be registered with. If this field is unset, i.e. nil, in the `kubeadm init` process
    /// it will be defaulted to []v1.Taint{'node-role.kubernetes.io/master=""'}. If you don't want to taint your control-plane node, set this field to an
    /// empty slice, i.e. `taints: []` in the YAML file. This field is solely used for Node registration.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub taints: Option<Vec<KubeadmControlPlaneTemplateTemplateSpecKubeadmConfigSpecJoinConfigurationNodeRegistrationTaints>>,
}

/// NodeRegistration holds fields that relate to registering the new control-plane node to the cluster.
/// When used in the context of control plane nodes, NodeRegistration should remain consistent
/// across both InitConfiguration and JoinConfiguration
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
pub enum KubeadmControlPlaneTemplateTemplateSpecKubeadmConfigSpecJoinConfigurationNodeRegistrationImagePullPolicy
{
    Always,
    IfNotPresent,
    Never,
}

/// The node this Taint is attached to has the "effect" on
/// any pod that does not tolerate the Taint.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
pub struct KubeadmControlPlaneTemplateTemplateSpecKubeadmConfigSpecJoinConfigurationNodeRegistrationTaints
{
    /// Required. The effect of the taint on pods
    /// that do not tolerate the taint.
    /// Valid effects are NoSchedule, PreferNoSchedule and NoExecute.
    pub effect: String,
    /// Required. The taint key to be applied to a node.
    pub key: String,
    /// TimeAdded represents the time at which the taint was added.
    /// It is only written for NoExecute taints.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "timeAdded")]
    pub time_added: Option<String>,
    /// The taint value corresponding to the taint key.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub value: Option<String>,
}

/// Patches contains options related to applying patches to components deployed by kubeadm during
/// "kubeadm join". The minimum kubernetes version needed to support Patches is v1.22
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
pub struct KubeadmControlPlaneTemplateTemplateSpecKubeadmConfigSpecJoinConfigurationPatches {
    /// Directory is a path to a directory that contains files named "target[suffix][+patchtype].extension".
    /// For example, "kube-apiserver0+merge.yaml" or just "etcd.json". "target" can be one of
    /// "kube-apiserver", "kube-controller-manager", "kube-scheduler", "etcd". "patchtype" can be one
    /// of "strategic" "merge" or "json" and they match the patch formats supported by kubectl.
    /// The default "patchtype" is "strategic". "extension" must be either "json" or "yaml".
    /// "suffix" is an optional string that can be used to determine which patches are applied
    /// first alpha-numerically.
    /// These files can be written into the target directory via KubeadmConfig.Files which
    /// specifies additional files to be created on the machine, either with content inline or
    /// by referencing a secret.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub directory: Option<String>,
}

/// NTP specifies NTP configuration
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
pub struct KubeadmControlPlaneTemplateTemplateSpecKubeadmConfigSpecNtp {
    /// Enabled specifies whether NTP should be enabled
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub enabled: Option<bool>,
    /// Servers specifies which NTP servers to use
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub servers: Option<Vec<String>>,
}

/// User defines the input for a generated user in cloud-init.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
pub struct KubeadmControlPlaneTemplateTemplateSpecKubeadmConfigSpecUsers {
    /// Gecos specifies the gecos to use for the user
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub gecos: Option<String>,
    /// Groups specifies the additional groups for the user
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub groups: Option<String>,
    /// HomeDir specifies the home directory to use for the user
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "homeDir")]
    pub home_dir: Option<String>,
    /// Inactive specifies whether to mark the user as inactive
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub inactive: Option<bool>,
    /// LockPassword specifies if password login should be disabled
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "lockPassword"
    )]
    pub lock_password: Option<bool>,
    /// Name specifies the user name
    pub name: String,
    /// Passwd specifies a hashed password for the user
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub passwd: Option<String>,
    /// PasswdFrom is a referenced source of passwd to populate the passwd.
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "passwdFrom"
    )]
    pub passwd_from:
        Option<KubeadmControlPlaneTemplateTemplateSpecKubeadmConfigSpecUsersPasswdFrom>,
    /// PrimaryGroup specifies the primary group for the user
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "primaryGroup"
    )]
    pub primary_group: Option<String>,
    /// Shell specifies the user's shell
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub shell: Option<String>,
    /// SSHAuthorizedKeys specifies a list of ssh authorized keys for the user
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "sshAuthorizedKeys"
    )]
    pub ssh_authorized_keys: Option<Vec<String>>,
    /// Sudo specifies a sudo role for the user
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub sudo: Option<String>,
}

/// PasswdFrom is a referenced source of passwd to populate the passwd.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
pub struct KubeadmControlPlaneTemplateTemplateSpecKubeadmConfigSpecUsersPasswdFrom {
    /// Secret represents a secret that should populate this password.
    pub secret: KubeadmControlPlaneTemplateTemplateSpecKubeadmConfigSpecUsersPasswdFromSecret,
}

/// Secret represents a secret that should populate this password.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
pub struct KubeadmControlPlaneTemplateTemplateSpecKubeadmConfigSpecUsersPasswdFromSecret {
    /// Key is the key in the secret's data map for this value.
    pub key: String,
    /// Name of the secret in the KubeadmBootstrapConfig's namespace to use.
    pub name: String,
}

/// MachineTemplate contains information about how machines
/// should be shaped when creating or updating a control plane.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
pub struct KubeadmControlPlaneTemplateTemplateSpecMachineTemplate {
    /// Standard object's metadata.
    /// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub metadata: Option<KubeadmControlPlaneTemplateTemplateSpecMachineTemplateMetadata>,
    /// NodeDeletionTimeout defines how long the machine controller will attempt to delete the Node that the Machine
    /// hosts after the Machine is marked for deletion. A duration of 0 will retry deletion indefinitely.
    /// If no value is provided, the default value for this property of the Machine resource will be used.
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "nodeDeletionTimeout"
    )]
    pub node_deletion_timeout: Option<String>,
    /// NodeDrainTimeout is the total amount of time that the controller will spend on draining a controlplane node
    /// The default value is 0, meaning that the node can be drained without any time limitations.
    /// NOTE: NodeDrainTimeout is different from `kubectl drain --timeout`
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "nodeDrainTimeout"
    )]
    pub node_drain_timeout: Option<String>,
    /// NodeVolumeDetachTimeout is the total amount of time that the controller will spend on waiting for all volumes
    /// to be detached. The default value is 0, meaning that the volumes can be detached without any time limitations.
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "nodeVolumeDetachTimeout"
    )]
    pub node_volume_detach_timeout: Option<String>,
}

/// Standard object's metadata.
/// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
pub struct KubeadmControlPlaneTemplateTemplateSpecMachineTemplateMetadata {
    /// Annotations is an unstructured key value map stored with a resource that may be
    /// set by external tools to store and retrieve arbitrary metadata. They are not
    /// queryable and should be preserved when modifying objects.
    /// More info: http://kubernetes.io/docs/user-guide/annotations
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub annotations: Option<BTreeMap<String, String>>,
    /// Map of string keys and values that can be used to organize and categorize
    /// (scope and select) objects. May match selectors of replication controllers
    /// and services.
    /// More info: http://kubernetes.io/docs/user-guide/labels
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub labels: Option<BTreeMap<String, String>>,
}

/// The RemediationStrategy that controls how control plane machine remediation happens.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
pub struct KubeadmControlPlaneTemplateTemplateSpecRemediationStrategy {
    /// MaxRetry is the Max number of retries while attempting to remediate an unhealthy machine.
    /// A retry happens when a machine that was created as a replacement for an unhealthy machine also fails.
    /// For example, given a control plane with three machines M1, M2, M3:
    ///
    /// A retry could happen only after RetryPeriod from the previous retry.
    /// If a machine is marked as unhealthy after MinHealthyPeriod from the previous remediation expired,
    /// this is not considered a retry anymore because the new issue is assumed unrelated from the previous one.
    ///
    /// If not set, the remedation will be retried infinitely.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "maxRetry")]
    pub max_retry: Option<i32>,
    /// MinHealthyPeriod defines the duration after which KCP will consider any failure to a machine unrelated
    /// from the previous one. In this case the remediation is not considered a retry anymore, and thus the retry
    /// counter restarts from 0. For example, assuming MinHealthyPeriod is set to 1h (default)
    ///
    /// If not set, this value is defaulted to 1h.
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "minHealthyPeriod"
    )]
    pub min_healthy_period: Option<String>,
    /// RetryPeriod is the duration that KCP should wait before remediating a machine being created as a replacement
    /// for an unhealthy machine (a retry).
    ///
    ///
    /// If not set, a retry will happen immediately.
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "retryPeriod"
    )]
    pub retry_period: Option<String>,
}

/// RolloutBefore is a field to indicate a rollout should be performed
/// if the specified criteria is met.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
pub struct KubeadmControlPlaneTemplateTemplateSpecRolloutBefore {
    /// CertificatesExpiryDays indicates a rollout needs to be performed if the
    /// certificates of the machine will expire within the specified days.
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "certificatesExpiryDays"
    )]
    pub certificates_expiry_days: Option<i32>,
}

/// The RolloutStrategy to use to replace control plane machines with
/// new ones.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
pub struct KubeadmControlPlaneTemplateTemplateSpecRolloutStrategy {
    /// Rolling update config params. Present only if
    /// RolloutStrategyType = RollingUpdate.
    #[serde(
        default,
        skip_serializing_if = "Option::is_none",
        rename = "rollingUpdate"
    )]
    pub rolling_update: Option<KubeadmControlPlaneTemplateTemplateSpecRolloutStrategyRollingUpdate>,
    /// Type of rollout. Currently the only supported strategy is
    /// "RollingUpdate".
    /// Default is RollingUpdate.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "type")]
    pub r#type: Option<String>,
}

/// Rolling update config params. Present only if
/// RolloutStrategyType = RollingUpdate.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
pub struct KubeadmControlPlaneTemplateTemplateSpecRolloutStrategyRollingUpdate {
    /// The maximum number of control planes that can be scheduled above or under the
    /// desired number of control planes.
    /// Value can be an absolute number 1 or 0.
    /// Defaults to 1.
    /// Example: when this is set to 1, the control plane can be scaled
    /// up immediately when the rolling update starts.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "maxSurge")]
    pub max_surge: Option<IntOrString>,
}
