---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
  annotations:
    controller-gen.kubebuilder.io/version: v0.9.1
  creationTimestamp: null
  name: kkclusters.infrastructure.cluster.x-k8s.io
spec:
  group: infrastructure.cluster.x-k8s.io
  names:
    categories:
    - cluster-api
    kind: KKCluster
    listKind: KKClusterList
    plural: kkclusters
    shortNames:
    - kkc
    singular: kkcluster
  scope: Namespaced
  versions:
  - additionalPrinterColumns:
    - description: Cluster to which this KKClusters belongs
      jsonPath: .metadata.labels.cluster\.x-k8s\.io/cluster-name
      name: Cluster
      type: string
    - description: Cluster infrastructure is ready for SSH instances
      jsonPath: .status.ready
      name: Ready
      type: string
    - description: API Endpoint
      jsonPath: .spec.controlPlaneEndpoint
      name: Endpoint
      priority: 1
      type: string
    name: v1beta1
    schema:
      openAPIV3Schema:
        description: KKCluster is the Schema for the kkclusters 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: KKClusterSpec defines the desired state of KKCluster
            properties:
              component:
                description: Component is optional configuration for modifying the
                  FTP server that gets the necessary components for the cluster.
                properties:
                  host:
                    description: Host is the host to download the binaries.
                    type: string
                  overrides:
                    description: Overrides is a list of components download information
                      that need to be overridden.
                    items:
                      description: Override is a component download information that
                        need to be overridden.
                      properties:
                        arch:
                          description: Arch is the component arch. e.g. amd64, arm64,
                            etc.
                          type: string
                        checksum:
                          description: Checksum is the SHA256 checksum of the binary.
                          properties:
                            path:
                              description: Path defines the URL path, which is the
                                path of the checksum file.
                              type: string
                            value:
                              description: Value is the checksum string value.
                              type: string
                          type: object
                        id:
                          description: ID is the component id name. e.g. kubeadm,
                            kubelet, containerd, etc.
                          type: string
                        path:
                          description: Path defines the URL path, which is the string
                            of information that comes after the top level domain name.
                          type: string
                        url:
                          description: URL is the download url of the binaries.
                          type: string
                        version:
                          description: Version is the component version. e.g. v1.21.1,
                            v1.22.0, etc.
                          type: string
                      type: object
                    type: array
                  zone:
                    description: 'ZONE is the zone of the KKCluster where can get
                      the binaries. If you have problem to access https://storage.googleapis.com,
                      you can set "zone: cn".'
                    type: string
                type: object
              controlPlaneEndpoint:
                description: ControlPlaneEndpoint represents the endpoint used to
                  communicate with the control plane.
                properties:
                  host:
                    description: The hostname on which the API server is serving.
                    type: string
                  port:
                    description: The port on which the API server is serving.
                    format: int32
                    type: integer
                required:
                - host
                - port
                type: object
              controlPlaneLoadBalancer:
                description: ControlPlaneLoadBalancer is optional configuration for
                  customizing control plane behavior.
                properties:
                  host:
                    description: The hostname on which the API server is serving.
                    type: string
                type: object
              distribution:
                description: Distribution represents the Kubernetes distribution type
                  of the cluster.
                type: string
              nodes:
                description: Nodes represents the information about the nodes available
                  to the cluster
                properties:
                  auth:
                    description: Auth is the SSH authentication information of all
                      instance. It is a global auth configuration.
                    properties:
                      password:
                        description: Password is the password for SSH authentication.
                        type: string
                      port:
                        description: Port is the port for SSH authentication.
                        type: integer
                      privateKey:
                        description: PrivateKey is the value of the private key for
                          SSH authentication.
                        type: string
                      privateKeyPath:
                        description: PrivateKeyFile is the path to the private key
                          for SSH authentication.
                        type: string
                      secret:
                        description: Secret is the secret of the PrivateKey or Password
                          for SSH authentication.It should in the same namespace as
                          capkk. When Password is empty, replace it with data.password.
                          When PrivateKey is empty, replace it with data.privateKey
                        type: string
                      timeout:
                        description: Timeout is the timeout for establish an SSH connection.
                        format: int64
                        type: integer
                      user:
                        description: User is the username for SSH authentication.
                        type: string
                    type: object
                  instances:
                    description: Instances defines all instance contained in kkcluster.
                    items:
                      description: InstanceInfo defines the information about the
                        instance.
                      properties:
                        address:
                          description: Address is the IP address of the machine.
                          type: string
                        arch:
                          description: Arch is the architecture of the machine. e.g.
                            "amd64", "arm64".
                          type: string
                        auth:
                          description: Auth is the SSH authentication information
                            of this machine. It will override the global auth configuration.
                          properties:
                            password:
                              description: Password is the password for SSH authentication.
                              type: string
                            port:
                              description: Port is the port for SSH authentication.
                              type: integer
                            privateKey:
                              description: PrivateKey is the value of the private
                                key for SSH authentication.
                              type: string
                            privateKeyPath:
                              description: PrivateKeyFile is the path to the private
                                key for SSH authentication.
                              type: string
                            secret:
                              description: Secret is the secret of the PrivateKey
                                or Password for SSH authentication.It should in the
                                same namespace as capkk. When Password is empty, replace
                                it with data.password. When PrivateKey is empty, replace
                                it with data.privateKey
                              type: string
                            timeout:
                              description: Timeout is the timeout for establish an
                                SSH connection.
                              format: int64
                              type: integer
                            user:
                              description: User is the username for SSH authentication.
                              type: string
                          type: object
                        internalAddress:
                          description: InternalAddress is the internal IP address
                            of the machine.
                          type: string
                        name:
                          description: Name is the host name of the machine.
                          minLength: 1
                          type: string
                        roles:
                          description: Roles is the role of the machine.
                          items:
                            description: Role represents a role of a node.
                            type: string
                          type: array
                      type: object
                    type: array
                required:
                - instances
                type: object
              registry:
                description: Registry represents the cluster image registry used to
                  pull the images.
                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
                  auth:
                    description: Auth defines the auth of this PrivateRegistry.
                    properties:
                      caFile:
                        description: CAFile is an SSL Certificate Authority file used
                          to secure etcd communication.
                        type: string
                      certFile:
                        description: CertFile is an SSL certification file used to
                          secure etcd communication.
                        type: string
                      certsPath:
                        description: CertsPath defines the path of the certs files
                          of this PrivateRegistry.
                        type: string
                      insecureSkipVerify:
                        description: InsecureSkipVerify allow contacting this PrivateRegistry
                          over HTTPS with failed TLS verification.
                        type: boolean
                      keyFile:
                        description: KeyFile is an SSL key file used to secure etcd
                          communication.
                        type: string
                      password:
                        description: Password defines the password of this PrivateRegistry.
                        type: string
                      plainHTTP:
                        description: PlainHTTP allow contacting this PrivateRegistry
                          over HTTP.
                        type: boolean
                      username:
                        description: Username defines the username of this PrivateRegistry.
                        type: string
                    required:
                    - certsPath
                    - insecureSkipVerify
                    - password
                    - plainHTTP
                    - username
                    type: object
                  insecureRegistries:
                    description: InsecureRegistries defines the insecure registries
                      of ContainerManager.
                    items:
                      type: string
                    type: array
                  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
                  namespaceOverride:
                    description: NamespaceOverride defines the namespace override
                      of this PrivateRegistry.
                    type: string
                  privateRegistry:
                    description: PrivateRegistry defines the private registry address
                      of ContainerManager.
                    type: string
                  registryMirrors:
                    description: RegistryMirrors defines the registry mirrors of this
                      PrivateRegistry.
                    items:
                      type: string
                    type: array
                required:
                - auth
                - namespaceOverride
                - privateRegistry
                type: object
            required:
            - nodes
            type: object
          status:
            description: KKClusterStatus defines the observed state of KKCluster
            properties:
              conditions:
                description: Conditions defines current service state of the KKMachine.
                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: "FailureMessage will be set in the event that there is
                  a terminal problem reconciling the Machine and will contain a more
                  verbose string suitable for logging and human consumption. \n This
                  field should not be set for transitive errors that a controller
                  faces that are expected to be fixed automatically over time (like
                  service outages), but instead indicate that something is fundamentally
                  wrong with the Machine's spec or the configuration of the controller,
                  and that manual intervention is required. Examples of terminal errors
                  would be invalid combinations of settings in the spec, values that
                  are unsupported by the controller, or the responsible controller
                  itself being critically misconfigured. \n Any transient errors that
                  occur during the reconciliation of Machines can be added as events
                  to the Machine object and/or logged in the controller's output."
                type: string
              failureReason:
                description: "FailureReason will be set in the event that there is
                  a terminal problem reconciling the Machine and will contain a succinct
                  value suitable for machine interpretation. \n This field should
                  not be set for transitive errors that a controller faces that are
                  expected to be fixed automatically over time (like service outages),
                  but instead indicate that something is fundamentally wrong with
                  the Machine's spec or the configuration of the controller, and that
                  manual intervention is required. Examples of terminal errors would
                  be invalid combinations of settings in the spec, values that are
                  unsupported by the controller, or the responsible controller itself
                  being critically misconfigured. \n Any transient errors that occur
                  during the reconciliation of Machines can be added as events to
                  the Machine object and/or logged in the controller's output."
                type: string
              ready:
                default: false
                type: boolean
            required:
            - ready
            type: object
        type: object
    served: true
    storage: true
    subresources:
      status: {}
