SlideShare a Scribd company logo
Cameron C. Dutro
Kuby: ActiveDeployment forRails Apps
Welcome!
Who is this guy?
β€’ Cameron Dutro


β€’ I work at GitHub


β€’ He/him/his


β€’ Go Seahawks!
Rails is awesome
β€’ Easy for beginners!


β€’ Simple database tools!


β€’ Super-fast development experience!


β€’ A right place for every
fi
le!


β€’ Generators! Gems! Community!


β€’ Take that, Java!
β€œOOPS!”
Time to deploy!
Rails has no official tool orguide to aide in
deploying an app into production.
THE UNFORTUNATE TRUTH IS,
RR 403: Rails Needs Active Deployment
with Stefan Wintermeyer
March 12th, 2019
β€œ ”
In my experience, deployment is one of
the major problems of normal Rails
users… it is a big pain to set up a
deployment system for a Rails application,
and I don’t see anything out there that
makes it easier.
- Stefan Wintermeyer
RR 403: Rails Needs Active Deployment
with Stefan Wintermeyer
March 12th, 2019
β€œ ”
I believe that we lose quite a lot of
companies and new developers on this
step. Because everything else [is] so much
easier with Rails… but that last step - and
it’s a super important step - is still super
complicated.
- Stefan Wintermeyer
Our options
β€’ Heroku? Expensive


β€’ EC2 instance + capistrano? Dif
fi
cult


β€’ EC2 instance + Chef/Puppet/Ansible? So much to learn


β€’ Render, Fly, Cloud 66 Easy but vendor lock-in
Kuby, ActiveDeployment for Rails Apps
Today’s journey
Cameron circa 2000
β€’ What do we mean by β€œdeployment”?


β€’ How deployment has changed in the last
~20 years


β€’ The state-of-the-art in Rails land


β€’ ActiveDeployment (a.k.a. Kuby)
What is deployment?
β€’ You’ve built a great website and you want to put it online


β€’ Need a computer to run it on


β€’ (Ideally not your laptop)


β€’ Need to install software that listens for requests, invokes
your code, and sends back the response


β€’ Might need a domain name (mycoolsite.com)


β€’ Might need persistent storage like a database
CCM Glass
β€’ In 2002 I built my
fi
rst website


β€’ Pure hand-coded HTML


β€’ Deployed to free hosting provider


β€’ Free hosting, powered by ads


β€’ Files deployed via FTP
PHP (2004 - 2010)
β€’ More dynamic


β€’ Able to store and retrieve data from MySQL


β€’ Still deploying via FTP
Fluther (2010)
β€’ First job out of college


β€’ Django app (Python)


β€’ MySQL database


β€’ Solr full-text search


β€’ Deployed using Capistrano
β€œDr. Jelly”
Twitter (2011)
β€’ Thousands of app servers


β€’ Deployments too slow using Capistrano


β€’ Wrote our own deployment tool


β€’ Servers pull code from each other via BitTorrent


β€’ First server seeds new version
Twitter
β€’ In 2013, Twitter switched to Apache Mesos


β€’ β€œProgram against your datacenter like it’s a single pool of resources”


β€’ Many distinct services (geolocation, photos, twitter.com, etc)


β€’ Services isolated from each other on the same host


β€’ Resource allocation, ports, etc con
fi
gured declaratively
Lumos Labs
β€’ 2014: VPSes in Softlayer


β€’ Bespoke Capistrano setup + Chef


β€’ Deployed via in-house web app called Catapult


β€’ 2015: EC2 instances in AWS, still Capistrano


β€’ 2016: Docker + ECS (Elastic Container Service)


β€’ Deployed using in-house tool called Broadside


β€’ 2017: Kubernetes
GitHub (2022)
β€’ Dotcom


β€’ Kubernetes, deployed via chat-ops


β€’ Other services


β€’ Self-service Kubernetes-based framework called Moda


β€’ Kubernetes is the platform


β€’ Tooling abstracts away the details
2O YEARS
FTP Docker + Kubernetes
Rails has no official tool orguide to aide in
deploying an app into production.
TO REITERATE,
ActiveRecord
ActionText
ActiveJob
ActionMailbox
ActiveStorage
ActionCable
ActiveDeployment
? ?
?
?
What I want from ActiveDeployment
β€’ Launches my app. Runs my app on a remote server


