Issue with cloudflared docker in Kubernetes(AKS

I am using AKS and wants to use Cloudflare tunnel. So, I followed Cloudflare github’s named-tunnel-k8s for reference for setting up deployment in AKS.

But pod is not created and failing in liveness check. I tried using latest 2022.5.x and also tried 2022.4.1(based on github suggestions) but getting following error in both scenarios.
Note: I am using traefik ingres and AKS.

Please find error details below.


GOOS: linux, GOVersion: go1.17.1, GoArch: amd64
INF Settings: map[config:/etc/cloudflared/config/config.yaml cred-file:/etc/cloudflared/creds/credentials.json credentials-file:/etc/cloudflared/creds/credentials.json metrics:0.0.0.0:2000 no-autoupdate:true]
INF Generated Connector ID: f2b485a1-96cc-4b61-a69d-3b852b203cc5
INF Initial protocol quic
INF Starting metrics server on [::]:2000/metrics
failed to sufficietly increase receive buffer size (was: 208 kiB, wanted: 2048 kiB, got: 416 kiB).
WRN Your version 2022.4.1 is outdated. We recommend upgrading it to 2022.6.1
ERR Failed to create new quic connection error=“failed to dial to edge: timeout: no recent network activity” connIndex=0
ERR Serve tunnel error error=“failed to dial to edge: timeout: no recent network activity” connIndex=0
INF Retrying connection in up to 2s seconds connIndex=0
WRN If this log occurs persistently, and cloudflared is unable to connect to Cloudflare Network with quic protocol, then most likely your machine/network is getting its egress UDP to port 7844 (or others) blocked or dropped. Make sure to allow egress connectivity
If you are using private routing to this Tunnel, then UDP (and Private DNS Resolution) will not workunless your cloudflared can connect with Cloudflare Network with quic. connIndex=0
INF Switching to fallback protocol http2 connIndex=0
INF Initiating graceful shutdown due to signal terminated …
INF Tunnel server stopped
ERR Unable to establish connection with Cloudflare edge error=“DialContext error: dial tcp 198.41.200.193:7844: operation was canceled” connIndex=0
ERR Serve tunnel error error=“DialContext error: dial tcp 198.41.200.193:7844: operation was canceled” connIndex=0
INF Metrics server stopped


From the message, it is understood that something might be wrong with ‘quic’ protocol or egree/UDP port blocked. but I am not sure how to proceed further on as Cloudflare is new stuff to me.

cloudflared expects to connect to Cloudflare’s network at port 7844. If your firewall or maybe the Kubernetes configuration is blocking outbound/outgoing traffic to port 7844 then you should allow it.