mirror of
https://gitlab.kube.huskypup.net/Scooby/Homelabv4.git
synced 2026-08-20 23:16:49 +00:00
Initial commit
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
apiVersion: kyverno.io/v1
|
||||
kind: ClusterPolicy
|
||||
metadata:
|
||||
name: disallow-nodeport-services
|
||||
annotations:
|
||||
policies.kyverno.io/title: Disallow NodePort Services
|
||||
policies.kyverno.io/category: Zero Trust
|
||||
policies.kyverno.io/severity: medium
|
||||
spec:
|
||||
validationFailureAction: Enforce
|
||||
background: true
|
||||
rules:
|
||||
- name: disallow-nodeport
|
||||
match:
|
||||
any:
|
||||
- resources:
|
||||
kinds:
|
||||
- Service
|
||||
exclude:
|
||||
any:
|
||||
- resources:
|
||||
namespaces:
|
||||
- kube-system
|
||||
- istio-system
|
||||
validate:
|
||||
message: "NodePort services are not allowed. Use ClusterIP or LoadBalancer."
|
||||
pattern:
|
||||
spec:
|
||||
type: "!NodePort"
|
||||
Reference in New Issue
Block a user