Go + Gin + Kubernetes

In this example, we use Cloud Native Build (CNB) to package a Go+Gin project into a Docker image and update the image version of specified pods in Tencent TKE using kubectl.
Prerequisites
- Use Cloud Native Build (CNB) to build your project
- Write a Dockerfile
- Understand Docker Artifact Registry
- Understand Environment Variables and their usage
- Use kubectl plugin to operate TKE cluster
- Configure .ide/Dockerfile for Cloud Native Development
Configuration Secrets
KUBECF: |
apiVersion: v1
xxxxxx
Quick Start
Install Dependencies
go get -u github.com/go-delve/delve/cmd/dlv
go install -v github.com/go-delve/delve/cmd/dlv@latest
Run Service
- Command line execution
go run main.go
- Debug Mode
- Click the "Run and Debug" icon in the activity bar on the left side of VS Code, select "Launch file" from the run and debug drop-down list, then click the green run button (or press F5 directly). View configuration