/tilt-rancher-example

Local Dev Example with Helm, Rancher Desktop, and Tilt

Primary LanguageStarlarkMIT LicenseMIT

Local Dev Example with Helm, Rancher Desktop, and Tilt

Easy local development with Kubernetes, without Docker.

Tilt dashboard screenshot

This example uses the MERN Stack Example application from MongoDB to show how to containerize and run an existing application in Tilt and Rancher Desktop.

Setup

  1. Install Rancher Desktop.
  2. Install Tilt.
  3. Clone this repository to your machine.
  4. Run git submodule init and git submodule update to clone the mern-stack-example code into the mern-stack-example directory.
  5. Run tilt up. (Note that when you quit Tilt with ctrl-C, the k8s workloads continue to run in the background. Run tilt down to destroy them.)
  6. Navigate to Tilt dashboard at http://localhost:10350/ to watch service startup.
  7. Navigate to web interface at http://localhost:3000/.

Code Organization

Implementation Notes

This example includes 3 services:

  • mongodb: Loaded from Bitnami MongoDB Helm chart
  • client: A React web application
  • server: An Express API service

These service have been copied / adapted from https://github.com/mongodb-developer/mern-stack-example.

The mongodb service is installed from the Bitnami helm chart. The MERN example applications are from MongoDB's MERN Stack example application

Both client and server have live updates enabled. If any files in the source directory are changed, Tilt will copy them into the running container.

Accessing Services

Individual services are also exposed directly on different ports - see the Tilt dashboard for links to individual services.

Known issue:

  • Please we've encounterer problem when running npm install with package-lock.json in mern-stack-example/mern/client. Please try to run 'npm i' locally first. If it still failed please switch to node 14.x