hetzner-k3s icon indicating copy to clipboard operation
hetzner-k3s copied to clipboard

Support node labels

Open sananguliyev opened this issue 1 year ago • 10 comments

Firstly, thanks a lot for the nice project! Is there any plan to support custom label or annotations for servers, since it's very useful for separating the deployments between nodes. There are a bunch of default labels like instance type, location, hostname but sometime devs need to have some custom labels, too.

sananguliyev avatar Aug 30 '22 07:08 sananguliyev

Does this need to happen during deployment? I add additional labels and taints aftrewards.

Privatecoder avatar Aug 30 '22 07:08 Privatecoder

Hi @sananguliyev, the tool doesn't add any labels to the nodes. What kind of labels where you thinking?

vitobotta avatar Aug 30 '22 07:08 vitobotta

Thanks for your answer. Let's assume that I am using the same type of servers for 2 different purposes.

  1. API gateway
  2. SQL Engine

It's very useful to add labels to nodes so when I deploy my gateway I can specify in my k8s deployment that run this app only on the nodes which has labelled api-gateway.

Edit: I am talking about nodeAffinity

sananguliyev avatar Aug 30 '22 07:08 sananguliyev

I understand. However I think this goes beyond the scope of the tool which is creating clusters with a common configuration. What you are asking is for specific use cases. Would you want to add the same labels on all the nodes in a pool or how?

vitobotta avatar Aug 30 '22 08:08 vitobotta

Yes, exactly. I would like to have those labels on all nodes in the pool, otherwise it would be too specific.

Desired configuration:

worker_node_pools:
- name: sql-engine-small
  instance_type: cpx21
  instance_count: 3
  labels: 
    purpose: sql-engine
    size: small

sananguliyev avatar Aug 30 '22 08:08 sananguliyev

Ok, I'll see what I can do.

vitobotta avatar Aug 30 '22 08:08 vitobotta

Perfect. Thanks in advance.

sananguliyev avatar Aug 30 '22 08:08 sananguliyev

@vitobotta if you add this you can also go ahead and add the same for taints, i.e.

worker_node_pools:
- name: sql-engine-small
  instance_type: cpx21
  instance_count: 3
  labels: 
    purpose: sql-engine
    size: small
  taints: 
    key: value

Would be more consistent ;)

Privatecoder avatar Aug 30 '22 08:08 Privatecoder

Ok

vitobotta avatar Aug 30 '22 08:08 vitobotta

Implemented in v0.6.2. Please give it a try and let me know how it goes.

vitobotta avatar Aug 30 '22 15:08 vitobotta