The CrashLoopBackOff state means that your pod is stuck in a infinite loop where it starts and crashes, then restarts and crashes again.
It’s a useful feature for debugging but a bit annoying when the bug in your code lives in a persistent volume.
The following steps will allow you to temporarily disable this feature so that you can get rid of the offending code in peace.
Downscale the Deployment
Stop using the PersistentVolumeClaim so that we can update our code
Create a Debugger Pod
1. Get the PVC identifier
2. Prep a debugger pod
3. Start the debugger pod
Now that I’m inside the container I can explore the volume which is mounted at /data and fix the issue.