Skip to content

loft-sh/vcluster-attach-detach

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

vcluster-attach-detach

Script to simplify detaching and later attaching vCluster resources

0. Prerequisites

  • vCluster you want to wipe the state of
  • Already synced resources such as PVCs and PVs
  • Downloaded this script "attach-detach.sh"
  • Kubectl and jq installed

1. Detach Persistent Volumes and Persistent Volume Claims from vCluster

# Detach all pvc's of vCluster called "my-vcluster" in namespace "my-vcluster-namespace"
./attach-detach.sh detach pvc my-vcluster -n my-vcluster-namespace

2. Restart vCluster and wipe state

# Make sure vCluster is stopped before you do this
kubectl delete pvc data-my-vcluster-0

Next start vCluster and restore the objects within the vCluster (statefulsets etc.)

3. Attach Persistent Volumes and Persistent Volume Claims

# Attach all pvc's of vCluster called "my-vcluster" in namespace "my-vcluster-namespace"
./attach-detach.sh attach pvc my-vcluster -n my-vcluster-namespace

About

Script to simplify detaching and later attaching vCluster resources

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages