Skip to content
This repository has been archived by the owner on Oct 21, 2024. It is now read-only.

Commit

Permalink
Merge pull request #29 from kurtosis-tech/galenmarchetti-condense-readme
Browse files Browse the repository at this point in the history
docs: condensing readme
  • Loading branch information
galenmarchetti authored Aug 6, 2024
2 parents d53699d + eb8cc5f commit 664ab28
Showing 1 changed file with 23 additions and 53 deletions.
76 changes: 23 additions & 53 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,20 @@

Welcome to the Kardinal Playground! This codespace contains a demo showing how you can safely test new features in ultra-lightweight development environments using Kardinal. 🚀 It takes about 5 minutes, 3 of which are just waiting for the setup script to complete.

> **Note**: Want to try the demo with Neon PostgreSQL instead of vanilla PostgresSQL? Check out the [Neon PostgreSQL Demo](#-neon-postgresql-demo) section below!
In this demo, you will:

1. Set up a Kubernetes cluster with a demo online boutique app installed on it (3 minutes)
2. Visualize your stable, staging cluster using the Kardinal Dashboard (30 seconds)
3. Use Kardinal to set up a lightweight "dev environment" inside of your cluster so you can quickly and efficiently test changes (30 seconds)
4. Visualize your cluster in the Kardinal Dashboard again, to see how the Kardinal "dev environment" is structured (30 seconds)
5. Clean up the dev flow and return the cluster to normal state (15 seconds)

## 🛠 Features

- 🐦 Kardinal: Our developer tool for spinning up ultra-lightweight development environments in Kubernetes
## 🚀 Codespace

## 🚀 Getting Started
Create a new Codespace from this repository using the button below. Once setup is complete, run through the steps in the "Usage Guide" section.

[![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://github.com/codespaces/new?hide_repo_select=true&ref=main&repo=818205437&skip_quickstart=true&machine=standardLinux32gb&devcontainer_path=.devcontainer%2Fdevcontainer.json)

1. 🏗 Create a new Codespace from this repository.
2. 🎉 Once setup is complete, run through the steps in the "Usage Guide" section

## 📊 About the Online Boutique App

The Online Boutique app is a cloud-native microservices demo application. It's a web-based e-commerce app where users can browse items, add them to the cart, and purchase them.

This setup demonstrates a microservices architecture, making it an ideal example for showcasing Kardinal's capabilities in managing development environments.

## 🗺 Usage Guide

Expand All @@ -40,78 +30,58 @@ Follow these steps to explore the Kardinal Playground.

This can take around 3 minutes 🕰️.

2. 🔗 Set up port forwarding and start nginx:
2. 🛍️ Explore the main online boutique deployment:
```
./scripts/forward.sh
```
This script will set up port forwarding and start nginx. Use the codespaces URL that is printed on the screen.

3. 🛍️ Explore the main online boutique deployment:
- Use the nginx URL provided by the forward.sh script
- Browse through the online store and add items to your cart to generate some traffic
- This might take a few seconds and a few retries as sometimes the local port forwarding takes a few seconds to come up
This script will forward the main demo application port from within Codespaces to a URL you can access

4. 📊 Visualize the application structure on app.kardinal.dev:
- Open a new terminal
- Get your Kardinal URL by running:
Now, explore the application:
- Use the URL provided by the forward.sh script
- Browse through the online store and add items to your cart
- To see your application architecture, get your dashboard URL by running the following:
```
echo "https://app.kardinal.dev/$(cat ~/.local/share/kardinal/fk-tenant-uuid)/traffic-configuration"
```
- Open the URL provided by the command above in your browser
- Observe the current structure of the deployment
5. 🔧 Create the dev flow:
3. 🔧 Create the dev flow:
```
kardinal flow create frontend leoporoli/newobd-frontend:dev
```
This command sets up a development version of the frontend alongside the main version.
This command sets up a development version of the frontend alongside the main version. It will output a URL, but it's not yet accessible because it's inside the Codespace.
6. 🌐 Set up nginx for the dev instance:
- From the output of the previous command, copy the host value (it should look like `dev-[a-zA-Z0-9]+.app.localhost`)
- Kill any instances of the previous forwarding script
- Run a new nginx instance with this host:
- To interact with the dev version, copy the hostname from the previous command (it should look like `dev-[a-zA-Z0-9]+.app.localhost`)
- Run the following to forward the dev demo application port from within Codespaces to a URL you can access
```
./scripts/forward.sh [your-dev-host-value]
```
- Note the new codespaces URL
7. 🧪 Interact with the dev version:
- Use the nginx URL to access your dev instance of the online boutique
- Notice how two items are already in the cart as we seeded the dev database for you
- Access the dev frontend from the forwarded port
- Notice how two items are already in the cart, as the dev database is configured to be seeded with some dev data
- Browse through the store and add items to your cart in the dev version
8. 🔍 Compare the new structure on app.kardinal.dev:
- Go back to the dashboard
4. 🔍 Compare the new structure on app.kardinal.dev:
- Go back to the Kardinal dashboard
- Notice the changes in the environment:
- A dev version of the frontend is now deployed in the same namespace
- Dev traffic is routed to the dev version of the frontend
- The main version still works independently in the same namespace
9. 🌐 Set up nginx for the prod instance:
- Kill any instances of the previous forwarding script
- Restart the forwarding to forward to prod:
```
./scripts/forward.sh
```
- Note the new codespaces URL
10. 🔄 Verify main deployment functionality:
- Return to the main online boutique URL (the first nginx URL)
- Confirm that it still works and has not been impacted by the development workflow
11. 🧹 Clean up the dev flow:
5. 🧹 Clean up the dev flow:
```
kardinal flow delete <flow_id>
```
This command removes the development version of the app.
11. 🔎 Final dashboard check
- Return to the dashboard one last time
- Observe that the environment has been cleaned up and returned to its original state, with only the main services visible.
- Return to the main online boutique URL (the first nginx URL)
- Confirm that it still works and has not been impacted by the development workflow
This guide showcases the power of Kardinal by demonstrating the seamless creation and deletion of a dev environment alongside your main, stable setup. You'll experience firsthand how Kardinal enables isolated development without risking stability of a shared cluster, or disrupting the live environment. 🚀
## 🔗 Port Forwarding and nginx Explanation
## 🔗 Port Forwarding Explanation
We're using port forwarding in combination with nginx in this Codespace setup to make the various services accessible to you. We use Codespaces to forward URLs over the internet but add an nginx proxy to set the right hostname to hit the right lightweight environment
Expand Down

0 comments on commit 664ab28

Please sign in to comment.