aboutsummaryrefslogtreecommitdiff
path: root/grumpy/gitsnapshot/gitsnapshot-cronjob.yaml
blob: 192c64c2a2ab5c1f259bbcefbfafb6ecf9d2c669 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
apiVersion: batch/v1
kind: CronJob
metadata:
  name: gitsnapshot
spec:
  jobTemplate:
    metadata:
      labels:
        app.kubernetes.io/instance: gitsnapshot
        app.kubernetes.io/name: gitsnapshot
    spec:
      template:
        spec:
          containers:
          - command:
            - gitsnap
            - backup
            - /opt/repos
            - privategit
            env:
            - name: WAL_FILE
              value: /opt/repos/git-snapshot.wal
            - name: AWS_DEFAULT_REGION
              valueFrom:
                secretKeyRef:
                  key: AWS_DEFAULT_REGION
                  name: aws-s3-secret
            - name: AWS_SECRET_ACCESS_KEY
              valueFrom:
                secretKeyRef:
                  key: AWS_SECRET_ACCESS_KEY
                  name: aws-s3-secret
            - name: AWS_ACCESS_KEY_ID
              valueFrom:
                secretKeyRef:
                  key: AWS_ACCESS_KEY_ID
                  name: aws-s3-secret
            image: gitsnapshot
            imagePullPolicy: Always
            name: gitsnapshot
            volumeMounts:
            - mountPath: /opt/repos
              name: go-git-storage
              readOnly: false
          restartPolicy: Never
          volumes:
          - name: go-git-storage
            persistentVolumeClaim:
              claimName: go-git-storage
  schedule: '*/60 * * * *'