Open anthonyalayo opened 1 year ago
@anthonyalayo thanks for the feature request. we will consider and triage this.
Thank you! I updated the description for clarity.
Hi @anthonyalayo to see if you can get unblocked in the interim:
In scenario 2, disabling deployment checks as well as setting suspend=y
were not sufficient to debug start up code? It seemed to work in my tests (using the Cloud Code supplied Java hello-world sample in the New Project wizard - https://github.com/GoogleCloudPlatform/cloud-code-samples/blob/v1/java/java-hello-world/kubernetes-manifests/hello.deployment.yaml#L26).
Of course port forwarding failed. But, I was then able to run kubectl port-forward [my-pod] 8080:8080
and debug the service itself. Not ideal, but at the moment Cloud Code doesn't have configurable port-forwarding as you observed. Also ideally Skaffold itself would support suspending (https://github.com/GoogleContainerTools/skaffold/issues/4870).
Of course port forwarding failed. But, I was then able to run kubectl port-forward [my-pod] 8080:8080 and debug the service itself. Not ideal, but at the moment Cloud Code doesn't have configurable port-forwarding as you observed.
I see, you manually port forwarded in a terminal after it failed. Was the IDE able to pick that up and hit breakpoints?
Also ideally Skaffold itself would support suspending (https://github.com/GoogleContainerTools/skaffold/issues/4870).
Agreed, thanks for pointing out that ticket. Either or would solve the problem here. Considering that the linked issue was opened over 2 years ago, I have less confidence that Skaffold support would get implemented.
Was the IDE able to pick that up and hit breakpoints?
yes it was.
I don’t know that there is a great solution here without Skaffold involvement. Skaffold controls the port-forwarding as well as the debug instrumentation (so making “suspend” configurable will require a change there too). I will check with them if any progress has been made.
Thank you!
I have a spring boot java service using cloud code. I want to debug the server start sequence, but there is no way to do it.
Scenario 1
Scenario 2
At present, how can I debug startup code in a server that occurs before readiness/liveness probes in cloud code?
If there was a button, or a delay, that I could configure for port forwarding to kick in, this would be solved. I could add
suspend=y
for the java debug agent, and have my port forwarding happen after X seconds.Expected Behavior
I can control when port forwarding URLs occurs when using "Develop on Kubernetes".
Actual Behavior
I can not control when port forwarding URLs occurs when using "Develop on Kubernetes".
Additional Information