This message was deleted.
# general
a
This message was deleted.
l
Does the
-e CATTLE_HOST_LABELS='my/label=setting'
still work with Rancher 2.x? I see it mentioned in the Rancher 1.x docs
t
In RKE you would update the cluster.yml file and run
rke up
. In the cluster.yml you can add an arbitrary map of labels for each node.
l
What about from a cluster registration command?
Copy code
sudo docker run -d --privileged --restart=unless-stopped --net=host -v /etc/kubernetes:/etc/kubernetes -v /var/run:/var/run  rancher/rancher-agent:v2.6.2 --server <https://my.rancher.domain> -e CATTLE_HOST_LABELS='my/label=setting' --token nope --worker
I haven’t tried it yet, just curious
t
I've never seen a registration command for RKE1. Is this for RKE1 or RKE2?
l
2
t
yes, it looks like you should be able to pass a
--node-label
option https://docs.rke2.io/install/install_options/linux_agent_config/
l
oh
shoot
my bad It’s RKE1
I totally forgot about the Rancher vs RKE distinction >_<
t
Ah, I see. So what we are really looking for is an option for the rancher agent.
In that case, yes - you can use
CATTLE_NODE_LABEL
or
--label
and for multiple labels pass the option more than once. other options are here https://rancher.com/docs/rancher/v2.6/en/cluster-provisioning/rke-clusters/custom-nodes/agent-options/
l
Well there it is right in the documentation 🤦
TY much!!
t
you're welcome!