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

Health check endpoint is disabled for Traefik #228

Closed
kimrgrey opened this issue Apr 17, 2023 · 6 comments
Closed

Health check endpoint is disabled for Traefik #228

kimrgrey opened this issue Apr 17, 2023 · 6 comments

Comments

@kimrgrey
Copy link

kimrgrey commented Apr 17, 2023

Traefik has it's own health check endpoint called "ping". Here is a documentation: https://doc.traefik.io/traefik/operations/ping/. By default this endpoint connects to the entrypoint "traefik" (port 8080). But when traefik is started by mrsk this endpoint is not exposed, which means that external load balancer can not be configured to check if traefik is actually alive. Should we enable ping by default and expose port 8080?

At the moment it is possible to achieve it by adding following config:

traefik:
  args:
    accesslog: true
    ping: true
  options:
    publish:
      - 8080:8080

But IMHO it could be a reasonable default behavior. Possible concern here is that not only 80 (main HTTP), but also 8080 (technical) will be exposed from server.

@dhh
Copy link
Member

dhh commented Apr 17, 2023

What's the situation where you need to know specifically whether traefik is up in a way different from the app? Wouldn't your external LB want to take the IP out of rotation regardless of whether it's technically the app or Traefik?

@kimrgrey
Copy link
Author

It is useful when you actually wanna check that host is alive but you do not care too much about an app. For example, if you have 2 apps sharing the same host.

Here is the case I'm talking about:

Screenshot 2023-04-18 at 12 16 04

  1. There are 2 different apps sharing the same infrastructure but responding on different domains. According to docs it can be achieved using traefik tags on containers: https://github.com/mrsked/mrsk#using-container-labels.
  2. In order to do SSL termination and balance requests between our hosts we have a load balancer standing in front. But how does the balancer know if host is alive or not? What happens if we reboot one of our hosts? We need a health check here.
  3. Another thing which is unclear for this scenario is who manages traefik in this case? If both apps have traefik section in their deploy configuration they should be somehow synced (or we gonna have a conflict).

I assume everything will be working fine if there is physically 1 app which is used to serve for 2 different domains. But as soon as we have 2 different apps with 2 different configs deployed to the same cluster we have a conflict for a traefik as our shared infrastructure unit. If we go back to what was possible with Capistrano, every app could add it's own virtual host configuration file to nginx while nginx itself was managed externally. Looks like that's not possible with mrsk at the moment because traefik is considered to be an extention of the app rather then independent thing.

@dhh
Copy link
Member

dhh commented Apr 18, 2023

I see. Yeah, things do start getting complicated like that. I think if you're in a high-availability requirement environment, I wouldn't recommend running multiple MRSK apps on the same hosts. Rather isolate each app to each host.

BUT. I'm fine having a way for this being possible. Don't think it's a good default, though, to have these ports open. So maybe we can just start by expanding the documentation if needed?

@kimrgrey
Copy link
Author

Sorry for the delay with response. I have been playing around with this problem for our apps to see what can be the best solution I could offer. Please, leave this issue open for a couple of more days to keep the context. There is chance I'm into something interesting. Or completely stupid 😄 Let's see.

@igor-alexandrov
Copy link
Contributor

@kimrgrey do you have any update on this issue?

@djmb
Copy link
Collaborator

djmb commented May 2, 2024

Going to close this one as we are planning to remove Traefik from v2.0

@djmb djmb closed this as completed May 2, 2024
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

4 participants