kubermatic / kubeone

Kubermatic KubeOne automate cluster operations on all your cloud, on-prem, edge, and IoT environments.
https://kubeone.io
Apache License 2.0
1.37k stars 234 forks source link

Validation permits having cloudProvider.none and machineController.deploy=true #3366

Open kron4eg opened 1 month ago

kron4eg commented 1 month ago

What happened?

Sometimes people can be confused and try to set unsupported config combination that lead to very obscure error messages, for example in this case:

Task failed, error was: runtime: unmarshalling manifest "deployment-controller.yaml"
error converting YAML to JSON: yaml: line 64: could not find expected ':'

Expected behavior

KubeOne should error out early, clearly indicating that such a config is not supported.

What KubeOne version are you using?

Any of them.

Provide your KubeOneCluster manifest here (if applicable)

```yaml apiVersion: kubeone.k8c.io/v1beta2 kind: KubeOneCluster name: kubeone versions: kubernetes: 1.29.7 cloudProvider: none: {} controlPlane: hosts: - privateAddress: 10.xxx - privateAddress: 10.xxx - privateAddress: 10.xxx apiEndpoint: host: 10.xxx alternativeNames: - seed.xxx port: 6443 machineController: deploy: true operatingSystemManager: deploy: true ```
xmudrii commented 3 weeks ago

KubeOne should error out early, clearly indicating that such a config is not supported.

This config should be supported, but we shouldn't deploy any credentials.

kron4eg commented 3 weeks ago

KubeOne should error out early, clearly indicating that such a config is not supported.

This config should be supported, but we shouldn't deploy any credentials.

How so? What's the purpose of credential-less and cloud-less machine-controller and osm?

xmudrii commented 3 weeks ago

@kron4eg machine-controller has more providers than what we support in KubeOne. The most notable example is Kubevirt, I could create a KubeOne cluster, deploy machine-controller and OSM, deploy credentials, and then use the machine-controller to create Kubevirt-based nodes.

kron4eg commented 2 weeks ago

In that case we should start supporting kubevirt. But until we not, this is an invalid configuration from K1 PoV.