GithubHelp home page GithubHelp logo

trumhemcut / dapr-microservices Goto Github PK

View Code? Open in Web Editor NEW
16.0 2.0 4.0 2.19 MB

Leverage the power of Dapr to build microservices on AKS

License: MIT License

JavaScript 5.43% HTML 1.60% Vue 22.40% TypeScript 61.02% Dockerfile 1.44% Smarty 4.74% Shell 3.37%
dapr azure microservices

dapr-microservices's Introduction

dapr microservices

Build Status Build Status Build Status License: MIT Follow on Twitter

Leverage the power of Dapr to build microservices application

Get started

Step 1 - Pre-requisites

  • Kubernetes, it's ok to use Kubernetes on Docker for Win/Mac or Minikube for development environment. Currently I've just tested on Docker for Win/Mac environment (with Kubernetes enabled). Minikube hasn't been tested yet!
  • Helm 3.0, no more Tiller. But please add the repo before we can install:
  • Dapr CLI, prefer latest version (e.g. 0.3.0)

Step 2 - Setup

First, initialize Dapr on Kubernetes so that it can inject sidecars to our applications:

$ dapr init --kubernetes

Next, clone the source code & install the SimplAds app via Helm:

$ git clone https://github.com/trumhemcut/dapr-microservices.git
$ cd dapr-microservices
$ helm dep up ./helm-chart
$ helm install simplads ./helm-chart

Step 3 - Change your host file

Since the SimplAds uses Traefik as its main ingress, and using hostnames as the main endpoints. Please add those following hostnames to your host files:

If you're using Mac, add the line below to this file /etc/hosts. If you're using Windows, add the line below to this file C:\Windows\System32\drivers\hosts

127.0.0.1   traefik.dapr.fun dashboard.dapr.fun web.dapr.fun zipkin.dapr.fun

Features

After finishing all above steps (it may takes several minutes), you can browse following Urls:

Architecture

TODO

dapr-microservices's People

Contributors

dependabot[bot] avatar trumhemcut avatar

Stargazers

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

Watchers

 avatar  avatar

dapr-microservices's Issues

Move zipkin to subcharts

Currently Zipkin is deployed as a deployment of main Helm chart, but it shouldn't as we will enable building block such as Azure Monitor to be distributed tracing component. So it's just optional within sub-charts to be enabled in development environment only.

Kafka pubsub

As the resize image service finishes, it publish an message to Kafka to notify the result.

Currently Kafka pubsub hasn't been available yet and waiting for merge request. Will implement the feature when it's done.

More details here:
dapr/components-contrib#8

Add OpenFaas

OpenFaas may be a good candidate for triggering function as a service. In this example, we will use OpenFaas to scale the image of advertisements.

Need to restart services after Kafka is done

Currently Dapr starts only once, so it's quite inconvenient if Kafka cluster is not up yet. In that case, Dapr will fail to connect to Kafka and it will break every activities later.

Discussion thread here: dapr/components-contrib#163

Workaround:

  • Restart the Dapr sidecar after Kafka cluster is up.

Need to think how to solve that problem.

Optimize the size of Docker images

Currently alpine for NodeJS is optimized and alpine for Python is also optimized. But they're different Dockerfile. If we install Python in a usual way in alpine, it will increase size significantly. So we need to merge these two Dockerfile into one so that we can optimized image for Alpine.

See more here:

Hopefully we can optimize base on those materials.

Build Kafka message bus

Build Kafka as a service bus so that we can enable pub/sub messaging for services. We also enable the option between Kafka / Azure Service later on.

Improve simplads

  • Enable upload
  • Serverless triggered after new ads uploaded
  • Showing image after upload

Setup ingress for K8S

Not sure service mesh is needed at this moment, so ingress may be enough. Ingress should work for both on-premises & AKS as well.

Add zipkin, mongodb as Helm dependencies

To be easily for end-user provisioning the environment, we will use Helm dependencies to create the dependent services such as zipkin / Jaeger, mongodb, ... to create Dev environment. For Azure environment, we will use Ansible / Terraform to create those services.

Add build & code coverage label

  • Build Docker images & push to Docker Hub
  • Adding testing to the app to see code coverage
  • Adding the build label to the README.md
  • Add language icon, reddit icon

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.