Using AWS, K8S (EKS), cloudformation and circleCI to build it.
- Using VPC, Subnet, SG, EKS, RDS, Cloudformation
- Diagram: AWS architect
- images:
- Building with kubectl, eksctl, ansible
- Diagram: Cluster architect
- images:
- Using CircleCI
- Diagram: CICD architect
- images:
Before we bring the CICD pipeline we need to presetup the infra
# Create infra
IaC/script/deploy-network.sh create false
# Update infra
IaC/script/deploy-network.sh udpate false
# Create infra
IaC/script/deploy-eks.sh create false
# Update infra
IaC/script/deploy-eks.sh update false
- You need to install kubectl using Docker Desktop or minikube
# Create secret using kubectl name DB_PASSWORD
kubectl create secret generic database-credential --from-literal DB_PASSWORD=abc
- Running everything up using:
kubectl apply -f k8s/local
- Change your /etc/host file to point local-capstone.com to 127.0.0.1
- After running the project success fully you can run kubectl get pods to check if there are 2 deployments todo-be and todo-fe, you also need to update env file of todo-fe for proper domain (local-capstone.com) or whatever you setup.
- Go to local-capstone.com and enjoy the result
1 .You have to install and config IAM role for ACK using this instruction: https://aws-controllers-k8s.github.io/community/docs/user-docs/install/
# Create secret using kubectl name DB_PASSWORD
kubectl create secret generic database-credential --from-literal DB_PASSWORD=abc
=> You need to update your kubeconfig file using this instruction in order to connect EKS cluster: aws eks update-kubeconfig --region region-code --name my-cluster
2. Install rds using this instruction: https://aws-controllers-k8s.github.io/community/docs/tutorials/rds-example/ (Sometimes ACK is not stable so instead of using ACK you still can create RDS manually and push DB credential to Configmap named rds-configmap)
- By this way, we are able to create RDS via k8s cluster (EKS).
- Go to your cloudformation output to check and change the value insde file
k8s/prod/db-instance.yml
- Deploy everything to EKS by using
kubectl apply -f k8s/prod
- install ingress-nginx using this instruction: https://kubernetes.github.io/ingress-nginx/deploy/#aws
- Deploy ingress controller using
kubectl apply -f ingress.yml
- You will reveive a load-balancer link: