helm-charts
helm-charts copied to clipboard
Creating backups using the single helm chart
Been using victoriametrics for a few months now and it's absolutely a breeze to set up with these helm charts. But what I'm missing here is a way to back up to a network drive (cifs/smb in my case). Now I'd gladly add this to the helm chart with a cronjob. But up on researching this I found that the only way it seems to backup is using direct access to the data dir. Is there a way to backup metrics over TCP/UDP from another pod?
As I know, the vmbackup ma run as a sidecar in the same pod as single-node VictoriaMetrics or vmstorage component in cluster version. cc'ing @tenmozes for more input
actually vmbackup is a cli command which can not be executed like sidecar, need to demonize it and add scheduling
this is main reason why it doesn't exist in helm chart
actually
vmbackupis a cli command which can not be executed like sidecar, need to demonize it and add scheduling this is main reason why it doesn't exist in helm chart
Yeah this is why I was thinking about using a cronjob for it. But if it only works with file access to the data that is going to be a bit harder
I think it should be possible, I am currently working on patching the helm chart to add a sidecar container to the server pod that would run vmbackup instance managed by crond.
Looks like vmbackup image is based off alpine, and according to
https://gist.github.com/AntonFriberg/692eb1a95d61aa001dbb4ab5ce00d291
I only need to put an incremental vmbackup invocation into /etc/periodic/hourly that would invoke a snapshot-creating request via curl against localhost (btw, would be a bit less moving pieces if vmbackup would be able to send the "create snapshot" request itself), and then put that snapshot into the /latest directory. And then a daily invocation of vmbackup would copy the /latest directory a daily snapshot, that script would go into /etc/periodic/daily.
Regarding "btw, would be a bit less moving pieces if vmbackup would be able to send the "create snapshot" request itself":
vmbackup has the option "-snapshot.createURL string" to do exactly this.
@ulikl ah, thank you, good to know!
does it mean that when i pass a -snapshotName=<local-snapshot> to vmbackup with -snapshot.createURL, it will create a snapshot automatically?
So does this mean we wouldn't have to go with the sidecar route and could go with a pod (cronjob) instead? Is -snapshot.createURL the URL of VM?
I think you still need a sidecar to access the volume where snapshots are created.
Ok wait, then how should I read:
-snapshot.createURL string
VictoriaMetrics create snapshot url. When this is given a snapshot will automatically be created during backup. Example: http://victoriametrics:8428/snaphsot/create
(From: https://victoriametrics.github.io/vmbackup.html )
I might be missing some VM knowledge how snapshots work here tbh :D
This is the URL on the VictoriaMetrics (vmstorage) instance itself, that would trigger a creation of a snapshot in its corresponding data directory. If vmbackup has access to that directory, it can then send the generated file wherever you point it (S3, GCP, etc).
Ahhhh ok check :+1: . Yeah then it's going to be really hard not using a sidecar