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

How to use host storage in kubernetes #1703

Closed
thexder1 opened this issue Feb 14, 2018 · 11 comments
Closed

How to use host storage in kubernetes #1703

thexder1 opened this issue Feb 14, 2018 · 11 comments

Comments

@thexder1
Copy link

Expected behavior

Able to mount shared drive in containers running in kubernetes

Actual behavior

Could not find any way to configure this

Information

I am using Docker for Windows Edge with the built in Kubernetes configuration and trying to mount a persistent volume of some kind from the host. I am running Windows 10 Enterprise. I thought I would be able to use the local volumes that were added as alpha in Kubernetes, but they are behind feature gates and I do not see any way to enable them so I can use that.

Steps to reproduce the behavior

  1. Install Docker for Windows Edge
  2. Make sure you are using Linux Containers
  3. Open Docker settings, go to kubernetes tab and check the boxes and click apply
  4. Go to shared drives tab and share drive
  5. Ponder the possible ways this share could get passed into kubernetes.
@pgayvallet
Copy link

Hello,

In the 18.03-rc1 edge version (due this week), you will be able to use hostPath type volume to mount volumes shared from the host. Just use a hostPath volume. VM-side, the shared drive are in the /host_mnt folder. I.E: "/host_mnt/c/path/to/my/folder for a folder in the C drive.

@pgayvallet pgayvallet self-assigned this Feb 19, 2018
@thexder1
Copy link
Author

thexder1 commented Feb 19, 2018 via email

@thexder1
Copy link
Author

thexder1 commented Feb 19, 2018 via email

@creativearmenia
Copy link

Running docker version 18.03.0-ce-rc1 on windows 10
Failed to mount volume from persistentvolumeclaim,
it shows error under Events Error: Error response from daemon: invalid mode:

image

@gpassero
Copy link

+1

@seanturner83
Copy link

+1

@kalexmills
Copy link

kalexmills commented Jul 7, 2018

Do you need to have shared drives set up to enable k8s persistent volumes? It asks me to share the c:\ drive whenever I try to create a PVC.

Seeing the same behavior as in #77 and I am not having success with setting up shared drives in Docker for Windows. Tried suggestions here: http://peterjohnlightfoot.com/docker-for-windows-on-hyper-v-fix-the-host-volume-sharing-issue/ and here: https://blogs.msdn.microsoft.com/stevelasker/2016/06/14/configuring-docker-for-windows-volumes/

Neither work.

@ghost
Copy link

ghost commented Jul 12, 2018

Invalid mode issue can be solved for me by replacing

C:/WhateverPath

with

/C/WhateverPath

Misleading error message, but there's an issue for that already here:

kubernetes/kubernetes#59876

@figaw
Copy link

figaw commented Oct 19, 2018

@pgayvallet Thank you for your comment, it totally works, how... do you know this? :)

I'm trying to figure out where the documentation is for this, but the only thing I can find is a reference in Docker for Windows Stable Release notes under Docker Community Edition 17.12.0-ce-win47 2018-01-12:

Fix Mount compatibility when mounting drives with -v //c/..., now mounted in /host_mnt/c in the LinuxKit VM. Fixes #1509, #1516, #1497

Thank you! (I'm only commenting here because the issue is still open.)

@docker-robott
Copy link
Collaborator

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale comment.
Stale issues will be closed after an additional 30d of inactivity.

Prevent issues from auto-closing with an /lifecycle frozen comment.

If this issue is safe to close now please do so.

Send feedback to Docker Community Slack channels #docker-for-mac or #docker-for-windows.
/lifecycle stale

@docker-robott
Copy link
Collaborator

Closed issues are locked after 30 days of inactivity.
This helps our team focus on active issues.

If you have found a problem that seems similar to this, please open a new issue.

Send feedback to Docker Community Slack channels #docker-for-mac or #docker-for-windows.
/lifecycle locked

@docker docker locked and limited conversation to collaborators Jun 26, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

8 participants