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

Kubernetes doesn't have a same feature as Docker's volumes-from #103814

Closed
lojies opened this issue Jul 21, 2021 · 7 comments
Closed

Kubernetes doesn't have a same feature as Docker's volumes-from #103814

lojies opened this issue Jul 21, 2021 · 7 comments
Labels
kind/feature Categorizes issue or PR as related to a new feature. kind/support Categorizes issue or PR as a support question. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. sig/node Categorizes an issue or PR as relevant to SIG Node.

Comments

@lojies
Copy link
Contributor

lojies commented Jul 21, 2021

What would you like to be added:

For example, there is a data volume in the docker image, it can be userd by another container directly through --volumes-from.
Dockerfile like:
FROM ubuntu
MAINTAINER hello
VOLUME ["/data"]

docker run --name test1 -it myimage /bin/bash
docker run --name test2 -it --volumes-from test1 ubuntu /bin/bash

I want to share data between containers in the same pod.For example, pod have two containers: containerA and containerB. containerA has a tool git and i want to use it in containerB. Volume emptyDir seems can do this, but i need copy git to the volume path and then containerB can use it.
Can someway omit copy?Because copy may cause cpu and io high and make some warning.

Why is this needed:

@lojies lojies added the kind/feature Categorizes issue or PR as related to a new feature. label Jul 21, 2021
@k8s-ci-robot k8s-ci-robot added the needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. label Jul 21, 2021
@k8s-ci-robot
Copy link
Contributor

@lojies: This issue is currently awaiting triage.

If a SIG or subproject determines this is a relevant issue, they will accept it by applying the triage/accepted label and provide further guidance.

The triage/accepted label can be added by org members by writing /triage accepted in a comment.

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.

@k8s-ci-robot k8s-ci-robot added the needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. label Jul 21, 2021
@lojies
Copy link
Contributor Author

lojies commented Jul 21, 2021

/sig node

@k8s-ci-robot k8s-ci-robot added sig/node Categorizes an issue or PR as relevant to SIG Node. and removed needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Jul 21, 2021
@endocrimes
Copy link
Member

/kind support

Sharing contents of containers is a pretty different problem to sharing data between them. Is there a reason you can't include the tool inside the container that needs it?

@k8s-ci-robot k8s-ci-robot added the kind/support Categorizes issue or PR as a support question. label Jul 21, 2021
@lojies
Copy link
Contributor Author

lojies commented Jul 22, 2021

/kind support

Sharing contents of containers is a pretty different problem to sharing data between them. Is there a reason you can't include the tool inside the container that needs it?

For example, i need to use jdk in containers, but for the security reason, the jdk need to be upgraded frequently.But my app is upgraded less, i don't want to build image frequently.So if data can be shared between containers like docker, i can only change docker images.

@endocrimes
Copy link
Member

I'd definitely not recommend doing that - Rebuilding the single image usually also means that you can validate your application with new versions of dependencies prior to deploying them to your clusters.

Trying to share dependencies across different containers is always going to be somewhat painful and difficult to manage over time.

You could use multi-stage builds, or copy an externally built application binary into a container during its build process for example to minimize rebuild time if that's what you're worried about there.

@endocrimes
Copy link
Member

/close

@k8s-ci-robot
Copy link
Contributor

@endocrimes: Closing this issue.

In response to this:

/close

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Categorizes issue or PR as related to a new feature. kind/support Categorizes issue or PR as a support question. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. sig/node Categorizes an issue or PR as relevant to SIG Node.
Projects
None yet
Development

No branches or pull requests

3 participants