[kubernetes]9-3 Scheduler --- 玩转pod调度(下)
9-3 Scheduler --- 玩转pod调度(下) 创建web-dev-pod.yaml 验证pod的亲和性 apiVersion: apps/v1 kind: Deployment metadata: name: web-demo-pod namespace: dev spec: selector: matchLabels: app: web-demo-pod replicas: 1 template: metadata: labels: app: web-demo-pod spec: containers: - name: web-demo-pod image: harbor.pdabc.com/kubernetes/web:v3 ports: - containerPort: 8080 affinity: podAffinity: requiredDuringSchedulingIgnoredDuringExecution: - labelSelector: # 和app 名为web-demo的pod 运行在一起 matchExpressions: - key: app operator: In values: - web-demo # 运行的条件 会运行在同一个节点 topologyKey: kubernetes.io/hostname # 倾向于和名为web