- Use a more permissive version for the nginx Docker image the rails_app plugin uses for serving static assets.
- Remove accidentally-released
require 'sorbet-runtime'
in bin/kuby.
- Modify the Rails generator to add the
activerecord-cockroachdb-adapter
to your bundle. - Add the
LayerStack#replace
and correspondingDocker::Spec#replace
methods for replacing phases. This can be a lot easier than using#insert
and#delete
, which can mess with the relative order of the phases and cause surprising results. - Don't run init containers for creating and migrating the database if database management is turned off.
- Add support for configuring the number of web workers for puma (#124, @zhalltyemill)
- Add the ability to specify your app's root directory.
- Call
app_root <path>
inside thedocker
section of your Kuby config file. - Necessary for use-cases like apps living inside gem repos, etc.
- Call
- Add
:app_phase
to set of Docker build phases.- Allows easily setting environment variables.
- Sets the working directory to the app root if the app's root directory has been set via the
app_root
feature described above.
- Upgrade to Nginx ingress controller v1.1.1.
- Necessary to support Kind, the local Kubernetes cluster tool (see the kuby-kind gem).
- Run
bundle lock
before installing gem dependencies. - Fix bug causing errors when certain container registries return a 401 if the repo doesn't exist yet.
- I'm looking at you, Azure.
- Don't fail to deploy if the app doesn't use Active Record.
- Fix git merge issue causing no output when running
kuby dockerfiles
. - Upgrade integration tests to Kubernetes 1.23.
- This upgrade is incompatible with the version of KubeDB we're currently using.
- KubeDB has been replaced with the CockroachDB operator. Kuby will no longer support KubeDB after this release.
- Add ability to deploy resources into more than one namespace.
- Remove support for MySQL and Postgres in favor of CockroachDB.
- KubeDB has moved to an incompatible licensing model and Kuby can no longer use it.
- CockroachDB is now the only managed database offering (aside from SQLite) for the following reasons:
- CRDB is cloud-native, i.e. is designed to be run on cloud platforms like Kubernetes.
- CRDB can be easily upgraded in-place while both MySQL and Postgres demand a much more manual, error-prone upgrade process that proved very difficult to automate.
- CRDB is Postgres wire-compatible, meaning those who use Postgres (and I believe that accounts for the majority of Rails devs) will hardly be impacted by this change at all. While CRDB is not feature-by-feature compatible with Postgres, the differences are unlikely to be important to the average Rails app.
- Use SSL certificates instead of usernames and passwords for database authentication.
- This is the preferred way to communicate with instances of CockroachDB (also supported by Postgres).
- Kuby uses cert-manager to establish a custom PKI for database interactions.
- The Rails generator now entirely omits the database configuration section, making config simpler.
- Avoid failing on first deploy.
- Previous versions of Kuby did not wait for the database to spin up before attempting to start the Rails app, which resulted in what appeared to be a failed deploy. Kubernetes would eventually sort everything out, but it made for a less than ideal developer experience.
- The
create_unless_exists
rake task has been superceded by thebootstrap
rake task, which is run in an init container whenever the app boots. It is responsible for ensuring the database server is reachable and creating any users defined in the Kuby config.
- Add the ability for plugins to define their own set of rake tasks.
- These are runnable via the CLI.
- Add the ability for plugins to define a
#remove
routine, which is meant to do the opposite of whatever#setup
does.- It is now also possible to run a plugin's remove routine from the CLI.
- Add the ability for plugins to depend on things like Kubernetes and Helm.
- Uses semantic versioning and compares required versions to current versions.
- Avoid using the
which
command to find executables on the current PATH.which
has been deprecated in at least one Linux distro (Debian), perhaps others.- Use
Kuby::Utils.which
instead.
- Support Rails 7.
- Don't run
yarn install
if there's no package.json.
- Don't run
- Automatically cache Docker builds from the latest image, should it exist.
- Allow storage class to be customized when using the built-in bare metal provider.
- Fix a bug where the assets image would be built using the previous app image instead of the current one.
- Centralize the lookup of the Rails master key (not user-facing).
- Add descriptions to numerous CLI commands and their arguments.
- CLI now accepts multiple
--only
flags passed to subcommands likebuild
,push
, etc. - Allow running setup steps for individual plugins.
- Fix a few bugs caused by leaving
continue-on-error: true
in the GitHub actions config 🤦- Docker builds would fail if no previous images existed in the registry.
- The assets image would fail to build because
RAILS_MASTER_KEY
was not propagated correctly.
- Use the kuby-prebundler gem in the integration tests instead of a custom layer.
- Allow Bundler executable to be customized.
- Main use-case is to allow adding in the Prebundler plugin, https://github.com/getkuby/kuby-prebundler.
- Print error message and exit on missing Docker build args.
- Ignore with
--ignore-missing-args
.
- Ignore with
- Add an extra parameter to the Docker spec for specifying the URL of the Docker registry index.
- In most cases, the registry and registry index URLs will be the same. However Docker Hub, the default registry, uses index.docker.io for API requests (catalog, tags, etc) but only allows pushes to docker.io.
- Add config/master.key to the .dockerignore created by the Rails generator.
- This was an unfortunate oversight, but such are the perils of using pre-1.0 software.
- Print an error message if building images on non-x86 hardware.
- People with M1 Macs are running into mismatches between their laptop's arch and the arch of their hosting provider's hardware. The error message asks you to explicitly pass the
--platform
flag to Docker. - We may need to revisit this in the future if ARM processors become more popular.
- People with M1 Macs are running into mismatches between their laptop's arch and the arch of their hosting provider's hardware. The error message asks you to explicitly pass the
- Make RAILS_MASTER_KEY available in the assets image (@palkan, #63)
- Allow specifying custom docker build options via CLI (@palkan, #65)
- Fix handling rails/rake options in remote exec (@palkan, #60)
- Add
bundler_phase.gemfiles(*paths)
to allow adding additional gemfiles (@palkan, #61)
- Fix issue causing volume mount errors when k8s tries to schedule asset pods on multiple nodes (fixes #42).
- Persistent volumes can only be mounted on a single physical node.
- Kuby now creates a separate assets image powered by nginx.
- Ingress routes requests to either the Rails service or assets service depending on the URL (i.e. /assets).
- Since the ingress layer is now essential, the Docker Desktop provider no longer deletes ingresses or monkeys with service objects. You'll have to either 1) add an entry for your hostname to your hosts file, or 2) set the
Host
header when making requests to your app.
- Plugins can now specify additional Dockerfiles to build during
kuby build
. - Switch from TravisCI to Github Actions.
- Remove support for development environments.
- Proved to be too difficult to maintain.
- Kuby is a deployment tool anyway, not a dev tool.
- Maybe we can turn the dev stuff into a gem at some point.
- Refactor Docker image logic.
- Introduced the
Image
class and friends. - Deleted the
Kuby::Docker::Metadata
class.
- Introduced the
- Add missing git dependency to Alpine distro.
- Add a bare metal provider (fixes #10).
- Fix yarn phase
- Apparently you have to copy at least one file, TIL.
- Copy over .npmrc and .yarnrc before running yarn install.
- Don't include port in image host for registry secrets (no idea why)
- Include port in image host.
- Revamp Docker URL parsing
- Docker URLs shouldn't have a scheme.
- Add support for a Docker registry running on localhost.
- Correctly parse and handle URLs with specific ports.
- Only perform a Docker login if a username is provided.
- Fix spelling in error message.
- Use correct Docker Hub registry URL (index.docker.io).
- Alias Rails
config_map
toenv
.
- Properly namespace constant lookup for
Kubernetes::MissingPluginError
. - Add missing
#storage
method for Postgres plugin.
- Fix Rails generator.
- Causing
undefined method 'module_parent_name'
. Apparentlymodule_parent_name
wasn't introduced until Rails 6.
- Causing
- Raise friendlier error when attempting to add Docker credentials in the development environment.
- Raise friendlier error when attempting to set a username and password for SQLite databases.
- Fix bug causing crash when running CLI commands.
- Turns out was caused by adding a Sorbet type annotation inside an anonymous singleton class and forgetting to extend
T::Sig
. Thanks @lazyatom!
- Turns out was caused by adding a Sorbet type annotation inside an anonymous singleton class and forgetting to extend
- I've gone back and forth a few times on this, but I decided to put the initializer code back into the Rails generator.
- Attempt to auto-require the requested provider if it isn't registered.
- Adjust error message when provider can't be found to include reminder to add a require statement.
- Use integers for ports instead of strings to appease Kubernetes.
- Defer evaluation of database config until after Kuby has been configured.
- The issue that prompted this was that the
database
block was being evaluated before the Rails root had been set viaroot
. Kuby couldn't find database.yml in a non-standard location and blew up with an error.
- The issue that prompted this was that the
- Fix tests broken in 0.10.1.
- Set up Travis CI builds.
- Add a few tests for custom build phases.
- Add the
Environment#configured?
method that will returntrue
if Kuby has been configured andfalse
if configuration hasn't happened or is in progress. - Add sorbet typedefs for some classes.
- Fix issue in Rails generator (hadn't been updated with new
environment
block). - Add kuby-core.rb so Bundler setup works for Kuby without having to add a Rails initializer.
- Fix bug causing some
rails
andrake
commands to not be executed. - Fix issue restricting Docker CLI output.
- Set default database user and password in dev environment.
- Add ability to run rake tasks in dev environment.
- Disallow running rails and rake tasks in non-dev environments.
- Don't run database config through ERB.
- Rails env often isn't loaded, so ERB rendering can blow up with
NoMethodError
s, etc. - All we really need to know is what database engine to stand up.
- Rails env often isn't loaded, so ERB rendering can blow up with
- Require database user/password to be added manually to Kuby config.
- Run dev setup when asked to.
- Bug caused dev setup to be skipped even when requested.
- Deployer should be tolerant of missing namespace.
- Add support for developing your app using a local Kubernetes cluster.
- Includes a default
:development
Kuby environment.
- Includes a default
- Remove rake tasks in favor of a
kuby
executable powered by GLI. - Rename the
minikube
provider todocker_desktop
, which is more accurate. - Add more tests.
- Avoid running commands inside pods that aren't running or that are marked for deletion (#15).
- Pass
RAILS_MASTER_KEY
to Docker build (#14). - Add
kuby remote restart
command for manually restarting Rails pods. - Automatically restart Rails pods if deploy doesn't change the Docker image URL (#11).
- Fix database config rewriter task.
- Broke with refactoring of database config code.
- More correctly parse Docker image URLs.
- It can be challenging to identify the hostname in image URLs because 1) the host can be omitted, and 2) the scheme is often omitted.
- The new strategy is to look for a "." in the first segment of the URL if there is no scheme. It's not bulletproof but is better than what we had before, which was to assume the first segment was the host. Eg. for an image URL like camertron/foo, we would identify the host as "camertron."
- Add a number of tests and a Rails dummy app in spec/.
- Upgrade to Krane >= 1.1.4, < 2.0.
- Remove Krane monkeypatch in ext/.
- Implement a Rails static asset server.
- Move plugins from
Kuby::Kubernetes
namespace toKuby
namespace.- This is to eventually enable plugins to modify the Dockerfile and introduce additional Dockerfiles (i.e. to enable a development mode, etc).
- Pass
Environment
instead ofDefinition
instances around.- Providers, plugins, etc all take
Definition
instances.Definition#kubernetes
, for example, returns the Kubernetes spec for theEnvironment
specified byKUBY_ENV
(or the first env defined ifKUBY_ENV
is not set). This is a problem for Kuby configs that specify multiple environments, and causes plugins to make changes to the default environment instead of the one they've been specifically added to. For example, if the:production
env is defined first, the:development
env still gets a cluster issuer from cert-manager even thoughenable_tls
is set tofalse
.
- Providers, plugins, etc all take
- Fix issue causing
Kuby.environment(...)
to raise anUndefinedEnvironmentError
for existing environments.
- Fix timestamp tag parsing regression caused by adding anchor tags to the regex.
- Instead, let's rely on
strptime
and returnnil
if it throws anArgumentError
.
- Instead, let's rely on
- Automatically perform
docker login
if not already logged into the Docker registry. - Fix timestamp tag parsing issue causing deploy to fail with no available tags.
- Issue turned out to be ignoring the month of October in the validation regex.
- Fix issue causing database.yml to not be rewritten to point at correct database host.
- Don't load the Rails environment when running Kuby's rake tasks.
- Kuby's gems are still part of the bundle, but config has been moved out of the initializer and into kuby.rb in the Rails root directory.
- Internal classes no longer retain a reference to
Rails.application
. - Kuby config now requires
environment
blocks:Kuby.define('my-app') do environment(:production) do ... end environment(:staging) do ... end end
- Fix
MissingDistroError
caused by not setting a default distro. - Create a .dockerignore file when running the Rails generator.
- Add ability to insert inline Docker layers without having to create a separate class, eg:
insert :hello, before: :bundler_phase do |dockerfile| dockerfile.run('echo "hello, world"') end
- Add Postgres database support.
- Don't install sqlite libs by default.
- Modify Rails generator
- Require kuby and load config safely.
- Provide manual access to credentials via
ActiveSupport::EncryptedConfiguration
, which is necessary now that our rake tasks don't load the Rails environment.
- Add a convenience method for requesting the amount of block storage for the database.
- Add the ability to entirely disable database management via
manage_database false
. - Avoid deploying nginx-ingress if it's already deployed.
- Add rake task for running arbitrary
kubectl
commands.
- Fix Rails generators issue causing crash at startup.
- Add rake task to run arbitrary kubectl commands.
- Introduce simple managed package.
- Refactor deploy task into its own class.
- Fix Krane issue causing incorrect constant lookup and therefore deploy failures.
- See: Shopify/krane#720
- Fixed via monkeypatch in lib/ext/krane/kubernetes_resource.rb
- Move Docker timestamp tag logic into the
Tags
class. - Refactor Docker timestamp tag logic.
- Change deployment names so they're more descriptive of the role (i.e. web, worker, etc)
- Rails app deployment changes from [app_name]-deployment to [app_name]-web.
- Database deployment changes from [app_name]-[environment]-[adapter] to [app-name]-web-[adapter].
- Add shortcut for specifying number of Rails app replicas.
- Move registry secret from the
rails_app
plugin to the Kubernetes spec. - Fix rollback functionality.
- Move Kubernetes CLI error classes into kubernetes-cli gem.
- Update README to indicate Kuby supports Rails 5.1 and up.
- Depend on railties >= 5.1.
- Birthday!