Phase 6 : Deploying Netflix In ArgoCD using EKS

You need cluster and node group to fully operate an EKS environment.

  • Cluster = Control plane (manages Kubernetes).

  • Node group = Worker nodes (run your apps).

Step 01 : Create Cluster

We are going to create a cluster. In this cluster we will install argo cd, prometheus using helm charts and install grafana.

Here I am going to create cluster in an easy way using eksctl.

Prerequisites:

  1. You need to have one user with admin permissions.

  2. Choose one micro instance or cloud shell to configure the installtions.

  3. aws cli installed.

  4. kubectl installed.

  5. ekctl installed.

Create user and configure

Go to IAM and create user with administration access permission as below.

Check credentials using

aws sts get-caller-identity

aws cli installation

curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
unzip awscliv2.zip
sudo ./aws/install

kubectl installation

curl -o kubectl https://amazon-eks.s3.us-west-2.amazonaws.com/1.19.6/2021-01-05/bin/linux/amd64/kubectl
chmod +x ./kubectl
sudo mv ./kubectl /usr/local/bin
kubectl version --short --client

eksctl installation

curl --silent --location "https://github.com/weaveworks/eksctl/releases/latest/download/eksctl_$(uname -s)_amd64.tar.gz" | tar xz -C /tmp
sudo mv /tmp/eksctl /usr/local/bin
eksctl version

Errors you may face

  1. If you're encountering, "The maximum number of addresses has been reached", means that you have reached the limit on Elastic IP addresses (EIPs) for your AWS account in the region you're working in. By default, AWS limits the number of EIPs per region (typically 5). Since the cluster creation process involves creating a NAT Gateway, which requires an EIP, this limit can block the process.

In this case you can Release unused EIPs. In my case there are , 5 EIP addresses and hence it is not able to create another. Just release unused ones. ( If it is associated with IDs, then delete NAT Gateways first then delete the EIPS. )

  1. You may also face roles and permission issues if you are trying to create cluster using Amazon console. It is better to opt using command line.

Creating cluster

eksctl create cluster --name eks-netflix-1 --version 1.24 --region us-east-1 --nodegroup-name worker-nodes --node-type t2.medium --nodes 1 --nodes-min 1 --nodes-max 1
aws eks update-kubeconfig --region us-east-1 --name eks-netflix-1
kubectl get nodes

Now we are able to run the kubectl commands.

Step 02 : Install Argo CD

Go to this site and install argo cd commands.

https://archive.eksworkshop.com/intermediate/290_argocd/install/

kubectl create namespace argocd
kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/v2.4.7/manifests/install.yaml

You can confirm if argo CD is installed or not using kubectl get ns. You will see argoCD namespace could have been created.

kubectl get all -n argocd

Expose argocd server

https://archive.eksworkshop.com/intermediate/290_argocd/configure/

kubectl patch svc argocd-server -n argocd -p '{"spec": {"type": "LoadBalancer"}}'

we created loadbalancer service and it takes bit time to visible in aws.

Once the load balancer is created, we can connect to argocd using DNS, connect to repo and deploy the application.

Step 03 : Install Helm

curl https://baltocdn.com/helm/signing.asc | sudo apt-key add -
sudo apt-get install apt-transport-https --yes
sudo apt-get update
sudo apt-get install helm
helm version

Step 04 : Install Node Exporter using Helm

To begin monitoring your Kubernetes cluster, you'll install the Prometheus Node Exporter. This component allows you to collect system-level metrics from your cluster nodes. Here are the steps to install the Node Exporter using Helm:

helm repo add prometheus-community https://prometheus-community.github.io/helm-charts
kubectl create namespace prometheus-node-exporter
helm install prometheus-node-exporter prometheus-community/prometheus-node-exporter --namespace prometheus-node-exporter

After installing prometheus node exporter, verify using

kubectl get ns
kubectl get podds -n prometheus-node-exporter

Step 05 : Access Argo CD

Get the DNS endpoint using

export ARGOCD_SERVER=`kubectl get svc argocd-server -n argocd -o json | jq --raw-output '.status.loadBalancer.ingress[0].hostname'`
echo $ARGOCD_SERVER

Copy paste the endpoint in browser and open via advanced section.

Login to ArgoCd

Lets now set the argocd password.

export ARGO_PWD=`kubectl -n argocd get secret argocd-initial-admin-secret -o jsonpath="{.data.password}" | base64 -d`
echo $ARGO_PWD

Use this autogenerated password and login into your argocd.

Connect to Repo in argocd

Go to the repositories and give git project url by keeping default.

Create Netflix application

Add 30007 security group inbound rule

Go to the cluster node and edit SG and add 30007 port

Access using node public ip and app port

Finally we deployed Netflix application using EKS in ARGOCD.

Please reachout to me via comments if you face any issues.