2023-09-17 22:24:26 +00:00
|
|
|
---
|
2020-11-16 21:39:59 +00:00
|
|
|
apiVersion: kyverno.io/v1
|
|
|
|
kind: ClusterPolicy
|
|
|
|
metadata:
|
|
|
|
name: no-loadbalancers
|
|
|
|
spec:
|
2023-09-17 22:24:26 +00:00
|
|
|
admission: true
|
|
|
|
background: true
|
2020-11-16 21:39:59 +00:00
|
|
|
rules:
|
2023-09-17 22:24:26 +00:00
|
|
|
- match:
|
|
|
|
any:
|
|
|
|
- resources:
|
|
|
|
kinds:
|
|
|
|
- Service
|
|
|
|
name: no-LoadBalancer
|
2020-11-16 21:39:59 +00:00
|
|
|
validate:
|
2023-09-17 22:24:26 +00:00
|
|
|
message: Service of type LoadBalancer is not allowed.
|
2020-11-16 21:39:59 +00:00
|
|
|
pattern:
|
|
|
|
spec:
|
2023-09-17 22:24:26 +00:00
|
|
|
type: '!LoadBalancer'
|
|
|
|
validationFailureAction: Audit
|