A guide to setting up your first argo-tunnel. If this is NOT your first argo-tunnel, skip to step 3 or refer to other guides.
mydomain.com
is a place holder. Updated the value to match your Cloudflare domain.
- A Cloudflare account
- An active zone on Cloudflare
- An active subscription to Argo, enable here
- The cloudflared daemon
If it’s your first time using Argo, navigate to the Traffic tab of the Cloudflare dashboard, click the ‘Enable’ button, and follow the steps on the screen for setting up usage-based billing.
- Browse to Cloudflare: Traffic.
- Locate
Argo
and clickEnable
.
Enterprise customers who have enabled Argo will need to contact their Cloudflare representative to have Smart Routing enabled for their account as it is necessary for Argo Tunnel to work.
cloudflared
provides a mechanism to login, configure zones, and access
zone credentials.
Follow these instructions to install cloudflared
Once installed, verify cloudflared has installed properly by checking the version.
cloudflared --version
cloudflared login
If the browser fails to open automatically, copy and paste the URL into your browser’s address bar and press enter.
Once you login, you will see a list of domains associated with your account. Locate the domain you wish to connect a tunnel to and click its name in the table row. Once you select the domain, Cloudflare will issue a certificate which will be downloaded automatically by your browser. This certificate will be used to authenticate your machine to the Cloudflare edge.
Move the certificate to the .cloudflared
directory on your system.
mv cert.pem ~/.cloudflared/cert.pem
The certificate and domain will be used to define an Ingress to your system.
kubectl create secret generic mydomain.com --from-file="$HOME/.cloudflared/cert.pem"
Create the secret in the same namespace as your service deployment. Adjust
mydomain.com
to match your Cloudflare domain.
A single controller can configure tunnels for multiple domains. An Ingress definition will be used to defined tunnels to Services and link Secrets by external hostname.
When the controller observes the creation of an Ingress, it verifies that the referenced service, endpoints, and secret exists and opens a tunnel between the Cloudflare receiver and the kubernetes virtual service ip.
kubectl apply -f deploy/echo.yaml
Adjust the Ingress host
echo.mydomain.com
to match your Cloudflare domain. Adjust the Ingresstls
section to link the host with a secret.
Caveats:
- routing by path is not supported (
Ingress.spec.rules[*].host.http.paths[*].path
)
This caveat will be addressed in future releases.
The tunnel will be visible under DNS on the Cloudflare dashboard.
- Browse to Cloudflare: DNS.
- Browse to
echo.mydomain.com
.
Adjust the Ingress host
echo.mydomain.com
to match your Cloudflare domain.