weather helm

This commit is contained in:
Waylon Walker 2024-02-13 19:47:14 -06:00
parent 4a2a168081
commit 87ad20d355
No known key found for this signature in database
GPG key ID: 66E2BF2B4190EFE4
4 changed files with 41 additions and 0 deletions

View file

@ -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

View file

View file

@ -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

View file

@ -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