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_host_filesystem.yaml

21 lines
669 B
YAML
Raw Normal View History

2019-10-10 18:42:54 -07:00
apiVersion: "kyverno.io/v1alpha1"
kind: "ClusterPolicy"
metadata:
name: "deny-use-of-host-fs"
2019-10-11 18:57:16 -07:00
annotations:
policies.kyverno.io/category: Data Protection
2019-10-14 13:58:47 -07:00
policies.kyverno.io/description: |
The volume of type 'hostpath' binds pods to a specific host, and data persisted in the volume is dependent on the life of the node. In a shared cluster, it is recommeded that applications are independent of hosts.
2019-10-10 18:42:54 -07:00
spec:
rules:
- name: "deny-use-of-host-fs"
match:
resources:
kinds:
- "Pod"
validate:
message: "Host path is not allowed"
pattern:
spec:
volumes:
- X(hostPath): null