How to specify nodeSelector for RabbitMQ on Azure AKS Hybrid cluster

12/29/2020

I have created a Azure AKS cluster which is having one Linux node and one Windows Node. Now when I am setting up RabbitMQ, it is saying "Container Creating" for long time. If I am removing Windows node, the RabitMQ configuration is getting success.

I want to know how can I properly set node selector.

nodeSelector:
  beta.kubernetes.io/os: linux
  kubernetes.io/os: linux
  worker: rabbitmq
-- Roushan
azure
kubernetes

1 Answer

12/29/2020

To deploy an application on linux nodes you can do as below by specifying "beta.kubernetes.io/os": linux as nodeSelector

apiVersion: apps/v1
kind: Deployment
metadata:
  name: sample
  labels:
    app: sample
spec:
  replicas: 1
  template:
    metadata:
      name: sample
      labels:
        app: sample
    spec:
      nodeSelector:
        "beta.kubernetes.io/os": linux
      containers:
      - name: rabbitmq
        image: rabbitmq
        resources:
          limits:
            cpu: 1
            memory: 800M
          requests:
            cpu: .1
            memory: 300M
        ports:
          - containerPort: 80
  selector:
    matchLabels:
      app: sample
-- Arghya Sadhu
Source: StackOverflow