--config flag does not work when starting a tunnel

hi im trying to run cloudflard on my local k3s cluster. im switching over because of ngroks free plan not enabling cname records and for being generally slow wgile testing i relized i could not specify the --config flag for example
[nix-shell:~/Nixos/K3s/deployments_and_services]$ cloudflared tunnel run --config /path/to/config.yaml
Incorrect Usage: flag provided but not defined: -config
[nix-shell:~/Nixos/K3s/deployments_and_services]$ cloudflared tunnel run --config /path/to/config.yaml
Incorrect Usage: flag provided but not defined: -config
im also dealing with erros where when not specifying where the config file is and letting it defualt to the defualt location it reads the tunnel id but it does not read the ingress controlles

2025-03-05T03:07:29Z INF Starting tunnel tunnelID=a71cefd1-862d-49bd-a7dc-634345f4d35d
...
2025-03-05T03:07:58Z WRN No ingress rules were defined in provided config (if any) nor from the cli, cloudflared will return 503 for all incoming HTTP requests

2025-03-05T03:07:29Z INF Starting tunnel tunnelID=a71cefd1-862d-49bd-a7dc-634345f4d35d
...
2025-03-05T03:07:58Z WRN No ingress rules were defined in provided config (if any) nor from the cli, cloudflared will return 503 for all incoming HTTP requests
as you can see it reads the tunnle id from the config map config.yml but then does not register the ingress controls. this could just be my error of setting the config maps up wrong but im not sure. i look forwerd to all your responses.
1 Reply
feelfeel2008
feelfeel2008OP2mo ago
by the way this is the deployment and config map, the secrets and public keys are defined as kubernetes secrets in other files
apiVersion: apps/v1
kind: Deployment
metadata:
name: cloudflared
namespace: utility
spec:
replicas: 1
selector:
matchLabels:
app: cloudflared
template:
metadata:
labels:
app: cloudflared
spec:
containers:
- name: cloudflared
image: cloudflare/cloudflared:latest
command:
- cloudflared
args:
- tunnel
- run
- --token
- $(TUNNEL_TOKEN)

env:
- name: TUNNEL_TOKEN
valueFrom:
secretKeyRef:
name: cloudflare-tunnel-token
key: token
- name: TUNNEL_ORIGIN_CERT
value: "/etc/cloudflared/cert.pem"
volumeMounts:
- name: cloudflare-cert
mountPath: "/etc/cloudflared"
readOnly: true
- name: cloudflared-config
mountPath: "~/.cloudflared"

readOnly: true
volumes:
- name: cloudflare-cert
secret:
secretName: cloudflare-cert
- name: cloudflared-config
configMap:
name: cloudflared-config
---

apiVersion: v1
kind: ConfigMap
metadata:
name: cloudflared-config
namespace: utility
data:
config.yml: |
tunnel: a71cefd1-862d-49bd-a7dc-634345f4d35d
ingress:
- hostname: felixhub.dev
service: http://felixhub-internal.default.svc.cluster.local:8080
- http_status: 404 # Correct fallback rule for 404 error
apiVersion: apps/v1
kind: Deployment
metadata:
name: cloudflared
namespace: utility
spec:
replicas: 1
selector:
matchLabels:
app: cloudflared
template:
metadata:
labels:
app: cloudflared
spec:
containers:
- name: cloudflared
image: cloudflare/cloudflared:latest
command:
- cloudflared
args:
- tunnel
- run
- --token
- $(TUNNEL_TOKEN)

env:
- name: TUNNEL_TOKEN
valueFrom:
secretKeyRef:
name: cloudflare-tunnel-token
key: token
- name: TUNNEL_ORIGIN_CERT
value: "/etc/cloudflared/cert.pem"
volumeMounts:
- name: cloudflare-cert
mountPath: "/etc/cloudflared"
readOnly: true
- name: cloudflared-config
mountPath: "~/.cloudflared"

readOnly: true
volumes:
- name: cloudflare-cert
secret:
secretName: cloudflare-cert
- name: cloudflared-config
configMap:
name: cloudflared-config
---

apiVersion: v1
kind: ConfigMap
metadata:
name: cloudflared-config
namespace: utility
data:
config.yml: |
tunnel: a71cefd1-862d-49bd-a7dc-634345f4d35d
ingress:
- hostname: felixhub.dev
service: http://felixhub-internal.default.svc.cluster.local:8080
- http_status: 404 # Correct fallback rule for 404 error

Did you find this page helpful?