{
  "properties": {
    "apiVersion": {
      "description": "APIVersion defines the versioned schema of this representation of an object.\nServers should convert recognized schemas to the latest internal value, and\nmay reject unrecognized values.\nMore 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.\nServers may infer this from the endpoint the client submits requests to.\nCannot be updated.\nIn CamelCase.\nMore info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds",
      "type": "string"
    },
    "metadata": {
      "type": "object"
    },
    "spec": {
      "properties": {
        "k0sConfigSpec": {
          "properties": {
            "args": {
              "description": "Args specifies extra arguments to be passed to k0s controller.\nSee: https://docs.k0sproject.io/stable/cli/k0s_controller/",
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            "customUserDataRef": {
              "description": "CustomUserDataRef is a reference to a secret or a configmap that contains the custom user data.\nProvided user-data will be merged with the one generated by k0smotron. Note that you may want to specify the merge type.\nSee: https://cloudinit.readthedocs.io/en/latest/reference/merging.html",
              "properties": {
                "configMapRef": {
                  "description": "ConfigMapRef is a reference to a configmap that contains the content.",
                  "properties": {
                    "key": {
                      "description": "Key is the key in the source that contains the content",
                      "type": "string"
                    },
                    "name": {
                      "description": "Name is the name of the source",
                      "type": "string"
                    }
                  },
                  "required": [
                    "key",
                    "name"
                  ],
                  "type": "object",
                  "additionalProperties": false
                },
                "secretRef": {
                  "description": "SecretRef is a reference to a secret that contains the content.",
                  "properties": {
                    "key": {
                      "description": "Key is the key in the source that contains the content",
                      "type": "string"
                    },
                    "name": {
                      "description": "Name is the name of the source",
                      "type": "string"
                    }
                  },
                  "required": [
                    "key",
                    "name"
                  ],
                  "type": "object",
                  "additionalProperties": false
                }
              },
              "type": "object",
              "additionalProperties": false
            },
            "downloadURL": {
              "description": "DownloadURL specifies the URL from which to download the k0s binary.\nIf the version field is specified, it is ignored, and whatever version is downloaded from the URL is used.\nSupported protocols are: http, https, oci. Using 'oci' scheme requires 'oras' to be installed on the target system.\n\nIf 'oci' schema is used and the OCI registry requires authentication, make sure to set up the authentication beforehand\nby adding a file to the Files section that contains the necessary config for ORAS. See: https://oras.land/docs/how_to_guides/authentication/\nThe file must be placed at `/root` directory (HOME for cloud-init execution time) and named `config.json`.\nNOTE: use `.preStartCommands` to set DOCKER_CONFIG environment variable in order to let ORAS pick up your custom config file.",
              "type": "string"
            },
            "files": {
              "description": "Files specifies extra files to be passed to user_data upon creation.",
              "items": {
                "description": "File defines a file to be passed to user_data upon creation.",
                "properties": {
                  "content": {
                    "type": "string"
                  },
                  "contentFrom": {
                    "description": "ContentFrom specifies the source of the content.",
                    "properties": {
                      "configMapRef": {
                        "description": "ConfigMapRef is a reference to a configmap that contains the content.",
                        "properties": {
                          "key": {
                            "description": "Key is the key in the source that contains the content",
                            "type": "string"
                          },
                          "name": {
                            "description": "Name is the name of the source",
                            "type": "string"
                          }
                        },
                        "required": [
                          "key",
                          "name"
                        ],
                        "type": "object",
                        "additionalProperties": false
                      },
                      "secretRef": {
                        "description": "SecretRef is a reference to a secret that contains the content.",
                        "properties": {
                          "key": {
                            "description": "Key is the key in the source that contains the content",
                            "type": "string"
                          },
                          "name": {
                            "description": "Name is the name of the source",
                            "type": "string"
                          }
                        },
                        "required": [
                          "key",
                          "name"
                        ],
                        "type": "object",
                        "additionalProperties": false
                      }
                    },
                    "type": "object",
                    "additionalProperties": false
                  },
                  "path": {
                    "type": "string"
                  },
                  "permissions": {
                    "type": "string"
                  }
                },
                "type": "object",
                "additionalProperties": false
              },
              "type": "array"
            },
            "ignition": {
              "description": "Ignition defines the ignition configuration. If empty, k0smotron will use cloud-init.",
              "properties": {
                "additionalConfig": {
                  "description": "AdditionalConfig is an unstructured object that contains additional config to be merged\nwith the generated one. The format follows Butane spec: https://coreos.github.io/butane/",
                  "type": "string"
                },
                "variant": {
                  "description": "Variant declares which distribution variant the generated config is for.\nCheck the supported variants and versions here:\nhttps://coreos.github.io/butane/specs/#butane-specifications-and-ignition-specifications",
                  "enum": [
                    "fcos",
                    "flatcar",
                    "openshift",
                    "r4e",
                    "fiot"
                  ],
                  "type": "string"
                },
                "version": {
                  "description": "Version is the schema version of the Butane config to use\nCheck the supported variants and versions here:\nhttps://coreos.github.io/butane/specs/#butane-specifications-and-ignition-specifications",
                  "type": "string"
                }
              },
              "required": [
                "variant",
                "version"
              ],
              "type": "object",
              "additionalProperties": false
            },
            "k0s": {
              "description": "K0s defines the k0s configuration. Note, that some fields will be overwritten by k0smotron.\nIf empty, will be used default configuration. @see https://docs.k0sproject.io/stable/configuration/",
              "type": "object",
              "x-kubernetes-preserve-unknown-fields": true
            },
            "k0sInstallDir": {
              "default": "/usr/local/bin",
              "description": "K0sInstallDir specifies the directory where k0s binary will be installed.\nIf empty, k0smotron will use /usr/local/bin, which is the default install path used by k0s get script.",
              "type": "string"
            },
            "postStartCommands": {
              "description": "PostStartCommands specifies commands to be run after starting k0s worker.",
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            "preInstalledK0s": {
              "description": "PreInstallK0s specifies whether k0s binary is pre-installed on the node.",
              "type": "boolean"
            },
            "preStartCommands": {
              "description": "PreStartCommands specifies commands to be run before starting k0s worker.",
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            "tunneling": {
              "description": "Tunneling defines the tunneling configuration for the cluster.",
              "properties": {
                "enabled": {
                  "default": false,
                  "description": "Enabled specifies whether tunneling is enabled.",
                  "type": "boolean"
                },
                "mode": {
                  "default": "tunnel",
                  "description": "Mode describes tunneling mode.\nIf empty, k0smotron will use the default one.",
                  "enum": [
                    "tunnel",
                    "proxy"
                  ],
                  "type": "string"
                },
                "serverAddress": {
                  "description": "Server address of the tunneling server.\nIf empty, k0smotron will try to detect worker node address for.",
                  "type": "string"
                },
                "serverNodePort": {
                  "default": 31700,
                  "description": "NodePort to publish for server port of the tunneling server.\nIf empty, k0smotron will use the default one.",
                  "format": "int32",
                  "type": "integer"
                },
                "tunnelingNodePort": {
                  "default": 31443,
                  "description": "NodePort to publish for tunneling port.\nIf empty, k0smotron will use the default one.",
                  "format": "int32",
                  "type": "integer"
                }
              },
              "type": "object",
              "additionalProperties": false
            },
            "useSystemHostname": {
              "default": false,
              "description": "UseSystemHostname specifies whether to use the system hostname for the kubernetes node name.\nBy default, k0smotron will use Machine name as a node name. If true, it will pick it from `hostname` command output.",
              "type": "boolean"
            },
            "workingDir": {
              "description": "WorkingDir specifies the working directory where k0smotron will place its files.",
              "type": "string"
            }
          },
          "type": "object",
          "additionalProperties": false
        },
        "machineTemplate": {
          "properties": {
            "infrastructureRef": {
              "description": "InfrastructureRef is a required reference to a custom resource\noffered 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\nshould contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2].\nFor example, if the object reference is to a container within a pod, this would take on a value like:\n\"spec.containers{name}\" (where \"name\" refers to the name of the container that triggered\nthe event) or if no container name is specified \"spec.containers[2]\" (container with\nindex 2 in this pod). This syntax is chosen only to have some well-defined way of\nreferencing a part of an object.",
                  "type": "string"
                },
                "kind": {
                  "description": "Kind of the referent.\nMore info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds",
                  "type": "string"
                },
                "name": {
                  "description": "Name of the referent.\nMore info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names",
                  "type": "string"
                },
                "namespace": {
                  "description": "Namespace of the referent.\nMore 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.\nMore 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.\nMore info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids",
                  "type": "string"
                }
              },
              "type": "object",
              "x-kubernetes-map-type": "atomic",
              "additionalProperties": false
            },
            "metadata": {
              "description": "Standard object's metadata.\nMore 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\nset by external tools to store and retrieve arbitrary metadata. They are not\nqueryable and should be preserved when modifying objects.\nMore info: http://kubernetes.io/docs/user-guide/annotations",
                  "type": "object"
                },
                "labels": {
                  "additionalProperties": {
                    "type": "string"
                  },
                  "description": "labels is a map of string keys and values that can be used to organize and categorize\n(scope and select) objects. May match selectors of replication controllers\nand services.\nMore info: http://kubernetes.io/docs/user-guide/labels",
                  "type": "object"
                }
              },
              "type": "object",
              "additionalProperties": false
            },
            "nodeDeletionTimeout": {
              "description": "NodeDeletionTimeout defines how long the machine controller will attempt to delete the Node that the Machine\nhosts after the Machine is marked for deletion. A duration of 0 will retry deletion indefinitely.\nIf 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\nThe default value is 0, meaning that the node can be drained without any time limitations.\nNOTE: NodeDrainTimeout is different from `kubectl drain --timeout`",
              "type": "string"
            },
            "nodeVolumeDetachTimeout": {
              "description": "NodeVolumeDetachTimeout is the total amount of time that the controller will spend on waiting for all volumes\nto be detached. The default value is 0, meaning that the volumes can be detached without any time limitations.",
              "type": "string"
            }
          },
          "required": [
            "infrastructureRef"
          ],
          "type": "object",
          "additionalProperties": false
        },
        "replicas": {
          "default": 1,
          "format": "int32",
          "type": "integer"
        },
        "updateStrategy": {
          "default": "InPlace",
          "description": "UpdateStrategy defines the strategy to use when updating the control plane.",
          "enum": [
            "InPlace",
            "Recreate",
            "RecreateDeleteFirst"
          ],
          "type": "string"
        },
        "version": {
          "description": "Version defines the k0s version to be deployed. You can use a specific k0s version (e.g. v1.27.1+k0s.0) or\njust the Kubernetes version (e.g. v1.27.1). If left empty, k0smotron will select one automatically.",
          "type": "string"
        }
      },
      "required": [
        "k0sConfigSpec",
        "machineTemplate"
      ],
      "type": "object",
      "additionalProperties": false
    },
    "status": {
      "default": {
        "initialization": {
          "controlPlaneInitialized": false
        },
        "initialized": false,
        "ready": false,
        "version": ""
      },
      "properties": {
        "conditions": {
          "description": "Conditions defines current service state of the K0sControlPlane.",
          "items": {
            "description": "Condition defines an observation of a Cluster API resource operational state.",
            "properties": {
              "lastTransitionTime": {
                "description": "lastTransitionTime is the last time the condition transitioned from one status to another.\nThis should be when the underlying condition changed. If that is not known, then using the time when\nthe API field changed is acceptable.",
                "format": "date-time",
                "type": "string"
              },
              "message": {
                "description": "message is a human readable message indicating details about the transition.\nThis field may be empty.",
                "maxLength": 10240,
                "minLength": 1,
                "type": "string"
              },
              "reason": {
                "description": "reason is the reason for the condition's last transition in CamelCase.\nThe specific API may choose whether or not this field is considered a guaranteed API.\nThis field may be empty.",
                "maxLength": 256,
                "minLength": 1,
                "type": "string"
              },
              "severity": {
                "description": "severity provides an explicit classification of Reason code, so the users or machines can immediately\nunderstand the current situation and act accordingly.\nThe Severity field MUST be set only when Status=False.",
                "maxLength": 32,
                "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.\nMany .condition.type values are consistent across resources like Available, but because arbitrary conditions\ncan be useful (see .node.status.conditions), the ability to deconflict is important.",
                "maxLength": 256,
                "minLength": 1,
                "type": "string"
              }
            },
            "required": [
              "lastTransitionTime",
              "status",
              "type"
            ],
            "type": "object",
            "additionalProperties": false
          },
          "type": "array"
        },
        "externalManagedControlPlane": {
          "description": "externalManagedControlPlane is a bool that should be set to true if the Node objects do not exist in the cluster.",
          "type": "boolean"
        },
        "initialization": {
          "description": "initialization represents the initialization status of the control plane",
          "properties": {
            "controlPlaneInitialized": {
              "description": "controlPlaneInitialized indicates whether the control plane is initialized",
              "type": "boolean"
            }
          },
          "type": "object",
          "additionalProperties": false
        },
        "initialized": {
          "description": "initialized denotes that the K0sControlPlane API Server is initialized and thus\nit can accept requests.\nNOTE: this field is part of the Cluster API contract and it is used to orchestrate provisioning.\nThe value of this field is never updated after provisioning is completed. Please use conditions\nto check the operational state of the control plane.",
          "type": "boolean"
        },
        "ready": {
          "description": "Ready denotes that the control plane is ready",
          "type": "boolean"
        },
        "readyReplicas": {
          "description": "readyReplicas is the total number of fully running and ready control plane machines.",
          "format": "int32",
          "type": "integer"
        },
        "replicas": {
          "description": "replicas is the total number of non-terminated machines targeted by this control plane\n(their labels match the selector).",
          "format": "int32",
          "type": "integer"
        },
        "selector": {
          "description": "selector is the label selector in string format to avoid introspection\nby clients, and is used to provide the CRD-based integration for the\nscale subresource and additional integrations for things like kubectl\ndescribe.. The string will be in the same format as the query-param syntax.\nMore info about label selectors: http://kubernetes.io/docs/user-guide/labels#label-selectors",
          "type": "string"
        },
        "unavailableReplicas": {
          "description": "unavailableReplicas is the total number of unavailable machines targeted by this control plane.\nThis is the total number of machines that are still required for\nthe deployment to have 100% available capacity. They may either\nbe machines that are running but not yet ready or machines\nthat still have not been created.",
          "format": "int32",
          "type": "integer"
        },
        "updatedReplicas": {
          "description": "updatedReplicas is the total number of non-terminated machines targeted by this control plane\nthat have the desired template spec.",
          "format": "int32",
          "type": "integer"
        },
        "version": {
          "description": "version represents the minimum Kubernetes version for the control plane machines\nin the cluster.",
          "type": "string"
        }
      },
      "type": "object",
      "additionalProperties": false
    }
  },
  "type": "object"
}
