Coder Social home page Coder Social logo

microsoft / containerized-microservices-pipeline Goto Github PK

View Code? Open in Web Editor NEW
76.0 19.0 35.0 3.69 MB

Reference solution for Production micro-services pipeline built on VSTS, docker, kubernetes and full CI / CD pipeline.

License: MIT License

Shell 47.06% Smarty 2.53% C# 50.41%

containerized-microservices-pipeline's Introduction

Containerized Micro-services

This project is a reference solution for building out a full Production ready micro-services solution. This solution is hosted in Kubernetes running on Azure. All apps and services have a small (micro-service) footprint of responsibilities and are run in Docker containers. This solution is meant to be a best practice example of a micro-service development and hosting solution ready for Production.

Solution Overview

Solution Architecture

Included in this Solution

Deployment scripts

Deployment scripts

Deployment scripts are provided as part of the reference solution that will setup a new Azure Subscription with all of the necessary resources, create Azure Active Directory Service Principal service accounts, grant needed access and deploy out n number of k8 clusters. Documentation for CI / CD setup in VSTS is provided to enable you to get a full end-to-end pipeline micro-service pipeline setup in no time.

Example Angular app micro-service

https://github.com/Microsoft/containerized-microservices-pipeline-app

An example front end web app written in Angular is provided as part of the solution, including a suite of unit and integration tests that are run when a Pull Request is created for a robust CI process. Changes to the app micro-service is automatically deployed to the canary pods as part of the CD process.

Example .NET Core api micro-service

https://github.com/Microsoft/containerized-microservices-pipeline-service

An example cross platform middle tier api is provided as part of the solution, including a suite of unit and integration tests that are run when a Pull Request is created for a robust CI process. Changes to the api micro-service is automatically deployed to the canary pods as part of the CD process.

Development Prerequisites

  1. Mac - Homebrew

  2. Windows - Powershell & Linux Subsystem

  3. Docker

  4. Azure CLI

  5. kubectl

    • Install kubectl on Mac with Homebrew
      brew install kubectl
    • Install kubectl on Windows with PowerShell
      Install-Script -Name install-kubectl -Scope CurrentUser -Force
      install-kubectl.ps1 [-DownloadLocation <path>]
  6. ACS Engine

  7. JQ

  8. Visual Studio

    • Will be used for editing and executing web and load tests. There's an option to run the tests locally or in the cloud through VSTS. Web and load tests examples found here.
    • Download and install Visual Studio

Deploying Azure Resources and ACS Kubernetes Cluster

Deployment

Securing Secrets

Deploying secrets to production

Traffic Routing

Routing requests to Azure and within Kubernetes

Using VSTS to set up Continuous Integration and Continuous Deployment

Continuous integration/deployment

Log Analytics

Integrating Log Analytics

Repository Structure and Strategy

We have one repository for the front end solution, one for our middle tier, and one common repository for deployment scripts. Because we are dealing with microservices, this approach allows the project to be both modular and scalable. The smaller codebases help developers contribute with faster execution and innovate rapidly due to fewer merge conflicts and clear ownership. Additionally, it allows the project to take full advantage of helm charts, helping control Kubernetes objects and application versioning. Using this structure as a reference solution, it is recommended that each additional microservice uses separate repositories for each of its respective services.

Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com.

When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

containerized-microservices-pipeline's People

Contributors

aaron-schnieder avatar billpratt avatar elizabethhalper avatar ivan-shaporov avatar jobanputra avatar lalo avatar microsoftopensource avatar msftgits avatar yutanglin16 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  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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

containerized-microservices-pipeline's Issues

Complete OMS example with containers workspace

As a user deploying a k8s cluster via acs-engine, I want the same OMS/Log Analytics setup that I can get from deploying a AKS cluster

Acceptance Criteria:

  • OMS/Log Analytics parity with AKS when deploying via acs-engine

HA clusters

As a user of this reference architecture I would like to know how to deploy highly available k8s clusters.

Acceptance Criteria:

  • Ability to deploy a highly available cluster(s)
  • Ability to turn on/off highly available feature during deployment
  • Documentation on HA best practices

POC acs-engine and VMSS

With the release of k8s 1.12, you can now deploy a cluster with Azure virtual machine scale sets using acs-engine. Cluster autoscaling was also added. More details here: https://kubernetes.io/blog/2018/10/08/support-for-azure-vmss--cluster-autoscaler-and-user-assigned-identity/

We should evaluate how well this works over availability sets.

  • Requires k8s 1.12. If user tries to deploy VMSS where k8s < 1.12, script should fail with the appropriate error
  • 1.12 k8s cluster with VMSS
    • VMSS node pool
    • VMSS masters?
  • cluster autoscaler

Design interactive version of deploy resource and deploy cluster scripts

Design how we can redesign the deployment scripts to make them generic, interactive and reusable so there is no need to modify the scripts by hand for any project. We should also include CI/CD task deployment as part of the design.

First step is to get a meeting together and start a design doc to get in agreement on what the requirements are and how we will build it. Additional user stories should be created as a result of this.

Possible options to explore:

  • Azure CLI extension
  • VS Code extension
  • kubectl plugin (requires 1.12 of CLI)
  • Aure ARM template

Add ability to enable/disable RBAC

Both AKS and acs-engine support RBAC. When deploying a cluster, add the ability to switch RBAC on/off.

AKS currently has the ability to switch this on/off. RBAC is enabled by default in acs-engine

If RBAC is turned on, we should "wire up" the cluster with RBAC examples to give the user a good understanding of best practices using RBAC in a k8s cluster.

Acceptance Criteria:

  • When deploying a cluster, user has ability to turn RBAC on or off
  • Wire up and document RBAC policies for appropriate deployments, secrets etc.

End to end testing

We should add some type of end to end testing that can be ran on PRs and PR merges.

Examples:

  • Basic linting on deployment scripts
  • Run scripts end-to-end and verify there are no errors
  • Run basic operations on cluster to determine correct functionality
  • Teardown cluster at the end of tests

Acceptance Criteria:

  • On every PR and PR merge, I want the ability to run tests on the deployment scripts
  • Documentation on end to end testing
  • (Bonus) Azure DevOps pipeline YAML committed with steps

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.