apiVersion: apps/v1
kind: Deployment
metadata:
name: sakura521yz-002
namespace: default
spec:
replicas: 2
selector:
matchLabels:
app: sakura521yz-002
template:
metadata:
labels:
app: sakura521yz-002
spec:
containers:
- name: sakura521yz-002-c1
image: nginx
imagePullPolicy: IfNotPresent
restartPolicy: Always
dnsPolicy: ClusterFirst
imagePullSecrets:
- name: default-secret
affinity:
podAntiAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchExpressions:
- key: app
operator: In
values:
- sakura521yz-002
topologyKey: kubernetes.io/hostname
schedulerName: default-scheduler
deployment拥有2个在节点级别反亲和的pod
未经允许不得转载:陈桂林博客 » deployment拥有2个在节点级别反亲和的pod