Using Tailscale to access your SPIN Runtime
Tailscale is a VPN service that allows you to access your SPIN Runtime from anywhere. It’s particularly interesting because it doesn’t require you to expose your SPIN Runtime to the public internet.Obtain Tailscale authentication key
-
Ensure there is a tag
tag:container
in your Tailscale network under Access Controls. -
Go to OAuth client settings and create a new client.
Enable Write permissions for Devices -> Core and choose the
tag:container
tag. Then enable Write for All (there probably is a better way to do this). -
Copy the client secret. this is your
<AUTH_KEY>
.
Set up using sidecar container
The following configuration will set up a sidecar container that will proxy HTTPS traffic to the SPIN Runtime. You’ll need to replace the following variables:<AUTH_KEY>
: Your Tailscale authentication key.<HOSTNAME>
: The hostname of your SPIN Runtime. This will be part of the URL you use to access your SPIN runtime.<SPIN_TOKEN>
: Your SPIN Runtime token. You receive this token when you add a new runtime in the SPIN UI.
compose.yml
compose.yml
file, it will be mounted into the tailscale sidecar container.
proxy-config.json