β€’ Ease of use. Con
fi
g should be easy to grok


β€’ BYOS. Bring our own servers


β€’ Endemicity. Rails-native
These would be nice too
β€’ SSL/TLS certi
fi
cates installed/rotated automatically


β€’ Managed database instance


β€’ Sidekiq workers


β€’ Static asset server


β€’ No vendor lock-in
as turnkey as Heroku, as unrestricted as
Capistrano
BASICALLY I WANT IT TO BE
Planet Argon’s Ruby Community Survey Results, 2020
Who here uses Capistrano?
πŸ™‹
Capistrano
β€’ Server automation tool written in Ruby


β€’ Servers managed via remote SSH connections


β€’ Uses Rake tasks under the hood
Why Capistrano?
β€’ Simple. It’s just rake tasks + SSH


β€’ Flexible. No limits on what you can do


β€’ Established. We’ve got years of prior art to guide us


β€’ Independent. No vendor lock-in


β€’ Ruby. Written in the language we all love
Why not Capistrano?
β€’ Bespoke. You have to do a lot of things yourself


β€’ Imperative. Is your server really in the state you think it’s in?


β€’ Not portable. Does everything still work if you upgrade the OS?


β€’ Server-focused. Thinks of servers as individual machines
Layers of abstraction
WE ARE
HERE
FTP + SSH
Capistrano
Chef/Puppet
Docker
Kubernetes
Layers of abstraction
WE


COULD BE
HERE
FTP + SSH
Capistrano
Chef/Puppet
Docker
Kubernetes
Why Kubernetes?
β€’ Extensible. Provides a true platform


β€’ Declarative. Tell Kubernetes what, not how


β€’ Portable. Deploy to any cloud provider with no con
fi
g changes


β€’ Cluster-focused. Servers are treated collectively as a single resource


β€’ Resilient. Restarts failed processes automatically


β€’ Scalable. Can scale on-demand
Introducing Kuby
+ =
Introducing Kuby
β€’ Kuby is ActiveDeployment for Rails apps


β€’ Packages and deploys your app into a Kubernetes cluster


β€’ Minimal, easy-to-read con
fi
guration


β€’ Supports major cloud providers


β€’ DigitalOcean, Linode, EKS (Amazon), Azure
Introducing Kuby
β€’ Rails-native


β€’ Deploys the secrets in credentials.yml


β€’ Automatically provisions a database instance


β€’ Creates a static asset server


β€’ Acquires SSL/TLS certi
fi
cates for your domain
Starter config
Kuby.define('Railsconf') do
environment(:production) do
docker do
credentials do
username app_creds[:DOCKER_USERNAME]
password app_creds[:DOCKER_PASSWORD]
email app_creds[:DOCKER_EMAIL]
end
image_url "docker.pkg.github.com/camertron/railsconf/railsconf"
end
kubernetes do
add_plugin :rails_app
provider :linode do
cluster_id app_creds[:LINODE_CLUSTER_ID]
access_token app_creds[:LINODE_ACCESS_TOKEN]
end
end
end
end
Your first deploy
$> bundle exec kuby -e production build
$> bundle exec kuby -e production push
$> bundle exec kuby -e production deploy
$> bundle exec kuby -e production setup
Kuby, ActiveDeployment for Rails Apps
Kubernetes is a true platform
BUT REMEMBER,
Plugins
β€’ kuby-redis: stand up Redis instances


β€’ kuby-sidekiq: easily add background job workers


β€’ kuby-prebundler: speed up bundle install


β€’ kuby-previews: deploy a copy of your app per pull request


β€’ kuby-anycable: deploys anycable’s go-based RPC components
Add Sidekiq
require "kuby/sidekiq"

add_plugin(:sidekiq) do
replicas 2 # run two workers
end
In your Kuby con
fi
g:
Add Sidekiq
if Rails.env.production
?

Sidekiq.configure_server do |config
|

config.redis = Kuby.environment.kubernetes.plugin(:sidekiq).connection_param
s

end
Sidekiq.configure_client do |config
|

config.redis = Kuby.environment.kubernetes.plugin(:sidekiq).connection_param
s

end
end
In con
fi
g/initializers/sidekiq.rb:
Deploy Sidekiq
$> bundle exec kuby -e production build
$> bundle exec kuby -e production push
$> bundle exec kuby -e production deploy
$> bundle exec kuby -e production setup
(because we added a plugin)
The Platform
β€’ Capistrano:


β€’ Machine running FTP server or SSH daemon


β€’ Kubernetes:


β€’ Container scheduler, scaling, fault tolerance


β€’ Networking, load-balancing, ingress/egress


β€’ Persistent storage


β€’ Role-based access control
Other things you can do
β€’ kuby logs: Get logs from a web pod


β€’ kuby remote shell: Like SSH - start an interactive shell in a web pod


β€’ kuby remote console: Like rails console


β€’ kuby remote dbconsole: Like rails dbconsole


β€’ kuby kubectl: Run arbitrary kubectl commands


β€’ … and much more
Resources
β€’ getkuby.io


β€’ github.com/getkuby


β€’ github.com/getkuby/kuby-core
Also, I need help! Let’s make Kuby awesome together.
Kuby, ActiveDeployment for Rails Apps
Thank you!
Questions?

More Related Content

PDF
Hosting Ruby Web Apps
PPTX
Deploying Web Apps with PaaS and Docker Tools
PPT
Deploying Rails at SeeClickFix
PDF
Implementing an Automated Staging Environment
PDF
Capistrano
PDF
Forced Evolution: Shopify's Journey to Kubernetes
PPTX
Capistrano 3 Deployment
PPT
Hosting a Rails App
Hosting Ruby Web Apps
Deploying Web Apps with PaaS and Docker Tools
Deploying Rails at SeeClickFix
Implementing an Automated Staging Environment
Capistrano
Forced Evolution: Shopify's Journey to Kubernetes
Capistrano 3 Deployment
Hosting a Rails App

Similar to Kuby, ActiveDeployment for Rails Apps (20)

PDF
OSMC 2017 | Groovy There is a Docker in my Dashing Pipeline by Kris Buytaert
PDF
Groovy there's a docker in my application pipeline
PDF
Rock Solid Deployment of Web Applications
PDF
Capistrano for non-rubyist
KEY
Heroku + Jeweler & Gemcutter
PDF
Railsconf 2014 - Deploying Rails is Easier Thank It Looks
PDF
Deploying Rails Applications with Capistrano
PPT
Real World Rails Deployment
PDF
Kubernetes Intro
KEY
Rails Usergroup Hamburg: Heroku
PDF
Large-scaled Deploy Over 100 Servers in 3 Minutes
KEY
Rails tools
PDF
KubeCon 2019 Recap (Parts 1-3)
PDF
Kubernetes Deployments: A "Hands-off" Approach
PDF
Symfony Live NYC 2014 - Rock Solid Deployment of Symfony Apps
PDF
SymfonyCon Madrid 2014 - Rock Solid Deployment of Symfony Apps
PDF
Advanced technic for OS upgrading in 3 minutes
PPTX
CI/CD Pipeline with Kubernetes
PDF
Evolving for Kubernetes
PDF
Velocity NYC 2017: Building Resilient Microservices with Kubernetes, Docker, ...
OSMC 2017 | Groovy There is a Docker in my Dashing Pipeline by Kris Buytaert
Groovy there's a docker in my application pipeline
Rock Solid Deployment of Web Applications
Capistrano for non-rubyist
Heroku + Jeweler & Gemcutter
Railsconf 2014 - Deploying Rails is Easier Thank It Looks
Deploying Rails Applications with Capistrano
Real World Rails Deployment
Kubernetes Intro
Rails Usergroup Hamburg: Heroku
Large-scaled Deploy Over 100 Servers in 3 Minutes
Rails tools
KubeCon 2019 Recap (Parts 1-3)
Kubernetes Deployments: A "Hands-off" Approach
Symfony Live NYC 2014 - Rock Solid Deployment of Symfony Apps
SymfonyCon Madrid 2014 - Rock Solid Deployment of Symfony Apps
Advanced technic for OS upgrading in 3 minutes
CI/CD Pipeline with Kubernetes
Evolving for Kubernetes
Velocity NYC 2017: Building Resilient Microservices with Kubernetes, Docker, ...

