From 50c12bcf8f814d0844748f7d9c02132a6c8edd44 Mon Sep 17 00:00:00 2001 From: "Waylon S. Walker" Date: Tue, 24 Sep 2024 21:11:37 -0500 Subject: [PATCH] more policy --- temperature-cronjob/templates/cronjob.yaml | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/temperature-cronjob/templates/cronjob.yaml b/temperature-cronjob/templates/cronjob.yaml index 2093195..4fdb4b5 100644 --- a/temperature-cronjob/templates/cronjob.yaml +++ b/temperature-cronjob/templates/cronjob.yaml @@ -5,8 +5,14 @@ metadata: name: {{ .Release.Name }}-cronjob spec: schedule: "{{ .Values.schedule }}" + startingDeadlineSeconds: 200 + concurrencyPolicy: Forbid + successfulJobsHistoryLimit: 1 + failedJobsHistoryLimit: 1 jobTemplate: spec: + activeDeadlineSeconds: 180 + ttlSecondsAfterFinished: 100 template: spec: containers: @@ -21,6 +27,13 @@ spec: echo "Fetching temperature" && \ python /scripts/temperature_fetcher.py && \ sleep 300 + resources: + requests: + cpu: "100m" + memory: "128Mi" + limits: + cpu: "200m" + memory: "256Mi" env: - name: CITY value: "{{ .Values.city }}" @@ -33,7 +46,7 @@ spec: mountPath: "{{ .Values.mountPath }}" - name: script-volume mountPath: /scripts - restartPolicy: OnFailure + restartPolicy: Never volumes: - name: sqlite-data hostPath: