Consul: Deregister inactive service definitions

Description

Emre_Kumas writes:

this is a request for the consul connector. When working with multiple instances, lots and lots of duplicate service definitions are created and they remain in the consul forever. You will have this problem when you’re working with multiple nodes like in Kubernetes. I’m assuming you’re not deregistering them because somebody would like to see the failing ones. But I think there are better ways of checking the state of connectors like using Kubernetes pod metrics or CBES’s own metrics.

 

Environment

None

Gerrit Reviews

None

Release Notes Description

None

Activity

Show:

David Nault September 8, 2022 at 2:32 AM
Edited

Added two new config properties to `consul.toml`:

  • deregisterServiceOnGracefulShutdown - if true, the last thing the connector does during a graceful shutdown is deregister the corresponding Consul service. (default true)

  • deregisterCriticalServiceAfter - Time after which a failed connector service is automatically deregistered from Consul. (default 7 days)

David Nault August 12, 2022 at 9:25 PM

Note to self: investigate whether setting the `deregister_critical_service_after` field in the health check definition resolves the issue

https://www.consul.io/docs/discovery/checks#check-definition

Fixed
Pinned fields
Click on the next to a field label to start pinning.

Details

Assignee

Reporter

Story Points

Fix versions

Priority

Instabug

Open Instabug

PagerDuty

Sentry

Zendesk Support

Created January 4, 2022 at 7:49 PM
Updated September 20, 2022 at 5:50 PM
Resolved September 8, 2022 at 2:32 AM
Instabug