This commit is contained in:
2026-04-08 20:22:14 +07:00
commit 34fbdd1412
96 changed files with 5321 additions and 0 deletions

View File

@@ -0,0 +1,29 @@
apiVersion: kyverno.io/v2alpha1
kind: ClusterCleanupPolicy
metadata:
name: cleanup-debug-pods
annotations:
policies.kyverno.io/title: "Автоудаление debug подов"
policies.kyverno.io/category: Governance
policies.kyverno.io/severity: low
policies.kyverno.io/description: >-
Удаляет поды с лейблом purpose=debug старше 4 часов.
Запускается каждый час по расписанию.
Предотвращает накопление забытых отладочных подов в кластере.
spec:
schedule: "0 * * * *" # каждый час в :00
match:
resources:
kinds:
- Pod
namespaces:
- default
- staging
selector:
matchLabels:
purpose: debug
conditions:
any:
- key: "{{ time_since('', request.object.metadata.creationTimestamp, '') }}"
operator: GreaterThan
value: "4h"