Skip to content

A modern take on microservices in a cloud native world

License

Notifications You must be signed in to change notification settings

caulagi/rust-k8s-demo

Folders and files

NameName
Last commit message
Last commit date
Nov 18, 2024
Oct 16, 2024
Oct 16, 2024
Feb 11, 2025
Oct 17, 2021
Jan 8, 2020
Feb 11, 2025
Apr 1, 2019
Jan 8, 2020
Oct 15, 2021
Feb 11, 2025
Jan 22, 2021
Apr 1, 2019
Oct 16, 2024
Nov 6, 2023
Nov 11, 2021
Dec 27, 2020
Oct 10, 2023

Repository files navigation

rust-k8s-demo

Build & test project

architecture

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.

Features

  • 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

Getting started

  • The repo requires git-lfs.

    $ git clone https://github.com/caulagi/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 pradip.caulagi  staff   7.5M Feb 27 15:55 data.sql
  • Setup a local kubernetes cluster using kind.

    $ go install sigs.k8s.io/kind@v0.20.0
    $ 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.

Todo

  • Service mesh
  • CD
  • Distributed (open) tracing - partially done
  • Prometheus, grafana, alert-manager
  • Cert Manager
  • External DNS(?)

LICENSE

This project is licensed under MIT.