-
Notifications
You must be signed in to change notification settings - Fork 75
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
vtctldclient backup not working with defined VitessBackupStorages in cluster #472
Comments
I restarted the primary and saw "--file_backup_storage_root=/vt/backups/example" was added, but this is not the path I specified in the cluster. |
Hi @voarsh2, This is not the best place to try and get support/help. You should instead use the Vitess slack as this kind of thing requires a lot of back and forth: https://vitess.io/community/ There are also many people there from the community that are using the operator in production. I don't know anything about your setup (k8s version, vitess operator version, etc), nor what you've done -- e.g. the VitessCluster CRD definition you used. Nor what you want to do (how you want the backups to be performed). It's clear that something isn't quite right but w/o any details I cannot say what. In the meantime you can find the CRD/API reference here: https://github.com/planetscale/vitess-operator/blob/main/docs/api.md You can see some example walkthroughs here: https://github.com/planetscale/vitess-operator/tree/main/docs And a blog post: https://vitess.io/blog/2020-11-09-vitess-operator-for-kubernetes/ And the Vitess backup docs: https://vitess.io/docs/17.0/user-guides/operating-vitess/backup-and-restore/ The backups are very configurable and again I have no idea what you've specified. At the Vitess level, the error you shared is Vitess telling you that the component (vtctld,vttablet,vtbackup) has no value for its Between k8s (each install is a snowflake), Vitess, and the Vitess Operator this gets complicated. This is why Slack is easier for things like this. I know that this is complicated for you as well, and the docs are largely non-existent for the operator, but we'd need much more detail in order to try and help. I can only guess that perhaps you specified something like this in your CRD:
But guessing doesn't help. 🙂 After knowing the actual CRD definition, we'd have to look at the pod definitions, logs, etc. Best Regards |
Howdy @mattlord
Will look to try Slack next time. As you pointed out:
This is what I used for the Vitess Cluster config.
I've read most of those links. So, when running
Notice it's not using the hostpath I specified in the Cluster configuration. VitessBackupStorage
VitessCluster: example
https://github.com/planetscale/vitess-operator/blob/main/docs/api.md#planetscale.com/v2.VitessBackup - this doesn't show hostpath as a valid option, but I saw it in the sample YAML of the operator. In any case, I can't see any obvious reason why this is not working - not sure why the DB pods are using /vt/backups when I specify a different path. I might give S3 a try next...... |
I looked at the code and here is what I found - func fileBackupVolumes(volume *corev1.VolumeSource) []corev1.Volume {
return []corev1.Volume{
{
Name: fileBackupStorageVolumeName,
VolumeSource: *volume,
},
}
} Next, Vitess mounts this said volume on a fixed hardcoded path in the vtbackup and vtctld pod. The path that is used is func fileBackupVolumeMounts(subPath string) []corev1.VolumeMount {
return []corev1.VolumeMount{
{
Name: fileBackupStorageVolumeName,
MountPath: fileBackupStorageMountPath,
SubPath: subPath,
},
}
} Since the volume has been mounted on the path func fileBackupFlags(clusterName string) vitess.Flags {
return vitess.Flags{
"backup_storage_implementation": fileBackupStorageImplementationName,
"file_backup_storage_root": rootKeyPrefix(fileBackupStorageMountPath, clusterName),
}
} So while taking a backup, vtbackup will try to create a directory with the cluster name, in your case ☝️ explains why you are seeing Unfortunately, I don't know why the volume mount is unaccessible |
@voarsh2 any update on this? |
I run
I get:
However, in the cluster spec I have defined a hostpath for the backups - and I can see it show up in VitessBackupStorages
The text was updated successfully, but these errors were encountered: