Skip to content
This repository has been archived by the owner on Aug 21, 2024. It is now read-only.

Commit

Permalink
Changes to set default TTL of 1 day for k8s job (#10370)
Browse files Browse the repository at this point in the history
  • Loading branch information
hanzlamateen authored Jun 13, 2024
1 parent 09d60ae commit 7879546
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/server-core/src/k8s-job-helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@ export async function getJobBody(
app: Application,
command: string[],
name: string,
labels: { [key: string]: string }
labels: { [key: string]: string },
ttlSecondsAfterFinished = 86400 // This value is 1 day
): Promise<k8s.V1Job> {
const apiPods = await getPodsData(
`app.kubernetes.io/instance=${config.server.releaseName},app.kubernetes.io/component=api`,
Expand All @@ -96,6 +97,7 @@ export async function getJobBody(
labels
},
spec: {
ttlSecondsAfterFinished,
template: {
metadata: {
labels
Expand Down

0 comments on commit 7879546

Please sign in to comment.