Restore tenant assets from TAR in KOTS
Follow this process when you have an existing cluster and want to save your tenant assets on an external storage device.
Requirements
In EFS, the tenant assets must be backed up in a TAR file and restored once EFS has been configured.
Make sure that you use our process to create the TAR file; the restore commands expect a TAR file with a certain structure.
To restore tenant assets:
Set an environment variable with your tenant name:
export TENANT_NAME=jama
Copy the TAR file from its current location to a master node:
scp assets.tar.gz <user>@<ip-master-node>:~/assets.tar.gz
Log in to the master node and extract the TAR file:
tar -xvzf assets.tar.gz
Copy the assets to a core pod:
cd assets kubectl cp -c core . default/core-0:/home/contour/tenant/${TENANT_NAME}/ kubectl exec --tty -c core pods/core-0 -- chmod -R 755 /home/contour kubectl exec --tty -c core pods/core-0 -- chown -R tomcat:tomcat /home/contour
Verify that the assets were copied:
kubectl exec --tty -c core pods/core-0 -- ls -la /home/contour/tenant/${TENANT_NAME}/ kubectl exec --tty -c core pods/core-0 -- du -shc /home/contour/tenant/${TENANT_NAME}/