Recently uploaded (20)

PPTX
innovation process that make everything different.pptx
PPTX
CHE NAA, , b,mn,mblblblbljb jb jlb ,j , ,C PPT.pptx
PDF
Cloud-Scale Log Monitoring _ Datadog.pdf
PDF
πŸ’° π”πŠπ“πˆ πŠπ„πŒπ„ππ€ππ†π€π πŠπˆππ„π‘πŸ’πƒ π‡π€π‘πˆ 𝐈𝐍𝐈 πŸπŸŽπŸπŸ“ πŸ’°
Β 
PDF
Paper PDF World Game (s) Great Redesign.pdf
PDF
Automated vs Manual WooCommerce to Shopify Migration_ Pros & Cons.pdf
PDF
APNIC Update, presented at PHNOG 2025 by Shane Hermoso
Β 
PPTX
Introduction to Information and Communication Technology
PDF
The New Creative Director: How AI Tools for Social Media Content Creation Are...
PDF
RPKI Status Update, presented by Makito Lay at IDNOG 10
Β 
PPTX
June-4-Sermon-Powerpoint.pptx USE THIS FOR YOUR MOTIVATION
PPT
isotopes_sddsadsaadasdasdasdasdsa1213.ppt
PPTX
Funds Management Learning Material for Beg
PDF
How to Ensure Data Integrity During Shopify Migration_ Best Practices for Sec...
PPT
Design_with_Watersergyerge45hrbgre4top (1).ppt
PDF
Best Practices for Testing and Debugging Shopify Third-Party API Integrations...
PPTX
Job_Card_System_Styled_lorem_ipsum_.pptx
PDF
Tenda Login Guide: Access Your Router in 5 Easy Steps
PDF
An introduction to the IFRS (ISSB) Stndards.pdf
PDF
WebRTC in SignalWire - troubleshooting media negotiation
innovation process that make everything different.pptx
CHE NAA, , b,mn,mblblblbljb jb jlb ,j , ,C PPT.pptx
Cloud-Scale Log Monitoring _ Datadog.pdf
πŸ’° π”πŠπ“πˆ πŠπ„πŒπ„ππ€ππ†π€π πŠπˆππ„π‘πŸ’πƒ π‡π€π‘πˆ 𝐈𝐍𝐈 πŸπŸŽπŸπŸ“ πŸ’°
Β 
Paper PDF World Game (s) Great Redesign.pdf
Automated vs Manual WooCommerce to Shopify Migration_ Pros & Cons.pdf
APNIC Update, presented at PHNOG 2025 by Shane Hermoso
Β 
Introduction to Information and Communication Technology
The New Creative Director: How AI Tools for Social Media Content Creation Are...
RPKI Status Update, presented by Makito Lay at IDNOG 10
Β 
June-4-Sermon-Powerpoint.pptx USE THIS FOR YOUR MOTIVATION
isotopes_sddsadsaadasdasdasdasdsa1213.ppt
Funds Management Learning Material for Beg
How to Ensure Data Integrity During Shopify Migration_ Best Practices for Sec...
Design_with_Watersergyerge45hrbgre4top (1).ppt
Best Practices for Testing and Debugging Shopify Third-Party API Integrations...
Job_Card_System_Styled_lorem_ipsum_.pptx
Tenda Login Guide: Access Your Router in 5 Easy Steps
An introduction to the IFRS (ISSB) Stndards.pdf
WebRTC in SignalWire - troubleshooting media negotiation

