Where does node role "worker" get set? #792
-
I've noticed in your README that your worker nodes get a role of "worker" applied For example:
However my worker nodes all have my hosts.yaml
my node roles:
Where is this meant to be set? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
I've converted this into a discussion... This is to be set manually after the cluster is deployed. I've tried many times to have k3s set this label during bootstrap using the Ansible k3s role however there's some weird bug that prevents the k3s service from starting if that config is set. It's been about a year since I last tried so feel free to try this again and open a PR if you discover it works. Edit: ---
# https://rancher.com/docs/k3s/latest/en/installation/install-options/agent-config/
# https://github.com/PyratLabs/ansible-role-k3s
k3s_control_node: false
k3s_agent:
node-ip: "{{ ansible_host }}"
node-label:
- "node-role.kubernetes.io/worker=worker" # Will not work, see below This won't work, read here: k3s-io/k3s#1289 Looks like this is the reason you cannot do it the above way... |
Beta Was this translation helpful? Give feedback.
I've converted this into a discussion...
This is to be set manually after the cluster is deployed. I've tried many times to have k3s set this label during bootstrap using the Ansible k3s role however there's some weird bug that prevents the k3s service from starting if that config is set.
It's been about a year since I last tried so feel free to try this again and open a PR if you discover it works.
Edit:
https://github.com/onedr0p/flux-cluster-template/blob/main/ansible/inventory/group_vars/worker/k3s.yml