Coder Social home page Coder Social logo

eks-demo's Introduction

Automate all the Things!

About The Project

The contents of this repo is a python Flask application that in designed to be deployed on Kubernetes. This repository contains all the required resources to get this flask api up and running on AWS EKS. This readme describes how to deploy the solution, and a brief overview of resources that were used.

Infrastructure

EKS

For deployment of the EKS cluster, an AWS maintained ClodFormation template is used. The template is designed to deploy into a new VPC that is created alongside other infrastructure required for supporting EKS. The following architecture diagram details at a high level the infrastructure deployed by the CFN stack.


Getting Started

Makefile

The makefile is used for building and deploying this application and associated infrastructure. The makefile assumes that the tools that are called from the makefile are installed and configured on the machine from where it is ran. Several tools of note are listed below.

  • AWS CLI
  • Docker
  • Kubernetes CLI - kubectl

In addition to the tools listed above there are several variable in the make file that will be specific to each user. they are listed below.

  • docker_tag - the repository to push the built image to.
  • aws_profile - the named profile which should be configured in the AWS cli.

CFN parameters

The cfnparams.json file contains all the parameters for the cfn stack. Parameters are specific to each AWS account/region to which they are applied. This list is not exhaustive but covers most parameters of note.

  • KeyPairName
  • EKSPublicAccessEndpoint
  • EKSClusterName
  • KeyPairName
  • AvailabilityZones

Additional config

It will be necessary to configure kubectl to interact with the eks cluster. The makefile assumes this configuration has happened. The following tutorial gives a step by step instruction. https://docs.aws.amazon.com/eks/latest/userguide/create-kubeconfig.html

Build,Deploy, & Test

  1. building the docker image.
make build
  1. Push docker image to DockerHub
make push
  1. Deploy CFN stack
make infra-deploy
  1. Check deployment status of CFN stack. The stack can take 30-90 minutes to completely deploy. This command will return the status of the CFN stack and the status of the EKS cluster. Expected results are "CREATE_COMPLETE" & "ACTIVE". If that is not returned, further investigation or patience might be needed.
make test-env
  1. Deploy K8s
make deploy-api
  1. Test deployment
  make test-deploy

Cleanup

  1. Delete and cleanup stack
  make destroy

(back to top)

Links & Resources

eks-demo's People

Watchers

Andrew Noble 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.