小编Raj*_*esh的帖子

Kubernetes nodeaffinity 和 podAntiaffinity 无法根据需要部署 pod

我正在尝试为 mongodb 试验 2 节点集群(一旦稳定后将进行扩展)。这是使用 EKS。这 2 个节点在两个不同的 aws 区域中运行。描述符如下:

apiVersion: apps/v1beta1
kind: StatefulSet
metadata:
  name: mongod
  labels:
    name: mongo-repl
spec:
  serviceName: mongodb-service
  replicas: 2
  selector:
    matchLabels:
      app: mongod
      role: mongo
      environment: test
  template:
    metadata:
      labels:
        app: mongod
        role: mongo
        environment: test
    spec:
      terminationGracePeriodSeconds: 15
      affinity:
        nodeAffinity:
          requiredDuringSchedulingIgnoredDuringExecution:
            nodeSelectorTerms:
            - matchExpressions:
              - key: failure-domain.beta.kubernetes.io/zone
                operator: In
                values:
                - ap-south-1a
                - ap-south-1b
        podAntiAffinity:
          requiredDuringSchedulingIgnoredDuringExecution:
          - labelSelector:
              matchExpressions:
              - key: app
                operator: In
                values:
                - mongod
              - key: role
                operator: In
                values: …
Run Code Online (Sandbox Code Playgroud)

kubernetes amazon-eks

6
推荐指数
1
解决办法
1万
查看次数

标签 统计

amazon-eks ×1

kubernetes ×1