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

Be able to generate Deployment with podman generate kube #17712

Closed
cdrage opened this issue Mar 8, 2023 · 11 comments · Fixed by #17950
Closed

Be able to generate Deployment with podman generate kube #17712

cdrage opened this issue Mar 8, 2023 · 11 comments · Fixed by #17950
Labels
kind/feature Categorizes issue or PR as related to a new feature. kube locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. podman-desktop

Comments

@cdrage
Copy link

cdrage commented Mar 8, 2023

Feature request description

When using Podman, I'd like to generate a Deployment for Kubernetes using my Pods.

Unlike in Podman, pods in Kubernetes are immutable and disposable.

So if I were to deploy the YAML and my node restarts, that Pod will be completely gone.

Suggest potential solution

Be able to have the ability to create a Deployment

Have you considered any alternatives?

I used https://github.com/kubernetes/kompose to generate the Kubernetes YAML instead, by converting my pod to a Compose spec file and then to Kubernetes.

But it'd be nice to have this built-in to podman instead.

Additional context

Add any other context or screenshots about the feature request here.

@cdrage cdrage added the kind/feature Categorizes issue or PR as related to a new feature. label Mar 8, 2023
@vrothberg
Copy link
Member

@cdrage can you elaborate on your thoughts? Why is important and how do you expect it to work and behave?

That should help understand what to do and how it should behave etc.

@cdrage
Copy link
Author

cdrage commented Mar 13, 2023

@cdrage can you elaborate on your thoughts? Why is important and how do you expect it to work and behave?

That should help understand what to do and how it should behave etc.

I think it's important because:

  • podman kube play you're able to "play" deployments from Kubernetes YAML. It should also be symmetrical that you can also generate deployment with podman kube generate
  • Pods are immutable / disposable in the Kubernetes world and realistically, the only time you are ever deploying a Pod directly is for debugging purposes. By default Kubernetes does Deployment. podman kube generate provides little value to a Kubernetes developer other than a POC

IMHO podman kube generate should be creating Deployments by default. But it'd be nice to have a flag to be able to generate either pod or deployment from podman kube generate

@deboer-tim
Copy link

+1. Even though podman is just dealing with pods, deployments are really the 'standard' Kubernetes artifact and we feel it's better to generate a basic deployment containing a pod vs just the pod. Either way there should be a flag to generate whatever is not the default option.

In terms of the symmetrical behaviour, podman kube play should be able to play a deployment (likely warning if there are multiple replicas which it would ignore).

@vrothberg
Copy link
Member

Thanks!

@mheon @umohnani8 @baude , that's a priority for the desktop folks

@baude
Copy link
Member

baude commented Mar 14, 2023

I'm amenable to the consideration. Could you provide 1 or 2 legitimate/working YAML files as examples?

@rhatdan
Copy link
Member

rhatdan commented Mar 15, 2023

Yes then we can add a --deployment flag to play kube with it defaulted to true? But this would break backwards compatibility.

@ashley-cui
Copy link
Member

Maybe we can do it, but keep the pod as the default. Probably good to add a containers.conf section on it though, to change the default?

@rhatdan
Copy link
Member

rhatdan commented Mar 15, 2023

SGTM

@umohnani8
Copy link
Member

I can get started on a design doc for this. It should be pretty straightforward to use what we already have to generate a pod for a deployment instead.
A deploymentSpec is the podSpec with a few more fields, so what we really need to decide on is which deployment specific fields we want to populate during kube generate. Here is the API for reference https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.19/#deploymentspec-v1-apps

@baude
Copy link
Member

baude commented Mar 16, 2023

thank you @umohnani8

@rhatdan
Copy link
Member

rhatdan commented Mar 16, 2023

Are any required? I think generating them commented out would be fine. Play kube should work with both a deployment and a kubespec.

@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 Aug 28, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 28, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/feature Categorizes issue or PR as related to a new feature. kube locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. podman-desktop
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants