Skip to content
This repository was archived by the owner on Feb 14, 2025. It is now read-only.

Latest commit

 

History

History

K8s-on-aws

Getting started with Kubernetes on AWS

Abstract

Amazon Elastic Kubernetes Service (Amazon EKS) is 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.

This repo contains IaC scripts for provisioning an EKS cluster on aws and deploy a flask web app on the cluster. The EKS cluster will have 2 worker nodes.
Adjust region and other variables inside configuration file to adapt the procedure to your needs.

Prerequisites

terraform aws cli kubectl

Tested on Ubuntu 22.04 LTS

Instructions

clone this repo:

https://github.com/R3DRUN3/K8s-dev.git \
&& cd K8s-dev/K8s-on-aws 

Launch EKS provisioning via Terraform with the following command:

sh terraform_deploy.sh

Once the procedure is finished (takes about 10 minutes), configure Kubernetes deployment and service with the following command:

eks_service_deploy.sh

Output sample:

[ADDING CLUSTER TO CONTEXT]
Updated context arn:aws:eks:eu-central-1:210872676119:cluster/my-eks-cluster in /home/user/.kube/config

[PRINTING EKS NODES]
NAME                                          STATUS   ROLES    AGE     VERSION
ip-10-0-1-13.eu-central-1.compute.internal    Ready    <none>   3m20s   v1.21.12-eks-5308cf7
ip-10-0-2-148.eu-central-1.compute.internal   Ready    <none>   3m26s   v1.21.12-eks-5308cf7
ip-10-0-2-227.eu-central-1.compute.internal   Ready    <none>   3m11s   v1.21.12-eks-5308cf7

[CREATING NAMESPACE 'eks-sample-app']
namespace "eks-sample-app" created

[APPLY DEPLOYMENT MANIFEST TO CLUSTER]
deployment.apps/eks-sample-flask-deployment created

[APPLY SERVICE MANIFEST TO CLUSTER]
service/eks-sample-flask-service created

[OPENING EKS EXPOSED DEPLOYMENT IN BROWSER]
load balancer:  ad8b077a11a774668acd6a56ff4edadc-1210677540.eu-central-1.elb.amazonaws.com

Firefox will open automatically (if installed) pointing directly to the LoadBalancer URL of the Kubernetes service and we can confirm that our web-app flask has been correctly exposed:

alt_text

To release all creted resources on aws simply run:

terraform destroy
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy