pkg/kube/quadlet: add podman kube quadlet subcommand#29081
Conversation
ac5efa0 to
cd02304
Compare
|
[NON-BLOCKING] Packit jobs failed. @containers/packit-build please check. Everyone else, feel free to ignore. |
Luap99
left a comment
There was a problem hiding this comment.
Why would this be needed when we have kube unit support already that just run directly from the yaml?
This is a lot of code for something that is already possible to do AFAICT.
| // The bind-mount source uses a relative path (./<name>.sh) so the generated | ||
| // unit files are self-contained: they work regardless of the directory they | ||
| // are placed in, relying on Quadlet's getAbsolutePath resolution. | ||
| func applyShellScript(unit *parser.UnitFile, script, prefix, name string) *GeneratedFile { |
There was a problem hiding this comment.
what does this actually do, why would this be needed, commands are contained in the image and a script should not be extracted anywhere and then bind mounted again.
There was a problem hiding this comment.
this handles the case where you have :
initContainers:
- name: init-disk-rootdisk
command: ["/bin/bash", "-c", "cp /disk/disk.img /var/run/.../rootdisk && chmod ..."]
in this case you do not have an image
and escaping gets complicated , thats why its extracted to a separate file
There was a problem hiding this comment.
That is a poor excuse, having sperate files that need to manage din addition of this makes this much more complicated. Anyhow lets not focus on the details when the main question do we need this.
There was a problem hiding this comment.
ill be happy to adjust per your comments but as you said lets first establish this is aligned with the project's goals
podman kube play was created back in 2019 as far as i know , quadlets were added to podman at 2023 as far as i know . |
Signed-off-by: Asaf Ben Natan <asafbennatan@gmail.com> Co-authored-by: Cursor <cursoragent@cursor.com>
cd02304 to
b4808b5
Compare
apologies - fixed commit and PR messages |
That does not answer my question. We do have kube units https://docs.podman.io/en/latest/markdown/podman-kube.unit.5.html, just put a single quadlet and kube file and there you go. No need to translate anything here. This here adds basically a completely new kube parser to all out existing kube logic which adds unnecessary duplication and makes maintance much harder long term which is why I am opposed to doing this when this is already possible. |
kube.unit is a shim for pod.yaml it does not express native quadlet hierarchy of networks , pods , containers etc |
|
I don't mind the concept of this at all - I'm personally very in favor of a Compose YAML to Quadlet compiler, and this is next door to that, conceptually. I do wonder if Podman is the right place, though. https://github.com/containers/podlet is where the existing state-of-the-art in Compose-to-Quadlet lives, and maybe this should be in there as well? Alternatively, we could say that both compilers should be in Podman, merge this, develop our own Compose compiler - there are definitely benefits to that, keeping everything in one tool, but it's also a duplication of effort that I'd prefer to avoid... |
|
(In short, I definitely like this idea, just not sure where the best place to put it is) |
is this related to podman in any way or community driven ? |
Personally I would have rather hard objection dragging in the entire compose spec into podman directly. As for adding this into podlet I agree this would sounds like a great idea if they are willing to accept this, podlet is not maintained by us so you would need to confirm this with their maintainers first if that is even wanted to them. |
this is useful for converting pod.yaml into first class systemd (quadlet) units .
the current kube play approach bypasses native qudlet constructs making it harder to manage.
the approach taken by podman kube play is understandable since it precedes quadlets .
i suspect that if this was done today - translating it to quadlets would have been the approach taken