siderolabs / omni-feedback

Omni feature requests, bug reports
https://www.siderolabs.com/platform/saas-for-kubernetes/
MIT License
2 stars 0 forks source link

[bug] Cannot create a cluster with no workers via the CLI. Works fine via the UI. #20

Closed gerhard closed 1 year ago

gerhard commented 1 year ago

Is there an existing issue for this?

Current Behavior

A cluster definition with no Worker machines fails to create via omnictl with the following error:

omnictl cluster template sync --file cluster.experimental.yaml
Error: 1 error occurred:
    * template should contain 1 workers, got 0

The same cluster can be created just fine via the UI.

Expected Behavior

I would expect to be able to create a cluster with 1 ControlPlane via the omnictl CLI. It is possible via the UI.

Steps To Reproduce

Given the following cluster template cluster.experimental.yaml:

kind: Cluster
name: experimental-2023-04-10
kubernetes:
  version: v1.26.2
talos:
  version: v1.3.6
---
kind: ControlPlane
machines:
  - 77902500-68a6-0706-0025-9077a6680e0f
---
kind: Machine
name: 77902500-68a6-0706-0025-9077a6680e0f
install:
  disk: /dev/sdb

Running omnictl cluster template sync --file cluster.experimental.yaml fails as described above.

What browsers are you seeing the problem on?

No response

Anything else?

No response

gerhard commented 1 year ago

Will defer creating more bug reports until the ones that I have opened today are addressed. Don't want to jam your backlog. By the way, I don't mind to have some of these closed if there is a workaround, or they are not important enough to fix. Hope this is helpful.

smira commented 1 year ago

The template requires you to create an (empty) Workers document.

https://omni.siderolabs.com/docs/reference/cluster-templates/

Each cluster template should have exactly one document of kind: Cluster, kind: ControlPlane, and kind: Workers.

gerhard commented 1 year ago

I can confirm that the following cluster.experimental.yaml worked as expected, even when there is a single ControlPlane in the cluster & no Workers:

kind: Cluster
name: experimental-2023-04-10
kubernetes:
  version: v1.26.4
talos:
  version: v1.3.7
patches:
  - name: kubelet-tls-bootstrap
    file: patches/kubelet-tls-bootstrap.yaml
  - name: allow-scheduling-on-controlplanes
    file: patches/allow-scheduling-on-controlplanes.yaml
---
kind: ControlPlane
machines:
  - 77902500-68a6-0706-0025-9077a6680e0f
---
kind: Workers
machines: []
---
kind: Machine
name: 77902500-68a6-0706-0025-9077a6680e0f
install:
  disk: /dev/sdb
image

Thanks @smira!