2

My app is written in go and is packaged in a helm chart which is deployed on the k3s cluster.

I am able to use skaffold to deploy to the k3s cluster. I am also able to deploy to the cluster using Google Cloud Code VS Code Extension. However, if I set a break point in my main.go, the debugger never hands me control and simply continues execution. Below is my launch.json

{
    "configurations": [
        {
            "name": "Kubernetes: Run/Debug",
            "type": "cloudcode.kubernetes",
            "request": "launch",
            "skaffoldConfig": "${workspaceFolder}/skaffold.yaml",
            "watch": true,
            "cleanUp": true,
            "portForward": true,
            "imageRegistry": "docker_image_registry"
        },
        {
            "name": "Attach to Kubernetes Pod (Go)",
            "type": "cloudcode.kubernetes",
            "request": "attach",
            "language": "Go",
            "debugPort": 2345,
            "podSelector": {
                "app": "collector"
            },
            "localRoot": "${workspaceFolder}",
            "remoteRoot": "/opt/remote_root"
        }
    ]
}

The first configuration works well. Please can someone help me get the Attach to Kubernetes Pod (Go) configuration to work.

Jonathan Hall
  • 75,165
  • 16
  • 143
  • 189
Moses
  • 611
  • 5
  • 20
  • Are you using the "Debug on Kubernetes" command from within the Cloud Code extension in VSCode? Does that deployment fully succeed and proceed to the Streaming Logs step? Could you also check the "Cloud Code" logs in the outputs window in case there was an error thrown somewhere? – Sebastian Krupa Mar 06 '23 at 21:46

0 Answers0