Cuber: deploy your apps on Kubernetes easily (Heroku alternative)
Marco Colli
Posted on February 21, 2022
Cuber is an automation tool that makes it easy to publish your applications on Kubernetes. Cuber is a gem written in Ruby, but you can deploy apps in any language and framework.
TL;DR Define a Cuberfile, run cuber deploy and you will have your application running on Kubernetes (which is much cheaper than Heroku).
An automation tool that simplify the deployment of your apps on Kubernetes.
CUBER
Deploy your apps on Kubernetes easily.
What is Cuber?
Cuber is an automation tool (written in Ruby) that can package and deploy your apps (written in any language and framework) on Kubernetes.
Unlike other tools that add more options and more complexity to Kubernetes, Cuber is made to simplify and reduce the complexity, thus making the deployment process more standardized and reliable.
You just need to create a Cuberfile, with ~10 lines of code, and then type cuber deploy to package and deploy your app on any Kubernetes cluster.
Kubernetes is up to 80% cheaper compared to PaaS like Heroku and you can choose between different cloud providers (no lock-in)
It is also reliable and it can scale applications of any size
The only downside is that it's complex and requires many steps and configurations, even if most applications share the same needs...
Cuber makes Kubernetes simple and…
There are already many platforms and tools to publish and run your applications in the cloud:
Heroku is simple, but you get lock-in and high costs when you scale.
Capistrano works very well, but when you scale on multiple machines you need to manage each of them (and can become a pain when you start having 10+ servers).
Dokku and other projects are great projects, but they don't have horizontal scalability (you are constrained on a single server).
Managing servers and infrastructure directly (e.g. use droplets directly on DigitalOcean) is complex and time consuming and it doesn't scale well to tens or hundreds of servers.
Jenkins, Argo CD, Helm, kustomize and other devops tools for Kubernetes require deep knowledge of Kubernetes and they basically add complexity over complexity.
... And that's why, after using many of the above solutions, I built Cuber.
Cuber has the simplicity of a PaaS, like Heroku, while you get the cost of bare infrastructure (i.e. by using Kubernetes, instead of Heroku, you get a 80% cost reduction!).
Also, you don't have provider lock-in, since you can easily move to any Kubernetes provider (e.g. DigitalOcean, Vultr, Google Cloud, AWS, or any other).
How it works
You just need to create a Cuberfile for your application (it is somewhat similar to a Procfile for Heroku or a Capfile for Capistrano).
the Git repo (i.e. the location of the Git repo, where to get the source code)
how to build the application (i.e. in the above example we use automatic builds with Heroku Buildpacks, but we can also provide a Dockerfile if we prefer)
where the store the Docker image of our application (i.e. the Docker repository)
the Kubernetes cluster (i.e. where to deploy our application)
the process to run (i.e. in this case we define the web server process, but we can also add background workers and other custom processes)
the environment variables and secrets that we want to make available to our running application.
This is only a basic example, but you can also add more configurations (e.g. database migrations, ssl, etc.)
After defining your Cuberfile, you can deploy your application to Kubernetes with a single command:
$ cuber deploy
This command will run a CI/CD pipeline:
Checkout the code from the Git repository
Build the app using Buildpacks or Docker
Publish the Docker image in the Docker registry
Run your app on Kubernetes
Finally you can see the status of your running application:
$ cuber info
There's even more
Using Cuber, it's not only simple to deploy an application, but it's simple to maintain it over time.
When you need to change a configuration, simply edit the Cuberfile and then type cuber deploy again.
You can also run maintenance task directly on your cluster:
$ cuber run [yourcommand]
For example with a Rails application you can run:
$ cuber run rails db:migrate
$ cuber restart
Or you can run interactive shells, for example:
$ cuber run bash
$ cuber run rails console
You can even see your application logs with a simple command:
$ cuber logs
Built for production
Cuber is a new project, but it uses the best practices and it is a solid tool meant for production.