AspNetCore.Diagnostics.HealthChecks icon indicating copy to clipboard operation
AspNetCore.Diagnostics.HealthChecks copied to clipboard

Add docker service discovery to UI

Open LordMike opened this issue 6 years ago • 5 comments

Fixes #191

This is an initial docker service discovery .. service .. It has been modeled after the current K8s discovery service, and as such it will:

  • Iterate docker containers on a fixed interval (5 minutes by default)
  • Calculate the health check endpoint given labels from the Container
  • Verify that docker containers return 200 OK or 500 Server Error on their Health check endpoints
  • Not make any updates to existing configurations, only add new ones (identified by Uri)

Todos

  • [ ] Add documentation
  • [x] Add tests
  • [ ] Identify which parts of nuget package-lock to commit
  • [ ] Should endpoints be updated, if they change IP's?

Operation

It will enumerate (running) containers from a docker socket using Docker.DotNet, and read out some labels to configure the final monitor configuration. It will read the following labels (with a configurable prefix):

Configuration by labels

Label Note Default
HealthChecks.Enabled Set this to enable the container false
HealthChecks.Name Name of the check container name or id
HealthChecks.Network Network to use to get the IP of the container first network
HealthChecks.Scheme Scheme of the health check service http
HealthChecks.Port first exposed port, or scheme default (80 for http, 443 for https)
HealthChecks.Path /hc (configured in options)

LordMike avatar May 23 '19 19:05 LordMike

Hi @CarlosLanderas can you checkout this PR? It is related with K8S feature you implemented!

unaizorrilla avatar May 28 '19 19:05 unaizorrilla

@LordMike thanks for the contribution, I'll review the PR these days. I've been busy sorry :/

CarlosLanderas avatar Jun 26 '19 20:06 CarlosLanderas

@LordMike Hi. I help to maintain this repo for some time. I have never used docker/k8s or UI stuff from this repo so feedback from core team is required here. Ping @carlosrecuero @unaizorrilla .

sungam3r avatar Dec 22 '22 22:12 sungam3r

FYI, I've been using this PR in production for years without problems. Since it's semi-isolated in it's features (opt-in) AND it works well -- I'm not sure why it couldn't be merged.

Jaben avatar Jan 27 '24 17:01 Jaben

It can be merged but only by those who has knowledge and can take responsibility to support these changes. Unfortunately, I have no experience in k8s.

sungam3r avatar Jan 31 '24 04:01 sungam3r