Distributed Node #12

EKS

And take your prize!

Amazon Elastic Kubernetes Service (Amazon EKS) - a managed service that you can use to run Kubernetes on AWS without needing to install, operate, and maintain your own Kubernetes control plane or nodes.

AWS EKS Setup

Amazon Virtual Private Cloud (Amazon VPC) is a service that lets you launch AWS resources in a logically isolated virtual network that you define.

VS

Setup

AWS CLI version 2 installation instructions:

Test aws cli

Don't forget to add AmazonEC2FullAccess , EksAllAccess , IamLimitedAccess , and AWSCloudFormationFullAccess to your EKS user

User EKS permissions

Setup eksctl

apiVersion: eksctl.io/v1alpha5
kind: ClusterConfig

metadata:
  name: basic-cluster
  region: eu-north-1

nodeGroups:
  - name: ng-1
    instanceType: m5.large
    desiredCapacity: 10
    volumeSize: 80
    ssh:
      allow: true # will use ~/.ssh/id_rsa.pub as the default ssh key
  - name: ng-2
    instanceType: m5.xlarge
    desiredCapacity: 2
    volumeSize: 100
    ssh:
      publicKeyPath: ~/.ssh/ec2_id_rsa.pub

Cluster example configuration

eksctl create cluster -f file.yaml

Now lets create a cluster

Execute it and wait ~20 minutes

Deploy chat

#!/bin/bash

# Create namespace for kafka
 kubectl create ns kafka

# Setup helm to be able to use bitnami charts
 helm repo add bitnami https://charts.bitnami.com/bitnami

#Basic mongo
 helm install my-mongo bitnami/mongodb

# Redis with 0 slaves to save resources
 helm install my-redis --set cluster.slaveCount=0 bitnami/redis

#Kafka
 helm install my-kafka --namespace kafka -f 07-kafka-config.yaml bitnami/kafka

# Chat + Users API + Client
 kubectl apply -f 01-user-service.yaml
 kubectl apply -f 02-chat-service.yaml
 kubectl apply -f 03-chat-app.yaml

# Traefik
 kubectl apply -f 04-traefik-rbac.yaml
 kubectl apply -f 05-traefik-deployment.yaml
 kubectl apply -f 06-traefik-ingress-routes.yaml

# Facebook oauth servcie
 kubectl apply -f 08-auth-middleware.yaml

Execute following script

Check chat-service logs

Find Traefik svc LoadBalancer DNS name

Check all routes are helthy

Configure DNS to map your domain to a  Traefik LB

Finally it works in the cloud

$ Pricing

Service

1d (24h)

1m

EKS control plane

$2.4

1x EC2 t2.large (2Cores, 8GB RAM)

$2.4

10x EC2 t2.micro (1Core, 1GB RAM)

$2.4

24 GB EBS Volumes GP2

$2.4

1x DNS Hosted zone (Route 53)

$0.5

Total

$0.08

$0.015

$7.3

$72

$72

$72

$219

Content

Nest.js quick start

Databases

Docker

CI / CD

Caching

Nest.js + WebSocket

Kubernetes

Load balancing & Ingress

Messaging queues

Authentication & authorization

AWS

Deploy app to EKS

Course contributors

Inna Ivashchuk

Senior Software Engineer

Dmytro Bielik

Senior Software Engineer

Trainers

Guests

Vladyslav Matus
Solution Architect

Oleksandr Fedirko
Solution Architect

Denys Vasyliev
Lead Software Engineer

Volodymyr Vyshko
Lead Software Engineer

Organizers

Ivan Andreiev
Technology Manager

Tatiana Gusar
Lead Specialist

Kateryna Marunyak
Specialist

Oleksandra Kovalchuk
Junior Specialist

Thank You!

Distributed Node #12

By Vladimir Vyshko

Distributed Node #12

EKS

  • 570