loft-sh / devpod

Codespaces but open-source, client-only and unopinionated: Works with any IDE and lets you use any cloud, kubernetes or just localhost docker.
https://devpod.sh
Mozilla Public License 2.0
8.42k stars 305 forks source link

Unable to assign a label for pods #1134

Open Iyappanj opened 1 week ago

Iyappanj commented 1 week ago

Is your feature request related to a problem?
Yes, I am unable to get the exact pod name of the pod created using devpod. I want to create a automation for creation of pod, service and ingress. to do this I need someway to get the pod name or alteast assign a label at every devpod up command

Which solution do you suggest?
Devpod up command should give an option to set the label on each devpod up command

Which alternative solutions exist?
No Idea

Additional context

pascalbreuninger commented 1 week ago

Hey @Iyappanj, thanks for opening the issue. You can always add labels to a workspace with the kubernetes provider and the LABELS option.

Iyappanj commented 6 days ago

@pascalbreuninger Thanks for the hint. I already have seen this label in provider level like the below

devpod provider set-options kubernetes --option etc....

But I am trying to set a dynamic label for each container in runtime, is there a way I can set the label in the devpod up command ? if so can you show some examples

Also is it possible to provide a unique name to the pod? I tried with option -id and it take only 10 characters from my input

Thanks in Advance

pascalbreuninger commented 6 days ago

is there a way I can set the label in the devpod up command ?

Yes, by running devpod up ... --provider-option=LABELS=YOUR_LABEL_HERE. This will overwrite the provider option for this workspace.

Also is it possible to provide a unique name to the pod?

The pod names should be unique eventually, if you want to customize them you're responsible for their uniqueness. Something like combining a base string with 5-6 random characters should work