PageSourceSearch

https://volcano.sh/assets/js/79cc3a83.3c8d8e89.js

js volcano.sh collected 2026-10-02 06:15:08 UTC 5,287 bytes, 1 lines download raw bytes

1"use strict";(globalThis.webpackChunkdocs_site=globalThis.webpackChunkdocs_site||[]).push([[16522],{19853(e,n,t){t.r(n),t.d(n,{assets:()=>c,contentTitle:()=>l,default:()=>u,frontMatter:()=>r,metadata:()=>o,toc:()=>a});const o=JSON.parse('{"id":"UserGuide/user_guide_how_to_use_job_ttl","title":"Volcano Job Time to Live User Guide","description":"Background","source":"@site/versioned_docs/version-v1.15.0/UserGuide/user_guide_how_to_use_job_ttl.md","sourceDirName":"UserGuide","slug":"/UserGuide/user_guide_how_to_use_job_ttl","permalink":"/docs/v1.15.0/UserGuide/user_guide_how_to_use_job_ttl","draft":false,"unlisted":false,"editUrl":"https://github.com/volcano-sh/website/tree/master/versioned_docs/version-v1.15.0/UserGuide/user_guide_how_to_use_job_ttl.md","tags":[],"version":"v1.15.0","lastUpdatedAt":1781163901000,"frontMatter":{"title":"Volcano Job Time to Live User Guide"},"sidebar":"docsSidebar","previous":{"title":"Volcano Job Policy User Guide","permalink":"/docs/v1.15.0/UserGuide/user_guide_how_to_use_job_policy"},"next":{"title":"MPI Plugin User Guide","permalink":"/docs/v1.15.0/UserGuide/user_guide_how_to_use_mpi_plugin"}}');var i=t(74848),s=t(28453);const r={title:"Volcano Job Time to Live User Guide"},l=void 0,c={},a=[{value:"Background",id:"background",level:2},{value:"Key Points",id:"key-points",level:2},{value:"Other Reading",id:"other-reading",level:2},{value:"Example",id:"example",level:2}];function d(e){const n={a:"a",code:"code",h2:"h2",p:"p",pre:"pre",...(0,s.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(n.h2,{id:"background",children:"Backgroun
1d"}),"\n",(0,i.jsxs)(n.p,{children:["Similar to a standard ",(0,i.jsx)(n.code,{children:"Job"})," resource, VolcanoJobs can be configured to be automatically garbage\ncollected after they finish execution (either Complete or Failed). This is configured by setting\n",(0,i.jsx)(n.code,{children:"spec.ttlSecondsAfterFinished"})," which limits the lifetime of a Job."]}),"\n",(0,i.jsx)(n.h2,{id:"key-points",children:"Key Points"}),"\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.code,{children:"ttlSecondsAfterFinished"})," is an optional parameter that can be configured on VolcanoJobs which\ndefaults to ",(0,i.jsx)(n.code,{children:"nil"}),". The value of ",(0,i.jsx)(n.code,{children:"ttlSecondsAfterFinished"})," must be a positive integer and indicates\nthe number of seconds after a job finishes executing (either Complete or Failed) before it becomes\neligible for garbage collection."]}),"\n",(0,i.jsxs)(n.p,{children:["If ",(0,i.jsx)(n.code,{children:"ttlSecondsAfterFinished"})," is unset or set to ",(0,i.jsx)(n.code,{children:"nil"}),", the job will remain indefinitely. If set to\nzero (",(0,i.jsx)(n.code,{children:"0"}),"), the job will become eligible for garbage collection immediately upon completion. If set\nto a positive integer, ",(0,i.jsx)(n.code,{children:"N"}),", the job will become eligible for garbage collection ",(0,i.jsx)(n.code,{children:"N"})," seconds after\nthe job has completed."]}),"\n",(0,i.jsx)(n.h2,{id:"other-reading",children:"Other Reading"}),"\n",(0,i.jsxs)(n.p,{children:["While this uses a custom garbage collector, this operates nearly identically to\n",(0,i.jsx)(n.code,{children:"ttlSecondsAfterFinished"})," from a standard ",(0,i.jsx)(n.code,{children:"batch.v1.job"})," resource. The ",(0,i.jsx)(n.a,{href:"https://kubernetes.io/docs/concepts/workloads/controllers/ttlafterfinished/",children:"official Kubernetes\ndocumentation"})," has some\nuseful tips describing how mutating webhooks can be used to take greater advantage of\n",(0,i.jsx)(n.code,{children:"ttlSecondsAfterFinished"}),"."]}),"\n",(0,i.jsx)(n.h2,{id:"example",children:"Example"}),"\n",(0,i.jsx)(n.p,{children:"The manifest below creates a job that will be eligible for garbage collection 10 minutes after it\neither completes or fails."}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-yaml",children:'apiVersion: batch.volcano.sh/v1alpha1\nkind: Job\nmetadata:\n  generateName: test-job-\nspec:\n  minAvailable: 1\n  schedulerName: volcano\n  queue: testing\n  ttlSecondsAfterFinished: 600\n  policies:\n    - event: PodEvicted\n      action: RestartJob\n  tasks:\n    - replicas: 1\n      name: sleeper\n      policies:\n        - event: TaskCompleted\n          action: CompleteJob\n      template:\n        spec:\n          restartPolicy: Never\n          imagePullPolicy: IfNotPresent\n          containers:\n            - name: sleeper\n              image: debian:buster\n              command:\n                - /bin/bash\n                - -c\n                - |\n                  for i in {0..5}; do\n                      echo "sleeping"\n                      sleep 1\n                  done\n'})})]})}function u(e={}){const{wrapper:n}={...(0,s.R)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(d,{...e})}):d(e)}},28453(e,n,t){t.d(n,{R:()=>r,x:()=>l});var o=t(96540);const i={},s=o.createContext(i);function r(e){const n=o.useContext(s);return o.useMemo(function(){return"function"==typeof e?e(n):{...n,...e}},[n,e])}function l(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:r(e.components),o.createElement(s.Provider,{value:n},e.children)}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.