I'm running a MySQL image in my one-node cluster for local testing purposes only.
I would like to be able to delete the database when needed to have the image build a new database from scratch, but I can't seem to find where or how I can do that easily.
I am on Windows, using Docker Desktop to manage my Docker images and Kubernetes cluster with WSL2. The pod uses a persistent volume/claim which can be seen below.
apiVersion: v1
kind: PersistentVolume
metadata:
name: mysql-pv-volume
labels:
type: local
spec:
storageClassName: manual
capacity:
storage: 3Gi
accessModes:
- ReadWriteOnce
hostPath:
path: "/var/MySQLTemp"
type: DirectoryOrCreate
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: mysql-pv-claim
spec:
storageClassName: manual
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 3Gi
The volume part of my deployment looks like:
volumeMounts:
- name: mysql-persistent
mountPath: /var/lib/mysql
volumes:
- name: mysql-persistent
persistentVolumeClaim:
claimName: mysql-pv-claim
Is there a command I can use to either see where this database is stored on my Windows or WSL2 machine so I can delete it manually, or delete it from the command line through docker
or kubectl
?