Giter Club home page Giter Club logo

rust-k8s-demo's Introduction

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/[email protected]
    $ 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.

rust-k8s-demo's People

Contributors

caulagi avatar dependabot-preview[bot] avatar dependabot[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

rust-k8s-demo's Issues

Your .dependabot/config.yaml contained invalid details

Dependabot encountered the following error when parsing your .dependabot/config.yaml:

The property '#/update_configs/0/package_manager' value "rust" did not match one of the following values: javascript, ruby:bundler, php:composer, java:maven, elixir:hex, rust:cargo, java:gradle, dotnet:nuget, go:dep, go:modules, docker, elm, submodules, github_actions, python, terraform
The property '#/update_configs/1/package_manager' value "rust" did not match one of the following values: javascript, ruby:bundler, php:composer, java:maven, elixir:hex, rust:cargo, java:gradle, dotnet:nuget, go:dep, go:modules, docker, elm, submodules, github_actions, python, terraform

Please update the config file to conform with Dependabot's specification using our docs and online validator.

Dependabot couldn't find a Cargo.toml for this project

Dependabot couldn't find a Cargo.toml for this project.

Dependabot requires a Cargo.toml to evaluate your project's current Rust dependencies. It had expected to find one at the path: /fortuneservice/Cargo.toml.

If this isn't a Rust project, or if it is a library, you may wish to disable updates for it in the .dependabot/config.yaml file in this repo.

View the update logs.

Builds are slow

Every code change builds the docker image without any cache. Probably look at having a base image which has a default setup of packages compiled?

docker image is too big

The base image based on Debian is over 1 gb. Should look at Alpine, which has rust as a package (even though it is old).

Fix error with docker-for-desktop

The kubernetes that we get using docker-for-desktop provides a loadbalancer when we specify it in yaml. So we don't need metallb on OSX (Mac) when the kube context is docker-for-desktop or docker-desktop.

Currently there is an error at the end of skaffold run when using docker-for-desktop cluster. We need to fix this (the setup works inspite of the error, but I guess it is confusing to the user)

Dependabot couldn't find a Cargo.toml for this project

Dependabot couldn't find a Cargo.toml for this project.

Dependabot requires a Cargo.toml to evaluate your project's current Rust dependencies. It had expected to find one at the path: /fortuneservice/Cargo.toml.

If this isn't a Rust project, or if it is a library, you may wish to disable updates for it in the .dependabot/config.yaml file in this repo.

View the update logs.

Dependabot couldn't find a Cargo.toml for this project

Dependabot couldn't find a Cargo.toml for this project.

Dependabot requires a Cargo.toml to evaluate your project's current Rust dependencies. It had expected to find one at the path: /fortuneservice/Cargo.toml.

If this isn't a Rust project, or if it is a library, you may wish to disable updates for it in the .dependabot/config.yaml file in this repo.

View the update logs.

Tracing support status

Hi! I was looking at a microservices demo exactly as yours for Rust and I noticed Distributed (open) tracing - partially done but it wasn't exactly clear the status of it or what means partially done. What's in it and what's missing? Honest question out of curiosity :-)

Dependabot couldn't find a Cargo.toml for this project

Dependabot couldn't find a Cargo.toml for this project.

Dependabot requires a Cargo.toml to evaluate your project's current Rust dependencies. It had expected to find one at the path: /fortuneservice/Cargo.toml.

If this isn't a Rust project, or if it is a library, you may wish to disable updates for it in the .dependabot/config.yaml file in this repo.

View the update logs.

Use a proper dns resolution crate/solution

We should use a proper dns resolution crate/solution instead of the ugly code with getent in frontend service. If we use a crate, it should use async/await syntax and based on tokio.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.