Skip to content

wils93/udacity_capstone_prj5

Repository files navigation

Capstone Project 5 (DGBWM)

This is the final project for the Udacity Cloud DevOps Engineer Nanodegree.

In this project I applied the skills and knowledge that I gained throught the nanodegree program.

This includes:

Svelte CircleCI AWS Docker Nginx Ansible Kubernetes

  • Also using Svelte to build up a simple static web app
  • Using CircleCI for CI/CD pipeline
  • Using CloudFormation for automatic deployment of infrastructure
  • Working in AWS
  • Using Docker for building containerized apps
  • Using NGINX for serving the website
  • Using Ansible for automatic configuration of infrastructure
  • Using Minikube for building local Kubernetes clusters
  • Using CloudFront to access the website content

Project Overview

Did you ever get bored? Kept wondering around and surfing the internet for something interesting? Kept searching for something with type & accessibility?

This simple project makes use of Bored API and built a static web app around it which helps you to find a random task to do/learn whenever you are bored!

So you Don't Get Bored With Me (DGBWM)

Project Workflow

  • Developer updates the website code using Svelte
  • Developer pushes code to GitHub
  • CircleCI workflow starts:
    • Lint
    • Build
    • Create Docker image and push to Docker Hub
    • Use CloudFormation to create AWS infrastructure
    • Use Ansible to configure infrastructure
    • Use Ansible to start Kubernetes cluster
  • Use AWS CloudFront to access the website

Project Files

├── ansible                 # Ansible
│   ├── ansible.cfg             # global ansible configuration
│   ├── inventory.txt           # inventory for hosts to run on
│   ├── roles                   # Roles for ansible playbooks
│   │   ├── install-tools       # role to install needed tools
│   │   └── k8s-cluster         # role to enable/start minikube cluster
│   └── setup-server.yaml       # main ansible playbook
├── architecture            # Architecture Diagrams
│   ├── cloud.svg
│   ├── cluster.svg
│   └── workflow.svg
├── .c9                     # AWS Cloud9
│   └── resize.sh               # script to resize cloud9 instance
├── .circleci               # CircleCI
│   └── config.yml              # config file for CI/CD pipeline
├── cloudformation          # AWS CloudFormation
│   ├── cloudfront.yaml         # create cloudfront stack
│   ├── network-params.json     # params for network stack
│   ├── network.yaml            # create network stack
│   ├── servers-params.json     # params for servers stack
│   └── servers.yaml            # create servers stack
├── deploy.sh               # Deployment shell script
├── Dockerfile              # Dockerfile for build the image
├── k8s                     # Kubernetes
│   ├── deploy-cluster.yaml     # create deployment and needed services
│   └── ingress.yaml            # create nginx ingress
├── Makefile                # Makefile having targets to automate tasks
├── nginx                   # nginx server configuration
├── package.json
├── package-lock.json
├── README.md
├── run.sh                  # Script for create/update/delete CloudFormation stacks
└── src                     # Source code of website

Project Architecture

Workflow

workflow

Cloud

workflow

Cluster

workflow

CI/CD Pipeline

workflow

Project Setup

In order to start working with the project you shall install the needed tools Most of the steps are automated using the Makefile

To know all available targets use $ make list

$ make list
install-hadolint:
install-circleci:
install-k8s:
install-minikube:
install-docker:
install-ansible:
install-yq:
install-local:
build-local: install-local
run-local:
lint: install-local install-hadolint
build-image:
push-image: lint build-image
run-server: build-image
create-network:
delete-network:
create-servers:
delete-servers:
delete-stacks: delete-servers delete-network
run-cluster:
delete-cluster:
list:

Install needed tool

$ make install-* # where * to be replaced with the name of tool needed

Run & debug locally

  1. Build locally
$ make build-local
  1. Install locally (for debugging)
$ make run-local
  1. Visit website, go to
http://localhost:8080

Run on Docker

  1. Make sure that docker is installed
docker version
  1. Build image locally
make build-image
  1. Run docker container
make run-server
  1. Test by visiting
http://localhost:80

Run on Minikube (local K8S cluster)

  1. Make sure Minikube is installed
minikube version
  1. Run cluster locally
make run-cluster
  1. Get cluster IP
minikube ip
  1. Curl or visit browse
http://<minikube ip>:80
  1. After finishing, clean up everything
make delete-cluster

Project Website

In order to play around the website, please visit DGBWM

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published