Giter VIP home page Giter VIP logo

bluegreenpipeline's Introduction

Jenkins CI/CD pipelines for Kubernetes Appilication: Continuously Build and Deliver to Amazon EKS Cluster

End-to-End Jenkins CI/CD pipelines for Kubernetes application. Use blue/green deployment strategy to deliver/deploy to a cluster on Amazon Elastic Kubernetes Service.

Helpful Files

  • bin/setup_jenkins_ubuntu.sh
    • All the commands to setup an EKS-ready Jenkins.
    • This file is for reference only. DON'T RUN!
  • bin/create_cluster_eks.sh
    • Automatically create/update the roles & network used by EKS, and then create/update the cluster & its node group.
    • Same code is used in Jenkinsfile.
  • bin/deploy_k8s_app.sh
    • Deploy the Kubernetes application using kubectl.
    • Same code is used in Jenkinsfile.

How to Roll out a New Version

In the develop branch:

  1. Commit the changes for the new version.
  2. Update the VERSION variable in Jenkinsfile and commit.
  3. Push develop to trigger CI stages in pipeline.

In the staging branch:

  1. Pull and merge the latest develop branch.
  2. Push staging to trigger CD stages in pipeline (will be deployed to a copy of production environment).

If everything is ready for production:

  1. Checkout a release/** branch from staging branch.
  2. Push and merge the branch to master
  3. Push master to trigger CI+CD stages in pipeline (will be deployed to the ACTUAL production environment).

An Example for CI

  1. Assume that you already have an app running at version 1.0.

  2. And you make the following changes for a newer version 1.1.

    sed -i "s/World/New World" app/app.py
    sed -i "s/World/New World" tests/test_app.py
  3. Update the version from 1.0 to 1.1 in Jenkinsfile.

    Otherwise the existing version will be OVERWRITTEN after running the pipeline.

    sed -i "s/VERSION = '1.0'/VERSION = '1.1'/" Jenkinsfile
  4. Commit changes to develop, push to trigger the pipeline for CI.

Trouble Shoot

  1. How to fix Insufficient pods issue when deploying to Amazon EKS:

    Refer to this and this to choose a suitable instance type for the worker node.

bluegreenpipeline's People

Contributors

chrisolido avatar

Watchers

James Cloos 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.