I am trying to install RabbitMQ operator from this link on K8S cluster
I created the following setup on our environment
Example
K8S Control Plane (Cent OS) - 192.168.1.2
Worker Node - 1 (Cent OS) - 192.168.1.3
Worker Node - 2 (WindowS) - 192.168.1.4
When I execute kubectl apply -f https://github.com/rabbitmq/cluster-operator/releases/latest/download/cluster-operator.yml
by default it tries to install RabbitMQ on Windows Node
As the RabbitMQ Operator YAML file is too big I am not sure where and all nodeSelector should be changed
However, I want to install RabbitMQ on Linux node
and I don’t know how to change / set the default node for Kubernetes
EDIT
[root@re-ctrl1 ~]# kubectl get nodes -o wide --show-labels
NAME STATUS ROLES AGE VERSION INTERNAL-IP EXTERNAL-IP OS-IMAGE KERNEL-VERSION CONTAINER-RUNTIME LABELS
re-devcentos Ready <none> 83d v1.21.0 192.168.1.3 <none> CentOS Linux 7 (Core) 3.10.0-862.el7.x86_64 docker://1.13.1 beta.kubernetes.io/arch=amd64,beta.kubernetes.io/os=linux,kubernetes.io/arch=amd64,kubernetes.io/hostname=re-devcentos,kubernetes.io/os=linux
re-ctrl1 Ready control-plane,master 91d v1.21.0 192.168.1.2 <none> CentOS Linux 7 (Core) 3.10.0-862.el7.x86_64 docker://20.10.6 beta.kubernetes.io/arch=amd64,beta.kubernetes.io/os=linux,kubernetes.io/arch=amd64,kubernetes.io/hostname=re-ctrl1,kubernetes.io/os=linux,node-role.kubernetes.io/control-plane=,node-role.kubernetes.io/master=,node.kubernetes.io/exclude-from-external-load-balancers=
win-lj7gtbktpgg Ready <none> 8d v1.21.1 192.168.1.4 <none> Windows Server 2019 Standard 10.0.17763.2061 docker://20.10.7 beta.kubernetes.io/arch=amd64,beta.kubernetes.io/os=windows,kubernetes.io/arch=amd64,kubernetes.io/hostname=win-lj7gtbktpgg,kubernetes.io/os=windows,node.kubernetes.io/windows-build=10.0.17763
2
Answers
In your
node
labels, there is an useful label calledkubernetes.io/os=linux
,you should use this label to schedule pod on the node with this label.Eg: (partial file)….
You can use the multiple options for same, You can use the Node selector, Node affinity & taint-toleration.
Node affinity is a property of Pods that attracts them to a set of nodes (either as a preference or a hard requirement). Taints are the opposite — they allow a node to repel a set of pods.
https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#affinity-and-anti-affinity
for rabbitMQ it could be something like
Taint & toleration example : https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/