mirror of
https://github.com/kyverno/kyverno.git
synced 2024-12-14 11:57:48 +00:00
add disallow_node_port.yaml
This commit is contained in:
parent
18c190447f
commit
381210e977
3 changed files with 19 additions and 2 deletions
17
samples/best_practices/disallow_node_port.yaml
Normal file
17
samples/best_practices/disallow_node_port.yaml
Normal file
|
@ -0,0 +1,17 @@
|
|||
apiVersion: kyverno.io/v1alpha1
|
||||
kind: ClusterPolicy
|
||||
metadata:
|
||||
name: disallow-node-port
|
||||
spec:
|
||||
rules:
|
||||
- name: disallow-node-port
|
||||
match:
|
||||
resources:
|
||||
kinds:
|
||||
- Service
|
||||
validate:
|
||||
message: "Disallow service of type NodePort"
|
||||
pattern:
|
||||
spec:
|
||||
type: "!NodePort"
|
||||
|
|
@ -1,8 +1,8 @@
|
|||
|
||||
# file path relative to project root
|
||||
input:
|
||||
policy: examples/best_practices/policy_validate_disallow_node_port.yaml
|
||||
resource: examples/best_practices/resources/resource_validate_disallow_node_port.yaml
|
||||
policy: samples/best_practices/disallow_node_port.yaml
|
||||
resource: test/manifest/disallow_node_port.yaml
|
||||
expected:
|
||||
validation:
|
||||
policyresponse:
|
||||
|
|
Loading…
Reference in a new issue