Add ngrok token instructions

This commit is contained in:
Jérôme Petazzoni
2024-02-21 23:40:19 +01:00
parent 633c29b62c
commit 4fcd490b30
2 changed files with 50 additions and 14 deletions

View File

@@ -198,21 +198,9 @@ Some examples ...
(the Node "echo" app, the Flask app, and one ngrok tunnel for each of them) (the Node "echo" app, the Flask app, and one ngrok tunnel for each of them)
.lab[ - We will need an ngrok account for the tunnels
- Go to the webhook directory: (a free account is fine)
```bash
cd ~/container.training/webhooks/admission
```
- Start the webhook in Docker containers:
```bash
docker-compose up
```
]
*Note the URL in `ngrok-echo_1` looking like `url=https://xxxx.ngrok.io`.*
--- ---
@@ -250,6 +238,42 @@ class: extra-details
--- ---
## Ngrok tokens
- If you're attending a live training, you might have an ngrok token
- Look in `~/ngrok.env` and if that file exists, copy it to the stack:
.lab[
```bash
cp ~/ngrok.env ~/container.training/webhooks/admission/.env
```
]
---
## Starting the whole stack
.lab[
- Go to the webhook directory:
```bash
cd ~/container.training/webhooks/admission
```
- Start the webhook in Docker containers:
```bash
docker-compose up
```
]
*Note the URL in `ngrok-echo_1` looking like `url=https://xxxx.ngrok.io`.*
---
## Update the webhook configuration ## Update the webhook configuration
- We have a webhook configuration in `k8s/webhook-configuration.yaml` - We have a webhook configuration in `k8s/webhook-configuration.yaml`

View File

@@ -1,3 +1,11 @@
# Note: Ngrok doesn't have an "anonymous" mode anymore.
# This means that it requires an authentication token.
# That said, all you need is a free account; so if you're
# doing the labs on admission webhooks and want to try
# this Compose file, I highly recommend that you create
# an Ngrok account and set the NGROK_AUTHTOKEN environment
# variable to your authentication token.
version: "3" version: "3"
services: services:
@@ -5,6 +13,8 @@ services:
ngrok-echo: ngrok-echo:
image: ngrok/ngrok image: ngrok/ngrok
command: http --log=stdout localhost:3000 command: http --log=stdout localhost:3000
environment:
- NGROK_AUTHTOKEN
ports: ports:
- 3000 - 3000
@@ -16,6 +26,8 @@ services:
ngrok-flask: ngrok-flask:
image: ngrok/ngrok image: ngrok/ngrok
command: http --log=stdout localhost:5000 command: http --log=stdout localhost:5000
environment:
- NGROK_AUTHTOKEN
ports: ports:
- 5000 - 5000