Standard way to take backup of mysql running inside Kubernetes pod?

2/22/2019

i am having Kubernetes cluster on digital ocean and running database inside k8s pod.

I am planning for schedule backup eveyday so what is best way for everyday auto backup. JOB or JENKINS ?

Database is not exposed outside using any service

if i use K8s job how to store backup in PVC and how to delete old one?

I am already running script to take snapshot of volume via jenkin is good way to restore?

-- Harsh Manvar
database
kubernetes
pod

1 Answer

2/22/2019

you can consider one of the below approach

  1. Create a CronJob in k8s and run backup using mysql service dns.
  2. install cron inside mysql container ( update mysql image with cron) and run mysql backup at scheduled interval. archive the backup and push it to s3 storage.
-- P Ekambaram
Source: StackOverflow