Skip to content

lolbyte-code/lolbyte-service

Repository files navigation

LolByte Service

Description

Next generation LolByte service which aims to fully replace the lolbyteapi.

API Documentation: https://lolbyte.services/swagger-ui/#/

Architecture

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.

Dependencies

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.

Build

./gradlew build

Update Docker Image

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>

Run API Tests

Start LolByte locally (on localhost:8080) and run the following:

postman collection run postman/LolByte.postman_collection.json

Deploy

Update kube/lolbyte.yaml with the above version and run:

kubectl apply -f kube/lolbyte.yaml

Access Metrics CronJob

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.

Update CronJob Docker Image

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>

Useful Kubernetes Commands

Restart deployment:

kubectl rollout restart deployment lolbyte

Resources

TODO

  • CI / CD integrated w/ GitHub repo

About

LolByte backend

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published