tall-greece-98310
11/25/2022, 5:47 PMcurved-intern-91221
11/28/2022, 12:54 PMtall-greece-98310
11/29/2022, 10:15 AMcold-jordan-68753
11/30/2022, 9:40 AMtall-greece-98310
11/30/2022, 12:18 PMbig-spring-14945
11/30/2022, 5:58 PMcurved-intern-91221
12/01/2022, 11:08 AMbrief-restaurant-63679
12/01/2022, 5:11 PMyaml
services:
devMode:
command:
- "/bin/sh"
- "-c",
- "watchexec -r -e java --debounce 1000 -- ./compile-and-run-my-code.sh # Tweak debounce depending on how slow the compile-and-run script is
watchexec
process in the remote container watches for those changes and responds to them, e.g. by compiling your code and then restarting your server.
- You can use the --debounce
flag so that it has time to compile and restart between changes.
You may also want to tweak liveness probes here if it takes a long time for the server to restart, so that K8s doesn't evict the pod in the meantime.tall-greece-98310
12/03/2022, 5:41 PMmillions-family-77940
01/08/2023, 8:52 PMcurved-intern-91221
01/09/2023, 12:03 PMquaint-dress-831
01/09/2023, 3:16 PMgdbserver
. Then you'd set up your sync folders between your local environment and remote environment. I do this with Python in this video: millions-family-77940
01/09/2023, 5:04 PMquaint-dress-831
01/09/2023, 5:07 PMbuild.targetImage
keyancient-diamond-80011
01/11/2023, 3:48 PMcargo watch
on it, and a separate dockerfile for the release deployment. let me know if this would work for you or if you need additional help!millions-family-77940
01/16/2023, 10:23 AMtall-greece-98310
01/20/2023, 8:36 AMdevspace
does things: if there was a way to detect if devMode is active for a service, then one could use a conditional for the image, so that it uses a separate dev image (with all the tooling required for that), that allows sync'ing files and all that, while not needing to touch the prod image (that shouldn't contain all that kind of stuff).
e.g. we could have two container builds that a helm module depends on (conditionally via template ternary test on devMode being active or not). one is a devMode one and a standard "deploy" one. then in the service we can again use a ternary conditional to specify the image used for the service etc.
Is there already a way to detect in a template if devMode is active? That'd be a killer addition I think.kubefwd
(https://kubefwd.com/) into the picture. It can even be started/stopped as part of the workflow or similar to ensure that at the point where the local mode service starts the local machine is able to access all DNS names and service ports just as if it had been running within the k8s cluster.
This is similar to how one would use mirrord
, but I believe easier to include in a smooth workflow since you don't need to know the name of any pods etc. Rely on garden
for the reverse port forwarding of traffic FROM cluster TO local service, and on kubefwd for portforwarding of traffic FROM local service TO cluster.