-
Notifications
You must be signed in to change notification settings - Fork 10
Enable ingress in Getting Started tutorial #156
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
ruokun-niu
merged 16 commits into
drasi-project:main
from
ruokun-niu:getting-started-ingress
Oct 29, 2025
+87
−17
Merged
Changes from 4 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
98be234
completed dev conatiner
ruokun-niu e9ce47f
wip
ruokun-niu 25f7835
screenshot for codespace
ruokun-niu 9ea6478
completed docs;
ruokun-niu 22479e4
removed bold
ruokun-niu 063ae4c
removed kubectl patch command
ruokun-niu 7a5dca4
Merge branch 'main' into getting-started-ingress
ruokun-niu 945328e
spellcheck
ruokun-niu 5068d39
Update docs/content/getting-started/_index.md
amansinghoriginal e8af4c7
Apply suggestion from @Copilot
amansinghoriginal c723c32
Apply suggestion from @Copilot
amansinghoriginal df46e07
Apply suggestion from @Copilot
amansinghoriginal 06e97e9
updated devcontainer zip file link
ruokun-niu cda8314
Merge branch 'getting-started-ingress' of https://github.com/ruokun-n…
ruokun-niu eb31b67
Merge branch 'main' into getting-started-ingress
ruokun-niu 831088a
Merge branch 'main' into getting-started-ingress
ruokun-niu File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -59,7 +59,7 @@ To complete this tutorial, you need a Drasi environment and a PostgreSQL databas | |||||||||
| Complete one of the options described below before continuing to [Step 2](#step-2---create-the-postgresql-source): | ||||||||||
|
|
||||||||||
| {{< tabpane >}} | ||||||||||
| {{% tab header="GitHub Codespace" text=true %}} | ||||||||||
| {{% tab header="Github Codespaces" text=true %}} | ||||||||||
|
|
||||||||||
| The Getting Started Tutorial codespace is hosted in the Drasi [learning](https://github.com/drasi-project/learning) repo. Click this button to create a codespace: | ||||||||||
|
|
||||||||||
|
|
@@ -85,7 +85,7 @@ This folder contains files you will use later in the tutorial to create the Dras | |||||||||
| You can now proceed with the rest of the tutorial. | ||||||||||
|
|
||||||||||
| {{% /tab %}} | ||||||||||
| {{% tab header="VS Code Dev Container" text=true %}} | ||||||||||
| {{% tab header="VSCode DevContainer" text=true %}} | ||||||||||
| To use the Drasi Getting Started Dev Container, you will need to install: | ||||||||||
| - [Visual Studio Code](https://code.visualstudio.com/) (or [Insiders Edition](https://code.visualstudio.com/insiders)) | ||||||||||
| - Visual Studio Code [Dev Containers extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers) | ||||||||||
|
|
@@ -133,9 +133,27 @@ To adjust these settings in Docker Desktop: | |||||||||
| If the Dev Container startup fails, it is usually due to a problem with Docker resources. The following link contains instructions for [cleaning out unused containers and images](https://code.visualstudio.com/docs/devcontainers/tips-and-tricks#_cleaning-out-unused-containers-and-images). If this doesn't resolve your problem, you can contact the Drasi Team. | ||||||||||
|
|
||||||||||
| {{% /tab %}} | ||||||||||
| {{% tab header="Install Drasi" text=true %}} | ||||||||||
| {{% tab header="Local Setup" text=true %}} | ||||||||||
|
|
||||||||||
| As an alternative to completing this tutorial using a GitHub Codespace or VS Code Dev Container you can install Drasi on one of the supported platforms [Drasi Installation Guides](/how-to-guides/installation/). The complexity and time this will take depends on the platform you choose. After the installation completes, you will also need to configure the ingress controller in order to access the Debug Reaction later in the tutorial. | ||||||||||
|
|
||||||||||
| - **AKS/EKS**: Run the following command to install the Contour ingress controller: | ||||||||||
| ```bash | ||||||||||
| drasi ingress init | ||||||||||
| ``` | ||||||||||
| - **Kind**: Run the following command to install the Contour ingress controller: | ||||||||||
| ```bash | ||||||||||
| drasi ingress init --local-cluster | ||||||||||
| ``` | ||||||||||
| - **k3d**: Run the following command to install the Contour ingress controller: | ||||||||||
| ```bash | ||||||||||
| drasi ingress init --local-cluster --ingress-annotation "projectcontour.io/websocket-routes=/" | ||||||||||
| ``` | ||||||||||
| Or, if you are using Traefik as the ingress controller, run: | ||||||||||
| ```bash | ||||||||||
| drasi ingress init --use-existing --ingress-class-name traefik --ingress-ip-address 127.0.0.1 | ||||||||||
| ``` | ||||||||||
|
|
||||||||||
| As an alternative to completing this tutorial using a GitHub Codespace or VS Code Dev Container you can install Drasi on one of the supported platforms [Drasi Installation Guides](/how-to-guides/installation/). The complexity and time this will take depends on the platform you choose. | ||||||||||
|
|
||||||||||
| You will also need a PostgreSQL database where you can load the dataset used in the tutorial. The [Getting Started Tutorial Dataset](/reference/sample-data/getting-started/) page describes a way to easily setup a PostgreSQL server on Kubernetes and to load the required data. | ||||||||||
|
|
||||||||||
|
|
@@ -362,9 +380,9 @@ drasi list reaction | |||||||||
| You should expect to see the following response: | ||||||||||
|
|
||||||||||
| ``` | ||||||||||
| ID | AVAILABLE | MESSAGES | ||||||||||
| --------------------+-----------+----------- | ||||||||||
| hello-world-debug | true | | ||||||||||
| ID | AVAILABLE | INGRESS URL | MESSAGES | ||||||||||
| --------------------+-----------+----------------------------------------------------+----------- | ||||||||||
| hello-world-debug | true | http://hello-world-debug.drasi.<ip-address>.nip.io | | ||||||||||
| ``` | ||||||||||
|
|
||||||||||
| If your Reaction is not yet available (AVAILABLE = false), you can use the `drasi wait` command to wait for it to complete its startup: | ||||||||||
|
|
@@ -377,23 +395,77 @@ When `drasi wait` returns, your Debug Reaction is created and ready to use. | |||||||||
|
|
||||||||||
| Once the Debug Reaction is working (AVAILABLE = true), the Drasi Hello World solution is fully deployed and ready to test. | ||||||||||
|
|
||||||||||
| Because the Debug Reaction is running in Kubernetes, in order to connect its Web UI you must forward the container port to a local port. In the Dev Container terminal, run the following command: | ||||||||||
| Access the Debug Reaction Web UI as follows: | ||||||||||
|
|
||||||||||
| {{< tabpane >}} | ||||||||||
| {{% tab header="Github Codespaces" text=true %}} | ||||||||||
amansinghoriginal marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||||||||
| By default, the Debug Reaction is configured with an ingress. However, because Codespaces run in a containerized environment, you can't directly access the ingress URL shown in the output of the `drasi list reaction` command. | ||||||||||
|
|
||||||||||
| To access the Debug Reaction in Codespaces, you'll need to first apply a patch to configure the ingress properly: | ||||||||||
| ```bash | ||||||||||
| kubectl port-forward services/hello-world-debug-gateway 8080:8080 -n drasi-system | ||||||||||
| kubectl patch ingress hello-world-debug-reaction-ingress -n drasi-system \ | ||||||||||
| --type=json \ | ||||||||||
| --patch-file=resources/ingress-codespace-patch.yaml | ||||||||||
| ``` | ||||||||||
|
|
||||||||||
| Now open your browser and navigate to [http://localhost:8080](http://localhost:8080), where you will see the Debug Reaction UI shown here: | ||||||||||
| The GitHub Codespace setup script has already port-forwarded the traefik ingress controller to port 8080. We now need to update the port visibility settings to make port 8080 public: | ||||||||||
|
|
||||||||||
| 1. Go to the PORTS tab in VS Code and **Right click on port 8080** | ||||||||||
| 2. Select Port Visibility | ||||||||||
| 3. Mark it as public | ||||||||||
| 4. Make sure that the port is marked as Public. | ||||||||||
|
|
||||||||||
| {{< figure src="Codespaces_04_EnsurePublicPort.png" | ||||||||||
| alt="VS Code Ports tab showing how to make port 8080 public" width="100%" >}} | ||||||||||
|
|
||||||||||
| The demo should now be accessible at **`https://<your-codespace-id>-8080.app.github.dev/`**. You can access the UI by clicking on the browser link shown in the PORTS tab for port 8080. | ||||||||||
|
|
||||||||||
| {{% /tab %}} | ||||||||||
|
|
||||||||||
| {{% tab header="VSCode DevContainer" text=true %}} | ||||||||||
| By default, the Debug Reaction is configured with ingress and can be accessed directly using the URL from the `drasi list reaction` command output by appending `:8080` to the hostname. For example, if the ingress URL is `http://hello-world-debug.drasi.127.0.0.1.nip.io`, you would access the Debug Reaction at: | ||||||||||
| ``` | ||||||||||
| http://hello-world-debug.drasi.127.0.0.1.nip.io:8080 | ||||||||||
| ``` | ||||||||||
| {{% /tab %}} | ||||||||||
|
|
||||||||||
| {{% tab header="Local Setup" text=true %}} | ||||||||||
| - **AKS/EKS:** You can access the Debug Reaction using the ingress URL from the `drasi list reaction` command output. | ||||||||||
| - **Kind/k3d:** Please refer to the [ingress setup instructions](/reference/ingress/#using-ingress-in-local-clusters) for your local cluster to access the Debug Reaction using the ingress. | ||||||||||
|
|
||||||||||
| In addition to accessing the Debug Reaction via ingress, you can also port-forward the Debug Reaction service to your local machine. Run the following command in a terminal window: | ||||||||||
| ```bash | ||||||||||
| kubectl port-forward services/hello-world-debug-gateway 8080:8080 -n drasi-system | ||||||||||
| ``` | ||||||||||
| Now open your browser and navigate to [http://localhost:8080](http://localhost:8080), where you will see the Debug Reaction UI shown here: | ||||||||||
| {{< figure src="debug-reaction-ui.png" alt="Debug Reaction UI" width="70%" >}} | ||||||||||
| {{% /tab %}} | ||||||||||
|
|
||||||||||
| {{% /tabpane %}} | ||||||||||
|
|
||||||||||
| ## Step 5 - Test the Solution | ||||||||||
| To test the Hello World solution, you will need to add/update/delete data in the `Message` table of the PostgreSQL database, so you will need a way to run SQL commands. The Dev Container is pre-configured with [psql](https://www.postgresql.org/docs/current/app-psql.html), the PostgreSQL CLI, which will connect to the pre-installed PostgreSQL database. If you run the following command from a Dev Container terminal, it will create an interactive terminal session with the database in which you can enter SQL commands and see the results: | ||||||||||
|
|
||||||||||
| To test the Hello World solution, you will need to add/update/delete data in the `Message` table of the PostgreSQL database, so you will need a way to run SQL commands. | ||||||||||
|
|
||||||||||
| {{< tabpane >}} | ||||||||||
| {{% tab header="Github Codespaces" text=true %}} | ||||||||||
| The Github Codespace is pre-configured with [psql](https://www.postgresql.org/docs/current/app-psql.html), the PostgreSQL CLI, which will connect to the pre-installed PostgreSQL database. If you run the following command from a Dev Container terminal, it will create an interactive terminal session with the database in which you can enter SQL commands and see the results: | ||||||||||
|
||||||||||
| {{% tab header="Github Codespaces" text=true %}} | |
| The Github Codespace is pre-configured with [psql](https://www.postgresql.org/docs/current/app-psql.html), the PostgreSQL CLI, which will connect to the pre-installed PostgreSQL database. If you run the following command from a Dev Container terminal, it will create an interactive terminal session with the database in which you can enter SQL commands and see the results: | |
| {{% tab header="GitHub Codespaces" text=true %}} | |
| The GitHub Codespace is pre-configured with [psql](https://www.postgresql.org/docs/current/app-psql.html), the PostgreSQL CLI, which will connect to the pre-installed PostgreSQL database. If you run the following command from a Dev Container terminal, it will create an interactive terminal session with the database in which you can enter SQL commands and see the results: |
amansinghoriginal marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
amansinghoriginal marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
amansinghoriginal marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
amansinghoriginal marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.