1
0
Fork 0

jenkins: Add Argo CD pre-sync hook

Argo CD will delete and re-create this Job each time it synchronizes the
*jenkins* application.  The job creates a snapshot of the Jenkins volume
using an HTTP request to the Longhorn UI.
dch-webhooks-secrets
Dustin 2023-10-22 21:50:25 -05:00
parent cf7ec7dd64
commit 7797da19f9
2 changed files with 26 additions and 0 deletions

View File

@ -0,0 +1,25 @@
apiVersion: batch/v1
kind: Job
metadata:
name: jenkins-snapshot-hook
namespace: jenkins
annotations:
argocd.argoproj.io/hook: PreSync
argocd.argoproj.io/hook-delete-policy: BeforeHookCreation
spec:
template:
metadata:
labels:
app.kubernetes.io/name: jenkins-snapshot-hook
spec:
containers:
- name: jenkins-snapshot
image: docker.io/curlimages/curl
command:
- curl
- http://longhorn-frontend.longhorn-system/v1/volumes/pvc-4d42f4d3-2f9d-4edd-b82c-b51a385a3276?action=snapshotCreate
- -H
- 'Content-Type: application/json'
- -d
- '{}'
restartPolicy: Never

View File

@ -7,6 +7,7 @@ labels:
resources: resources:
- jenkins.yaml - jenkins.yaml
- argocd-sync-hook.yaml
configMapGenerator: configMapGenerator:
- name: ssh-known-hosts - name: ssh-known-hosts