PHP debugging with Kubernetes on WSL
We recently switched from Docker to Kubernetes. With Docker it is possible to run a debugger by setting up the CLI to run the PHP container through the Docker API. With Kubernetes there is no such API and additionally Windows users us Ubuntu on WSL to have the same workflow as other developers working on a Unix system. Because with minikube we no longer require Docker, not every developer has that installed anymore.
Is there some way to enable a connection between PHPStorm and the local Kubernetes cluster so that we are able to run a CLI interpreter for debugging again?
请先登录再写评论。
Unfortunately, no, there's no support for Kubernetes in PhpStorm: https://youtrack.jetbrains.com/issue/WI-43032
The only option here is that you expose the container's SSH to the host.
How would you go about that? I can't get it to work on my local machine. Hopefully I'm approaching it the wrong way. I have tried the following:
I am currently all out of ideas. Could you help me out here?
It would be more convenient if it would be able to run it through kubectl with the name of the service. Any idea when support will be added?
I figured it out. Instead of the exposed port you need to use the assigned NodePort or the ssh-server should be injected as side-car. For now we moved with the NodePort approach and specified the port number in the manifest, but a future release of Okteto will enable ssh login on a specifyable port number.