Skip to content
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

Data dir permissions issue in Minikube #4

Open
pbitty opened this issue Dec 28, 2016 · 4 comments
Open

Data dir permissions issue in Minikube #4

pbitty opened this issue Dec 28, 2016 · 4 comments

Comments

@pbitty
Copy link

pbitty commented Dec 28, 2016

Hello,

I'm following this tutorial on a local minikube cluster and Consul fails with this error:

$ kubectl logs -f consul-0
==> CRITICAL: Permission denied for data folder at "/var/lib/consul/mdb"!
==> Consul will refuse to boot without access to this directory.
==> Please correct permissions and try starting again.

I was able to get around it by using /consul/data as the mountPath. The Consul image entrypoint sets the right permissions for this path when launching Consul.

I'm not sure if this error is specific to Minikube, but I imagine volume mounts in general would be owned by root and would have the same issue. I guess the issue here is that Consul runs as a non-root user, which is unconventional for Docker images.

@naiduarvind
Copy link

Hi,

I am also running this tutorial with a local minikube cluster and even after changing the mountPath to /consul/data, it seem to be not working. Performing a kubectl get pods and getting the logs resulted in what you see below.

screen shot 2016-12-30 at 6 56 05 pm

@pbitty
Copy link
Author

pbitty commented Dec 30, 2016

@naiduarvind It looks like Consul is still trying to use /var/lib/consul. When I made this change, I also removed the arg -data-dir=/var/lib/consul from the StatefulSet. See if that works for you.

@haf
Copy link

haf commented Jan 2, 2017

@pbitty 's solution works, but it doesn't change /var/lib from being the recommended unix folder for storing DB state. This is probably a bug in minikube?

@blachniet
Copy link
Contributor

I was having the same issue with the v0.9.0 Consul container. I updated the paths used in my pull request to update to v0.9.0, #15, which resolved the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants