<p>I am trying to install RabbitMQ operator from this <a href="https://www.rabbitmq.com/kubernetes/operator/install-operator.html" rel="nofollow noreferrer">link</a> on K8S cluster</p>
<p>I created the following setup on our environment</p>
<p>Example</p>
<pre><code>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
</code></pre>
<p>When I execute <code>kubectl apply -f https://github.com/rabbitmq/cluster-operator/releases/latest/download/cluster-operator.yml</code> by default it tries to install <code>RabbitMQ on Windows Node</code></p>
<p>As the RabbitMQ Operator YAML file is too big I am not sure where and all nodeSelector should be changed</p>
<p>However, I want to install <code>RabbitMQ on Linux node</code> and I don't know how to change / set the default node for Kubernetes</p>
<p><strong>EDIT</strong></p>
<pre><code>[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    &lt;none&gt;                 83d   v1.21.0   192.168.1.3    &lt;none&gt;        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    &lt;none&gt;        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    &lt;none&gt;                 8d    v1.21.1   192.168.1.4    &lt;none&gt;        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
</code></pre>

Sathish Kumar
<p>You can use the multiple options for same, You can use the Node selector, <a href="https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#affinity-and-anti-affinity" rel="nofollow noreferrer">Node affinity</a> &amp; taint-toleration.</p>
<p>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.</p>
<p><a href="https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#affinity-and-anti-affinity" rel="nofollow noreferrer">https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#affinity-and-anti-affinity</a></p>
<pre><code>apiVersion: v1
kind: Pod
metadata:
  name: with-node-affinity
spec:
  affinity:
    nodeAffinity:
      requiredDuringSchedulingIgnoredDuringExecution:
        nodeSelectorTerms:
        - matchExpressions:
          - key: kubernetes.io/e2e-az-name
            operator: In
            values:
            - e2e-az1
            - e2e-az2
      preferredDuringSchedulingIgnoredDuringExecution:
      - weight: 1
        preference:
          matchExpressions:
          - key: another-node-label-key
            operator: In
            values:
            - another-node-label-value
  containers:
  - name: with-node-affinity
    image: k8s.gcr.io/pause:2.0
</code></pre>
<p>for rabbitMQ it could be something like</p>
<pre><code>apiVersion: apps/v1beta1
kind: StatefulSet
metadata:
  name: rabbitmq
spec:
  replicas: 1
  serviceName: rabbitmq
  selector:
    matchLabels:
      app: rabbitmq
  template:
    metadata:
      labels:
        app: rabbitmq
    spec:
      affinity:
nodeAffinity:
  requiredDuringSchedulingIgnoredDuringExecution:
    nodeSelectorTerms:
    - matchExpressions:
      - key: kubernetes.io/os
        operator: In
        values:
        - linux
        - ubuntu
      containers:
      - name: rabbitmq
        image: rabbitmq:3-management
        env:
        - name: &quot;RABBITMQ_ERLANG_COOKIE&quot;
          value: &quot;dsfsadfsfsd+0t36lQ=&quot;
        volumeMounts:
        - mountPath: /var/lib/rabbitmq
          name: rabbitmq-data
      volumes:
        - name: rabbitmq-data
          hostPath:
            path: /data/rabbitmq
            type: DirectoryOrCreate
</code></pre>
<p>Taint &amp; toleration example : <a href="https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/" rel="nofollow noreferrer">https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/</a></p>
