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

Problems of converting volumes #75

Closed
janetkuo opened this issue Aug 2, 2016 · 4 comments
Closed

Problems of converting volumes #75

janetkuo opened this issue Aug 2, 2016 · 4 comments
Assignees

Comments

@janetkuo
Copy link
Member

janetkuo commented Aug 2, 2016

A few problems I discovered specific to volumes:

  1. In kompose conversion logic, a volume is created as read-only by default. However, in Kubernetes spec, container volumeMounts is read-write by default; same as docker-compose (I believe so from looking at the file format, please correct me if not).
  2. We create emptyDir for volumes, but if host is specified (i.e. HOST:CONTAINER, see spec), shouldn't we use hostPath instead?
  3. We create a random string (length of 20) for volume names, which it's not readable; also, volume names defined in docker-compose.yml file is ignored.
@ngtuna
Copy link
Contributor

ngtuna commented Aug 3, 2016

Thanks @janetkuo for pointing this out. This is an important part of kompose conversion. Firstly I would say the current volume conversion was outdated a little bit. I just have a quick look at this.

  1. Originally compose defined a volume is in ro mode by default (correct me if I am wrong). Now I see it set to rw mode.
  2. I believe there was something missing on volume part when I did refactoring app.go. Take a look into the original code: https://github.com/skippbox/kompose/blob/9bdc4cf2dd516590135cd12bd6bf27816f0bbffd/cli/app/app.go#L415. I will check your PR immediately.
  3. Volume name is not defined in compose v1 format. That's why I created random name. Now with v2 we have named volume. Could you add a switch/check for volume conversion if the compose file is version 1 or 2 as there are some options in volume definition of compose v2 I haven't covered yet.

@janetkuo
Copy link
Member Author

janetkuo commented Aug 3, 2016

I looked closer at the spec and libcompose, the v2 volume you mentioned are in Project.VolumeConfigs, which we don't support. The logic I added in #78 is to parse Project.ServiceConfigs.Volumes and use the volume name specified there.

We should add warnings for not supporting VolumeConfigs too (we don't have that yet).

@ngtuna
Copy link
Contributor

ngtuna commented Aug 6, 2016

@janetkuo Can we close this issue by your merged PRs?

@janetkuo
Copy link
Member Author

janetkuo commented Aug 6, 2016

Yes

@janetkuo janetkuo closed this as completed Aug 6, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants