This is the code for a sample todo application written in ruby which uses either a mysql or postgres db.
The resources can be deployed either manually or using github actions. Prior to the deployment you need to be prepared.
Make sure the values in values-prod.yaml and github worflow are appropriate before proceeding to deployment. Use this guide to set appropriate values.
This app can be deployed on kubernetes cluster using this github workflow.
You can manually deploy this app on kubernetes cluster using helm
tool or you can locally run this app on your workstation as mentioned below.
Run with mysql
docker run --rm -p 3306:3306 -e MYSQL_ROOT_HOST=% -e MYSQL_ROOT_PASSWORD=123456 mysql/mysql-server
export DATABASE_URL=mysql2://root:123456@127.0.0.1:3306/todo_app
bundle install
bundle exec rake db:setup
rails s
Run with postgresql
docker run --rm -p 5432:5432 -e POSTGRES_PASSWORD=123456 postgres
export DATABASE_URL=postgresql://postgres:123456@127.0.0.1:5432/todo_app
bundle install
bundle exec rake db:setup
rails s
Once you deploy the app, create AWS WAF rule for DDoS protection (rate limit rule) by following this guide and attach this WAF to Application load balancer created by your application's ingress resource.