- Have AWS CLI and eksctl installed
- Have an AWS account with sufficient IAM permissions to create clusters, IAM roles, and EBS volumes
- Have kubectl installed and configured for Kubernetes operations
To create the EKS cluster for this lab, use the following commands:
1. Set up a directory for cluster configuration:
mkdir eks-argo-geolocation
cd eks-argo-geolocation
2. Verify your AWS identity:
aws sts get-caller-identity
3. Create an EKS cluster:
eksctl create cluster --name geolocation-cluster --region us-east-1 --nodegroup-name my-nodes --node-type t3.medium --nodes 2 --nodes-min 1 --nodes-max 2
4- Update the kubeconfig for the new cluster:
aws eks --region us-east-1 update-kubeconfig --name geolocation-cluster
5- Verify Cluster Nodes:
kubectl get nodes
# install ArgoCD in k8s cluster
# create a namespace for argo CD
kubectl create namespace argocd
# install argo CD on the created namespace
kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml
# check the pods created
kubectl get pods -n argocd
# check the services
kubectl get svc -n argocd
# Change the argocd-server service type to LoadBalancer
kubectl patch svc argocd-server -n argocd -p '{"spec": {"type": "LoadBalancer"}}'
# Show services and Copy the dns name of Loadbalancer from argocd-server service
kubectl get svc -n argocd
# get the password to connect to the admin account
kubectl -n argocd get secret argocd-initial-admin-secret -o jsonpath="{.data.password}" | base64 -d; echo
# Connect on the Argo UI with username: admin and the password generated by the below command
# you can change and delete init password
After successfully done this lab, you must delete all the resources created to avoid charges:
1. Delete the Argo CD application:
kubectl delete -f application.yaml -n argocd
2. Delete all resources inside argocd namespace:
kubectl delete all --all -n argocd
3. Delete argocd and myapp namespaces:
kubectl delete namespace argocd
kubectl delete namespace myapp
4. Delete the EKS cluster:
eksctl delete cluster --name geolocation-cluster --region us-east-1