Skip to content
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

Backup to Google Cloud Storage #427

Closed
filiprafaj opened this issue Jul 15, 2022 · 9 comments
Closed

Backup to Google Cloud Storage #427

filiprafaj opened this issue Jul 15, 2022 · 9 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@filiprafaj
Copy link

Hello, I am trying and failing to store backups to Google Cloud Storage.

I have set up Workload Identity to give the k8s service account the permissions to access the bucket.

I have also tried defining the AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY variables.

Still I get
Error: failed to take a full dump: failed to put dump.tar: operation error S3: PutObject, https response error StatusCode: 403, RequestID: , HostID: , api error SignatureDoesNotMatch: The request signature we calculated does not match the signature you provided. Check your Google secret key and signing method.

Is there anybody who made backups to GCS working?

Thank you!

@ymmt2005
Copy link
Member

ymmt2005 commented Jul 15, 2022

Backup to GCS is not supported now.
It can be added by implementing Bucket interface for GCS in this package.
https://github.com/cybozu-go/moco/tree/main/pkg/bucket

We welcome a pull request for adding GCS support.

@ymmt2005 ymmt2005 added enhancement New feature or request good first issue Good for newcomers labels Jul 15, 2022
@d-kuro
Copy link
Collaborator

d-kuro commented Aug 10, 2022

@filiprafaj
GCS supports the S3 compatibility API. (Sorry, I have not verified this.)
Could you please refer to the documentation and try again?

refs:

If it still doesn't work, it would be helpful if you could report it again, including the definition of BackupPolicy 🙏
https://cybozu-go.github.io/moco/usage.html#backuppolicy

@filiprafaj
Copy link
Author

Hi @d-kuro , I have tried now with interoperability credentials and I am getting:

Error: failed to take a full dump: failed to put dump.tar: operation error S3: PutObject, https response error StatusCode: 403, RequestID: , HostID: , api error SignatureDoesNotMatch: The request signature we calculated does not match the signature you provided. Check your Google secret key and signing method. failed to take a full dump: failed to put dump.tar: operation error S3: PutObject, https response error StatusCode: 403, RequestID: , HostID: , api error SignatureDoesNotMatch: The request signature we calculated does not match the signature you provided. Check your Google secret key and signing method.

the backup file looks like this:

apiVersion: moco.cybozu.com/v1beta2
kind: BackupPolicy
metadata:
  namespace: default
  name: daily
spec:
  schedule: "@daily"
  jobConfig:
    serviceAccountName: moco-test-mysqlcluster
    env:
    - name: AWS_ACCESS_KEY_ID
      value: ***
    - name: AWS_SECRET_ACCESS_KEY
      value: ***
    bucketConfig:
      bucketName: ***
      endpointURL: https://storage.googleapis.com
    workVolume:
      emptyDir: {}
    memory: 1Gi
    maxMemory: 1Gi
    threads: 1

@Prakharkarsh1
Copy link

Hii @filiprafaj i want to contribute to this issue

@ymmt2005
Copy link
Member

@Prakharkarsh1
Hi,
Thank you for your intention to contribute to this project.
We will review your pull request when it's ready.

@yamatcha yamatcha assigned yamatcha and unassigned yamatcha Sep 12, 2022
@yamatcha
Copy link
Contributor

@Prakharkarsh1

MOCO uses aws-sdk-go-v2 to connect to s3-compatible storage.
However, aws-sdk-go-v2 is not compatible with third-party platforms and therefore cannot connect GCS.
aws/aws-sdk-go-v2#1816
So it would be better to implement for gcs bucket in moco/pkg/bucket/gcs.

@ymmt2005
Copy link
Member

We use minio to test S3 bucket implementation.

Likewise, we may use these tools to test GCS bucket implementation.

@ymmt2005
Copy link
Member

@Prakharkarsh1
Hello,
Do you still want to contribute to this feature?

@masa213f
Copy link
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

7 participants
@ymmt2005 @filiprafaj @yamatcha @d-kuro @masa213f @Prakharkarsh1 and others