diff --git a/charts/mageai/templates/cleanup-cronjob.yaml b/charts/mageai/templates/cleanup-cronjob.yaml index a5f55d1..77e81a7 100644 --- a/charts/mageai/templates/cleanup-cronjob.yaml +++ b/charts/mageai/templates/cleanup-cronjob.yaml @@ -7,6 +7,9 @@ spec: schedule: {{ .Values.cleanupJob.schedule_cron | default "0 * * * *" | quote }} jobTemplate: spec: + {{- if .Values.cleanupJob.ttlSecondsAfterFinished }} + ttlSecondsAfterFinished: {{ .Values.cleanupJob.ttlSecondsAfterFinished }} + {{- end }} template: spec: containers: @@ -37,6 +40,12 @@ spec: {{- toYaml .Values.extraVolumeMounts | nindent 16 }} {{- end }} restartPolicy: OnFailure + resources: + {{- toYaml .Values.cleanupJob.resources | nindent 12 }} + {{- with .Values.cleanupJob.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 12 }} + {{- end }} volumes: {{- if .Values.volumes }} {{- toYaml .Values.volumes | nindent 12 }} diff --git a/charts/mageai/values.yaml b/charts/mageai/values.yaml index 3d065a7..bd62a9b 100644 --- a/charts/mageai/values.yaml +++ b/charts/mageai/values.yaml @@ -231,7 +231,20 @@ extraEnvs: fieldPath: metadata.namespace cleanupJob: - enabled: false + enabled: true clean_variable_cli_args: "" clean_log_cli_args: "" schedule_cron: "0 * * * *" # Runs every hour + ttlSecondsAfterFinished: ~ + resources: {} + # We usually recommend not to specify default resources and to leave this as a conscious # W: comment not indente… + # choice for the user. This also increases chances charts run on environments with little + # resources, such as Minikube. If you do want to specify resources, uncomment the following + # lines, adjust them as necessary, and remove the curly braces after 'resources:'. + # limits: + # cpu: 100m + # memory: 128Mi + # requests: + # cpu: 100m + # memory: 128Mi + nodeSelector: {}