Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Public hostnames aren't propagated automatically #41

Open
bhvk0 opened this issue Jul 5, 2023 · 7 comments
Open

Public hostnames aren't propagated automatically #41

bhvk0 opened this issue Jul 5, 2023 · 7 comments

Comments

@bhvk0
Copy link

bhvk0 commented Jul 5, 2023

Public hostnames aren't propagated automatically. In the example below you can see our configuration:

cloudflare:
  ingress:
    - hostname: prom-server.domain.com
      service: https://prometheus-server.monitoring:80

But these settings aren't applying automatically. It means that I still have to add public hostnames in Tunnel configuration manually. Are there any additional settings required? Or this functionality isn't working yet?

Screenshot 2023-07-05 at 18 16 40

@bhvk0 bhvk0 changed the title Ingress hostnames aren't propagated automatically Public hostnames aren't propagated automatically Jul 5, 2023
@matt-j-so
Copy link

I'm also facing the same issue.

@verenion
Copy link

verenion commented Aug 2, 2023

I've also hit this issue. There are now two helm-charts here, and no documentation regarding what the actual difference between them is

@dsalaza4
Copy link

dsalaza4 commented Sep 5, 2023

Are there any updates regarding this?

@aug70
Copy link

aug70 commented Oct 19, 2023

I've also hit this issue. There are now two helm-charts here, and no documentation regarding what the actual difference between them is

@verenion cloudflare-tunnel-remote chart assumes that you created your own config (public hostnames) on cf site and reads your config from there.
Other chart cloudflare-tunnel attempts to create this config for you via it's ingress values you provide. I'm saying attempts because this chart doesn't work. See issue #59

@tomasodehnal
Copy link

I was trying to achieve the same - deploy cloudflared on kubernetes and configure the host to service mapping on the K8s side. And obviously, I ran into the same issue.

To rule out any K8s specifics, I was experimenting with cloudflared on Linux directly. I found out, that setting the mapping in the config file is not enough. One first needs to manually create the public hostname under the tunnel, as described here https://developers.cloudflare.com/cloudflare-one/connections/connect-networks/get-started/create-local-tunnel/#5-start-routing-traffic. After creating the public record, cloudflared successfully routes traffic for matching hostname in the config file. This applies to K8s deployment as well.

To sum up:

  • cloudflared uses the config file to route traffic to specified services. It DOES NOT handle the hostname creation under the tunnel based on the config file.
  • The public hostname can be created either:
    • In command line using cloudflared tunnel route dns <tunnel name/id> <hostname>
    • In zero trust web dashboard
    • Using 'DNS way' described here

It still makes sense to use the 'locally-managed tunnel' approach, as it can be handled (except the login step 2) in the command line:

  1. Download cloudflared.
  2. Login to your account - this step also creates a certificate that is needed for tunnel AND records management, so without that, the K8s deployment couldn't manage the hostnames anyway.
  3. Create the tunnel - this creates the credentials json which can be directly used to create the secret.
  4. Create the hostname under the tunnel.
  5. Now you can continue with the K8s side and use the json file from point 3 to create the secret.

One final note, when the tunnel is created as locally-managed, it has a note in the web dashboard. Looks like you need to pick one of the approaches and stick to it (makes sense).
image

Hope this helps someone.

@Syntax3rror404
Copy link

@tomasodehnal you can also do it via cli.

cloudflared tunnel route dns TUNNELNAME FQDN

and youre done. You can also iterate over the ingress rules via init container to automate this.

@yevon
Copy link

yevon commented Dec 1, 2024

I was going crazy with this, I would assume that it would automatically setup that for you. I changed to manual configuration from the ui as it is much easier than with helm.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants