Coder Social home page Coder Social logo

eks-fargate's Introduction

Start with the eksworkshop setup:

Deploy sample apps:

cd ~/environment/ecsdemo-nodejs
kubectl apply -f kubernetes/deployment.yaml
kubectl apply -f kubernetes/service.yaml
cd ~/environment/ecsdemo-crystal
kubectl apply -f kubernetes/deployment.yaml
kubectl apply -f kubernetes/service.yaml
kubectl scale deployment ecsdemo-nodejs --replicas=3
kubectl scale deployment ecsdemo-crystal --replicas=3

Examine current state of things:

kubectl get nodes # we see our 3 managed nodes

There are currently a few limitations that you should be aware of:

  • There is a maximum of 4 vCPU and 30Gb memory per pod.
  • Currently there is no support for stateful workloads that require persistent volumes or file systems.
  • You cannot run Daemonsets, Privileged pods, or pods that use HostNetwork or HostPort.
  • The only load balancer you can use is an Application Load Balancer.

Because of that last one, we want to make sure we deploy the frontend to a different namespace:

  • edit yaml to deploy to new namespace

example diff:

$ git diff
diff --git a/kubernetes/deployment.yaml b/kubernetes/deployment.yaml
index 3dcd89a..aad7093 100644
--- a/kubernetes/deployment.yaml
+++ b/kubernetes/deployment.yaml
@@ -4,7 +4,7 @@ metadata:
   name: ecsdemo-frontend
   labels:
     app: ecsdemo-frontend
-  namespace: default
+  namespace: frontend
 spec:
   replicas: 1
   selector:
diff --git a/kubernetes/service.yaml b/kubernetes/service.yaml
index 19c7497..474acaa 100644
--- a/kubernetes/service.yaml
+++ b/kubernetes/service.yaml
@@ -2,12 +2,12 @@ apiVersion: v1
 kind: Service
 metadata:
   name: ecsdemo-frontend
+  namespace: frontend

Create a new namespace and deploy the frontend

kubectl create namespace frontend # create a new namespace for the frontend service
kubectl apply -f ~/environment/ecsdemo-frontend/kubernetes/deployment.yaml # deploy frontend application
kubectl apply -f ~/environment/ecsdemo-frontend/kubernetes/service.yaml # deploy frontend service

Now deploy a farage profile:

eksctl create fargateprofile --cluster eks-fargate-demo --namespace default

example output:

[ℹ]  creating Fargate profile "fp-2e5e699f" on EKS cluster "eks-fargate-demo"
[ℹ]  created Fargate profile "fp-2e5e699f" on EKS cluster "eks-fargate-demo"

Next redeploy the backend apis:

kubectl apply -f ~/environment/ecsdemo-nodejs/kubernetes/  # this scales back to 1
kubectl apply -f ~/environment/ecsdemo-crystal/kubernetes/ # this scales back to 1
kubectl scale deployment ecsdemo-nodejs --replicas=3
kubectl scale deployment ecsdemo-crystal --replicas=3
# optionally delete the remaining pods

View the deployments:

kubectl get deployments --all-namespaces

View the pods:

kubectl get pods --all-namespaces -o wide | column -t | awk '{ print $2, $8 }' | column -t

Examine the current state of things:

kubectl get nodes # now we see 6 additional nodes, 1 per pod, on fargate.

eks-fargate's People

Contributors

aditmodi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

eks-fargate's Issues

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.