This project demonstrates how to build a Kafka log processing pipeline using AWS EKS and Terraform. It provisions necessary AWS resources, configures an EKS cluster, and deploys a highly available Kafka cluster using ArgoCD.
- Terraform (infra): Sets up VPC, EKS, DynamoDB, and ECR.
- ArgoCD (kubernetes/argocd): Manages continuous deployment in the Kubernetes environment.
- Kafka Deployment (kubernetes/kafka): Contains the Kafka and Zookeeper deployment manifests for Kubernetes, configured for high availability.
- Install Terraform (v1.0+).
- Install AWS CLI.
- Install kubectl.
- Install Helm for ArgoCD setup.
- Configure AWS CLI with appropriate IAM permissions for EKS, VPC, S3, DynamoDB, and IAM.
-
Navigate to the
infra
directory:cd infra
-
Initialize and apply Terraform configuration:
terraform init terraform apply
This will provision:
- A VPC with subnets for the EKS cluster.
- An EKS cluster.
- A DynamoDB table for log storage.
- An ECR repository for container images.
-
Verify EKS Cluster Access:
After Terraform completes, configure
kubectl
to access the EKS cluster.aws eks update-kubeconfig --name <cluster_name> --region <region>
-
Navigate to the
kubernetes/argocd
directory:kubectl create namespace argocd kubectl apply -f kubernetes/argocd/install_argo.yaml
-
Access the ArgoCD UI:
-
Forward the ArgoCD server port:
kubectl port-forward svc/argocd-server -n argocd 8080:443
-
Access ArgoCD at
https://localhost:8080
. Login credentials can be retrieved with:kubectl get secret argocd-initial-admin-secret -n argocd -o jsonpath="{.data.password}" | base64 -d
-
-
Apply Kafka and Zookeeper Manifests:
kubectl apply -f kubernetes/kafka/zookeeper_deployment.yaml kubectl apply -f kubernetes/kafka/kafka_pvc.yaml kubectl apply -f kubernetes/kafka/kafka_deployment.yaml kubectl apply -f kubernetes/kafka/kafka_service.yaml
-
Verify Kafka Deployment:
kubectl get pods -n kafka
To destroy all resources created, run:
cd infra
terraform destroy