From 87ad20d35523f304c473ddac5778227f23fe0822 Mon Sep 17 00:00:00 2001 From: "Waylon S. Walker" Date: Tue, 13 Feb 2024 19:47:14 -0600 Subject: [PATCH] weather helm --- active/weather/Chart.yaml | 4 ++++ active/weather/charts/.gitkeep | 0 active/weather/templates/cronjob.yaml | 27 +++++++++++++++++++++++++++ active/weather/values.yaml | 10 ++++++++++ 4 files changed, 41 insertions(+) create mode 100644 active/weather/Chart.yaml create mode 100644 active/weather/charts/.gitkeep create mode 100644 active/weather/templates/cronjob.yaml create mode 100644 active/weather/values.yaml 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