Skip to content

Instantly share code, notes, and snippets.

@TBeijen
Last active September 27, 2023 10:18
Show Gist options
  • Save TBeijen/c4959161003203a371848e89e2686d26 to your computer and use it in GitHub Desktop.
Save TBeijen/c4959161003203a371848e89e2686d26 to your computer and use it in GitHub Desktop.
Docker Desktop Kubernetes (M1)

HOWTO

Find and delete persistent volume contents

Problem:

  • PV contents keep re-appearing, even when PV/PVC is removed even when persistentVolumeReclaimPolicy is set to Delete
  • Underlying docker-desktop VM apparently still has contents
docker run -it --rm --privileged --pid=host justincormack/nsenter1

# From within pod 
# Example: clearing postgres data to allow init sql scripts to run
#
# Find it
find ./ -name PG_VERSION

# Delete it
cd /containers/services/02-docker/rootfs
ls -al ./data/postgres
rm -rf ./data/postgres
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment