GithubHelp home page GithubHelp logo

udacity-devops-capstone's Introduction

Udacity Capstone project: K8S-TODO LIST APP

Using AWS, K8S (EKS), cloudformation and circleCI to build it.

Table of content

  1. Proposal
    1. AWS architecture
    2. K8S cluster
    3. AWS CICD solution
  2. Presetup
    1. Setup AWS network
    2. Setup EKS Cluster
    3. Running k8s cluster locally
    4. Deploy our cluster to EKS
  3. Project brochure

1. Proposal

1.1 AWS architecture

  • Using VPC, Subnet, SG, EKS, RDS, Cloudformation
  • Diagram: AWS architect
  • images:

1.2 K8S cluster

1.3 CI/CD process

2 Pre-setup

Before we bring the CICD pipeline we need to presetup the infra

2.1 Prepare network infra by running:

# Create infra
IaC/script/deploy-network.sh create false

# Update infra
IaC/script/deploy-network.sh udpate false

2.2 Prepare eks cluster (AWS cluster) by running:

# Create infra
IaC/script/deploy-eks.sh create false

# Update infra
IaC/script/deploy-eks.sh update false

2.3 Running the project locally:

  1. You need to install kubectl using Docker Desktop or minikube
# Create secret using kubectl name DB_PASSWORD
kubectl create secret generic database-credential --from-literal DB_PASSWORD=abc
  1. Running everything up using: kubectl apply -f k8s/local
  2. Change your /etc/host file to point local-capstone.com to 127.0.0.1
  3. After running the project success fully you can run kubectl get pods to check if there are 2 deployments todo-be and todo-fe, you also need to update env file of todo-fe for proper domain (local-capstone.com) or whatever you setup.
  4. Go to local-capstone.com and enjoy the result

2.4 Deploy to EKS

1 .You have to install and config IAM role for ACK using this instruction: https://aws-controllers-k8s.github.io/community/docs/user-docs/install/

# Create secret using kubectl name DB_PASSWORD
kubectl create secret generic database-credential --from-literal DB_PASSWORD=abc

=> You need to update your kubeconfig file using this instruction in order to connect EKS cluster: aws eks update-kubeconfig --region region-code --name my-cluster 2. Install rds using this instruction: https://aws-controllers-k8s.github.io/community/docs/tutorials/rds-example/ (Sometimes ACK is not stable so instead of using ACK you still can create RDS manually and push DB credential to Configmap named rds-configmap)

  1. By this way, we are able to create RDS via k8s cluster (EKS).
  2. Go to your cloudformation output to check and change the value insde file k8s/prod/db-instance.yml
  3. Deploy everything to EKS by using kubectl apply -f k8s/prod
  4. install ingress-nginx using this instruction: https://kubernetes.github.io/ingress-nginx/deploy/#aws
  5. Deploy ingress controller using kubectl apply -f ingress.yml
  6. You will reveive a load-balancer link:

in my case: [a0d120f18bc6b4653b9f5013cf30053e-6c146ae369ac8bdc.elb.us-east-1.amazonaws.com] 9. I bought a cheap domain named **schoolx.host** and add an CNAME to it so from now we can use schoolx.host to refer to LB domain above. To see how the website look like:

3. Project brochure

udacity-devops-capstone's People

Contributors

phanhuutoan 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.