-
Hi, Regarding: Have you tried it with this project? Would it be wise to implement regarding scale and having multiple k8s clusters in Hetzner Cloud? |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 6 replies
-
Thanks, very interesting, did not know about it! I do not see any reason why it will not work with this project. |
Beta Was this translation helpful? Give feedback.
-
Did you ever try this out? Question here becomes what should be disabled when using this solution? It runs from within and seems it points directory to the service which could handle the load balancing? https://github.com/cloudflare/argo-tunnel-examples/blob/master/named-tunnel-k8s/app.yaml Is disabling the hetzner load balancer as simple as removing those lines? What about the ingress controller, should cloudflared point to the ingress or to the service? Seems like it is documented for the service so then what is the running ingress used for? Then would need to disable access on the firewall which would no longer be needed. |
Beta Was this translation helpful? Give feedback.
-
Here's what our good friend GPT-4 has to say about it, maybe this can get you started: K3s Cluster with CloudflareYou:I disabled all ingress controllers on my k3s cluster, how do I use cloudflared (that I can have as a deployment in the cluster) make my deployments accessible through cloudflared tunnels? ChatGPT:To use Cloudflare's
First, you need to have
Run the following command to authenticate
This command will open a browser window where you can log in to your Cloudflare account and authorize
Create a Kubernetes Secret containing the
Create a Kubernetes deployment for apiVersion: apps/v1
kind: Deployment
metadata:
name: cloudflared
spec:
replicas: 1
selector:
matchLabels:
app: cloudflared
template:
metadata:
labels:
app: cloudflared
spec:
containers:
- name: cloudflared
image: cloudflare/cloudflared:latest
args:
- tunnel
- --url
- http://your-service.namespace.svc.cluster.local:your-service-port
- --hostname
- your-subdomain.example.com
- --origincert
- /etc/cloudflared/cert.pem
volumeMounts:
- name: cloudflared-cert
mountPath: /etc/cloudflared
volumes:
- name: cloudflared-cert
secret:
secretName: cloudflared-cert Replace the following placeholders with your own values:
Apply the deployment configuration file to your cluster:
Once the deployment is ready and running, your service should be accessible via the specified hostname (e.g., Note that if you have more than one service you want to expose, you can create additional deployments for each service by modifying the |
Beta Was this translation helpful? Give feedback.
-
So far so good. Here are some docs from Cloudflare on an implementation: https://developers.cloudflare.com/cloudflare-one/connections/connect-networks/deployment-guides/kubernetes/ I generated the token from Cloudflare Zero dashboard, added it as a secret, then put it in to the container as an environment variable
The final piece of the puzzle allowing all the inbound ports to be closed. |
Beta Was this translation helpful? Give feedback.
So far so good. Here are some docs from Cloudflare on an implementation: https://developers.cloudflare.com/cloudflare-one/connections/connect-networks/deployment-guides/kubernetes/
I generated the token from Cloudflare Zero dashboard, added it as a secret, then put it in to the container as an environment variable
TUNNEL_TOKEN
which allows Cloudflared to pick it up: