Add Kavita Docker automation CronJob
This commit is contained in:
parent
34127f7f23
commit
4a89c706c3
3 changed files with 42 additions and 0 deletions
|
|
@ -0,0 +1,32 @@
|
||||||
|
apiVersion: batch/v1
|
||||||
|
kind: CronJob
|
||||||
|
metadata:
|
||||||
|
name: kavita-docker-auto-restart
|
||||||
|
namespace: automation
|
||||||
|
spec:
|
||||||
|
schedule: "*/15 * * * *"
|
||||||
|
successfulJobsHistoryLimit: 2
|
||||||
|
failedJobsHistoryLimit: 3
|
||||||
|
jobTemplate:
|
||||||
|
spec:
|
||||||
|
template:
|
||||||
|
spec:
|
||||||
|
restartPolicy: OnFailure
|
||||||
|
containers:
|
||||||
|
- name: restart-kavita
|
||||||
|
image: docker:27-cli
|
||||||
|
command:
|
||||||
|
- /bin/sh
|
||||||
|
- -c
|
||||||
|
- |
|
||||||
|
echo "Restarting Kavita Docker container..."
|
||||||
|
docker restart kavita
|
||||||
|
echo "Kavita restart completed."
|
||||||
|
volumeMounts:
|
||||||
|
- name: docker-sock
|
||||||
|
mountPath: /var/run/docker.sock
|
||||||
|
volumes:
|
||||||
|
- name: docker-sock
|
||||||
|
hostPath:
|
||||||
|
path: /var/run/docker.sock
|
||||||
|
type: Socket
|
||||||
6
apps/kavita-docker-automation/kustomization.yaml
Normal file
6
apps/kavita-docker-automation/kustomization.yaml
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
|
kind: Kustomization
|
||||||
|
|
||||||
|
resources:
|
||||||
|
- namespace.yaml
|
||||||
|
- kavita-docker-restart-cronjob.yaml
|
||||||
4
apps/kavita-docker-automation/namespace.yaml
Normal file
4
apps/kavita-docker-automation/namespace.yaml
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Namespace
|
||||||
|
metadata:
|
||||||
|
name: automation
|
||||||
Reference in a new issue