๐8๐ ๐๐น๐๐๐๐ฒ๐ฟ(EKS) ๐ ๐ผ๐ป๐ถ๐๐ผ๐ฟ๐ถ๐ป๐ด ๐๐๐ถ๐ป๐ด ๐ฃ๐ฟ๐ผ๐บ๐ฒ๐๐ต๐ฒ๐๐ ๐ฎ๐ป๐ฑ ๐๐ฟ๐ฎ๐ณ๐ฎ๐ป๐ฎ
- An AWS Account
- IAM credentials and programmatic access.
- AWS credentials that are set up locally with aws configure.
- Ubuntu 22.04 LTS
Installing and setting up kubectl configures the command-line interface essential for managing Kubernetes clusters
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
sudo install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl
kubectl version --client
Installing and setting up eksctl simplifies the process of creating and managing Amazon EKS clusters with its command-line utility.
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
Installing Helm Charts involves deploying pre-configured packages onto Kubernetes clusters.
curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3
chmod 700 get_helm.sh
./get_helm.sh
Creating an Amazon EKS Cluster using eksctl streamlines the process of setting up and managing Kubernetes clusters on AWS. It provides a simplified command-line interface for creating EKS clusters with predefined configurations, ensuring efficient cluster deployment.
eksctl create cluster --name=eks-monitoring-demo --region=us-east-1 --version=1.29 --nodegroup-name=my-nodes --node-type=t3.medium --managed --nodes=2 --nodes-min=2 --nodes-max=3 --profile=akshay-test
Kindly note that it would take 15โ20 minutes for this installation to complete.
eksctl get cluster --name=eks-monitoring-demo --region=us-east-1 --profile=akshay-test
This should confirm that EKS cluster is up and running.
Update Kube config by entering below command:
aws eks update-kubeconfig --name=eks-monitoring-demo --region=us-east-1 --profile=akshay-test
Connect to EKS cluster using kubectl commands
To view the list of worker nodes as part of EKS cluster.
kubectl get nodes
kubectl get ns
We need to add the Helm Stable Charts for your local client.
helm repo add stable https://charts.helm.sh/stable
helm repo add prometheus-community https://prometheus-community.github.io/helm-charts
kubectl create namespace prometheus
kubectl get ns
Using below command, We install kube-Prometheus-stack. The helm repo kube-stack-Prometheus comes with a Grafana deployment embedded ( as the default one ).
helm install stable prometheus-community/kube-prometheus-stack -n prometheus
kubectl get pods -n prometheus
kubectl get svc -n prometheus
Using LoadBalancer Service
kubectl edit svc stable-kube-prometheus-sta-prometheus -n prometheus
change it from Cluster IP to LoadBalancer after changing make sure you save the file
kubectl get svc -n prometheus
A load balancer has been provisioned for Prometheus, allowing access via the link provided on port 9090.
Using LoadBalancer Service
kubectl edit svc stable-grafana -n prometheus
change it from Cluster IP to LoadBalancer after changing make sure you save the file
kubectl get svc -n prometheus
use the link of the LoadBalancer of grafana and access from the Browser
Grafana user is Admin and to get the grafana password run below commandm,
kubectl get secret --namespace prometheus stable-grafana -o jsonpath="{.data.admin-password}" | base64 --decode ; echo
Now we will delete all our resources.
eksctl delete cluster --name=eks-monitoring-demo --profile=akshay-test