Code Monkey home page Code Monkey logo

eksdemo's Introduction

reference

0. prerequisites

1. deploy kubernetes cluster (EKS) on AWS

terraform plan & apply:

cd terraform
terraform plan
terraform apply

apply EKS kubeconfig:

aws eks --region ap-northeast-1 update-kubeconfig --name demo

2. check the cluster

Show running nodes:

kubectl get nodes

Show running pods:

kubectl get pods --all-namespaces

3. deploy cluster infrastructure

deploy nginx ingress controller and metrics server:

kubectl apply -f kubernetes/

4. deploy example app

dockerlize example app:

docker build -t archean/echo:1.0.0 .

push to hub.docker.com:

docker push archean/echo:1.0.0

deploy example app: echo:

kubectl apply -f deploy/

check web service:

ip=$(kubectl get ingress echo -o jsonpath='{.status.loadBalancer.ingress[0].hostname}')
curl -H 'Host:example.com' http://$ip/ping

5. scale example app

manual scale up echo app:

kubectl scale deployment echo --replicas=2

automatic scale up nodes:

kubectl apply -f kubernetes/cluster-autoscaler.yaml
kubectl scale deployment echo --replicas=5

see nodes auto scale up:

kubectl get nodes -w

6. destroy cluster

delete example app:

kubectl delete -f deploy/

delete cluster infrastructure:

kubectl delete -f kubernetes/

destroy EKS cluster:

terraform destory

eksdemo's People

Contributors

iarchean avatar

Watchers

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