Demo REST API using Go. Easily deployable to Kubernetes.
First, in main.go
, change DbHost
to localhost
docker-compose up
docker run -d --name posts-api-go -e POSTGRES_USER=postgres-dev -e POSTGRES_PASSWORD=not-for-prod -e POSTGRES_DB=dev -v posts-api-go-data:/var/lib/postgresql/data -p 5432:5432 postgres:latest
go run main.go
- Starts @ http://localhost:8080
- Create a Kubernetes cluster, e.g. GKE
- Run
kompose convert
- Create a zip of the entire project folder
- Upload zip via Cloud Shell
- Unzip
chmod +x kubectl.sh
./kubectl.sh