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

hostPath volumes? #109

Closed
kadel opened this issue Aug 17, 2016 · 14 comments
Closed

hostPath volumes? #109

kadel opened this issue Aug 17, 2016 · 14 comments

Comments

@kadel
Copy link
Member

kadel commented Aug 17, 2016

We use hostPath in volumes?
This doesn't really makes sense to me. When you are deploying to Kubernets cluster hostPath will never contain files that you have on your local machine from which you are running kompose. Unless you somehow copy them manually.
Another thing with hostPath is that even if you somehow upload you files to it, whenever pod is rescheduled to another node hostPath can contain completely different files.

Because of above I think that hostPath can confuse users instead of helping.

Ideally user should be able to choose which type of volume he/she wants (this will usually depend on his environment setup (gcePersistentDisk, awsElasticBlockStore, nfs ....)).

For now I propose using emptyDir, and displaying warning or some message explaining why this is. And that right now you can't copy content of local directory to cluster volume.

@janetkuo
Copy link
Member

For now I propose using emptyDir, and displaying warning or some message explaining why this is. And that right now you can't copy content of local directory to cluster volume.

You're right. Let's remove hostPath.

@xiaoping378
Copy link

i need the hostPaht, even if i copy them manually.
can i push a merged about adding --hostPath option?

@surajnarwade
Copy link
Contributor

@xiaoping378 , can you please explain your use case ?

@xiaoping378
Copy link

@surajnarwade
i'm try to run hyperledger fabric on the k8s, but the fabric samples has too many volumes, if kompose don't write hostpath, i will so plain to edit the k8s yaml.

@cdrage
Copy link
Member

cdrage commented Aug 2, 2017

Hey @kadel @surajnarwade @xiaoping378

I'm re-opening this issue for discussion.

As volumes are a very difficult area for converting, I suggest we add a different parameter, preferably, --volumes

For example, we'd have:

--volumes [none|host-path|empty,etc.]

What do you think?

@surajssd
Copy link
Member

@cdrage how does it help?
Or what is the requirement that will be solved with this feature? Adding this is only supporting anti-pattern in k8s world?

@cdrage
Copy link
Member

cdrage commented Aug 10, 2017

@surajssd Not exactly an anti-pattern, but more in regards to filling in the "blanks" between Kompose and its heavy use of volumes and the "PersistentVolumeClaim" method for Kubernetes.

Since we already have one parameter (emptyvols), it makes sense to combine them all into one parameter (volumes) so we don't have multiple similar params.

@surajssd
Copy link
Member

In most cases hostPath and emptyDir will behave the same because pod would not be scheduled on same node.

Behave the same means that it will most probably have empty storage.

Also hostPath is more error prone because user will have to make sure that path on the k8s node exists and container runtime has permissions to write there.

@cdrage
Copy link
Member

cdrage commented Aug 14, 2017

@kadel thoughts?

@kadel
Copy link
Member Author

kadel commented Aug 14, 2017

Adding --volumes [none|host-path|empty,etc.] and removing --emptyvols is good idea.
I would use Kubernetes naming so it should be emptyDir and hostPath.

But this will have one big limitation that might confuse pepole a bit.
If we add option for hostPath it means that all the volumes in given Dockerfile will be converted to hostPaths volumes. We need properly document and explain it in --help
I'm definetly agains adding some magic label or other logic that will allow specify this on per volume basic.
But global flag is OK.

@cdrage
Copy link
Member

cdrage commented Aug 16, 2017

@kadel

Okay, I will go through with it. First off is refactoring the code to --volumes and deprecating --emptyvols I shall also update and notify #734

@cdrage cdrage added this to the 1.1.0 release milestone Aug 16, 2017
@cdrage cdrage modified the milestones: 1.1.0 release, 1.2.0 release Aug 30, 2017
@cdrage cdrage modified the milestones: 1.3.0 release, 1.4.0 release Oct 10, 2017
@cdrage cdrage modified the milestones: 1.4.0 release, 1.5.0 release Oct 31, 2017
@cdrage cdrage removed this from the 1.5.0 release milestone Jan 24, 2018
@fejta-bot
Copy link

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

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

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jan 29, 2018
@surajnarwade
Copy link
Contributor

/remove-lifecycle stale

@k8s-ci-robot k8s-ci-robot removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Feb 8, 2018
@cdrage
Copy link
Member

cdrage commented Mar 19, 2018

This has been fixed in #957

@cdrage cdrage closed this as completed Mar 19, 2018
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

9 participants