-
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
Port forwarding does not work with ko builder #6995
Comments
Note that adding this in portForward:
- resourceType: deployment
resourceName: test-skaffold
namespace: default
port: 56268
address: 0.0.0.0
localPort: 56268
does the trick; but I think that this should not be done explicitly, like with docker builder where this is not required. |
@halvards any chance you might have some more context on this? Nothing immediately comes to mind as to why this might be happening |
Thanks for opening this issue @norbjd, and for including a repo that reproduces the issue! It seems that if the image placeholder name uses the In the meantime, you can get the expected port forwarding behavior by removing the |
@halvards Thanks for the help 🙌 Actually, to make it work we only need to remove To be fair, I don't know why I include build:
artifacts:
- image: my-simple-go-app
ko: {} But yes, the port forwarding behavior is weird in the case we include |
Great to hear @norbjd!
|
This change ensures that images with the `ko://` prefix have the `dlv` debug port forwarded by default when running `skaffold debug`. The image build process sanitizes the image name by removing the `ko://` prefix and lowercasing the Go import path. This means that the built image name doesn't match the placeholder values in the Kubernetes manifest files. This change sanitizes the image placeholder values from the Kubernetes resource files when matching with the built image names, which in turn means that Skaffold sets up port forwarding. Fixes: GoogleContainerTools#6995
This change ensures that images with the `ko://` prefix have the `dlv` debug port forwarded by default when running `skaffold debug`. The image build process sanitizes the image name by removing the `ko://` prefix and lowercasing the Go import path. This means that the built image name doesn't match the placeholder values in the Kubernetes manifest files. This change sanitizes the image placeholder values from the Kubernetes resource files when matching with the built image names, which in turn means that Skaffold sets up port forwarding. Fixes: #6995
Expected behavior
When using ko builder, any of the following commands:
should expose the debugging port (default 56268) locally, i.e. port forwarding should work.
Actual behavior
None of the previous commands port forwards the debugging port, nor deployment port (in the case of
skaffold debug --port-forward=pods
,skaffold debug --port-forward=user
, orskaffold run --port-forward
).It is like skaffold never port forwards anything with ko builder.
Information
Steps to reproduce the behavior
cd ko && SKAFFOLD_DEFAULT_REPO=<replace with repo> skaffold debug
Logs does not show errors, but does not port forward debug port (I have also tried with
skaffold debug --port-forward
).It is noticeable that debug port is correctly exposed in deployment (see
containerPort: 56268
in resulting deployment):The text was updated successfully, but these errors were encountered: