mirror of
https://github.com/kyverno/kyverno.git
synced 2025-03-09 09:26:54 +00:00
36 lines
771 B
YAML
36 lines
771 B
YAML
|
apiVersion: kyverno.io/v1
|
||
|
kind: ClusterPolicy
|
||
|
metadata:
|
||
|
name: add-safe-to-evict
|
||
|
spec:
|
||
|
rules:
|
||
|
- name: annotate-empty-dir
|
||
|
match:
|
||
|
any:
|
||
|
- resources:
|
||
|
kinds:
|
||
|
- Pod
|
||
|
mutate:
|
||
|
patchStrategicMerge:
|
||
|
metadata:
|
||
|
annotations:
|
||
|
+(cluster-autoscaler.kubernetes.io/safe-to-evict): "true"
|
||
|
spec:
|
||
|
volumes:
|
||
|
- <(emptyDir): {}
|
||
|
- name: annotate-host-path
|
||
|
match:
|
||
|
any:
|
||
|
- resources:
|
||
|
kinds:
|
||
|
- Pod
|
||
|
mutate:
|
||
|
patchStrategicMerge:
|
||
|
metadata:
|
||
|
annotations:
|
||
|
+(cluster-autoscaler.kubernetes.io/safe-to-evict): "true"
|
||
|
spec:
|
||
|
volumes:
|
||
|
- hostPath:
|
||
|
<(path): "*"
|