mirror of
https://github.com/jpetazzo/container.training.git
synced 2026-02-14 17:49:59 +00:00
➕ Add ngrok token instructions
This commit is contained in:
@@ -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`
|
||||||
|
|||||||
@@ -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
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user