-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Files in hostPath volumes are lost after minikube restart #3582
Comments
Do you mind elaborating on your repro instructions? I'd like to see if this problem exists on other platforms, but am not yet familiar with hostPath volumes. Thanks! |
Hi @tstromberg : thanks for taking a look. I have the following volume definition in my stateful set:
and one or more containers use that volume and mount it to a path inside the container:
After I start a pod with the above, the software running in the pod writes files to |
@tstromberg - Did you get a chance to look at this? do you need more info? |
Minikube will only persist host paths located under The dynamically provision volumes are also persisted, but the paths should be considered internal. Here is the
So the recommended location provided for persistent See https://github.com/kubernetes/minikube/blob/master/docs/persistent_volumes.md |
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
I'm having this issue. After restart I lose data in my Postgres DB. Here's the apiVersion: apps/v1
kind: Deployment
metadata:
name: postgres
namespace: db
labels:
app: postgres
spec:
replicas: 1
selector:
matchLabels:
app: postgres
template:
metadata:
labels:
app: postgres
spec:
containers:
- name: postgres
image: postgres:11.5
ports:
- containerPort: 5432
envFrom:
- configMapRef:
name: config-postgres
env:
- name: PGDATA
value: /var/lib/postgresql/data
volumeMounts:
- mountPath: /var/lib/postgresql
name: postgresdb
volumes:
- name: postgresdb
persistentVolumeClaim:
claimName: pvc-postgres And the volumes: apiVersion: v1
kind: PersistentVolume
metadata:
name: minikube-pv-postgres
namespace: db
labels:
app: minikube-pv-postgres
spec:
storageClassName: standard
accessModes:
- ReadWriteOnce
capacity:
storage: 10Gi
hostPath:
path: /data/minikube-pv-postgres/
---
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: pvc-postgres
namespace: db
labels:
app: pvc-postgres
spec:
volumeName: minikube-pv-postgres
storageClassName: standard
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 10Gi The headache is I specify |
Stale issues rot after 30d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
Rotten issues close after 30d of inactivity. Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
@fejta-bot: Closing this issue. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Hi @hellovietduc |
Is this a BUG REPORT or FEATURE REQUEST? (choose one):
BUG REPORT
Please provide the following details:
Environment: Minikube on MacOS Mojave (10.14.2)
Minikube version : v0.33.1
What happened: Files present in
hostPath
volumes are not persisted after restart of minikubeWhat you expected to happen: Files present in
hostPath
volumes should be persisted after restart of minikubeHow to reproduce it (as minimally and precisely as possible):
hostPath
volumes and corresponding volume mountsminikube ssh
and see that the files are present in the hostPath directory)minikube stop
minikube start --vm-driver="virtualbox"
Output of
minikube logs
(if applicable):minikube-logs.txt
Anything else do we need to know: This was working perfectly fine until recently. I have upgraded MacOS, minikube (using brew cask), docker recently. Not sure which one could be the culprit ¯_(ツ)_/¯
The text was updated successfully, but these errors were encountered: