homelab-gitops/platform/kyverno/policies/purge-terminal-pods.yaml
gwg313 8d74a625bc
update
Signed-off-by: gwg313 <gwg313@pm.me>
2026-05-17 14:29:03 -04:00

21 lines
473 B
YAML

apiVersion: kyverno.io/v2beta1
kind: ClusterCleanupPolicy
metadata:
name: purge-terminal-pods
spec:
match:
any:
- resources:
kinds:
- Pod
schedule: "*/15 * * * *"
conditions:
all:
- key: "{{ request.object.status.phase }}"
operator: AnyIn
value:
- Succeeded
- Failed
- key: "{{ request.object.metadata.creationTimestamp }}"
operator: DurationGreaterThan
value: 30m