我创建了一个 Azure AKS 群集,该群集具有一个 Linux 节点和一个 Windows 节点。现在,当我设置 RabbitMQ 时,它长时间显示“容器创建”。 如果我删除 Windows 节点,RabitMQ 配置就会成功。
我想知道如何正确设置节点选择器。
nodeSelector:
beta.kubernetes.io/os: linux
kubernetes.io/os: linux
worker: rabbitmq
最佳答案
要在 Linux 节点上部署应用程序,您可以通过指定 "beta.kubernetes.io/os": linux
作为 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
关于azure - 如何在 Azure AKS 混合群集上为 RabbitMQ 指定节点选择器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65490248/