violet_rails
violet_rails copied to clipboard
infra v2 upgrade
This spec is to create a 2 high availability deployment strategies for Violet Rails using
- AWS (deploy to ECS using Github action, app stack using route 53, RDS, ACM, ALB)
- Heroku (using nakedSSL, route 53)
Tech debt/blockers
https://github.com/restarone/violet_rails/issues/536 ✅
Requirements
- CI runs on Github, if it passes-- GitHub Action triggers deployment pipeline
- Centralized environment variable management (env variables are not included as part of docker images or stored in an insecure way)
- must have multiple application and worker servers with servers serving web traffic distributed over multiple availability zones
- high availability deployments (no downtime between monolith versions)
Research
Kubernetes approach
- Rails on K8s: https://medium.com/@seemiller/rails-from-the-closet-to-kubernetes-deployment-6e9b2697dd3d
- Migrations: https://thoughtbot.com/blog/zero-downtime-rails-deployments-with-kubernetes
- complete repo: https://www.honeybadger.io/blog/rails-on-kubernetes/
- from docker compose to k8s: https://www.digitalocean.com/community/tutorials/how-to-migrate-a-docker-compose-workflow-for-rails-development-to-kubernetes
- in-depth guide: https://kubernetes-rails.com
- cron jobs: https://github.com/keylimetoolbox/cron-kubernetes-ruby
- more on cron: https://jeremy.wadsack.com/2020/01/08/managing-cron-jobs-in-kubernetes-with-ruby/
- sidekiq k8s: https://github.com/mperham/sidekiq/wiki/Kubernetes
- full stack K8s with TLS: https://willschenk.com/articles/2021/rails_on_kubernetes_with_tls/
- deploy using GitHub action: https://dev.to/leandronsp/deploy-to-kubernetes-using-github-actions-including-slack-notification-11je
- kuby? https://getkuby.io
Docker approach
misc
- cron jobs in docker (with whenever): https://blog.kurttomlinson.com/posts/how-to-run-cron-jobs-with-the-whenever-gem-in-a-docker-container