mirror of
https://github.com/kyverno/kyverno.git
synced 2024-12-14 11:57:48 +00:00
7562bea6db
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
31 lines
711 B
YAML
31 lines
711 B
YAML
---
|
|
apiVersion: kyverno.io/v1
|
|
kind: ClusterPolicy
|
|
metadata:
|
|
name: spread-pods
|
|
spec:
|
|
admission: true
|
|
background: true
|
|
rules:
|
|
- match:
|
|
any:
|
|
- resources:
|
|
kinds:
|
|
- Deployment
|
|
selector:
|
|
matchLabels:
|
|
distributed: required
|
|
mutate:
|
|
patchStrategicMerge:
|
|
spec:
|
|
template:
|
|
spec:
|
|
+(topologySpreadConstraints):
|
|
- labelSelector:
|
|
matchLabels:
|
|
distributed: required
|
|
maxSkew: 1
|
|
topologyKey: zone
|
|
whenUnsatisfiable: DoNotSchedule
|
|
name: spread-pods-across-nodes
|
|
validationFailureAction: Audit
|