Next generation LolByte service which aims to fully replace the lolbyteapi.
API Documentation: https://lolbyte.services/swagger-ui/#/
LolByte is a RESTful web service written in Kotlin and uses Spring Boot. It is currently deployed using the managed Kubernetes service on Digital Ocean. You can access the live production version at: https://lolbyte.services/health
The Kubernetes deployment is defined under kube/
. The primary components are a Deployment resource which wraps the lolbyte-service
container (pulled from the Digital Ocean container registry) and a Service resource. All of that is fronted by an nginx
load balancer where TLS is terminated. Lastly, there are two CertManager resources used to issue staging and production certificates.
LolByte's primary dependency is R4J which is used to interact with the Riot API. LolByte is mostly just an adapter layer which transforms data from the Riot API into a form that the LolByte clients can interact with.
./gradlew build
Creates a new docker image and pushes to the Digital Ocean container registry.
./gradlew bootBuildImage --imageName=registry.digitalocean.com/lolbyte/lolbyte-service:<version>
docker push registry.digitalocean.com/lolbyte/lolbyte-service:<version>
Start LolByte locally (on localhost:8080
) and run the following:
postman collection run postman/LolByte.postman_collection.json
Update kube/lolbyte.yaml
with the above version and run:
kubectl apply -f kube/lolbyte.yaml
The cronjob defined in kube/access_metrics_cronjob.yaml
utilizes a Docker container which runs GoAccess to upload daily dashboards of metrics from the NGINX ingress controller access logs to Digital Ocean Spaces.
docker build -t access-metrics:<version> access-metrics/.
docker tag access-metrics:<version> registry.digitalocean.com/lolbyte/access-metrics:<version>
docker push registry.digitalocean.com/lolbyte/access-metrics:<version>
Restart deployment:
kubectl rollout restart deployment lolbyte
- https://learnk8s.io/spring-boot-kubernetes-guide
- https://www.digitalocean.com/community/tutorials/how-to-set-up-an-nginx-ingress-with-cert-manager-on-digitalocean-kubernetes
- CI / CD integrated w/ GitHub repo