-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adds support for debug
for Helm
#4732
Adds support for debug
for Helm
#4732
Conversation
Codecov Report
@@ Coverage Diff @@
## master #4732 +/- ##
==========================================
- Coverage 73.85% 73.68% -0.17%
==========================================
Files 347 348 +1
Lines 13796 13899 +103
==========================================
+ Hits 10189 10242 +53
- Misses 2972 3014 +42
- Partials 635 643 +8
Continue to review full report at Codecov.
|
8dece20
to
23bec07
Compare
cmd/skaffold/app/cmd/debug.go
Outdated
@@ -37,14 +46,70 @@ func NewCmdDebug() *cobra.Command { | |||
WithLongDescription("Similar to `dev`, but configures the pipeline for debugging."). | |||
WithCommonFlags(). | |||
WithHouseKeepingMessages(). | |||
WithFlags(func(f *pflag.FlagSet) { | |||
// --filter and --build-artifacts are used to support debug for Helm and are internal | |||
f.BoolVar(&filtering, "filter", false, `Filter manifests from stdin for debugging similar to "skaffold debug".`) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: since skaffold debug --filter
only writes the modified manifests to StdOut
and doesn't do anything else should the flag be called filter-only
or render-only
or something which makes it obvious?
@@ -254,15 +254,15 @@ var flagRegistry = []Flag{ | |||
Value: &opts.KubeContext, | |||
DefValue: "", | |||
FlagAddMethod: "StringVar", | |||
DefinedOn: []string{"build", "debug", "delete", "deploy", "dev", "run"}, | |||
DefinedOn: []string{"build", "debug", "delete", "deploy", "dev", "run", "filter"}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This feels weird, but we do derive the local docker daemon from the kube-context (e.g., minikube)
|
this is really close, looks like you have one file that needs a rebase. I also see this "error" when running locally after ending my session with ctrl+c:
but when I monitor my workloads in cloud console, things are being created/deleted correctly so nothing seems to actually be going wrong, and skaffold is exiting with code 0. any idea why that's happening? |
@nkubala which version of Helm are you using? $ cd examples/helm-deployment
$ helm version
version.BuildInfo{Version:"v3.3.1", GitCommit:"249e5215cde0c3fa72e27eb7a30e8d55c9696144", GitTreeState:"clean", GoVersion:"go1.14.7"}
$ skaffold debug --port-forward
[...]
Starting deploy...
Helm release skaffold-helm not installed. Installing...
NAME: skaffold-helm
LAST DEPLOYED: Tue Sep 15 11:07:37 2020
NAMESPACE: default
STATUS: deployed
REVISION: 1
TEST SUITE: None
Waiting for deployments to stabilize...
- deployment/skaffold-helm: waiting for rollout to finish: 0 of 1 updated replicas are available...
- deployment/skaffold-helm is ready.
Deployments stabilized in 5.99460414s
Press Ctrl+C to exit
Not watching for changes...
Port forwarding pod/skaffold-helm-7f4866968f-fv6l8 in namespace default, remote port 56268 -> address 127.0.0.1 port 56268
[install-go-support] Installing runtime debugging support files in /dbg
[install-go-support] Installation complete
[skaffold-helm] API server listening at: [::]:56268
[skaffold-helm] Hello world! 0
[skaffold-helm] Hello world! 1
^CCleaning up...
release "skaffold-helm" uninstalled Tried Helm 3.1.2 and don't see anything different. |
sorry I meant to put that in there but forgot to copy-paste :)
|
@nkubala I tried against GKE with Helm 3.2.2 (admittedly not 3.2.4) and I can't reproduce. |
yeah i tried again on a different cluster and on minikube and i can't get it to happen - something is weird with the cluster i was testing on. don't worry about it |
Fixes: #2350
Related: #4704
Description
This PR adds support for
skaffold debug
for Helm deploys. It requires Helm 3.1.0 or later as the implementation requires using Helm 3.1's--post-renderer
flag.Basically the implementation is in two parts:
skaffold filter
, which supports--build-artifacts=xxx
and--debugging
. This command takes in a set of Kubernetes manifests on stdin and performs a set of transforms on the images listed inbuild-artifacts
, or all images found if no images are provided.helm
with Skaffold as a post-renderer. It uses theSKAFFOLD_CMDLINE
facility from Add SKAFFOLD_CMDLINE environment variable to pass command-line #4704 to cause Skaffold to run withfilter --debugging --build-artifacts=xxx
, such that Skaffold then debug-ifies the Helm-produced manifestsUser facing changes (remove if N/A)
skaffold debug