Bobcares

Cloudflare Argo Tunnel For Subdomain | Setup Tutorial

by | Mar 1, 2023

Let’s look into the steps to set up a Cloudflare Argo tunnel for a subdomain. With our Server Management Services, Bobcares offers solutions to your Cloudflare issues.

How to set up a Cloudflare Argo tunnel for a subdomain?

The Argo tunnel provides a private connection between our web server and Cloudflare. Before reaching the server, the traffic will route through Cloudflare, which offers more security. The server will be unroutable for senders, except that for Cloudflare. This helps us to keep our web server’s IP address private.

In this article, we’ll look into the steps to deploy the Cloudflare Argo tunnel for a subdomain as follows:

1. Creating Subdomain Certificate

2. Appending Tunnel Token

3. Deploying Tunnel Secret

4. Attaching Tunnel

5. Verifying Tunnel

Creating Subdomain Certificate

Certificates can be found on the Cloudflare dashboard under Crypto.

1. Navigate to Crypto.

2. Simply select Create Certificate.

3. Choose the ECDSA private key type.

4. Subdomain.mydomain.com and *.subdomain.mydomain.com should be set as domains.

5. Select Next

6. To the file cert.pem, save the private key and the certificate.

Appending Tunnel Token

We can use the below code to append the Argo Tunnel token to the subdomain:

awk '/BEGIN.*TUNNEL/{mark=1}/END.*TUNNEL/{print;mark=0}mark' ~/.cloudflared/cert.pem >> cert.pem

Deploying Tunnel Secret

The service deployment and the Tunnel secret should be having the same namespace. The subdomain.mydomain.com should be matching with our Cloudflare account.

kubectl create secret generic subdomain.mydomain.com --from-file="cert.pem"

Attaching Tunnel

The controller will verify that referenced services, endpoints, and secret exists when it sees an ingress creation. It also opens a tunnel between the Cloudflare and Kubernetes virtual service IPs.

kubectl apply -f deploy/echo.yaml

Verifying Tunnel

In the Cloudflare dashboard, we can see the Tunnel under DNS. We must browse to Cloudflare: DNS and also browse echo.subdomain.mydomain.com

[Are you looking for a solution to a different question? Our Server Management team can assist you with your concerns.]

Conclusion

To conclude, the article explains the steps to set up a Cloudflare Argo tunnel for a subdomain.

PREVENT YOUR SERVER FROM CRASHING!

Never again lose customers to poor server speed! Let us help you.

Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.

GET STARTED

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

Never again lose customers to poor
server speed! Let us help you.