Create a robust Golang service, deploy it using Docker and Kubernetes, and enhance it with logging, configuration metrics, (continue ............)
- Documentation using open api docs
- Packaged using Kubernetes
- Dockerized
- Middleware with JWT authentication
- Logging with Zap logger
- Microservice architecture
- Onion Layering
- sqlx used as Database ORM with PostgreSQL
- Unit testing
- Integration testing
- Opentelemetry with Prometheus, grafana, Loki, etc
- github workflow
- Docker
- Go (Golang)
- Kubernetes (optional for deploying to a local cluster)
Instructions on how to clone the repository and install the necessary dependencies.
$ git clone https://github.com/avyukth/service-s2p.git
$ cd project
$ go mod tidy
$ go mod vendor
To run the application locally, execute the following command:
$ go run main.go
If you want to deploy the service to a Kubernetes cluster, follow the steps below.
Create a local Kubernetes cluster using Kind:
$ make kind-up
Build and deploy the Docker image to the Kubernetes cluster:
$ make kind-update-apply
List and explain the different make commands available for managing the project.
make run
: Run the application locally using Go.make kind-up
: Create a local Kubernetes cluster using Kind.make kind-down
: Delete the local Kubernetes cluster.make kind-load
: Load the Docker image into the Kind cluster.make kind-status
: Get status information about the Kind cluster and its resources.make kind-apply
: Apply Kubernetes manifests to the Kind cluster.make kind-status-service
: Get status information about the deployed service pods.make kind-logs
: Tail the logs for the service pods.make kind-restart
: Restart the service pods in the Kind cluster.make kind-update
: Build the Docker image, load it into the Kind cluster, and restart the service pods.make kind-describe
: Get detailed information about the deployed service pods.make kind-update-apply
: Build the Docker image, load it into the Kind cluster, and apply Kubernetes manifests.
This section is dedicated to the support for Go modules vendor directory.
make tidy
: Performgo mod tidy
andgo mod vendor
to clean up the Go module and vendor dependencies.