velero: restic-restore-helper container doesn't run when pod has runAsNonRoot: true

What steps did you take and what happened:

Annotate pods with: backup.velero.io/backup-volumes: data velero backup create my-data-backup --include-namespaces=jon-test-system

backup completes successfully

oc delete namespace jon-test-system velero restore create --from-backup=my-backup --restore-volumes --include-resources=pvcs,pvs

(I don’t think the --include-resources argument is required)

Most of the resources are restored correctly, however pods with:

  securityContext:
    runAsNonRoot: true
    seLinuxOptions:
      level: s0:c37,c19

Fail with:

  initContainerStatuses:
  - image: velero/velero-restic-restore-helper:v1.3.2
    imageID: ""
    lastState: {}
    name: restic-wait
    ready: false
    restartCount: 0
    state:
      waiting:
        message: container has runAsNonRoot and image has non-numeric user (nobody),
          cannot verify user is non-root
        reason: CreateContainerConfigError

What did you expect to happen:

All resources and volumes restored correctly.

The output of the following commands will help us better understand what’s going on: (Pasting long output into a GitHub gist or other pastebin is fine.)

  • kubectl logs deployment/velero -n velero
  • velero backup describe <backupname> or kubectl get backup/<backupname> -n velero -o yaml
apiVersion: velero.io/v1
kind: Backup
metadata:
  creationTimestamp: "2020-04-15T08:05:06Z"
  generation: 3
  labels:
    velero.io/storage-location: default
  name: my-data-backup
  namespace: jon-velero
  resourceVersion: "11884425"
  selfLink: /apis/velero.io/v1/namespaces/jon-velero/backups/my-data-backup
  uid: 5a4173fb-909e-486e-ba1b-adf1eb65ba08
spec:
  hooks: {}
  includedNamespaces:
  - jon-test-system
  includedResources:
  - pvs
  - pvcs
  storageLocation: default
  ttl: 720h0m0s
status:
  completionTimestamp: "2020-04-15T08:06:12Z"
  expiration: "2020-05-15T08:05:06Z"
  phase: Completed
  startTimestamp: "2020-04-15T08:05:06Z"
  version: 1
  • velero restore describe <restorename> or kubectl get restore/<restorename> -n velero -o yaml apiVersion: velero.io/v1
kind: Restore
metadata:
  creationTimestamp: "2020-04-15T12:25:48Z"
  generation: 2
  name: my-data-backup-20200415132548
  namespace: jon-velero
  resourceVersion: "12031491"
  selfLink: /apis/velero.io/v1/namespaces/jon-velero/restores/my-data-backup-20200415132548
  uid: a52a2b83-adb9-499b-8de4-a7cda9b40f26
spec:
  backupName: my-data-backup
  excludedResources:
  - nodes
  - events
  - events.events.k8s.io
  - backups.velero.io
  - restores.velero.io
  - resticrepositories.velero.io
  includedNamespaces:
  - '*'
  restorePVs: true
status:
  phase: InProgress

Anything else you would like to add: [Miscellaneous information that will assist in solving the issue.]

Environment:

  • Velero version (use velero version):v1.3.2 55a9914a3e4719fb1578529c45430a8c11c28145
  • Velero features (use velero client config get features): features: <NOT SET>
  • Kubernetes version (use kubectl version): $ oc version Client Version: 4.3.5 Server Version: 4.3.0 Kubernetes Version: v1.16.2
  • Cloud provider or hardware configuration: OpenShift
  • OS (e.g. from /etc/os-release):
    • RuntimeOS: windows - RuntimeArch: amd64

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 3
  • Comments: 15 (5 by maintainers)

Most upvoted comments

As discussed in the community meeting with @sseago, we need to investigate whether we can change just the velero-restic-restore-helper to use the UID directly rather than nonroot user. This would require changes to our build process as we use the same Dockerfile for both the velero and velero-restic-restore-helper images.