Changing kubelet configuration

Hi, is it possible to change kubelet configuration for specific workers after the initial deployment?
For example, I would like to add to kubelet args --node-label X and other --node-label Y.
If I will use juju config kubernetes-worker , it will change the configuration for the entire stack.

Are you sure you want to add kubelet args? You can label nodes without changing anything in kubelet and I would suggest you do it in kubectl. That’s what I do on my cluster.

kubectl label nodes <node-name> <label-key>=<label-value>

Now specifically for having different options on the workers when it is cluster-wide by default:
Your best option here is to actually deploy multiple applications of kubernetes-worker. One with each option set. It could turn into a real pain if you want lots of unique options, but if you only want a couple different options it isn’t bad. You could have a kubernetes-worker app and a gpu-workers app for example.

juju deploy cs:~containers/kubernetes-worker gpu-workers

You can even use constraints to force this to specific machines or use --to in order to add it to existing machines.

Hi, thanks for the lengthy response.
So, I’m scaling up the cluster using the add-unit command, I was thinking of using the second method of:
juju deploy cs:~containers/kubernetes-worker
But I do have some questions here:

  1. How do I make sure that new machines will use the same charm version?
  2. How do I keep the relationship between all components using the deploy command?

Thanks in advance

Good questions.

  1. This will depend on what charm version is current when you deploy unless you specify the version, so it could be different. I would personally look at juju status and then force the second deploy’s version to match the first with juju deploy cs:~containers/kubernetes-worker-144 or something. For upgrades, you can use juju update-charm --revision to force them to stay the same.
  2. You will need to relate them again with the new deploy. This is something the bundle does for you as it explicitly calls it out. You can check the bundle on juju charms. For now, you can do something like this:
juju relate kubernetes-master:kube-control new-kubernetes-worker:kube-control
juju relate kubernetes-worker:certificates easyrsa:client
juju relate kubernetes-worker:kube-api-endpoint kubeapi-load-balancer:website
juju relate flannel:cni kubernetes-worker:cni

Hopefully that gets you going.