This project deploys a multi-tier application on a Kubernetes cluster using kops. The application consists of the following components:
vproapp
: Backend servicevprodb
: MySQL databasevpromc
: Memcached servicevprormq
: RabbitMQ service
Before you begin, ensure you have the following installed:
kubectl
: Kubernetes command-line toolkops
: Kubernetes Operations tool- AWS CLI configured with appropriate permissions
- Access to an AWS S3 bucket for storing Kubernetes cluster state
-
Create Kubernetes Cluster:
Use kops to create a Kubernetes cluster on AWS:
kops create cluster --name=mycluster.k8s.local --state=s3://k8s-bucket --zones=us-east-1a,us-east-1b --node-count=2 --node-size=t3.small --master-size=t3.medium --dns-zone=mycluster.k8s.local --node-volume-size=8 --master-volume-size=8 kops update cluster --name mycluster.k8s.local --state=s3://k8s-buket --yes --admin
-
Validate The Cluster
Make Sure To Check For The Cluster's Health
kops validate cluster --name mycluster.k8s.local --state=s3://kops-state-2024
-
Create an EBS Volume On AWS For The Database:
Using AWS CLi
aws ec2 create-vloume --availability-zone=us-east-1a --size=3 --volume-type=gp2
-
Tag The Volume With The Following Tag:
KubernetesCluster = mycluster.k8s.local
-
Label The Node In The Same Zone As The Volume:
Using kubectl
kubectl label node <node-name> zone=us-east-1a
-
Change The Volume ID
Update The Vloume ID in DB/vprodb-deploy.yml With Your Volume ID
-
Deploy The App:
Using kubectl
kubectl apply --recursive -f .
-
Clean Up
When You're Done Make Sure To Destroy The Cluster To Avoid Extra Charges
kubectl delete --recursive -f . kops delete cluster --name mycluster.k8s.local --state=s3://kops-bucket --yes
- Replace "mycluster.k8s.local" with your cluster's DNS name.
- Replace "k8s-bucket" with S3 bucket name.
- Ensure your AWS credentials are configured correctly.