Kuby, ActiveDeployment for Rails Apps

  • 1. Cameron C. Dutro Kuby: ActiveDeployment forRails Apps
  • 3. Who is this guy? β€’ Cameron Dutro β€’ I work at GitHub β€’ He/him/his β€’ Go Seahawks!
  • 4. Rails is awesome β€’ Easy for beginners! β€’ Simple database tools! β€’ Super-fast development experience! β€’ A right place for every fi le! β€’ Generators! Gems! Community! β€’ Take that, Java! β€œOOPS!”
  • 6. Rails has no official tool orguide to aide in deploying an app into production. THE UNFORTUNATE TRUTH IS,
  • 7. RR 403: Rails Needs Active Deployment with Stefan Wintermeyer March 12th, 2019 β€œ ” In my experience, deployment is one of the major problems of normal Rails users… it is a big pain to set up a deployment system for a Rails application, and I don’t see anything out there that makes it easier. - Stefan Wintermeyer
  • 8. RR 403: Rails Needs Active Deployment with Stefan Wintermeyer March 12th, 2019 β€œ ” I believe that we lose quite a lot of companies and new developers on this step. Because everything else [is] so much easier with Rails… but that last step - and it’s a super important step - is still super complicated. - Stefan Wintermeyer
  • 9. Our options β€’ Heroku? Expensive β€’ EC2 instance + capistrano? Dif fi cult β€’ EC2 instance + Chef/Puppet/Ansible? So much to learn β€’ Render, Fly, Cloud 66 Easy but vendor lock-in
  • 11. Today’s journey Cameron circa 2000 β€’ What do we mean by β€œdeployment”? β€’ How deployment has changed in the last ~20 years β€’ The state-of-the-art in Rails land β€’ ActiveDeployment (a.k.a. Kuby)
  • 12. What is deployment? β€’ You’ve built a great website and you want to put it online β€’ Need a computer to run it on β€’ (Ideally not your laptop) β€’ Need to install software that listens for requests, invokes your code, and sends back the response β€’ Might need a domain name (mycoolsite.com) β€’ Might need persistent storage like a database
  • 13. CCM Glass β€’ In 2002 I built my fi rst website β€’ Pure hand-coded HTML β€’ Deployed to free hosting provider β€’ Free hosting, powered by ads β€’ Files deployed via FTP
  • 14. PHP (2004 - 2010) β€’ More dynamic β€’ Able to store and retrieve data from MySQL β€’ Still deploying via FTP
  • 15. Fluther (2010) β€’ First job out of college β€’ Django app (Python) β€’ MySQL database β€’ Solr full-text search β€’ Deployed using Capistrano β€œDr. Jelly”
  • 16. Twitter (2011) β€’ Thousands of app servers β€’ Deployments too slow using Capistrano β€’ Wrote our own deployment tool β€’ Servers pull code from each other via BitTorrent β€’ First server seeds new version
  • 17. Twitter β€’ In 2013, Twitter switched to Apache Mesos β€’ β€œProgram against your datacenter like it’s a single pool of resources” β€’ Many distinct services (geolocation, photos, twitter.com, etc) β€’ Services isolated from each other on the same host β€’ Resource allocation, ports, etc con fi gured declaratively
  • 18. Lumos Labs β€’ 2014: VPSes in Softlayer β€’ Bespoke Capistrano setup + Chef β€’ Deployed via in-house web app called Catapult β€’ 2015: EC2 instances in AWS, still Capistrano β€’ 2016: Docker + ECS (Elastic Container Service) β€’ Deployed using in-house tool called Broadside β€’ 2017: Kubernetes
  • 19. GitHub (2022) β€’ Dotcom β€’ Kubernetes, deployed via chat-ops β€’ Other services β€’ Self-service Kubernetes-based framework called Moda β€’ Kubernetes is the platform β€’ Tooling abstracts away the details
  • 20. 2O YEARS FTP Docker + Kubernetes
  • 21. Rails has no official tool orguide to aide in deploying an app into production. TO REITERATE,
  • 23. What I want from ActiveDeployment β€’ Launches my app. Runs my app on a remote server β€’ Ease of use. Con fi g should be easy to grok β€’ BYOS. Bring our own servers β€’ Endemicity. Rails-native
  • 24. These would be nice too β€’ SSL/TLS certi fi cates installed/rotated automatically β€’ Managed database instance β€’ Sidekiq workers β€’ Static asset server β€’ No vendor lock-in
  • 25. as turnkey as Heroku, as unrestricted as Capistrano BASICALLY I WANT IT TO BE
  • 26. Planet Argon’s Ruby Community Survey Results, 2020
  • 27. Who here uses Capistrano? πŸ™‹
  • 28. Capistrano β€’ Server automation tool written in Ruby β€’ Servers managed via remote SSH connections β€’ Uses Rake tasks under the hood
  • 29. Why Capistrano? β€’ Simple. It’s just rake tasks + SSH β€’ Flexible. No limits on what you can do β€’ Established. We’ve got years of prior art to guide us β€’ Independent. No vendor lock-in β€’ Ruby. Written in the language we all love
  • 30. Why not Capistrano? β€’ Bespoke. You have to do a lot of things yourself β€’ Imperative. Is your server really in the state you think it’s in? β€’ Not portable. Does everything still work if you upgrade the OS? β€’ Server-focused. Thinks of servers as individual machines
  • 31. Layers of abstraction WE ARE HERE FTP + SSH Capistrano Chef/Puppet Docker Kubernetes
  • 32. Layers of abstraction WE 
 COULD BE HERE FTP + SSH Capistrano Chef/Puppet Docker Kubernetes
  • 33. Why Kubernetes? β€’ Extensible. Provides a true platform β€’ Declarative. Tell Kubernetes what, not how β€’ Portable. Deploy to any cloud provider with no con fi g changes β€’ Cluster-focused. Servers are treated collectively as a single resource β€’ Resilient. Restarts failed processes automatically β€’ Scalable. Can scale on-demand
  • 35. Introducing Kuby β€’ Kuby is ActiveDeployment for Rails apps β€’ Packages and deploys your app into a Kubernetes cluster β€’ Minimal, easy-to-read con fi guration β€’ Supports major cloud providers β€’ DigitalOcean, Linode, EKS (Amazon), Azure
  • 36. Introducing Kuby β€’ Rails-native β€’ Deploys the secrets in credentials.yml β€’ Automatically provisions a database instance β€’ Creates a static asset server β€’ Acquires SSL/TLS certi fi cates for your domain
  • 37. Starter config Kuby.define('Railsconf') do environment(:production) do docker do credentials do username app_creds[:DOCKER_USERNAME] password app_creds[:DOCKER_PASSWORD] email app_creds[:DOCKER_EMAIL] end image_url "docker.pkg.github.com/camertron/railsconf/railsconf" end kubernetes do add_plugin :rails_app provider :linode do cluster_id app_creds[:LINODE_CLUSTER_ID] access_token app_creds[:LINODE_ACCESS_TOKEN] end end end end
  • 38. Your first deploy $> bundle exec kuby -e production build $> bundle exec kuby -e production push $> bundle exec kuby -e production deploy $> bundle exec kuby -e production setup
  • 40. Kubernetes is a true platform BUT REMEMBER,
  • 41. Plugins β€’ kuby-redis: stand up Redis instances β€’ kuby-sidekiq: easily add background job workers β€’ kuby-prebundler: speed up bundle install β€’ kuby-previews: deploy a copy of your app per pull request β€’ kuby-anycable: deploys anycable’s go-based RPC components
  • 42. Add Sidekiq require "kuby/sidekiq"
 add_plugin(:sidekiq) do replicas 2 # run two workers end In your Kuby con fi g:
  • 43. Add Sidekiq if Rails.env.production ? Sidekiq.configure_server do |config | config.redis = Kuby.environment.kubernetes.plugin(:sidekiq).connection_param s end Sidekiq.configure_client do |config | config.redis = Kuby.environment.kubernetes.plugin(:sidekiq).connection_param s end end In con fi g/initializers/sidekiq.rb:
  • 44. Deploy Sidekiq $> bundle exec kuby -e production build $> bundle exec kuby -e production push $> bundle exec kuby -e production deploy $> bundle exec kuby -e production setup (because we added a plugin)
  • 45. The Platform β€’ Capistrano: β€’ Machine running FTP server or SSH daemon β€’ Kubernetes: β€’ Container scheduler, scaling, fault tolerance β€’ Networking, load-balancing, ingress/egress β€’ Persistent storage β€’ Role-based access control
  • 46. Other things you can do β€’ kuby logs: Get logs from a web pod β€’ kuby remote shell: Like SSH - start an interactive shell in a web pod β€’ kuby remote console: Like rails console β€’ kuby remote dbconsole: Like rails dbconsole β€’ kuby kubectl: Run arbitrary kubectl commands β€’ … and much more
  • 47. Resources β€’ getkuby.io β€’ github.com/getkuby β€’ github.com/getkuby/kuby-core Also, I need help! Let’s make Kuby awesome together.