Skip to content

restore with longhorn volumes is marked as completed before volume is actually restored #8556

Discussion options

You must be logged in to vote

I've finally got it working

  • Script waiting for specific PVC to have PV restored on longhorn side
  • ArgocCD app managing the whole thing with
    • Restore sync-wave=-10
    • Job executing script for each PVC in restore: sync-wave=-5
    • Workloads: sycn-wav= 0

in case someone needs it here is the script:

#!/bin/sh

set -e

VELERO_RESTORE_NAME="$1"
NAMESPACE="longhorn-system"

resource_exists() {
  kubectl get "$1" "$2" -n "$3" >/dev/null 2>&1
}

echo "Fetching PVCs restored by Velero restore: $VELERO_RESTORE_NAME"

RESTORED_PVCS=$(kubectl get pvc --all-namespaces -l velero.io/restore-name="$VELERO_RESTORE_NAME" -o custom-columns="NAMESPACE:.metadata.namespace,NAME:.metadata.name" --no-headers)

if [ -…

Replies: 3 comments 3 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
3 replies
@blackpiglet
Comment options

@KonstantinNosov
Comment options

@blackpiglet
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by blackpiglet
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants