This project is an experiment with how modern web applications would look like when using Rust and Kubernetes. It is a simple web application that returns a new quotation for each request.
There are two isolated microservices. The frontendservice provides one endpoint that clients (browsers) can connect to. The quotationservice is a grpc server, that answers with a quotation for each request. Both the microservices use fully asynchronous Rust libraries and are based on tokio.
- Microservices talking to each other using grpc
- Local dev setup using skaffold
- CI: Build code and run e2e tests for each commit in a k8s cluster
- Using cargo-chef to cache dependencies in Dockerfiles
-
The repo requires git-lfs.
$ git clone https://github.com/hueypeard/rust-k8s-demo # make sure git lfs files have been cloned; otherwise git lfs pull will get the file $ ls -lh databaseservice/data total 15424 -rw-r--r-- 1 user staff 7.5M Feb 27 15:55 data.sql
-
Setup a local kubernetes cluster using kind.
$ GO111MODULE="on" go get sigs.k8s.io/kind@v0.11.1 $ kind create cluster --config kind-config.yaml
-
Install skaffold and run the application
$ make bootstrap $ skaffold run --tail
QED - Go to http://localhost. See setup.md for more options for development setup.
- [] Modify the authors key of frontendservice/Cargo.toml
- [] Modify the authors key of quotationservice/Cargo.toml
- [] Modify the copyright of LICENSE
- [] Replace [INSERT EMAIL ADDRESS] with your email address in CODE_OF_CONDUCT.md
- CI features from https://github.com/EmbarkStudios/opensource-template
- Service mesh
- CD
- Distributed (open) tracing - partially done
- Prometheus, grafana, alert-manager
- Cert Manager
- External DNS(?)
This project is licensed under MIT.
Based on https://github.com/caulagi/rust-k8s-demo