跨可用区均衡
跨可用区均衡
spec:
topologySpreadConstraints:
- maxSkew: 1
topologyKey: topology.kubernetes.io/zone
whenUnsatisfiable: DoNotSchedule
minDomains: 2
labelSelector:
matchLabels:
app: web字段
| 字段 | 作用 |
|---|---|
| maxSkew | 各域副本数允许的偏差上限 |
| whenUnsatisfiable | DoNotSchedule(硬)/ ScheduleAnyway(软) |
| minDomains | 参与均衡的域数量下限(可省) |