The app is available to access: http://a7253a18030a04d0eab92ce5cffa8e0c-1737305406.us-east-1.elb.amazonaws.com:5153/api/reports/user_visits
eksctl create cluster --name project3-cluster --region us-east-1 --nodegroup-name project3-nodes --node-type t3.small --nodes 1 --nodes-min 1 --nodes-max 2
aws eks --region us-east-1 update-kubeconfig --name project3-cluster
kubectl config current-context
kubectl apply -f deployment/configmap.yaml
kubectl apply -f deployment/secrets.yaml
kubectl apply -f deployment/pv.yaml
kubectl apply -f deployment/pvc.yaml
kubectl apply -f deployment/postgresql-deployment.yaml
kubectl apply -f deployment/postgresql-service.yaml
kubectl port-forward --address 127.0.0.1 service/postgresql-service 5433:5432 &
export DB_PASSWORD=`kubectl get secret project3-secrets -o jsonpath='{.data.password}' | base64 --decode`
export DB_USER=`kubectl get configMap project3-config-map -o jsonpath='{.data.DB_USER}'`
export DB_NAME=`kubectl get configMap project3-config-map -o jsonpath='{.data.DB_NAME}'`
PGPASSWORD="$DB_PASSWORD" psql --host 127.0.0.1 -U ${DB_USER} -d ${DB_NAME} -p 5433 < ./db/1_create_tables.sql
PGPASSWORD="$DB_PASSWORD" psql --host 127.0.0.1 -U ${DB_USER} -d ${DB_NAME} -p 5433 < ./db/2_seed_users.sql
PGPASSWORD="$DB_PASSWORD" psql --host 127.0.0.1 -U ${DB_USER} -d ${DB_NAME} -p 5433 < ./db/3_seed_tokens.sql
kubectl apply -f deployment/coworking.yam
Attach the CloudWatchAgentServerPolicy
aws iam attach-role-policy \
--role-name eksctl-project3-cluster-nodegroup--NodeInstanceRole-wXPyILALCcWt \
--policy-arn arn:aws:iam::aws:policy/CloudWatchAgentServerPolicy
Attach the CloudWatchAgentServerPolicy
aws eks create-addon --addon-name amazon-cloudwatch-observability --cluster-name project3-cluster