Rapid release iteration with Replicated and Tilt

Ian Zink
 | 
Dec 19, 2022

When making a new release or adding new features to an existing release it’s very useful to have a rapid iteration development environment. We describe here how to setup an inner loop development cycle with Application Manager (KOTS) and use Tilt to automate that inner loop for truly rapid release iteration.

Circular diagram showing kots upload and kots download to make an iteration loop

Prerequisites for rapid release iteration

  • Tilt is installed (if just want to experience the inner loop without automation, you can leave this and run kots upload manually). Tilt is a tool for rapid iteration that watches files and takes actions -- in our case running the kots the command.
  • The kots plugin is installed in your kubectl CLI
  • The kubectl context is set to the cluster you want to use for rapid iteration
  • An application release deployed into a cluster for development

To begin rapid iteration, access your application manager console. Navigate to the files page, and you’ll see at the top of the page “Need to edit these files? Click here to learn how”. Click there and you will be presented with a dialog. These are the commands you will use for the inner development loop to support rapid release iteration. 

Web browser showing view Files Pane

A dialog like the one below will open. These are the two commands necessary for the inner loop development cycle:

Web browser showing the kots application file download dialog

First run the download command download the release:

[.pre]mkdir rapid-iterationcd rapid-iterationkubectl kots download
--namespace iz-test-app --slug iz-test-app
# Use the command given to you in the dialog above[.pre]

Now let’s setup our Tiltfile.

Create a file called Tiltfile in your local directory with contents like the below. Change the slug and folder names to match your application.

[.pre]local_resource ( "kots" , "kubectl kots upload --namespace default --slug iz-test-app ./iz-test-app --deploy --skip-preflights" , deps= "./iz-test-app" )[.pre]

Next let’s bring Tilt up:

[.pre]tilt up[.pre]

A console window showing Tilt active

Now you can load the url that tilt provided:

A Browser window show initial Tilt UI

Now that we can see that Tilt is synchronizing our release with KOTS, we’re ready to try making a change to our release.

A browser with tilt UI showing initial activity

For this example let’s add a new log file collector with the following contents under iz-test-app/upstream.

[.pre]apiVersion: troubleshoot.sh/v1beta2kind: SupportBundlemetadata: name: iz-test-appspec: collectors: - logs: selector: - app.kubernetes.io/instance=wordpress[.pre]

You’ll see a new a Tilt log show up

A browser window with Tilt UI showing new activity from watcher

Notice in the kots admin console we can see it was uploaded by kots:

Web browser with app manager console showing KOTS upload

We can see the file was updated:

Web browser with file explorer in app manager showing new file

And now let’s collect a new support bundle and see if our log file was collected:

A browser window displaying support bundle analysis showing pod log is now being collected

This demonstrated how we can use rapid release iteration with Tilt to make enhancements to replicated releases.Even if you don't choose to use Tilt to automate the inner loop like we did here, we hope you find the idea of using an inner loop with in your development cycle with releases useful and you can use this knowledge to advance your application releases more quickly.