Feature Request: ReversePortForward
For debugging PHP applications xdebug expects a client ip and port to connect back to when a session starts. Without reverse port forwarding this is very tricky to handle in a skaffold workflow.
I understand debugging have a lot of edgecases, but reverse port forwarding and some custom configuration would atleast make it possible when the skaffold supplied variants is not covered...
It has been requested here before, and Devspace.io seems to already include it, so there should be a "market" for the feature :) https://devspace.sh/cli/docs/configuration/development/reverse-port-forwarding https://github.com/GoogleContainerTools/skaffold/issues/4419 https://github.com/kubernetes/kubernetes/issues/20227
Expected behavior
a reversePortforward configuration option
Actual behavior
...
Information
- Skaffold version: 1.23
- Operating system: Fedora 34
- Installed via: skaffold.dev
- Contents of skaffold.yaml:
profiles:
- name: debug
activation:
- command: debug
patches:
- op: replace
path: /build/artifacts/0/docker/target
value: debug # dockerfile target with xdebug configuration
In the meantime I'm using ktunnel to debug PHP applications:
ktunnel expose --namespace=richard --tls xdebug-svc 9003
xdebug config:
zend_extension=xdebug
xdebug.mode =debug
xdebug.start_with_request = yes
; Kubernetes service injected by ktunnel:
xdebug.client_host = xdebug-svc
@briandealwis what do you think about this FR?
@Richard87 , do you think this approach would work with skaffold portForward technique?
Something like this:
- resourceType: service
resourceName: xdebug-svc
port: 9003
localPort: 9003
Of course I would have to create the service xdebug-svc. I'm using helm charts, so I think it would be interesting to use only skaffold in order to make the debug work.
Unfortunatly xdebug requires the reverse, we need to listen to a port in the cluster, and forward traffic there to the port listening locally.
Skaffold doesn't support that, so we are using ktunnel for that feature.
Running extra code in the cluster is something skaffold have never done, but I think it might be worthwile and might open for some interesting new possibilities!
Hi, do we have any update on this FR?
Currently the work here is not prioritized/on-the-roadmap for the direct Skaffold team as unfortunately we don't have the cycles to design and add such a feature currently. If anyone in this thread is open to adding this, please respond here. The likely first step would be to submit a PR with a design proposal at docs-v2/design_proposals