Skip to content

joshuaballantine/capstone

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Udacity DevOps Cloud Engineer Capstone Project

Objectives

  • Working in AWS
  • Using Jenkins or Circle CI to implement Continuous Integration and Continuous Deployment
  • Building pipelines
  • Working with Ansible and CloudFormation to deploy clusters
  • Building Kubernetes clusters
  • Building Docker containers in pipelines

Prerequisites

All tools required for this project are listed below. I have also set up an EC2 instance which will host/communicate with these tools and essentially serve as the management centre for this project.

Application Specification

A simple Nginx "Hello World" application defined here and here. The webpage will have a blue or green background depending on how the load balancer is configured.

CI/CD Pipeline

jenkinsFullPipeline.png

Stage 1 - Linting

My linting stage contains two jobs: linting the docker file using hadolint and linting the html using tidy. A successful linting job is shown here. A failed linting job is shown here and can be triggered by adding some erroneous syntax to the docker file or html file.

Stage 2 & 3 - Build Blue/Green Image

This is done by calling the run_docker.sh script from the blue/green folder with the tag name as the argument.

Stage 4 & 5 - Push Blue/Green Image

This is done by calling the upload_docker.sh script from the blue/green folder with the tag name, docker username and docker password respectively as the 3 arguments. Proof of a successful upload to the docker hub is shown here. Also note that for these stages rely on docker credential configuration within jenkins.

Stage 6 - Create Cluster

Deploys the cluster using EKS and cloud formation. This stage (and the remaining stages) rely on aws credential configuration within jenkins. The cluster status is shown here and the status of the pods are shown here.

Stage 7 - Set K8s Context

Updates kubeconfig and configures kubectl from AWS EKS as shown here.

Stage 8 & 9 - Deploy Blue/Green Container

Deploys a container using the docker image with tag=blue or tag=green. Replication controller status is shown here. Jenkins console output for these steps is shown here and here.

Stage 10 & 11 - Run Blue/Green Service

Starts the blue/green service on the worker nodes. Status of services are shown here.

Testing Application

The application can be tested by using the DNS Name and Port the load balancer is running on - this information is shown here. The last stage of the Jenkins pipeline is to run the green service so we can see the "Hello World" text with the green background in the web browser. greenApp.jpg This can be easily switched back to the blue version by running the "Run Blue Service" command.

kubectl apply -f ./k8s/blue/blue-controller.json

blueApp.jpg

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published