After working on this project for several months, I have decided to release it as open source software (Apache-2.0 license):
Thanks to this automation tool we can scale Pushpad (a monolithic Rails app) to thousands of req/s while keeping the cost of infrastructure low (we can save up to 80% compared to what we would pay on a PaaS like Heroku!).
It’s an automation and deployment tool written in Ruby (it’s somewhat similar to Capistrano, but it deploys on Kubernetes, so you don’t need to configure all the servers and it’s more scalable…).
Basically you can deploy a Rails application by defining a
Cuberfile (a few lines of Ruby code, like a Capfile for Capistrano) and then typing
cuber deploy in your terminal.
It has all the features needed to run an application in production.
Here’s an example
Cuberfile that you can use to deploy any Rails app on Kubernetes:
app 'myapp' repo '.' buildpacks 'heroku/buildpacks:20' image 'username/myapp' dockerconfig 'dockerconfig.json' kubeconfig 'kubeconfig.yml' migrate 'rails db:migrate', check: 'rake db:abort_if_pending_migrations' proc :web, 'bundle exec puma', scale: 3 proc :worker, 'bundle exec sidekiq', scale: 2 cron :mytask, '@daily', 'rake mytask' env 'RAILS_ENV', 'production' env 'RAILS_LOG_TO_STDOUT', 'enabled' env 'RAILS_SERVE_STATIC_FILES', 'enabled' env 'RAILS_MASTER_KEY', File.read('config/credentials/production.key').strip, secret: true
You can find a lot of information and technical documentation on the project website: https://cuber.cloud
Finally note that Kubernetes is a lot cheaper than Heroku or other PaaS, because it is bare infrastructure. Kubernetes is also offered by most cloud providers, and thus you avoid lock-in with a single service provider.
Please give a star to the project on GitHub if you like it. And if you have questions you can contact me here or on GitHub.