Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/kubernetes/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Kubernetes仅按特定标签在节点上运行特定部署_Kubernetes_Kubernetes Deployment - Fatal编程技术网

Kubernetes仅按特定标签在节点上运行特定部署

Kubernetes仅按特定标签在节点上运行特定部署,kubernetes,kubernetes-deployment,Kubernetes,Kubernetes Deployment,使用Kubernetes,我有一组高cpu的节点,并且我正在为给定的部署使用关联策略来专门针对这些高cpu节点: # deployment.yaml spec: affinity: nodeAffinity: requiredDuringSchedulingIgnoredDuringExecution: nodeSelectorTerms: - matchExpressions: - key: high-cpu-node

使用Kubernetes,我有一组高cpu的节点,并且我正在为给定的部署使用关联策略来专门针对这些高cpu节点:

# deployment.yaml
spec:
  affinity:
    nodeAffinity:
      requiredDuringSchedulingIgnoredDuringExecution:
        nodeSelectorTerms:
        - matchExpressions:
          - key: high-cpu-node
            operator: In
            values:
            - "true"


这是可行的,但是它不会阻止所有其他部署在这些高cpu节点上调度POD。如何指定这些高cpu节点只运行
高cpu节点=true
的POD?是否可以在不修改所有其他部署配置的情况下执行此操作(我有几十个部署)?

要获得此行为,您应该污染节点并在部署上使用容差:

但是,不幸的是,您必须修改部署。仅仅通过标签是不可能做到这一点的