Automated Deployment of Scalable Applications on AWS EC2 with Kubernetes and Argo CD

Automated Deployment of Scalable Applications on AWS EC2 with Kubernetes and Argo CD

Led the deployment of scalable applications on AWS EC2 using Kubernetes and Argo CD for streamlined management and continuous integration. Orchestrated deployments via Kubernetes dashboard, ensuring efficient resource utilization and seamless scaling.

Key Technologies:

  • AWS EC2: Infrastructure hosting for Kubernetes clusters.

  • Kubernetes Dashboard: User-friendly interface for managing containerized applications.

  • Argo CD: Continuous Delivery tool for automated application deployments.

🌟 Introduction

In today’s DevOps landscape, deploying scalable applications efficiently is crucial. Combining AWS EC2, Kubernetes, and Argo CD provides a robust solution for automating deployments. This guide will walk you through setting up an automated pipeline to deploy applications with high scalability and minimal manual intervention.

πŸ”§ Prerequisites

Before diving in, ensure you have the following:

  • πŸ–₯️ An AWS account.

  • 🐳 Basic knowledge of Kubernetes and Docker.

  • πŸ“œ Installed kubectl and aws-cli.

  • πŸ’» Argo CD installed on your Kubernetes cluster.

πŸ—οΈ Step 1: Setting up AWS EC2 Instances

  1. Launch EC2 Instances
  • Log in to your AWS Management Console.

  • Navigate to EC2 and launch a new instance with the desired specifications. Choose Amazon Linux or Ubuntu for optimal compatibility.

  • Install Docker and Kubernetes

  • SSH into your EC2 instance.

  • Run the following commands to install Docker:

  •   sudo yum update -y
      sudo yum install docker -y
      sudo systemctl start docker
      sudo systemctl enable docker
    
sudo  usermod -aG docker $USER && newgrp docker

πŸ—οΈ Step 2 : Clone the repo for creating cluster

git clone https://github.com/divyasatpute/Day-6-Project-6-K8-Voting-app.git
cd Day-6-Project-6-K8-Voting-app
cd kind-cluster/

In order to Install kind cluster we have give executable permission by following command

chmod +x install_kind.sh
./install_kind.sh

Now Create Cluster

kind create cluster --config=config.yml

chmod +x install_kubectl.sh
./install_kubectl.sh

hurrayyy !!!!! our cluster is Ready

In order to deploy our Application you have to navigate K8-specification directory

cd k8s-specifications/
kubectl apply -f .

kubectl get all

Install HELM

curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3

Give Permission

chmod 700 get_helm.sh
./get_helm.sh

Install Kube Prometheus Stack

 helm repo add prometheus-community https://prometheus-community.github.io/helm-charts
helm repo add stable https://charts.helm.sh/stable
helm repo update

Create Namespace

kubectl create namespace monitoring
helm install kind-prometheus prometheus-community/kube-prometheus-stack --namespace monitoring --set prometheus.service.nodePort=30000 --set prometheus.service.type=NodePort --set grafana.service.nodePort=31000 --set grafana.service.type=NodePort --set alertmanager.service.nodePort=32000 --set alertmanager.service.type=NodePort --set prometheus-node-exporter.service.nodePort=32001 --set prometheus-node-exporter.service.type=NodePort

Prometheus Deploy

kubectl get pods -n monitoring

Expose port (Bind Port )

kubectl port-forward svc/kind-prometheus-kube-prome-prometheus -n monitoring 9090:
9090 --address=0.0.0.0 &

Test Results

Did you find this article valuable?

Support Divya_satpute's_blog by becoming a sponsor. Any amount is appreciated!

Β