Question

Automate adding custom kubernetes node labels to new worker nodes

Posted July 12, 2019 1.1k views
DigitalOcean

I would like to customise my kubernetes cluster worker nodes, so that when I add new nodes (via the UI or via the API) they come up with custom node labels. (i.e. the labels that you add for example with “kubectl label node nodenamehere foo=bar”

As a stretch goal of this question, is it possible to customise the image that my kubernetes worker nodes use too? i.e. what if I wanted to add some custom software or configuration settings on my worker nodes? Right now all I see is the option to increase workers in my worker pools and everything below that is hidden. (I’ve had a look through the docs but didn’t see anything that looked like it would help me here).

Thanks!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

×
1 answer

Hi there!

Sorry for the delayed respponse on this. It is currently not possible to add custom node labels that persist reboot. You would need to use the default nodepool labels applied to nodes.

We do have a public feature request that you can track for this: https://github.com/digitalocean/DOKS/issues/3

Regards,

John Kwiatkoski
Senior Developer Support Engineer

  • Hi John,

    Good to see the feature request in though. I think this is an important ability to have. I use nodeSelector labels on some pods, so if DO rolls my workers for patching them my pods won’t start.

    Thanks!

Submit an Answer