diff --git a/chart/templates/jobs/create-user-job.yaml b/chart/templates/jobs/create-user-job.yaml index a4bb2bde9f899..e3ff94ba77025 100644 --- a/chart/templates/jobs/create-user-job.yaml +++ b/chart/templates/jobs/create-user-job.yaml @@ -48,6 +48,9 @@ metadata: {{- $annotations | toYaml | nindent 4 }} {{- end }} spec: + {{- if semverCompare ">= 1.23.x" (include "kubeVersion" .) }} + ttlSecondsAfterFinished: {{ .Values.createUserJob.ttlSecondsAfterFinished }} + {{- end }} template: metadata: labels: diff --git a/chart/templates/jobs/migrate-database-job.yaml b/chart/templates/jobs/migrate-database-job.yaml index 67e61abf48dc0..8b7400e8daaa6 100644 --- a/chart/templates/jobs/migrate-database-job.yaml +++ b/chart/templates/jobs/migrate-database-job.yaml @@ -48,6 +48,9 @@ metadata: {{- $annotations | toYaml | nindent 4 }} {{- end }} spec: + {{- if semverCompare ">= 1.23.x" (include "kubeVersion" .) }} + ttlSecondsAfterFinished: {{ .Values.migrateDatabaseJob.ttlSecondsAfterFinished }} + {{- end }} template: metadata: labels: diff --git a/chart/values.schema.json b/chart/values.schema.json index 803dadda77c91..4c7474c94f984 100644 --- a/chart/values.schema.json +++ b/chart/values.schema.json @@ -2894,6 +2894,11 @@ } } }, + "ttlSecondsAfterFinished": { + "description": "Number of seconds to wait until the job is eligible for deletion (Kubernetes 1.23+)", + "type": "integer", + "default": 300 + }, "extraContainers": { "description": "Launch additional containers for the create user job pod", "type": "array", @@ -3112,6 +3117,11 @@ } ] }, + "ttlSecondsAfterFinished": { + "description": "Number of seconds to wait until the job is eligible for deletion (Kubernetes 1.23+)", + "type": "integer", + "default": 300 + }, "extraContainers": { "description": "Launch additional containers for the migrate database job pod", "type": "array", diff --git a/chart/values.yaml b/chart/values.yaml index 60a957591744b..8e0a584595705 100644 --- a/chart/values.yaml +++ b/chart/values.yaml @@ -782,11 +782,12 @@ createUserJob: - "{{ .Values.webserver.defaultUser.lastName }}" - "-p" - "{{ .Values.webserver.defaultUser.password }}" - # Annotations on the create user job pod annotations: {} # jobAnnotations are annotations on the create user job jobAnnotations: {} + # Number of seconds to wait until the job is eligible for deletion (Kubernetes 1.23+) + ttlSecondsAfterFinished: 300 # Labels specific to createUserJob objects and pods labels: {} @@ -870,6 +871,9 @@ migrateDatabaseJob: # Annotations to add to migrate database job kubernetes service account. annotations: {} + # Number of seconds to wait until the job is eligible for deletion (Kubernetes 1.23+) + ttlSecondsAfterFinished: 300 + resources: {} # limits: # cpu: 100m