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

Play kube support for volumes created with podman volume create #5788

Closed
frezbo opened this issue Apr 10, 2020 · 26 comments · Fixed by #9749
Closed

Play kube support for volumes created with podman volume create #5788

frezbo opened this issue Apr 10, 2020 · 26 comments · Fixed by #9749
Assignees
Labels
Good First Issue This issue would be a good issue for a first time contributor to undertake. kind/feature Categorizes issue or PR as related to a new feature. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.

Comments

@frezbo
Copy link

frezbo commented Apr 10, 2020

Play kube support for volumes created with podman volume create

/kind feature

Description
Play kube support for volumes created with podman volume create

@openshift-ci-robot openshift-ci-robot added the kind/feature Categorizes issue or PR as related to a new feature. label Apr 10, 2020
@rhatdan rhatdan added the Good First Issue This issue would be a good issue for a first time contributor to undertake. label Apr 13, 2020
@rhatdan
Copy link
Member

rhatdan commented Apr 13, 2020

This currently does not work? What happens?
@kunalkushwaha @sujil02 PTAL

@mheon
Copy link
Member

mheon commented Apr 13, 2020

We have support for bind-mount (and I think tmpfs) volumes, but not named volumes. Those generate additional bits of Kubernetes YAML, which we have to deal with in both generate kube and play kube (and there was some debate as to exactly what YAML was required). Probably not particularly difficult, but someone more familiar with Kube would be a good fit for this.

@kunalkushwaha
Copy link
Collaborator

I can look into this.

@github-actions
Copy link

A friendly reminder that this issue had no activity for 30 days.

@rhatdan
Copy link
Member

rhatdan commented May 15, 2020

@kunalkushwaha Any progress on this?

@rhatdan
Copy link
Member

rhatdan commented May 15, 2020

@mheon @haircommander Any ideas on this?

@mheon
Copy link
Member

mheon commented May 15, 2020

On our end, the real difficulty is figuring out the format for Kube volume YAML. Once we have that, I think it's a pretty simple mapping.

@haircommander
Copy link
Collaborator

named volumes sound like emptyDir. am I correct in saying so?

@mheon
Copy link
Member

mheon commented May 15, 2020

Hmm. That does sound pretty close. I'll take a look.

@frezbo
Copy link
Author

frezbo commented May 15, 2020

@haircommander That seems fine to me too, since podman runs on the host.

@rhatdan
Copy link
Member

rhatdan commented Jun 9, 2020

@ryanchpowell Could you work with @haircommander on this?

@rhatdan
Copy link
Member

rhatdan commented Sep 10, 2020

@mheon @ashley-cui Could you take a look?

@xordspar0
Copy link
Contributor

The problem with emptyDir is that its lifetime is the same as the pod. When the pod is created, a new empty volume is created. When the pod is destroyed, the volume is deleted forever. emptyDir is a scratch space for running applications. It's similar to /tmp, and it can optionally be memory-backed, similar to /tmp.

podman volumes are independent of pods; they can be created and destroyed on their own. This is more similar to Kubernetes PersistentVolumeClaims, which is an API designed for abstracting over vendor-specific storage like S3 or Google Cloud Storage.

@aodhan-domhnaill
Copy link

I opened a PR to support this. I am trying to figure out how to write unit tests for this. Any guidance would be appreciated. I'm a bit stuck trying to figure out how to mock the Runtime.

@AlbanBedel
Copy link
Contributor

Using named volume in kube files is already possible, just use a hostPath volume with pathset to the volume name. This is working just fine for me:

  volumes:
    - name: app-data
      hostPath:
        path: my-named-volume
        type: Directory

@mheon
Copy link
Member

mheon commented Nov 11, 2020

If that works, I'd consider it more of a bug than a feature... I'm not saying we'll fix it, but if it breaks, fixing it will not be a priority.

@mheon
Copy link
Member

mheon commented Nov 30, 2020

#8497 merged and added support for persistent volume claims (backed by named volumes) to play kube. We do not, however, have support for this in generate kube yet, so I'll leave this open until that can be added.

@frezbo
Copy link
Author

frezbo commented Dec 18, 2020

@mheon I can we can close this issue now. Kudos for implementing the fixes 👍 ❤️ Sorry for not being around.

@vrothberg vrothberg reopened this Dec 18, 2020
@rhatdan
Copy link
Member

rhatdan commented Dec 18, 2020

@frezbo We still don't have generate kube according to @mheon .

@github-actions
Copy link

A friendly reminder that this issue had no activity for 30 days.

@rhatdan
Copy link
Member

rhatdan commented Jan 26, 2021

@mheon this is probably something you need to do.

@mheon mheon removed their assignment Feb 11, 2021
@mheon
Copy link
Member

mheon commented Feb 11, 2021

Unassigning myself, I don't think I'm going to have time for this any time soon. Hopefully the New First Issue label will attract contributors?

@github-actions
Copy link

A friendly reminder that this issue had no activity for 30 days.

@rhatdan
Copy link
Member

rhatdan commented Mar 15, 2021

@umohnani8 PTAL

@jwillikers
Copy link
Contributor

I just a came across a situation where having the generate behavior would be helpful.
I should be able to add this functionality later this week.

@xordspar0
Copy link
Contributor

This has been on my to do list for a long time, and it just worked its way up to the top. @jwillikers, please go ahead and work on this, it would save me some work! But I'll probably get to it next week if no one is working on it at that time.

jwillikers added a commit to jwillikers/podman that referenced this issue Mar 19, 2021
Fixes containers#5788

This commit adds support for named volumes in podman-generate-kube.
Named volumes are output in the YAML as PersistentVolumeClaims.
To avoid naming conflicts, the volume name is suffixed with "-pvc".
This commit adds a corresponding suffix for host path mounts.
Host path volumes are suffixed with "-host".

Signed-off-by: Jordan Williams <jordan@jwillikers.com>
mheon pushed a commit to mheon/libpod that referenced this issue Mar 29, 2021
Fixes containers#5788

This commit adds support for named volumes in podman-generate-kube.
Named volumes are output in the YAML as PersistentVolumeClaims.
To avoid naming conflicts, the volume name is suffixed with "-pvc".
This commit adds a corresponding suffix for host path mounts.
Host path volumes are suffixed with "-host".

Signed-off-by: Jordan Williams <jordan@jwillikers.com>
jmguzik pushed a commit to jmguzik/podman that referenced this issue Apr 26, 2021
Fixes containers#5788

This commit adds support for named volumes in podman-generate-kube.
Named volumes are output in the YAML as PersistentVolumeClaims.
To avoid naming conflicts, the volume name is suffixed with "-pvc".
This commit adds a corresponding suffix for host path mounts.
Host path volumes are suffixed with "-host".

Signed-off-by: Jordan Williams <jordan@jwillikers.com>
@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Sep 22, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 22, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Good First Issue This issue would be a good issue for a first time contributor to undertake. kind/feature Categorizes issue or PR as related to a new feature. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.
Projects
None yet