This is a bash script for installing and managing all the dependencies of Tilt + Kind on Podman-based desktops such as Silverblue.
You can run this script from anywhere. To install it into your ~/.local/bin
:
mkdir -p ~/.local/bin
install <(curl -s https://raw.githubusercontent.com/fishpercolator/silverblue-tilt/main/tilt-setup.sh) ~/.local/bin/tilt-setup.sh
At the moment, the script takes no options - just run it:
tilt-setup.sh
It will:
- Check you have the latest versions of kubectl, kind, helm and tilt and install them into your
~/.local/bin
if not. - Create a Kind control plane container and registry if they don't already exist
- Start these pods if they have been stopped
This repo contains a Rails example application that you can use to verify your Tilt setup, and also potentially use as a base for building your own Rails applications using this setup.
git clone https://github.com/fishpercolator/silverblue-tilt.git
cd silverblue-tilt/rails-example
tilt up
The Rails application was initialized using:
rails new --javascript=esbuild --css=bulma -d postgresql rails-example
This puts some handy JS and CSS pipelines in place that can be used to verify that the live_update
features of the Tiltfile are working properly.
The environment was then customized for Tilt in this commit - specifically:
- Removed
bin/dev
andProcfile.dev
, since Tilt is taking the place of Foreman in our development environment - Added a
Containerfile.dev
that is similar to the defaultDockerfile
but runs everything in development mode. Ideally the common parts would be abstracted into their own module. - Added a
k8s.yaml
file that contains the Kubernetes configuration of the main app, including secret-sharing and ports. - Modified
database.yml
to refer to the Kubernetes resources rather than assuming a database on localhost. - Added a
Tiltfile
that configures a PostgreSQL database using Helm, and the app configuration itself, usinglive_update
to ensure the appropriate parts are rebuilt when things change. - Added a
tilt-run
script that allows you to run commands on the running application usingkubectl exec
. - The Tiltfile also contains two buttons that run common
tilt-run
commands - one for running new DB migrations, and one for completely resetting the DB to the seed values.
- Add options for dry run
- Add support for architectures other than amd64
- Add commands to stop and/or uninstall