This repository contains Terraform scripts to deploy a Tier-3 AWS EKS architecture. Tier-3 architecture typically involves an persentation Tier, logic Tier and Database Tier.
Ensure you have the following prerequisites installed:
-
Clone the repository:
git clone https://github.com/yourusername/aws-eks-tier3.git cd aws-eks-tier3
-
Initialize Terraform:
terraform init
-
Adjust Configuration:
- Modify the variables.tf file to set appropriate values for your AWS environment.
-
Deploy Infrastructure:
terraform apply
Confirm the deployment by typing `yes` when prompted.
-
Verify Deployment:
kubectl get nodes # update the Kubernetes context aws eks update-kubeconfig --name my-eks-cluster --region ap-northeast-1
-
verify access:
kubectl auth can-i "*" "*" kubectl get nodes
-
Verify autoscaler running:
kubectl get pods -n kube-system
-
Check Autoscaler logs
kubectl logs -f -n kube-system -l app=cluster-autoscaler
-
Check load balancer logs
kubectl logs -f -n kube-system -l app.kubernetes.io/name=aws-load-balancer-controller
-
Update Kubeconfig
Syntax: aws eks update-kubeconfig --region region-code --name your-cluster-nameaws eks update-kubeconfig --region ap-northeast-1 --name my-eks-cluster
-
Create Namespace
kubectl create ns demo-eks kubectl config set-context --current --namespace demo-eks
```bash
cd Manifests/mongo_v1
kubectl apply -f secrets.yaml
kubectl apply -f deploy.yaml
kubectl apply -f service.yaml
```
Create NodeJs API deployment by running the following command:
```bash
kubectl apply -f backend-deployment.yaml
kubectl apply -f backend-service.yaml
```
Create the Frontend resource. In the terminal run the following command:
```bash
kubectl apply -f frontend-deployment.yaml
kubectl apply -f frontend-service.yaml
```
Finally create the final load balancer to allow internet traffic:
```bash
kubectl apply -f full_stack_lb.yaml
```
```bash
kubectl get svc -n prometheus
```
```
kubectl edit svc prometheus-grafana -n prometheus
```
Username: admin
Password: prom-operator
Import Dashboard ID: 1860
Exlore more at: https://grafana.com/grafana/dashboards/
```
cd ./Manifests
kubectl delete -f -f
```
```
cd terraform
terraform destroy --auto-approve
```