0

波纹管工作正常,k8s 每个节点运行一个 pod,但是当其中一个节点发生故障时,k8s 在一个节点中创建 2 个 pod。一个节点中是否可能只有一个 pod?

apiVersion: apps/v1
kind: StatefulSet
metadata:
  name: testpod
spec:
  replicas: 3
  selector:
    matchLabels:
      app: testpod
  serviceName: "srv"
  template:
    metadata:
      labels:
        app: testpod
    spec:
      affinity:
        podAntiAffinity:
          requiredDuringSchedulingIgnoredDuringExecution:
            - labelSelector:
                matchExpressions:
                  - key: "app"
                    operator: In
                    values:
                    - testpod
              topologyKey: "kubernetes.io/hostname"
      containers:
4

0 回答 0