Giter Site home page Giter Site logo

udacitynd-capstone's Introduction

SWOOD1872

UdacityND-Capstone

Udacity AWS Cloud DevOps Engineer Nanodegree - Capstone Project

Overview

My Capstone project is a simple web server written in Go, which serves a basic web page with some styling. I used the gorilla/mux router for routing rather than just the standard library. I've included a few 'extra' features as well, namely graceful shutdown, custom filesystem to prevent directory listings and usage of the 'go:embed' directive to embed static assets in to the binary.

The Dockerfile is a multi-stage docker build, in order to reduce the size of the image.

Testing

You can run the unit tests for this project as follows

go clean -testcache ./... && \
go test -v -race ./...

Running Locally

You can run the web server locally by compiling the code and running the binary/executable

go build -o server .

./server

Running in Docker

You can run the web server inside Docker

./run_docker.sh

Running in Kubernetes

You can also run inside Kubernetes on your own machine, using Minikube for example

./run_kubernetes.sh

Pipeline

The CICD tool of choice is CircleCI. As such, any commits will trigger the pipeline.

Any commits on the main branch, will also trigger a deployment to the AWS Cloud. This will perform a rolling deployment to a Kubernetes cluster running in Amazon EKS.

Main Pipeline Steps:

  1. Lint the Dockerfile and the Go code
  2. Vet the Go code
  3. Compile the Go code
  4. Run the unit tests
  5. Build the Docker image
  6. Tag the Docker image and push to Docker Hub
  7. Create an Amazon EKS cluster with Kuberneres version 1.18
  8. Apply the Kubernetes deployment and service to the cluster
  9. Perform a rolling deployment/restart

Build artifacts including test results, load balancer url and output from 'kubectl describe all' are all stored in the CircleCI artifacts tab of each build.

udacitynd-capstone's People

Contributors

woody1872 avatar

Watchers

 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.