violet_rails icon indicating copy to clipboard operation
violet_rails copied to clipboard

infra v2 upgrade

Open donrestarone opened this issue 3 years ago • 0 comments

This spec is to create a 2 high availability deployment strategies for Violet Rails using

  1. AWS (deploy to ECS using Github action, app stack using route 53, RDS, ACM, ALB)
  2. Heroku (using nakedSSL, route 53)

Tech debt/blockers

https://github.com/restarone/violet_rails/issues/536 ✅

Requirements

  1. CI runs on Github, if it passes-- GitHub Action triggers deployment pipeline
  2. Centralized environment variable management (env variables are not included as part of docker images or stored in an insecure way)
  3. must have multiple application and worker servers with servers serving web traffic distributed over multiple availability zones
  4. 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

donrestarone avatar Apr 28 '22 23:04 donrestarone