Debug Kubernetes Operator-sdk locally in Goland

This is a follow on from this article setting up the operator-sdk debug in vscode.

Setup Goland to debug

The setup for Goland is pretty similar to Vscode.

Delve is a debug tool for golang, it can be downloaded here or by just using go

go get -u github.com/go-delve/delve/cmd/dlv

In Goland go to `Run\Edit Configurations…`

Click on the Plus symbol `+` and add `Go Remote` add a Name and click `Apply` the defaults are fine

You need to run delve with the command line switch `enable-delve` on the `up local` command
e.g. The operator I am working on is called `integreatly-operator` so the commands to run it are as follows

NOTE: command changed with v0.15.0

operator-sdk run --local --namespace=integreatly-operator

Click on `Run\Debug ‘whatYouCallYourGoRemote’`

Goland will start to debug and stop at your breakpoints.

Senior Software Engineer at Red Hat https://austincunningham.ddns.net

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Becoming A Multilingual Super Hero In Django: Part 3

Theming with CSS Variables

Useful tips when developing an application using Google Maps

MySQL — Installation and Configuration

Practical Monitoring with Prometheus & Grafana (Part IV)

How To Count Files Per Folder With Powershell

An Intuitive Understanding on Tensor Sum Dimension with Pytorch

Creating a Local test environment: Installing CentOs to VirtualBox & Troubleshooting

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Austin Cunningham

Austin Cunningham

Senior Software Engineer at Red Hat https://austincunningham.ddns.net

More from Medium

How to upgrade Golang version in Linux?

Running two Kubernetes Operators locally

Using GitLab Private Go Package On Your Local Setup and CI 🚀

Deploying a simple web server on Kubernetes

A member of the Borg collective from Star Trek TNG