A microservice app that demonstrates the power of Tilt.
(Like Miguel de Cervantes, but with servers!)
- Install
tilt
- Start a local Kubernetes cluster
- Verify you have
m4
(either through XCode Command Line Tools on Mac orapt install m4
on Linux) git clone git@github.com:tilt-dev/servantes.git
cd servantes
tilt up
This will deploy several microservice apps in to the default namespace of your current kubernetes cluster. Use the arrow keys to navigate between services in the Tilt HUD. Hit 'b' to open a service in the (B)rowser; the service fe
is the frontend, and the most interesting to look at.
If you're exploring Tilt via Servantes, here are some things you can do to Servantes to see features of Tilt.
The Snack service is easy to edit. Open the file snack/main.go
and find the constant strings that are the options for snacks it will recommend. Comment all them out and write "Hello Tilt". Save, and watch Tilt build and update. Then reload Servantes in your web browse and see the new string.
Tilt's UX is built to highlight active problems, no matter where they're happening. Here are some ways you can break Servantes and see errors in Tilt.
In snack/main.go
, type in random characters and save. Tilt will start a build, and when it fails put the error in the HUD.
Fix the error and move on.
Kubernetes Pods can get into CrashLoopBackOff
when they can't startup, e.g. because they can't find a necessary resource file.
Tilt's onboarding is nifty because you can do it interactively, as described in our Tutorial. Instead of writing your config first then running Tilt, Tilt watches your config and updates itself as you configure it.
You can recreate this experience by resetting to a pre-Tilt state and then adding it back in:
- Stop tilt
- Run
tilt down
to delete what Tilt has created - Open
Tiltfile
in your editor and delete/comment out the entire contents. - Run
tilt up
with an empty Tiltfile - Add lines back (you'll want to add it back in the order in the original Tiltfile).
You can see Tilt spring to life as it gets more data.
Tilt can update Kubernetes in seconds, not minutes by using live_update
. Because Servantes is a demo app, most services are small enough that they don't need optimizations. We purposely built our frontend to have a slow build (it links in the Kubernetes client library which can take minutes to build). Servantes uses live_update
for the frontend to demo Tilt's speed at updating running services.
In fe/main.go
, change the constant maxWidgets
to display fewer widgets. Tilt will update fe
in-place in seconds. Then reload Servantes and you should see your chosen number of services.