Giter VIP home page Giter VIP logo

cloud-service-dev-recipe's Introduction

Micro-services CI+CD Pipeline using AWS & Kubernetes (EKS)

What is a micro-service

Executable code focusing on one business capability

  • Built independently of other code
  • Can be deployed independently of other code

What is CI

Fail fast, fail early, do Good

  • Commit code several times a day (new features as well as fixes)
  • Automatic & reliable testing
  • Fix issues earlier
  • Need DevOps to establish the pipeline & scale it for Enterprise
  • We will use Jenkins

What is CD

Automation with a human touch

  • Automate deployment to all environments (needs effective config management)
  • Build in manual gates as per organization culture & target customer
  • Monitor effectively

Demonstration

Set up a Kubernetes cluster in AWS a.k.a. EKS

* Install aws cli, eksctl, kubectl
    Refer to https://docs.aws.amazon.com/eks/latest/userguide/getting-started-console.html
* Create your Amazon EKS cluster IAM role & user
* Configure AWS cli & Setup SSH keys
    Refer to https://github.com/manug2/cloud-service-dev-recipe/blob/master/1_create-key-pair_steps.md
* Install new EKS cluster using 'eksctl' & configure
    Refer to https://github.com/manug2/cloud-service-dev-recipe/blob/master/2_create-eks-cluster.md

Set up Storage for Jenkins

Refer to

https://github.com/manug2/cloud-service-dev-recipe/blob/master/3_aws_add_persistent_storage.md

FYI, my steps follow Marcel Dempers' work

https://github.com/marcel-dempers/docker-development-youtube-series/tree/master/jenkins/amazon-eks/readme.md

Set up Jenkins on our cluster

* Install Jenkins on k8s and setup Kubernetes plugin in its console (Manage Jenkins)
Refer to 
    https://github.com/manug2/cloud-service-dev-recipe/blob/master/4_aws_jenkins_deployment.md
* Install Pipeline Maven Integration Plugin (Manage Jenkins -> Plugin Manager)
* Add Maven (Manage Jenkins -> Global Tool Configuration)
    * Note down Name for use in pipeline step 
* Restart Jenkins

Start Coding with CI

* Set up a git repo (if not done)
    * Code a micro-service
    * Add automated unit tests
    * Check it compiles and passes unit tests
* Add Jenkinsfile with steps to automate build
    * Add step for maven build
    * Add Dockerfile
    * Add step for docker build
* Commit to git
* Add Multibranch Pipeline (New Item) 
    * Input github repo link 
    * Choose to build for All branches in Discover branches)
* Watch Jenkins build (run on k8s ephemeral jenkins slave pods)
* If something does not work, fix and commit until build is SUCCESS.

Do the CD

* Add automated regression test pack
* Add k8s delpoyment yaml
* Add k8s service yaml (load balanced and exposed as a service)
* Add jenkins steps to automate deployment to k8s (load balanced and exposed as a service)
* Commit
* Watch Jenkins build & deploy (run on k8s ephemeral jenkins slave pod)
* Test the api using browser

Add new application to the pipeline CICD

* Add a simple HTML ui
* Add jenkins steps to automate build of ui
* Add jenkins steps to deployment of ui
* Commit
* Watch Jenkins build & deploy (ephemeral jenkins slave pods)
* Test UI - API interaction

cloud-service-dev-recipe's People

Contributors

manug2 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  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.