Author: James Ressler
Updated: August 2025
Audience: Everyone
Environmental details: Self-hosted, Replicated - KOTS
Issue
While trying to lower or unset the value in Admin Console > Config > Assets Size, shown below
You encounter the following error when redeploying under Deploy Logs > helmStderr:
UPGRADE FAILED: cannot patch "tenantfs" with kind PersistentVolumeClaim: PersistentVolumeClaim "tenantfs" is invalid: spec.resources.requests.storage: Forbidden: field can not be less than previous valueSolution
First, please note that the standard behavior of KOTS prevents reducing the size of a Persistent Volume (PV). Unless you absolutely need to reduce or unset this value, it is recommended that you only increase this value. To reduce the size of the PV, please follow the steps that follow.
Backup Your Tenant Assets
Since we will be deleting the tenantfs Persistent Volume Claim (PVC), there is a chance for data loss if we do not backup the tenant assets first. To backup the tenant assets,
Exec into the running core-0 pod
kubectl exec -it core-0 -- /bin/bashChange directories to where your assets are stored
cd /home/contour/tenant/<TENANT-NAME>Make an archive of the assets
tar -czvf assets.tar.gz avatars/ attachments/ diagrams/ reports/ equations/ tempreports/Exit your session on the running core-0 pod
exitCopy the archive off the running core-0 pod
kubectl cp core-0:/home/contour/tenant/<TENANT-NAME>/assets.tar.gz ./assets.tar.gzFinally, move the archive file off the application server for safety.
Delete the Old tenantfs PVC and Redeploy
Run the following command on the application server to delete the core statefulset and the tenantfs PVC:
kubectl delete sts/core pvc/tenantfsRedeploy your config with the lowered Asset Size value from the KOTS Admin Console. After the application comes back up, the error in hemlStderror should be gone.
Restore Your Tenant Assets From An Archive File
It may be necessary to restore your assets from the .tar.gz file created earlier. Move the file back onto your application server.
Set the environment variable for your tenant name
export TENANT_NAME=<TENANT-NAME>Copy the archive file onto the running core-0 pod
kubectl cp -c core /path/to/assets.tar.gz default/core-0:/home/contour/tenant/${TENANT_NAME}/Unpack the archive file
kubectl exec --tty -c core pods/core-0 -- tar -xvzf /home/contour/tenant/${TENANT_NAME}/assets.tar.gz -C /home/contour/tenant/${TENANT_NAME}/Change the permissions of the assets directory
kubectl exec --tty -c core pods/core-0 -- chmod -R 755 /home/contourChange the ownership of the assets directory
kubectl exec --tty -c core pods/core-0 -- chown -R tomcat:tomcat /home/contourDelete the core statefulset
kubectl delete sts/coreRedeploy the application from the KOTS Admin Console.
Comments
0 comments
Please sign in to leave a comment.