vmware-tanzu / velero

Backup and migrate Kubernetes applications and their persistent volumes
https://velero.io
Apache License 2.0
8.79k stars 1.41k forks source link

failed to create backup in s3 cloud.ru #8452

Open Nello-Angelo opened 17 hours ago

Nello-Angelo commented 17 hours ago

in kopia mode velero push backups to s3 cloud.ru correct but the same configuration in restic mode give me error

version of chart is 5.4.0

velero.txt

apiVersion: velero.io/v1
kind: Backup
metadata:
  annotations:
    kubectl.kubernetes.io/last-applied-configuration: >
      {"apiVersion":"velero.io/v1","kind":"Schedule","metadata":{"annotations":{},"name":"gitaas-backup","namespace":"velero"},"spec":{"schedule":"*/1
      * * *
      *","skipImmediately":false,"template":{"includedNamespaces":["gitaas"],"snapshotVolumes":true,"ttl":"2m"}}}
    velero.io/resource-timeout: 10m0s
    velero.io/source-cluster-k8s-gitversion: v1.27.14
    velero.io/source-cluster-k8s-major-version: '1'
    velero.io/source-cluster-k8s-minor-version: '27'
  creationTimestamp: '2024-11-25T07:32:43Z'
  generation: 7
  labels:
    velero.io/schedule-name: gitaas-backup
    velero.io/storage-location: default
  managedFields:
    - apiVersion: velero.io/v1
      fieldsType: FieldsV1
      fieldsV1:
        f:metadata:
          f:annotations:
            .: {}
            f:kubectl.kubernetes.io/last-applied-configuration: {}
            f:velero.io/resource-timeout: {}
            f:velero.io/source-cluster-k8s-gitversion: {}
            f:velero.io/source-cluster-k8s-major-version: {}
            f:velero.io/source-cluster-k8s-minor-version: {}
          f:labels:
            .: {}
            f:velero.io/schedule-name: {}
            f:velero.io/storage-location: {}
        f:spec:
          .: {}
          f:csiSnapshotTimeout: {}
          f:defaultVolumesToFsBackup: {}
          f:hooks: {}
          f:includedNamespaces: {}
          f:itemOperationTimeout: {}
          f:metadata: {}
          f:snapshotMoveData: {}
          f:snapshotVolumes: {}
          f:storageLocation: {}
          f:ttl: {}
        f:status:
          .: {}
          f:errors: {}
          f:expiration: {}
          f:failureReason: {}
          f:formatVersion: {}
          f:hookStatus: {}
          f:phase: {}
          f:progress:
            .: {}
            f:itemsBackedUp: {}
            f:totalItems: {}
          f:startTimestamp: {}
          f:version: {}
      manager: velero-server
      operation: Update
      time: '2024-11-25T07:32:49Z'
  name: gitaas-backup-20241125073243
  namespace: velero
  resourceVersion: '40320228'
  uid: 3ad2857e-3340-430e-9f3b-348ff29367a5
  selfLink: /apis/velero.io/v1/namespaces/velero/backups/gitaas-backup-20241125073243
status:
  errors: 5
  expiration: '2024-11-25T07:34:43Z'
  failureReason: >-
    rpc error: code = Unknown desc = error putting object
    backups/gitaas-backup-20241125073243/velero-backup.json: operation error S3:
    PutObject, https response error StatusCode: 403, RequestID:
    6e2188e1-b242-417f-ad1a-38d5ca212125, HostID: , api error
    SignatureDoesNotMatch: Request signature does not match access key
  formatVersion: 1.1.0
  hookStatus: {}
  phase: Failed
  progress:
    itemsBackedUp: 116
    totalItems: 116
  startTimestamp: '2024-11-25T07:32:43Z'
  version: 1
spec:
  csiSnapshotTimeout: 10m0s
  defaultVolumesToFsBackup: false
  hooks: {}
  includedNamespaces:
    - gitaas
  itemOperationTimeout: 4h0m0s
  metadata: {}
  snapshotMoveData: false
  snapshotVolumes: true
  storageLocation: default
  ttl: 2m0s
apiVersion: velero.io/v1
kind: BackupRepository
metadata:
  creationTimestamp: '2024-11-25T07:27:46Z'
  generateName: gitaas-default-restic-
  generation: 3
  labels:
    velero.io/repository-type: restic
    velero.io/storage-location: default
    velero.io/volume-namespace: gitaas
  managedFields:
    - apiVersion: velero.io/v1
      fieldsType: FieldsV1
      fieldsV1:
        f:metadata:
          f:generateName: {}
          f:labels:
            .: {}
            f:velero.io/repository-type: {}
            f:velero.io/storage-location: {}
            f:velero.io/volume-namespace: {}
        f:spec:
          .: {}
          f:backupStorageLocation: {}
          f:maintenanceFrequency: {}
          f:repositoryType: {}
          f:resticIdentifier: {}
          f:volumeNamespace: {}
        f:status:
          .: {}
          f:message: {}
          f:phase: {}
      manager: velero-server
      operation: Update
      time: '2024-11-25T07:27:46Z'
  name: gitaas-default-restic-r2vpm
  namespace: velero
  resourceVersion: '40318494'
  uid: b251261b-b8a4-4a81-aee0-a80180e87c5e
  selfLink: >-
    /apis/velero.io/v1/namespaces/velero/backuprepositories/gitaas-default-restic-r2vpm
status:
  message: >-
    error running command=restic init
    --repo=s3:https://s3.cloud.ru/dev-velero-gitaas/restic/gitaas
    --password-file=/tmp/credentials/velero/velero-repo-credentials-repository-password
    --cache-dir=/scratch/.cache/restic, stdout=, stderr=Fatal: create repository
    at s3:https://s3.cloud.ru/dev-velero-gitaas/restic/gitaas failed:
    client.BucketExists: 400 Bad Request

    : exit status 1
  phase: NotReady
spec:
  backupStorageLocation: default
  maintenanceFrequency: 168h0m0s
  repositoryType: restic
  resticIdentifier: s3:https://s3.cloud.ru/dev-velero-gitaas/restic/gitaas
  volumeNamespace: gitaas
apiVersion: velero.io/v1
kind: BackupStorageLocation
metadata:
  annotations:
    kubectl.kubernetes.io/last-applied-configuration: >
      {"apiVersion":"velero.io/v1","kind":"BackupStorageLocation","metadata":{"annotations":{},"labels":{"app.kubernetes.io/instance":"velero-dev-devtools","app.kubernetes.io/managed-by":"Helm","app.kubernetes.io/name":"velero","argocd.argoproj.io/instance":"velero-dev-devtools","helm.sh/chart":"velero-5.4.0"},"name":"default","namespace":"velero"},"spec":{"accessMode":"ReadWrite","config":{"region":"ru-central-1","s3ForcePathStyle":"true","s3Url":"https://s3.cloud.ru/"},"credential":{"key":"cloud","name":"cloudru-s3"},"default":true,"objectStorage":{"bucket":"dev-velero-gitaas"},"provider":"aws"}}
  creationTimestamp: '2024-11-25T07:16:32Z'
  generation: 43
  labels:
    app.kubernetes.io/instance: velero-dev-devtools
    app.kubernetes.io/managed-by: Helm
    app.kubernetes.io/name: velero
    argocd.argoproj.io/instance: velero-dev-devtools
    helm.sh/chart: velero-5.4.0
  managedFields:
    - apiVersion: velero.io/v1
      fieldsType: FieldsV1
      fieldsV1:
        f:metadata:
          f:annotations:
            .: {}
            f:kubectl.kubernetes.io/last-applied-configuration: {}
          f:labels:
            .: {}
            f:app.kubernetes.io/instance: {}
            f:app.kubernetes.io/managed-by: {}
            f:app.kubernetes.io/name: {}
            f:argocd.argoproj.io/instance: {}
            f:helm.sh/chart: {}
        f:spec:
          .: {}
          f:accessMode: {}
          f:config:
            .: {}
            f:region: {}
            f:s3ForcePathStyle: {}
            f:s3Url: {}
          f:credential: {}
          f:default: {}
          f:objectStorage:
            .: {}
            f:bucket: {}
          f:provider: {}
      manager: argocd-controller
      operation: Update
      time: '2024-11-25T07:16:32Z'
    - apiVersion: velero.io/v1
      fieldsType: FieldsV1
      fieldsV1:
        f:status:
          .: {}
          f:lastSyncedTime: {}
          f:lastValidationTime: {}
          f:phase: {}
      manager: velero-server
      operation: Update
      time: '2024-11-25T07:38:43Z'
  name: default
  namespace: velero
  resourceVersion: '40322248'
  uid: 8fa0531c-f7e9-4972-a4c9-da45368e4ef9
  selfLink: /apis/velero.io/v1/namespaces/velero/backupstoragelocations/default
status:
  lastSyncedTime: '2024-11-25T07:38:43Z'
  lastValidationTime: '2024-11-25T07:38:43Z'
  phase: Available
spec:
  accessMode: ReadWrite
  config:
    region: ru-central-1
    s3ForcePathStyle: 'true'
    s3Url: https://s3.cloud.ru/
  credential:
    key: cloud
    name: cloudru-s3
  default: true
  objectStorage:
    bucket: dev-velero-gitaas
  provider: aws
apiVersion: velero.io/v1
kind: Schedule
metadata:
  name: gitaas-backup
  namespace: velero
spec:
  schedule: '*/1 * * * *'
  skipImmediately: false
  template:
    includedNamespaces:
      - gitaas
    snapshotVolumes: true
    ttl: 2m
kaovilai commented 9 hours ago

Restic is on the path to removal. #8072 If kopia works, we likely won't be fixing restic IMO unless there is a regression of previous functionality.

Nello-Angelo commented 7 hours ago

okay but i cant restore backup because velero cant find id or name of backup in s3 if i use kopia

@kaovilai

kaovilai commented 3 hours ago

velero cant find id or name of backup in s3 if i use kopia

can you clarify?