Kuby.define('my-app') do environment(:production) do docker do credentials do username ENV['DOCKER_USERNAME'] password ENV['DOCKER_PASSWORD'] email ENV['DOCKER_EMAIL'] end image_url 'registry.gitlab.com/me/my-app' end kubernetes do provider :digitalocean do access_token ENV['DIGITALOCEAN_ACCESS_TOKEN'] cluster_id 'my-cluster-id' end add_plugin :rails_app do hostname 'mywebsite.com' database do user ENV[:DB_USER] password ENV[:DB_PASSWORD] end end end end end
This is all you need to deploy your Rails app to your favorite cloud provider. Kuby's convention-over-configuration approach means it uses smart defaults to deploy your app in a standard way. There isn't any complicated documentation to read, and aside from Docker, no additional tools to install.
Powerful Plugin System
Kuby features a plugin system that can make adding features like background jobs really easy. For example, add Sidekiq integration with a single
add_plugin :sidekiq statement. Kuby comes with a bunch of plugins out-of-the-box, with others installable as ruby gems.
Kuby automatically stands up a database for your app based on the contents of your database.yml. Just provide the database credentials and Kuby will do the rest, including automatically connecting to the right host.
Deploy with a Single Command
Deployment can be done easily by running
bundle exec kuby -e production deploy. Running this command will deploy the most recently created Docker image for your app to your Kubernetes cluster.
kuby executable comes with a number of useful commands for administering your Kubernetes cluster. It's essentially a bunch of convenient sugar on top of
kubectl, Kubernetes' command-line interface. Know your way around
kubectl? No problem.
kuby can run arbitrary
kubectl commands too.
Automated TLS Certificates
Kuby uses Let's Encrypt to automatically generate and install TLS certificates for your Rails app. Certificates are free and automatically rotated, so you can be sure your app stays secure.
TLS certificate integration is a good example of a Kuby plugin. The cert-manager plugin leverages the Kubernetes native cert-manager operator and makes it available inside your cluster with no additional configuration.
Static Asset Server
Kuby automatically stands up a separate server for your static assets, freeing up your Rails app to serve requests. Kuby uses Nginx, a popular webserver, that's fast and efficient.
Asset compilation and static asset server setup happens transparently during the Docker build and Kubernetes deploy without any additional configuration.