docker-volume-backup icon indicating copy to clipboard operation
docker-volume-backup copied to clipboard

[Question] Kubernetes

Open Rwanito opened this issue 3 years ago • 2 comments

  • I'm submitting a ...
    • [ ] bug report
    • [x] feature request
    • [ ] support request

Hello,

I would like to know if someone tried with Kubernetes (init with kubeadm). Because, I'm truly thinking about stopping with docker swarm since I'm not sure about the future with this.

And, this software is really what I'm looking for backing up my data.

Thanks you !

Rwanito avatar Jul 19 '22 17:07 Rwanito

I have to admit I don't know anything about Kubernetes, so I might not be a good reference here. My gut feeling tells me this image probably won't work well with Kubernetes as soon as you rely on functionality that requires interaction with the Docker Daemon (starting and stopping containers, executing commands) as Kubernetes will have a different API than Docker. If you just create and upload archives it should work just as well though. All of this might be wrong and is just a guess.

I have no idea how hard it would be to make it work, but if anyone has feedback on this I am happy to learn about it.

m90 avatar Jul 19 '22 19:07 m90

Hello, Thank you for your answer.

Okay, I see ! That's true docker is quite easy to use and a backup feature like that could be very useful in k8s. If someone tried already ?

ghost avatar Jul 20 '22 06:07 ghost

I run this image on Kubernetes using a CronJob and it works great:

apiVersion: batch/v1
kind: CronJob
metadata:
  name: backup
spec:
  schedule: "@weekly"
  jobTemplate:
    spec:
      template:
        spec:
          containers:
            - name: backup
              image: offen/docker-volume-backup:v2.33.2
              command:
                - backup
              env:
                - name: TZ
                  value: America/New_York
                - name: BACKUP_RETENTION_DAYS
                  value: "21"
                - name: AWS_S3_PATH
                  value: my-path
                - name: AWS_S3_BUCKET_NAME
                  value: backups
                - name: AWS_ACCESS_KEY_ID
                  valueFrom:
                    secretKeyRef:
                      name: backup
                      key: access-key
                - name: AWS_SECRET_ACCESS_KEY
                  valueFrom:
                    secretKeyRef:
                      name: backup
                      key: secret-key
              volumeMounts:
                - name: configurations
                  mountPath: /backup
                  readOnly: true
          volumes:
            - name: configurations
              persistentVolumeClaim:
                claimName: project-to-backup
          restartPolicy: OnFailure

bdsoha avatar Nov 19 '23 08:11 bdsoha