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