From 2a475f25c738e9d413400f7afbcc9d6e163f7366 Mon Sep 17 00:00:00 2001 From: Yusuke Kuoka Date: Thu, 7 Jul 2022 11:27:27 +0900 Subject: [PATCH] Use Argo Tunnel for exposing the autoscaler's webhook server (#1595) I've been manually setting up Argo Tunnel to expose the webhook server while running E2E tests so that I can cover the webhook-based autoscaling. This automates the setup process so that we can automatiaclly bring up and down cloudflared before/after the test run, so that it can be a part of our upcoming automated E2E test. --- acceptance/argotunnel.sh | 97 ++++++++++++++++++++++++++++++++++++++++ test/e2e/e2e_test.go | 43 ++++++++++++++++++ 2 files changed, 140 insertions(+) create mode 100755 acceptance/argotunnel.sh diff --git a/acceptance/argotunnel.sh b/acceptance/argotunnel.sh new file mode 100755 index 00000000..c4fc0a4d --- /dev/null +++ b/acceptance/argotunnel.sh @@ -0,0 +1,97 @@ +#!/usr/bin/env bash + +# See https://developers.cloudflare.com/cloudflare-one/tutorials/many-cfd-one-tunnel/ + +kubectl create ns tunnel || : + +kubectl -n tunnel delete secret tunnel-credentials || : + +kubectl -n tunnel create secret generic tunnel-credentials \ + --from-file=credentials.json=$HOME/.cloudflared/${TUNNEL_ID}.json || : + +cat <