homelab-gitops/platform/kyverno/policies/50-cleanup/cleanup-evicted-pods.yaml
gwg313 baa0216960
add kyverno policies
Signed-off-by: gwg313 <gwg313@pm.me>
2026-05-28 20:09:06 -04:00

22 lines
460 B
YAML

apiVersion: kyverno.io/v2beta1
kind: ClusterCleanupPolicy
metadata:
name: cleanup-evicted-pods
spec:
match:
any:
- resources:
kinds:
- Pod
conditions:
all:
- key: "{{ target.status.reason }}"
operator: Equals
value: Evicted
- key: "{{ time_diff('{{ target.metadata.creationTimestamp }}','{{ time_now_utc() }}') }}"
operator: GreaterThan
value: 1h
schedule: "0 * * * *"