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>
29 lines
622 B
YAML
29 lines
622 B
YAML
---
|
|
apiVersion: kyverno.io/v1
|
|
kind: ClusterPolicy
|
|
metadata:
|
|
name: deployment-has-multiple-replicas
|
|
spec:
|
|
admission: true
|
|
background: true
|
|
rules:
|
|
- exclude:
|
|
any:
|
|
- resources:
|
|
namespaces:
|
|
- kyverno
|
|
- kube-system
|
|
- kube-node-lease
|
|
- kube-public
|
|
match:
|
|
any:
|
|
- resources:
|
|
kinds:
|
|
- Deployment
|
|
name: deployment-has-multiple-replicas
|
|
validate:
|
|
message: Deployments must have more than one replica to ensure availability.
|
|
pattern:
|
|
spec:
|
|
replicas: '>1'
|
|
validationFailureAction: Audit
|