devspace-sh / devspace

DevSpace - The Fastest Developer Tool for Kubernetes ⚡ Automate your deployment workflow with DevSpace and develop software directly inside Kubernetes.
https://devspace.sh
Apache License 2.0
4.18k stars 351 forks source link

Default profile for `devspace dev` #1507

Open nVitius opened 2 years ago

nVitius commented 2 years ago

Is your feature request related to a problem? I've been using dev.replacePods to add local env variables to my containers. My only issue with this approach is that it scales the deployment down to 0 and creates a pod outside of it. This makes it a bit difficult to restart these pods when needed.

Instead, I would like to define a profile called dev and use the profile.patches to add my env variables this way instead.

Which solution do you suggest? It would be great to have a dev.profile property where you could set a default profile when running devspace dev

Which alternative solutions exist? This is already possible by specifying the profile explicitly in the command (e.g. devspace dev -p dev). This wouldn't be an issue, but I can see it being annoying if you forget to add the profile or perhaps it isn't communicated that it is necessary.

Additional context I'd be glad to work on this if someone would point me in the right direction. I haven't worked with Golang before and am having a hard time understanding where everything is in the codebase.

/kind feature

FabianKramm commented 2 years ago

@nVitius thanks for creating this issue! Did you try to use the devspace use profile command which sets a default profile? That should be very similar to what you want to achieve.

echozio commented 2 years ago

This feature would be very useful to have in some situations where we want to make larger changes to the deployment when invoked with devspace dev that are not otherwise necessary when invoked as a dependency or just deployed for testing.

Since expressions aren't supported in profiles[].activation and activations.env.1=dev aren't possible I don't currently see any good way to achieve this.