0
点赞
收藏
分享

微信扫一扫

k8s deployment pod 尽量分散在不同的node上

醉东枫 2022-03-12 阅读 50
kind: Deployment
apiVersion: apps/v1
metadata:
  name: springboot-web-app1
  labels:
    k8s-app: springboot-web-app1
spec:
  replicas: 5  
  template:    
    spec:      
      affinity:
        podAntiAffinity:
          requiredDuringSchedulingIgnoredDuringExecution:
            - labelSelector:
                matchExpressions:
                  - key: k8s-app
                    operator: In
                    values:
                      - springboot-web-app1
              topologyKey: kubernetes.io/hostname
举报

相关推荐

0 条评论