GithubHelp home page GithubHelp logo

guillermo-ampie / devops-capstone Goto Github PK

View Code? Open in Web Editor NEW
9.0 1.0 14.0 71 KB

Udacity AWS DevOps Capstone project

Makefile 37.12% Shell 53.85% Dockerfile 5.76% Python 3.27%
aws cloudformation devops circleci python-3 docker hadolint aws-eks kubectl kubernetes shellcheck ci-cd

devops-capstone's Introduction

Udacity AWS DevOps Engineer Capstone Project

Guillermo Ampie

Project Overview

This capstone project showcases the use of several CI/CD tools and cloud services covered in the program Udacity - AWS Cloud DevOps Engineer.

Introduction

This project "operationalize" a sample python/flask demo app "hello", using CircleCI and a Kubernetes(K8S) cluster deployed in AWS EKS(Amazon Elastic Kubernetes Services):

  • In a CircleCI pipeline, we lint the project's code, build a Docker image and deploy it to a public Docker Registry: Docker Hub
  • Then in an AWS EKS cluster, we run the application
  • Later, we promote to production a new app version using a rolling update strategy

All the project's tasks are included in a Makefile, which uses several shell scripts stored in the bin directory.

Project Tasks

Using a CI/CD approach, we build a Docker image and then run it in a Kubernetes cluster.

The project includes the following main tasks:

  • Initialize the Python virtual environment: make setup
  • Install all necessary dependencies: make install
  • Test the project's code using linting: make lint
    • Lints shell scripts, Dockerfile and python code
  • Create a Dockerfile to "containerize" the hello application: Dockerfile
  • Deploy to a public Docker Registry: Docker Hub the containerized application
  • Deploy a Kubernetes cluster: make eks-create-cluster
  • Deploy the application: make k8s-deployment
  • Update the app in the cluster, using a rolling-update strategy: make rolling-update
  • Delete the cluster: make eks-delete-cluster

The CirclCI pipeline(config.yml) will execute the following steps automatically:

  • make setup
  • make install
  • make lint
  • Build and publish the container image

To verify that the app is working, write your deployment's IP into your browser using port 80, like http://localhost:80 or http://LOAD_BALANCER_IP:80 (according to your environment).

Alternatively, you can use curl: curl localhost:80 or curl LOAD_BALANCER_IP:80

CI/CD Tools and Cloud Services

CicleCI Variables

The project uses circleci/docker orb, so to be able to build and publish your images, you need to set up the following environment variables in your CircleCI project with your DockerHub account's values:

  • DOCKER_LOGIN
  • DOCKER_PASSWORD

Main Files

  • Makefile: the main file to execute all the project steps, i.e., the project's command center!
  • config.yml: to test and integrate the app under CircleCI
  • hello.app: the sample python/flask app
  • Dockerfile: the Docker image's specification file
  • hello_cluster.yml: EKS cluster definition file

The following shell scripts are invoked from the Makefile

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.