infra4talos/apps-kustomized/tailscale-proxy/configmap.yaml
Martyn Ranyard 440682a8ff Add the tailscale proxy for use by ISO downloaders
Signed-off-by: Martyn Ranyard <m@rtyn.berlin>
2025-03-05 17:34:34 +00:00

13 lines
609 B
YAML

apiVersion: v1
kind: ConfigMap
metadata:
name: tailscale-script
data:
script.sh: |
tailscaled --socks5-server=localhost:1055 --outbound-http-proxy-listen=localhost:1055 --tun=userspace-networking &
tailscale up --authkey=$TS_AUTHKEY --advertise-tags=tag:k8s --hostname k8s-tailscale-proxy &
sleep 3
echo "Waiting for $COUNTRY to do something"
while ! tailscale exit-node list 2>/dev/null | grep $COUNTRY >/dev/null; do echo -n . ;sleep 5; done
tailscale set --exit-node $(tailscale exit-node list | grep $COUNTRY | cut -f2 -d' ' | shuf | head -n1)
while true; do sleep 1; done