1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2025-03-09 17:37:12 +00:00
kyverno/samples/best_practices/disallow_node_port.yaml

21 lines
479 B
YAML
Raw Normal View History

2019-10-08 22:13:34 -07:00
apiVersion: kyverno.io/v1alpha1
kind: ClusterPolicy
metadata:
name: disallow-node-port
2019-10-11 18:57:16 -07:00
annotations:
policies.kyverno.io/category: Security
policies.kyverno.io/description: Disable exposing the Service on each Nodes IP at a static port
2019-10-08 22:13:34 -07:00
spec:
rules:
- name: disallow-node-port
match:
resources:
kinds:
- Service
validate:
message: "Disallow service of type NodePort"
pattern:
spec:
type: "!NodePort"