diff --git a/slides/k8s/admission.md b/slides/k8s/admission.md index 681890fd..9c9e0914 100644 --- a/slides/k8s/admission.md +++ b/slides/k8s/admission.md @@ -198,21 +198,9 @@ Some examples ... (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: - ```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`.* + (a free account is fine) --- @@ -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 - We have a webhook configuration in `k8s/webhook-configuration.yaml` diff --git a/webhooks/admission/docker-compose.yml b/webhooks/admission/docker-compose.yml index af4653d5..c1a27015 100644 --- a/webhooks/admission/docker-compose.yml +++ b/webhooks/admission/docker-compose.yml @@ -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" services: @@ -5,6 +13,8 @@ services: ngrok-echo: image: ngrok/ngrok command: http --log=stdout localhost:3000 + environment: + - NGROK_AUTHTOKEN ports: - 3000 @@ -16,6 +26,8 @@ services: ngrok-flask: image: ngrok/ngrok command: http --log=stdout localhost:5000 + environment: + - NGROK_AUTHTOKEN ports: - 5000