---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
  annotations:
    controller-gen.kubebuilder.io/version: v0.9.1
  creationTimestamp: null
  name: k3scontrolplanes.controlplane.cluster.x-k8s.io
spec:
  group: controlplane.cluster.x-k8s.io
  names:
    categories:
    - cluster-api
    kind: K3sControlPlane
    listKind: K3sControlPlaneList
    plural: k3scontrolplanes
    shortNames:
    - k3scp
    singular: k3scontrolplane
  scope: Namespaced
  versions:
  - additionalPrinterColumns:
    - description: Cluster
      jsonPath: .metadata.labels['cluster\.x-k8s\.io/cluster-name']
      name: Cluster
      type: string
    - description: This denotes whether or not the control plane has the uploaded
        k3s-config configmap
      jsonPath: .status.initialized
      name: Initialized
      type: boolean
    - description: K3sControlPlane API Server is ready to receive requests
      jsonPath: .status.ready
      name: API Server Available
      type: boolean
    - description: Total number of machines desired by this control plane
      jsonPath: .spec.replicas
      name: Desired
      priority: 10
      type: integer
    - description: Total number of non-terminated machines targeted by this control
        plane
      jsonPath: .status.replicas
      name: Replicas
      type: integer
    - description: Total number of fully running and ready control plane machines
      jsonPath: .status.readyReplicas
      name: Ready
      type: integer
    - description: Total number of non-terminated machines targeted by this control
        plane that have the desired template spec
      jsonPath: .status.updatedReplicas
      name: Updated
      type: integer
    - description: Total number of unavailable machines targeted by this control plane
      jsonPath: .status.unavailableReplicas
      name: Unavailable
      type: integer
    - description: Time duration since creation of KubeadmControlPlane
      jsonPath: .metadata.creationTimestamp
      name: Age
      type: date
    - description: Kubernetes version associated with this control plane
      jsonPath: .spec.version
      name: Version
      type: string
    name: v1beta1
    schema:
      openAPIV3Schema:
        description: K3sControlPlane is the Schema for the k3scontrolplanes API
        properties:
          apiVersion:
            description: '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'
            type: string
          kind:
            description: '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'
            type: string
          metadata:
            type: object
          spec:
            description: K3sControlPlaneSpec defines the desired state of K3sControlPlane
            properties:
              k3sConfigSpec:
                description: K3sConfigSpec is a K3sConfigSpec to use for initializing
                  and joining machines to the control plane.
                properties:
                  agentConfiguration:
                    description: AgentConfiguration defines the k3s agent configuration.
                    properties:
                      kubernetesAgentProcesses:
                        description: KubernetesAgentProcesses defines the k3s agent
                          kubernetes processes configuration.
                        properties:
                          kubeProxyArgs:
                            description: KubeProxyArgs Customized flag for kube-proxy
                              process
                            items:
                              type: string
                            type: array
                          kubeletArgs:
                            description: KubeletArgs Customized flag for kubelet process
                            items:
                              type: string
                            type: array
                        type: object
                      networking:
                        description: Networking defines the k3s agent networking configuration.
                        properties:
                          nodeExternalIP:
                            description: NodeExternalIP External IP address to advertise
                              for node.
                            type: string
                          nodeIP:
                            description: NodeIP IP address to advertise for node.
                            type: string
                          resolvConf:
                            description: ResolvConf Path to Kubelet resolv.conf file.
                            type: string
                        type: object
                      node:
                        description: Node defines the k3s agent node configuration.
                        properties:
                          dataDir:
                            description: DataDir Folder to hold state.
                            type: string
                          lbServerPort:
                            description: 'LBServerPort Local port for supervisor client
                              load-balancer. If the supervisor and apiserver are not
                              colocated an additional port 1 less than this port will
                              also be used for the apiserver client load-balancer.
                              (default: 6444)'
                            type: integer
                          nodeLabels:
                            description: NodeLabels registering and starting kubelet
                              with set of labels.
                            items:
                              type: string
                            type: array
                          nodeName:
                            description: NodeName k3s node name.
                            type: string
                          nodeTaints:
                            description: NodeTaints registering and starting kubelet
                              with set of taints.
                            items:
                              type: string
                            type: array
                          seLinux:
                            description: SeLinux Enable SELinux in containerd
                            type: boolean
                        type: object
                      runtime:
                        description: Runtime defines the k3s agent runtime configuration.
                        properties:
                          containerRuntimeEndpoint:
                            description: ContainerRuntimeEndpoint Disable embedded
                              containerd and use alternative CRI implementation.
                            type: string
                          pauseImage:
                            description: PauseImage Customized pause image for containerd
                              or Docker sandbox.
                            type: string
                          privateRegistry:
                            description: PrivateRegistry Path to a private registry
                              configuration file.
                            type: string
                        type: object
                    type: object
                  cluster:
                    description: Cluster defines the k3s cluster Options.
                    properties:
                      server:
                        description: Server which server to connect to, used to join
                          a cluster.
                        type: string
                      token:
                        description: Token shared secret used to join a server or
                          agent to a cluster.
                        type: string
                      tokenFile:
                        description: TokenFile file containing the cluster-secret/token.
                        type: string
                    type: object
                  files:
                    description: Files specifies extra files to be passed to user_data
                      upon creation.
                    items:
                      description: File defines the input for generating write_files
                        in cloud-init.
                      properties:
                        append:
                          description: Append specifies whether to append Content
                            to existing file if Path exists.
                          type: boolean
                        content:
                          description: Content is the actual content of the file.
                          type: string
                        contentFrom:
                          description: ContentFrom is a referenced source of content
                            to populate the file.
                          properties:
                            secret:
                              description: Secret represents a secret that should
                                populate this file.
                              properties:
                                key:
                                  description: Key is the key in the secret's data
                                    map for this value.
                                  type: string
                                name:
                                  description: Name of the secret in the KubeadmBootstrapConfig's
                                    namespace to use.
                                  type: string
                              required:
                              - key
                              - name
                              type: object
                          required:
                          - secret
                          type: object
                        encoding:
                          description: Encoding specifies the encoding of the file
                            contents.
                          enum:
                          - base64
                          - gzip
                          - gzip+base64
                          type: string
                        owner:
                          description: Owner specifies the ownership of the file,
                            e.g. "root:root".
                          type: string
                        path:
                          description: Path specifies the full path on disk where
                            to store the file.
                          type: string
                        permissions:
                          description: Permissions specifies the permissions to assign
                            to the file, e.g. "0640".
                          type: string
                      required:
                      - path
                      type: object
                    type: array
                  postK3sCommands:
                    description: PostK3sCommands specifies extra commands to run after
                      k3s setup runs
                    items:
                      type: string
                    type: array
                  preK3sCommands:
                    description: PreK3sCommands specifies extra commands to run before
                      k3s setup runs
                    items:
                      type: string
                    type: array
                  serverConfiguration:
                    description: ServerConfiguration defines the k3s server configuration.
                    properties:
                      agent:
                        description: Agent is the agent configuration.
                        properties:
                          kubernetesAgentProcesses:
                            description: KubernetesAgentProcesses defines the k3s
                              agent kubernetes processes configuration.
                            properties:
                              kubeProxyArgs:
                                description: KubeProxyArgs Customized flag for kube-proxy
                                  process
                                items:
                                  type: string
                                type: array
                              kubeletArgs:
                                description: KubeletArgs Customized flag for kubelet
                                  process
                                items:
                                  type: string
                                type: array
                            type: object
                          networking:
                            description: Networking defines the k3s agent networking
                              configuration.
                            properties:
                              nodeExternalIP:
                                description: NodeExternalIP External IP address to
                                  advertise for node.
                                type: string
                              nodeIP:
                                description: NodeIP IP address to advertise for node.
                                type: string
                              resolvConf:
                                description: ResolvConf Path to Kubelet resolv.conf
                                  file.
                                type: string
                            type: object
                          node:
                            description: Node defines the k3s agent node configuration.
                            properties:
                              dataDir:
                                description: DataDir Folder to hold state.
                                type: string
                              lbServerPort:
                                description: 'LBServerPort Local port for supervisor
                                  client load-balancer. If the supervisor and apiserver
                                  are not colocated an additional port 1 less than
                                  this port will also be used for the apiserver client
                                  load-balancer. (default: 6444)'
                                type: integer
                              nodeLabels:
                                description: NodeLabels registering and starting kubelet
                                  with set of labels.
                                items:
                                  type: string
                                type: array
                              nodeName:
                                description: NodeName k3s node name.
                                type: string
                              nodeTaints:
                                description: NodeTaints registering and starting kubelet
                                  with set of taints.
                                items:
                                  type: string
                                type: array
                              seLinux:
                                description: SeLinux Enable SELinux in containerd
                                type: boolean
                            type: object
                          runtime:
                            description: Runtime defines the k3s agent runtime configuration.
                            properties:
                              containerRuntimeEndpoint:
                                description: ContainerRuntimeEndpoint Disable embedded
                                  containerd and use alternative CRI implementation.
                                type: string
                              pauseImage:
                                description: PauseImage Customized pause image for
                                  containerd or Docker sandbox.
                                type: string
                              privateRegistry:
                                description: PrivateRegistry Path to a private registry
                                  configuration file.
                                type: string
                            type: object
                        type: object
                      database:
                        description: Database is the database configuration.
                        properties:
                          clusterInit:
                            description: ClusterInit initialize a new cluster using
                              embedded Etcd.
                            type: boolean
                          dataStoreCAFile:
                            description: DataStoreCAFile TLS Certificate Authority
                              file used to secure datastore backend communication.
                            type: string
                          dataStoreCertFile:
                            description: DataStoreCertFile TLS certification file
                              used to secure datastore backend communication.
                            type: string
                          dataStoreEndPoint:
                            description: DataStoreEndPoint specify etcd, Mysql, Postgres,
                              or Sqlite (default) data source name.
                            type: string
                          dataStoreKeyFile:
                            description: DataStoreKeyFile TLS key file used to secure
                              datastore backend communication.
                            type: string
                        type: object
                      kubernetesComponents:
                        description: KubernetesComponents is the kubernetes components
                          configuration.
                        properties:
                          disable:
                            description: 'Disable do not deploy packaged components
                              and delete any deployed components (valid items: coredns,
                              servicelb, traefik,local-storage, metrics-server).'
                            type: string
                          disableHelmController:
                            description: DisableHelmController disable Helm controller.
                            type: boolean
                          disableKubeProxy:
                            description: DisableKubeProxy disable running kube-proxy.
                            type: boolean
                          disableNetworkPolicy:
                            description: DisableNetworkPolicy disable k3s default
                              network policy controller.
                            type: boolean
                        type: object
                      kubernetesProcesses:
                        description: KubernetesProcesses is the kubernetes processes
                          configuration.
                        properties:
                          kubeAPIServerArg:
                            description: KubeAPIServerArgs is a customized flag for
                              kube-apiserver process
                            items:
                              type: string
                            type: array
                          kubeControllerManagerArgs:
                            description: KubeControllerManagerArgs is a customized
                              flag for kube-controller-manager process
                            items:
                              type: string
                            type: array
                          kubeSchedulerArgs:
                            description: KubeSchedulerArgs is a customized flag for
                              kube-scheduler process
                            items:
                              type: string
                            type: array
                        type: object
                      listener:
                        description: Listener is the listener configuration.
                        properties:
                          advertiseAddress:
                            description: AdvertiseAddress IP address that apiserver
                              uses to advertise to members of the cluster.
                            type: string
                          advertisePort:
                            description: 'AdvertisePort Port that apiserver uses to
                              advertise to members of the cluster (default: listen-port).'
                            type: integer
                          bindAddress:
                            description: BindAddress k3s bind address.
                            type: string
                          httpsListenPort:
                            description: HTTPSListenPort HTTPS listen port.
                            type: integer
                          tlsSan:
                            description: TLSSan Add additional hostname or IP as a
                              Subject Alternative Name in the TLS cert.
                            type: string
                        type: object
                      networking:
                        description: Networking is the networking configuration.
                        properties:
                          clusterCIDR:
                            description: ClusterCIDR Network CIDR to use for pod IPs.
                            type: string
                          clusterDNS:
                            description: ClusterDNS cluster IP for coredns service.
                              Should be in your service-cidr range.
                            type: string
                          clusterDomain:
                            description: ClusterDomain cluster Domain.
                            type: string
                          flannelBackend:
                            description: 'FlannelBackend One of ‘none’, ‘vxlan’, ‘ipsec’,
                              ‘host-gw’, or ‘wireguard’. (default: vxlan)'
                            type: string
                          serviceCIDR:
                            description: ServiceCIDR Network CIDR to use for services
                              IPs.
                            type: string
                          serviceNodePortRange:
                            description: ServiceNodePortRange Port range to reserve
                              for services with NodePort visibility.
                            type: string
                        type: object
                    type: object
                  version:
                    description: Version specifies the k3s version
                    type: string
                type: object
              machineTemplate:
                description: MachineTemplate contains information about how machines
                  should be shaped when creating or updating a control plane.
                properties:
                  infrastructureRef:
                    description: InfrastructureRef is a required reference to a custom
                      resource offered by an infrastructure provider.
                    properties:
                      apiVersion:
                        description: API version of the referent.
                        type: string
                      fieldPath:
                        description: 'If referring to a piece of an object instead
                          of an entire object, this string should contain a valid
                          JSON/Go field access statement, such as desiredState.manifest.containers[2].
                          For example, if the object reference is to a container within
                          a pod, this would take on a value like: "spec.containers{name}"
                          (where "name" refers to the name of the container that triggered
                          the event) or if no container name is specified "spec.containers[2]"
                          (container with index 2 in this pod). This syntax is chosen
                          only to have some well-defined way of referencing a part
                          of an object. TODO: this design is not final and this field
                          is subject to change in the future.'
                        type: string
                      kind:
                        description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
                        type: string
                      name:
                        description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names'
                        type: string
                      namespace:
                        description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/'
                        type: string
                      resourceVersion:
                        description: 'Specific resourceVersion to which this reference
                          is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency'
                        type: string
                      uid:
                        description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids'
                        type: string
                    type: object
                    x-kubernetes-map-type: atomic
                  metadata:
                    description: 'Standard object''s metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata'
                    properties:
                      annotations:
                        additionalProperties:
                          type: string
                        description: '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'
                        type: object
                      labels:
                        additionalProperties:
                          type: string
                        description: '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'
                        type: object
                    type: object
                  nodeDeletionTimeout:
                    description: 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.
                    type: string
                  nodeDrainTimeout:
                    description: '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`'
                    type: string
                required:
                - infrastructureRef
                type: object
              replicas:
                description: Number of desired machines. Defaults to 1. When stacked
                  etcd is used only odd numbers are permitted, as per [etcd best practice](https://etcd.io/docs/v3.3.12/faq/#why-an-odd-number-of-cluster-members).
                  This is a pointer to distinguish between explicit zero and not specified.
                format: int32
                type: integer
              rolloutAfter:
                description: RolloutAfter is a field to indicate a rollout should
                  be performed after the specified time even if no changes have been
                  made to the K3sControlPlane.
                format: date-time
                type: string
              rolloutStrategy:
                default:
                  rollingUpdate:
                    maxSurge: 1
                  type: RollingUpdate
                description: The RolloutStrategy to use to replace control plane machines
                  with new ones.
                properties:
                  rollingUpdate:
                    description: Rolling update config params. Present only if RolloutStrategyType
                      = RollingUpdate.
                    properties:
                      maxSurge:
                        anyOf:
                        - type: integer
                        - type: string
                        description: '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.'
                        x-kubernetes-int-or-string: true
                    type: object
                  type:
                    description: Type of rollout. Currently the only supported strategy
                      is "RollingUpdate". Default is RollingUpdate.
                    type: string
                type: object
              version:
                description: Version defines the desired K3s version.
                type: string
            required:
            - machineTemplate
            - version
            type: object
          status:
            description: K3sControlPlaneStatus defines the observed state of K3sControlPlane
            properties:
              conditions:
                description: Conditions defines current service state of the K3sControlPlane.
                items:
                  description: Condition defines an observation of a Cluster API resource
                    operational state.
                  properties:
                    lastTransitionTime:
                      description: Last time the condition transitioned from one status
                        to another. This should be when the underlying condition changed.
                        If that is not known, then using the time when the API field
                        changed is acceptable.
                      format: date-time
                      type: string
                    message:
                      description: A human readable message indicating details about
                        the transition. This field may be empty.
                      type: string
                    reason:
                      description: The reason for the condition's last transition
                        in CamelCase. The specific API may choose whether or not this
                        field is considered a guaranteed API. This field may not be
                        empty.
                      type: string
                    severity:
                      description: Severity provides an explicit classification of
                        Reason code, so the users or machines can immediately understand
                        the current situation and act accordingly. The Severity field
                        MUST be set only when Status=False.
                      type: string
                    status:
                      description: Status of the condition, one of True, False, Unknown.
                      type: string
                    type:
                      description: Type of condition in CamelCase or in foo.example.com/CamelCase.
                        Many .condition.type values are consistent across resources
                        like Available, but because arbitrary conditions can be useful
                        (see .node.status.conditions), the ability to deconflict is
                        important.
                      type: string
                  required:
                  - lastTransitionTime
                  - status
                  - type
                  type: object
                type: array
              failureMessage:
                description: ErrorMessage indicates that there is a terminal problem
                  reconciling the state, and will be set to a descriptive error message.
                type: string
              failureReason:
                description: FailureReason indicates that there is a terminal problem
                  reconciling the state, and will be set to a token value suitable
                  for programmatic interpretation.
                type: string
              initialized:
                description: Initialized denotes whether or not the control plane
                  has the uploaded kubeadm-config configmap.
                type: boolean
              observedGeneration:
                description: ObservedGeneration is the latest generation observed
                  by the controller.
                format: int64
                type: integer
              ready:
                description: Ready denotes that the K3sControlPlane API Server is
                  ready to receive requests.
                type: boolean
              readyReplicas:
                description: Total number of fully running and ready control plane
                  machines.
                format: int32
                type: integer
              replicas:
                description: Total number of non-terminated machines targeted by this
                  control plane (their labels match the selector).
                format: int32
                type: integer
              selector:
                description: 'Selector is the label selector in string format to avoid
                  introspection by clients, and is used to provide the CRD-based integration
                  for the scale subresource and additional integrations for things
                  like kubectl describe.. The string will be in the same format as
                  the query-param syntax. More info about label selectors: http://kubernetes.io/docs/user-guide/labels#label-selectors'
                type: string
              unavailableReplicas:
                description: Total number of unavailable machines targeted by this
                  control plane. This is the total number of machines that are still
                  required for the deployment to have 100% available capacity. They
                  may either be machines that are running but not yet ready or machines
                  that still have not been created.
                format: int32
                type: integer
              updatedReplicas:
                description: Total number of non-terminated machines targeted by this
                  control plane that have the desired template spec.
                format: int32
                type: integer
              version:
                description: Version represents the minimum Kubernetes version for
                  the control plane machines in the cluster.
                type: string
            type: object
        type: object
    served: true
    storage: true
    subresources:
      scale:
        labelSelectorPath: .status.selector
        specReplicasPath: .spec.replicas
        statusReplicasPath: .status.replicas
      status: {}
