Git Product home page Git Product logo

marcoschmidl / cloud-native-sample Goto Github PK

View Code? Open in Web Editor NEW

This project forked from thinktecture-labs/cloud-native-sample

0.0 0.0 0.0 38.84 MB

Sample application to demonstrate how to build, orchestrate, and automate a polyglot cloud-native application

License: MIT License

Shell 0.10% JavaScript 0.06% Go 5.52% C# 48.53% CSS 10.81% Makefile 0.16% HTML 11.27% Smarty 4.22% HCL 5.86% Dockerfile 2.05% Less 11.29% SCSS 0.12%

cloud-native-sample's Introduction

Cloud-Native Sample Application

This repository contains a sample application that serves as a demonstration for building and automating a polyglot cloud-native application. The application is designed to showcase proven practices for developing and deploying cloud-native software using a combination of programming languages and tools:

  • Programming Languages

    • .NET (C#)
    • Go
  • Tools

    • Docker
    • Docker Compose
    • Dapr (Distributed Application Runtime)
    • Kubernetes (when running in Azure)
    • HashiCorp Terraform
    • GitHub Actions
    • Makefiles

[TBD: Some general introduction.]

Builds

AuthenticationService OrdersService ProductsService ShippingService OMC OrderMonitorService Gateway

License

MIT License

Application Diagram

Architecture Overview

Observability Stack

For the scope of this application, we've choosen the following technologies to address observability concerns:

Local execution

We decided to go with Docker Compose for local development story. As an alternative, you can also setup a local Kubernetes cluster (KIND / minikube /...).

URLs and demo credentials

When running the application in Docker Compose, you'll end up with the following ports forwarded on your host machine:

Use http://localhost:5000 to access the OMC proxied through the gateway locally.

Note: Dapr-dashboard does currently not work in Docker compose mode

Necessary plugins for local execution

We use Loki as log aggregation system. In the local environment, we leverage lokis docker plugin to ship all logs from containers output streams (STDOUT and STDERR) to Loki.

# Install Docker Plugin for Loki
docker plugin install grafana/loki-docker-driver:latest --alias loki --grant-all-permissions

Local Environment Execution using the Makefile

Find the Makefile in the root of the repository. Use it to perform common tasks as shown below:

# Install loki plugin locally
make init

# Start the sample locally (in docker)
make start 

# Quickstart (no image build) the sample locally (in docker)
make quickstart

# get logs
make logs

# stop the sample
make stop

# clean-up the local docker environment
## stops everything
## removes images
## removes volumes
## removes orphan containers
## removes custom docker network
make cleanup

Local Environment Execution using the docker-compose CLI

# Build Container images
docker-compose build

# Cleanup previously started instances
docker-compose rm -f

# Start cloud-native sample application (detached)
docker-compose up -d
# Start cloud-native sample application (blocking)
docker-compose up

# To stream logs to the terminal use
docker-compose logs

Cleanup environment

# remove running containers
docker-compose rm -f

# remove custom Docker network
docker network rm cloud-native -f

# uninstall Loki Plugin
docker plugin rm loki -f

Local Environment Execution using the cn-sample CLI

You can also automate the local environment execution using the cn-sample CLI (see /tools/<your_platform>).

Consider adding cn-sample to your path before invoking it.

The sn-sample CLI is designed to be invoked from the root directory of this repository.

Azure environment

For demonstration purposes, we added all necessary Infrastructure-as-Code (IaC) (using HashiCorp Terraform) and corresponding GitHub Actions to deploy and run the application in Microsoft Azure leveraging Azure Kubernetes Service (AKS).

When running in the cloud, one must always decide on Run vs. Rent. For example: Instead of running a message broker like RabbitMQ on your own (yes, running something in a container means you run it on your own, because you've to maintain and troubleshoot it), and renting a message broker like Azure Service Bus.

Again, you can find corresponding GitHub Actions in the repository to switch between Run and Rent in Azure. Those GitHub Actions must be triggered manually.

cloud-native-sample's People

Contributors

christianweyer avatar dependabot[bot] avatar feo2x avatar gingters avatar thorstenhans avatar

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.