Running Pods on Fargate with EKS and exposing them for the outside world using Terraform.

WS Fargate is a serverless compute engine for containers that works with both Amazon Elastic Container Service (ECS) and Amazon Elastic Kubernetes Service (EKS). Fargate makes it easy for you to focus on building your applications. Fargate removes the need to provision and manage servers, lets you specify and pay for resources per application, and improves security through application isolation by design.

Today’s world is all about Agile and Automation and we are moving towards new trends like Serverless. So, this article is full of automation and explains everything from serverless to securing the Database, from testing to production environments and code management.

This article explains that how you can host your own web application like WordPress, Owncloud, etc. on AWS Fargate(serverless) by setting up a Kubernetes Cluster with EKS. And for doing this setup we will use Terraform which is an IaC tool. But if you are not familiar with terraform then you can refer my this article.

Get the complete code from here, so that you can follow along with the article

Project Description

In this article, we will first create the Network setup like VPC, Subnets, etc. for the EKS Cluster. Then, we will create an EKS Cluster with a managed Node Group and a Fargate Profile. Next, we will launch a Kubernetes Deployment for our web app i.e., WordPress on Fargate, and also create a PVC (Persistent Volume Claim) for the Deployment. And to access the app we will also create a Load Balancer type Service in Kubernetes. Last we create a Database for our web app.

In this complete setup, we will use Terraform to automate our work. And at last, I will show you an interesting thing i.e., Code Management by creating our own Terraform modules. And will structure our code in such a way that the same code can be used to setup both Testing and Production environments with just one command.

In this article, I have tried to show you almost everything from scratch and I believe you will find some interesting and important concepts related to Terraform and AWS:)

#kubernetes #terraform #aws #serverless

Terraform: Serverless Kubernetes Cluster with AWS EKS
1.30 GEEK