This is a pet project that support multiple environments and cover some of the essential parts of backend development in microservice architecture such as API development, database, in-memory data store, containerization, and container orchestration.
Guide
Installation
Host Machine:
Duplicate file internal/app/config.example.yaml as internal/app/config.yaml
Update config.yaml file with your own credentials
Create new database schema authentication
Run go mod vendor
Run go run main.go
Docker:
Duplicate file internal/app/config.example.yaml as internal/app/config.yaml
Update config.yaml file with your own credentials
Update docker-compose.yaml as well if needed
Run docker-compose up
Kubernetes:
Duplicate file internal/app/config.example.yaml as internal/app/config.yaml
Update config.yaml with your own credentials
Make sure you already logged in to your docker hub or any other registry using docker login
Run make docker-build USERNAME="<YOUR_USERNAME>" VERSION="<DESIRED_IMAGE_VERSION>" to build your image and push it to the registry
Update spec.template.spec.containers[0].image value to the same value you used on 4th step in k8s/auth-deployment.yaml file
[Optional] If you change port mapping, make sure you update k8s/auth-service.yaml file as well
Run make k8s-deploy
To clear all data, you only need to run make k8s-destroy