DEV Community

Lloyd Smith
Lloyd Smith

Posted on

kubernetes development tools

I was reading pseudo-random New Relic documentation on distributed tracing and somehow saw mention of a tool called skaffold.

Long story short, it replaces a bunch of bespoke commands in my Makefile to make dev.

It watches the files copied into images and if you change any of them, it automatically rebuilds the appropriate container, etc.

It also sets up the port forwarding -- something I occasionally forgot to do with the old system.

Run skaffold without tearing down the database when you exit (keeps your persistent volume claims and maybe other stuff):

skaffold dev --cleanup=false
Enter fullscreen mode Exit fullscreen mode

Trigger Manual is nice when you don't want it to rebuild with every edit (possibly breaking the test environment, which others could be using). You click in the terminal running skaffold and hit "Enter" and it will rebuild with this mode.

skaffold dev --cleanup=false --trigger=manual
Enter fullscreen mode Exit fullscreen mode

As I was developing an MCP server and testing it with actual clients, I wanted to run the dev environment as close to production as possible and using minikube made this a cinch! I didn't have skaffold in those days and I'd be Ctrl+C and arrow-up or reverse-search (Ctrl+R) to get my serve command. And then forget the port forwarding or some other aspect. Also, it would build everything instead of just the changed components. It was fast enough as the Dockerfiles were using multi-stage build with cached layers, but skaffold is even better!

Top comments (0)