Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 7cf2d91fd8 | |||
| 936982731d | |||
| 33759c87db | |||
| 974f82e9be | |||
| d7dc75c18f | |||
| c62c63249c |
@@ -74,7 +74,7 @@ func (s *Service) GetFullAddr() string {
|
|||||||
if s.tls {
|
if s.tls {
|
||||||
proto = "https"
|
proto = "https"
|
||||||
}
|
}
|
||||||
return fmt.Sprintf("%s://%s:%d/", proto, s.Address, s.port)
|
return fmt.Sprintf("%s://%s:%d/", proto, s.domain, s.port)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *Service) Register() error {
|
func (s *Service) Register() error {
|
||||||
@@ -159,7 +159,7 @@ func (s *Service) healthCheck() (bool, error) {
|
|||||||
alive := func() bool {
|
alive := func() bool {
|
||||||
client := &http.Client{}
|
client := &http.Client{}
|
||||||
healthUrl := fmt.Sprintf("%s%s?name=%s", s.GetFullAddr(), "health", s.Name)
|
healthUrl := fmt.Sprintf("%s%s?name=%s", s.GetFullAddr(), "health", s.Name)
|
||||||
fmt.Printf("HealthCheck URL: %s%s?name=%s", s.GetFullAddr(), "health", s.Name)
|
// fmt.Printf("HealthCheck URL: %s%s?name=%s", s.GetFullAddr(), "health", s.Name)
|
||||||
req, err := http.NewRequest(http.MethodGet, healthUrl, nil)
|
req, err := http.NewRequest(http.MethodGet, healthUrl, nil)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return false
|
return false
|
||||||
@@ -213,10 +213,10 @@ func (s *Service) getTags() []string {
|
|||||||
"traefik.http.services." + s.Name + ".loadbalancer.server.scheme=https",
|
"traefik.http.services." + s.Name + ".loadbalancer.server.scheme=https",
|
||||||
"traefik.http.services." + s.Name + ".loadbalancer.server.port=" + strconv.Itoa(s.port),
|
"traefik.http.services." + s.Name + ".loadbalancer.server.port=" + strconv.Itoa(s.port),
|
||||||
"traefik.http.services." + s.Name + ".loadbalancer.passhostheader=true",
|
"traefik.http.services." + s.Name + ".loadbalancer.passhostheader=true",
|
||||||
"traefik.http.services." + s.Name + ".loadbalancer.healthcheck.interval=1s",
|
"traefik.http.services." + s.Name + ".loadbalancer.healthcheck.interval=2s",
|
||||||
"traefik.http.services." + s.Name + ".loadbalancer.healthcheck.timeout=1s",
|
"traefik.http.services." + s.Name + ".loadbalancer.healthcheck.timeout=1s",
|
||||||
"traefik.http.services." + s.Name + ".loadbalancer.healthcheck.path=/health",
|
"traefik.http.services." + s.Name + ".loadbalancer.healthcheck.path=/health",
|
||||||
"traefik.tls.certificates.certfile=certs/client.cert",
|
"traefik.tls.certificates.certfile=certs/client.crt",
|
||||||
"traefik.tls.certificates.keyfile=certs/client.key",
|
"traefik.tls.certificates.keyfile=certs/client.key",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user