DEV Community

Cover image for Debug Kubernetes Operator-sdk v1.0.0 locally using Vscode
Austin Cunningham
Austin Cunningham

Posted on

2 2

Debug Kubernetes Operator-sdk v1.0.0 locally using Vscode

Wrote this some time ago debug-kubernetes-operator-sdk-locally-using-vscode but due to changes in the Operator-sdk it's not valid for version v1.0.0 and greater.

here are the Steps to get debug running with v1.0.0

  • Go to Run\Add Configuration
  • Select Go from environments
  • Select Go Launch package

add go config

You should get the following launch.json

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Launch Package",
            "type": "go",
            "request": "launch",
            "mode": "debug",
            "program": "${workspaceFolder}"
        }
    ]
}
Enter fullscreen mode Exit fullscreen mode
  • Add an env for WATCH_NAMESPACE in the configuration so it looks like
{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Launch Package",
            "type": "go",
            "request": "launch",
            "mode": "debug",
            "program": "${workspaceFolder}",
            "env": {
                "WATCH_NAMESPACE": "your-operator-namespace",                
            }
        }
    ]
}
Enter fullscreen mode Exit fullscreen mode

Debug should now work as expected

Alt Text

Thanks goes to Oleg Matskiv for sharing this with me.

Image of Timescale

🚀 pgai Vectorizer: SQLAlchemy and LiteLLM Make Vector Search Simple

We built pgai Vectorizer to simplify embedding management for AI applications—without needing a separate database or complex infrastructure. Since launch, developers have created over 3,000 vectorizers on Timescale Cloud, with many more self-hosted.

Read more →

Top comments (0)

Postmark Image

Speedy emails, satisfied customers

Are delayed transactional emails costing you user satisfaction? Postmark delivers your emails almost instantly, keeping your customers happy and connected.

Sign up