docker-archive / deploykit

A toolkit for creating and managing declarative, self-healing infrastructure.
Apache License 2.0
2.25k stars 262 forks source link

Add health monitor path label support. #796

Closed craigyam closed 6 years ago

craigyam commented 6 years ago

The ibmcloud provider load balancer requires support for a label to set the health monitor health check url. This goes along with the existing support for certs when creating the route in the ibmcloud loadbalancer. When an HTTP/HTTPS route is added, a health monitor with a default health check url of / is created. If the service that publishes the port does not respond to the check on /, the route is disabled by the load balancer. To allow setting the url, a label needs to be added. Set HealthMonitorPathLabel in the yaml to the label you wish to use. ie:

RouteSources:
      swarm:
        Host: unix:///var/run/docker.sock
        CertificateLabel: lb-cert-label
        HealthMonitorPathLabel: lb-health-path

On the docker service create, specify the label:

docker service create --network ingress --name test-service --publish 4444:80 --publish 3333:25 --label lb-cert-label=my-cert@HTTPS:4444,HTTPS:3333 --label lb-health-path=/healthcheck@4444,/someother@3333 nginx

The format of the label is a comma separated list: <label>=<path>@<port>,<path>@<port> or <label>=<path>@<port1>,<port2> to apply the same path to multiple ports.

codecov[bot] commented 6 years ago

Codecov Report

Merging #796 into master will increase coverage by 0.06%. The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #796      +/-   ##
==========================================
+ Coverage   49.12%   49.18%   +0.06%     
==========================================
  Files          85       85              
  Lines        7630     7630              
==========================================
+ Hits         3748     3753       +5     
+ Misses       3528     3524       -4     
+ Partials      354      353       -1
Impacted Files Coverage Δ
pkg/spi/loadbalancer/spi.go 0% <ø> (ø) :arrow_up:
pkg/rpc/mux/server.go 47.91% <0%> (+5.2%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 3fb79a8...b681849. Read the comment docs.