{"id":13624073,"url":"https://github.com/erankitcs/BookStoreAppOnEKS","last_synced_at":"2025-04-15T20:33:14.420Z","repository":{"id":118644014,"uuid":"374338170","full_name":"erankitcs/BookStoreAppOnEKS","owner":"erankitcs","description":"A book store app powered by AWS EKS.","archived":false,"fork":false,"pushed_at":"2021-09-28T10:33:32.000Z","size":2686,"stargazers_count":42,"open_issues_count":0,"forks_count":32,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-04-03T12:11:37.631Z","etag":null,"topics":["angular","aws","docker","eks","helm","kubernetes","nodejs","python","terraform"],"latest_commit_sha":null,"homepage":"","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/erankitcs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2021-06-06T11:05:13.000Z","updated_at":"2025-01-22T07:34:41.000Z","dependencies_parsed_at":null,"dependency_job_id":"3412c2fe-e7d7-4723-894c-3c90fbd4fb00","html_url":"https://github.com/erankitcs/BookStoreAppOnEKS","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erankitcs%2FBookStoreAppOnEKS","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erankitcs%2FBookStoreAppOnEKS/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erankitcs%2FBookStoreAppOnEKS/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erankitcs%2FBookStoreAppOnEKS/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/erankitcs","download_url":"https://codeload.github.com/erankitcs/BookStoreAppOnEKS/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249148320,"owners_count":21220514,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["angular","aws","docker","eks","helm","kubernetes","nodejs","python","terraform"],"created_at":"2024-08-01T21:01:38.585Z","updated_at":"2025-04-15T20:33:13.705Z","avatar_url":"https://github.com/erankitcs.png","language":"HTML","readme":"# BookStore Web Application On AWS EKS\nA book store app powered by AWS EKS. Application is designed in microservices fashion running on EKS and integrating with other AWS Services. This project was based on learning from [ACloudGuru](https://acloudguru.com/course/a-practical-guide-to-amazon-eks)\n\n## Key Features\n1. AWS Infrastructure (IaC) via Terraform.\n2. Microservice Style - APIs and Front End in different language.\n3. Docker Compose for local testing.\n4. Heml for Kubernetes Deployment.\n5. IRSA for Kubernetes using IAM.\n6. External DNS to manage Route53.\n7. ALB Controller for Load Balancing.\n8. App Mesh (Envoy) for Kubernetes.\n9. X-Ray for Tracing.\n10. CI/CD Pipeline for automated build and deployment of Kubernetes.\n\n## Architecture\n\n![alt Bookstore Architecture](Bookstore-EKS-Arch.jpg)\n\n## Steps to run locally without build\nI have already shared images on Docker Hub which can be directly used to run the application locally.\n1. Create 4 DynamoDb tables into your AWS Cloud (development-inventory, development-resources, development-renting, development-clients)  by reffering tf_modules/dynamodb folder.\n2. Run Docker compose file named `docker-compose-image.yaml` using command \n```\ndocker compose -f .\\docker-compose-image.yaml up\n\n```\n3. Open the URL on `http://localhost:80`\n\n## Steps to run locally with build\n1. Create 4 DynamoDb tables into your AWS Cloud (development-inventory, development-resources, development-renting, development-clients)  by reffering tf_modules/dynamodb folder.\n2. Run Docker compose file named `docker-compose.yaml` using command. It will take some time to build and start the containers.\n```\ndocker compose up\n\n```\n3. Open the URL on `http://localhost:80`\n\n## Steps to Deploy into AWS Cloud using Helm.\n1. AWS CLI setup with Admin Role.\n2. Generate Code Commit Authentication from IAM.\n3. \n- Update Hosted zone in file `infrastructure\\eks\\terraform\\terraform.tfvars` \n- Update details in file`infrastructure\\openVPN\\terraform\\terraform.tfvars` for openVPN (required specifically for Elastic Search.). Read Readme.md file for more details about openVPN.\n- Run `bookstore_create_infra.sh` to create infrastructure.\n4. Update below files and run `bookstore_setup_k8s.sh`\n- Update Cluster Name `--cluster-name` in  `infrastructure\\k8s-tooling\\alb-controller\\alb-ingress-controller.yaml` file.\n- Update Role ARN `roleARN` in `infrastructure\\k8s-tooling\\app-mesh\\appmesh-sa\\values.yaml` of Service Account for App Mesh. IAM Role ending with `sa-app-mesh-role`\n5. Build Resource API and update `resource-api\\infra\\helm\\values.development.yaml` file with Repo , Tag and Service Account Role ending with `development-sa-resource-api-role`\n```\ncd resource-api\ndocker build -t \u003cDocker HUb Account\u003e/bookstoreapp_resource-api .\ndocker push \u003cDocker HUb Account\u003e/bookstoreapp_resource-api\n```\n6. Run Resource API\n```\n./create.sh development\n```\n7. Build Inventory API and update `inventory-api\\infra\\helm\\values.development.yaml` file with Repo , Tag and Service Account Role ending with `development-sa-inventory-api-role`\n```\ncd inventory-api\ndocker build -t \u003cDocker HUb Account\u003e/bookstoreapp_inventory-api .\ndocker push \u003cDocker HUb Account\u003e/bookstoreapp_inventory-api\n```\n8. Run Inventory API\n```\n./create.sh development\n```\n9. Build Clients API and update `clients-api\\infra\\helm\\values.development.yaml` file with Repo , Tag and Service Account Role ending with `development-sa-clients-api-role`\n```\ncd clients-api\ndocker build -t \u003cDocker HUb Account\u003e/bookstoreapp_clients-api .\ndocker push \u003cDocker HUb Account\u003e/bookstoreapp_clients-api\n```\n10. Run Clients API\n```\n./create.sh development\n```\n11. Build Renting API and update `renting-api\\infra\\helm\\values.development.yaml` file with Repo , Tag and Service Account Role ending with `development-sa-renting-api-role`\n```\ncd renting-api\ndocker build -t \u003cDocker HUb Account\u003e/bookstoreapp_renting-api .\ndocker push \u003cDocker HUb Account\u003e/bookstoreapp_renting-api\n```\n12. Run Renting API\n```\n./create.sh development\n```\n13. Build Front End and update `front-end\\infra\\helm\\values.development.yaml` file with Repo , Tag and Service Account Role ending with `development-sa-renting-api-role` and Hosted Zone.\n```\ncd front-end\ndocker build -t \u003cDocker HUb Account\u003e/bookstoreapp_front-end .\ndocker push \u003cDocker HUb Account\u003e/bookstoreapp_front-end\n```\n14. Run Front End\n```\n./create.sh development\n```\n15. Go to infrastructure/k8s-tooling/central-ingress and update your own HOSTED ZONE and run\n```\n./create.sh development\n```\n16. Verify the Application using the URL.  https://dev.bookstore.`UR-HOSTED-ZONE`\n17. Deploy production using below scripts.\n```\ncd resource-api\n./create.sh prod\ncd inventory-api\n./create.sh prod\ncd clients-api\n./create.sh prod\ncd renting-api\n./create.sh prod\ncd front-end\n./create.sh prod\ninfrastructure/k8s-tooling/central-ingress\n./create.sh prod\n```\n16. Verify the Application using the URL.  https://bookstore.`UR-HOSTED-ZONE`\n\n## Steps to Deploy into AWS Cloud using CI/CD Pipeline\n1. AWS CLI setup with Admin Role.\n2. Generate Code Commit Authentication from IAM.\n3. Update Hosted zone in file `infrastructure\\eks\\terraform\\terraform.tfvars` and Run `bookstore_create_infra.sh` to create infrastructure.\n4. Add RBAC for Code Build Jobs using below commands.\n```\nA. kubectl get -n kube-system configmap/aws-auth -o yaml\n//Copy output and create YAML file and update it with each build job role.\n- rolearn: \u003cROLE ARN\u003e\n      username: build-\u003cAPP NAME\u003e\n      groups:\n      - system:masters\nB. kubectl apply -f .\\auth-config.yaml\n```\n5. Run cicd script to push codes into Code Commit.\n```\n./bookstore_cicd.sh \n\n```\n6. Once deployment is complete in AWS CodePipeline for Dev stage. Go to infrastructure/k8s-tooling/central-ingress and update your own HOSTED ZONE and run\n```\n./create.sh development\n```\n7. Verify the Application using the URL.  https://dev.bookstore.`UR-HOSTED-ZONE`\n8. Go to each Pipeline and confirm to deploy the application into production environment.\n9. Once deployment is complete in AWS CodePipeline for Prod Stage. Go to infrastructure/k8s-tooling/central-ingress and update your own HOSTED ZONE and run\n```\n./create.sh prod\n```\n#### Access prodcution application via https://bookstore.`UR-HOSTED-ZONE`\n\n**Note**- if Code Build is failing with error `toomanyrequests: You have reached your pull rate limit.`. You can run the job again after 5 min wait.\n\n## Sample images.\n1. Web Page-\n\n![alt Bookstore ](bookstore.PNG)\n\n2. X-Ray\n![alt Bookstore ](xray.PNG)\n\n## Clean Up step.\n1. Delete namespaces. Go to `infrastructure\\k8s-tooling\\namespaces`\n```\n kubectl delete -f development.yaml\n kubectl delete -f prod.yaml\n kubectl delete -f appmesh-system.yaml\n```\n2. Remove K8S. \n```\nkubectl delete -f infrastructure\\k8s-tooling\\alb-controller\\alb-ingress-controller.yaml\nkubectl delete -f infrastructure\\k8s-tooling\\external-dns\\external-dns.yaml\n```\n3. Delete AwS resource from Terraform.\n- Go to each API Folder/infra/terraform and run `terraform destroy`\n- Go to  infrastructure\\cicd\\terraform and run `terraform destroy`\n- Go to infrastructure\\eks\\terraform and run `terraform destroy`\n\n\n\n","funding_links":[],"categories":["HTML"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ferankitcs%2FBookStoreAppOnEKS","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ferankitcs%2FBookStoreAppOnEKS","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ferankitcs%2FBookStoreAppOnEKS/lists"}