diff --git a/active/weather/Chart.yaml b/active/weather/Chart.yaml new file mode 100644 index 0000000..d2e9262 --- /dev/null +++ b/active/weather/Chart.yaml @@ -0,0 +1,4 @@ +apiVersion: v2 +name: weather-cronjob-chart +description: A Helm chart for deploying a cron job to fetch weather information +version: 0.1.0 diff --git a/active/weather/charts/.gitkeep b/active/weather/charts/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/active/weather/templates/cronjob.yaml b/active/weather/templates/cronjob.yaml new file mode 100644 index 0000000..5f873a7 --- /dev/null +++ b/active/weather/templates/cronjob.yaml @@ -0,0 +1,27 @@ +apiVersion: batch/v1 +kind: CronJob +metadata: + name: {{ .Release.Name }}-weather-cronjob +spec: + schedule: "{{ .Values.schedule }}" + jobTemplate: + spec: + template: + metadata: + labels: + app: weather-job + spec: + containers: + - name: weather-container + image: {{ .Values.container.image }} + command: ["sh", "-c", "{{ .Values.container.command }}"] + volumeMounts: + - name: logs-volume + mountPath: /logs + subPath: logs + restartPolicy: {{ .Values.restartPolicy }} + volumes: + - name: logs-volume + persistentVolumeClaim: + claimName: {{ .Values.volume.claimName }} + subPath: logs diff --git a/active/weather/values.yaml b/active/weather/values.yaml new file mode 100644 index 0000000..9d36df1 --- /dev/null +++ b/active/weather/values.yaml @@ -0,0 +1,10 @@ +schedule: "*/1 * * * *" + +container: + image: busybox + command: "curl 'wttr.in/peoria,il?format=3' >> /logs/weather.log" + +restartPolicy: OnFailure + +volume: + claimName: data