mirror of
https://github.com/kyverno/kyverno.git
synced 2025-03-09 01:16:55 +00:00
22 lines
No EOL
675 B
YAML
22 lines
No EOL
675 B
YAML
apiVersion: "kyverno.io/v1alpha1"
|
|
kind: "ClusterPolicy"
|
|
metadata:
|
|
name: "deny-use-of-host-fs"
|
|
annotations:
|
|
policies.kyverno.io/category: Data Protection
|
|
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.
|
|
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 |