Hello all,
I'm right in the middle of replacing 'nothing + Jenkins' with 'Skaffold + Argo workflows' for the company I work for. Idea was to unify local development and CI/CD pipeline as much as possible and to never again hear "but it works on my computer!" in my life. :) I chose Skaffold as that tool as it seemed like the best tool out of all those I've evaluated.
Configuration is fairly complex, I've split it into 7 different modules, 4 we are developing, so they have build and deploy sections, while 3 are third party (MSSQL, Redis, RabbitMQ), and they only have deploy sections. There is also a 'main' module that includes all 7 of the individual modules making the command that deploys everything into local k8s cluster:
skaffold dev --profile local --module main
At the same time CI server should be doing:
skaffold build --profile cluster --module api
in order to build and push built artifacts into container registry. The first part is working great, all that a new developer needs to do in order to get a fully functional app running locally is to install prerequisites and to run 'skaffold dev --profile local --module main'. Everything is super snappy as files are live reloaded into a running containers and the process inside watches for changes, building and reloading as necessary (e.g. CMD is set to 'dotnet watch -- run' or 'ng serve' for Dotnet and Angular services respectively).
Where I'm struggling currently is how to incorporate 'staffold debug' into the mix. Obviously debug only makes sense for local development, and ideally you would only want to debug 1 out of 7 modules, while the rest should continue to function normally.
Just running:
skaffold debug --profile local --module main
produces very subpar results.
One of the images I'm building contains highcharts-export-server (that's being installed with npm), that one gets correctly detected as nodejs app and gets replaced with a debug binary, however I have no intention of debugging this one. And there doesn't seem to be a good way to tell skaffold to ignore it, other than annotating the pod with '
debug.cloud.google.com/config: {}', but that would also block debugging of the second container in the same pod, and I do want to debug the second one.
All the dotnet images get incorrectly detected as jvm based just because of the fact that first environment variable Skaffold sees while scanning Dockerfile is JAVA_VERSION (I'm installing Java so Sonarqube Scanner would work correctly).
The whole debug command seems extremely rough around the edges right now. Looking at the issues in github (
https://github.com/GoogleContainerTools/skaffold/labels/area%2Fdebug) I see that people working are at least looking in the right direction, in my opinion minimum necessary would be to allow configuring debug mode inside skaffold.yml on a per-artifact basis. As in this is the runtime, do not debug this artifact as it's not necessary etc.
It's possible that I'm doing the whole thing wrong, I actually wanted to inquire if you can point me to some configuration in github or blog post or docs that has a working config for both 'skaffold dev/debug'. Seeing how others have solved this problem might point me in the right direction.
Other than that kudos to everyone working on development, Skaffold is shaping out to be an extremely useful tool, keep up the good work! :)