k0sctl icon indicating copy to clipboard operation
k0sctl copied to clipboard

Where do I specify node labels?

Open IngwiePhoenix opened this issue 3 months ago • 3 comments

Hello!

I have a list of very different nodes - basically, an assortment of random SBCs that I want to give node labels as a selection target for workloads. For example, some of them may need the label cpu_perf=high for high-core count CPUs or generally higher spec chips, whilst others may need cpu_perf=low for the opposite.

How would I specify those using k0sctl?

Thank you and kind regards, Ingwie

IngwiePhoenix avatar Sep 27 '25 04:09 IngwiePhoenix

There's this old issue https://github.com/k0sproject/k0sctl/issues/175 about adding labeling support.

Until that, maybe you could use after-hooks to run k0s kubectl .....

kke avatar Sep 29 '25 11:09 kke

Huh, surprised this long-standing ticket has never seen an implementation o.o

Guess using the hooks is my best bet. Thanks for the pointer!

IngwiePhoenix avatar Sep 29 '25 13:09 IngwiePhoenix

k0s itself has this option:

--labels mapStringString      Node labels, list of key=value pairs

So you should be able to set this via k0sctl installFlags, something like:

  - role: worker
    installFlags:
    - --labels=foo=bar
    ssh:
      address: 10.0.0.2

jnummelin avatar Nov 19 '25 13:11 jnummelin