Skip to content

Commit 66a5e76

Browse files
committed
avoid idle runners after 30 minutes
1 parent 73f156d commit 66a5e76

2 files changed

Lines changed: 11 additions & 0 deletions

File tree

charts/gitea-org-runner/templates/scaledjob.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,12 @@ spec:
1818
jobTargetRef:
1919
backoffLimit: 0
2020
ttlSecondsAfterFinished: {{ $.Values.keda.ttlSecondsAfterFinished | default 300 }}
21+
# Cap on total Job runtime. Without this, a runner pod that registers
22+
# but never gets dispatched a workflow polls Gitea forever (act_runner
23+
# has no built-in idle timeout). Set generously enough that legitimate
24+
# long workflows can finish, but short enough that orphaned idle
25+
# runners get reaped.
26+
activeDeadlineSeconds: {{ $.Values.keda.activeDeadlineSeconds | default 1800 }}
2127
template:
2228
metadata:
2329
labels:

charts/gitea-org-runner/values.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,11 @@ keda:
8989
pollingInterval: 30
9090
# KEDA cleans up completed Jobs older than this many seconds.
9191
ttlSecondsAfterFinished: 300
92+
# Hard cap on total Job runtime. Pod is killed if it exceeds this even
93+
# while polling for work. Set to a value larger than the longest legitimate
94+
# workflow you expect. Default 1800 = 30 min; raise if workflows can run
95+
# longer, lower if you want orphaned idle runners reaped faster.
96+
activeDeadlineSeconds: 1800
9297
# K8s keeps the last N successful / failed Job records visible.
9398
successfulJobsHistoryLimit: 5
9499
failedJobsHistoryLimit: 5

0 commit comments

Comments
 (0)