service-discovery

Retrieve healthy service instances via DNS, Consul, etcd, or Kubernetes.

Updated Jun 5, 2026
One-click install
npx skills add https://github.com/hung-phan/system-skills --skill service-discovery-hung-phan
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: service-discovery
Source: https://github.com/hung-phan/system-skills/tree/main/skills/system-review/references/communication/service-discovery
Command: npx skills add https://github.com/hung-phan/system-skills --skill service-discovery-hung-phan

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires consul, etcd, kubernetes, and includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill helps clients discover and connect to healthy service instances in dynamic, autoscaling, partition-prone fleets.

Core Features & Use Cases

  • Client-Side Discovery: Clients can pick healthy instances based on local caching and updates.
  • Server-Side Discovery: Load balancers can select instances on behalf of clients.
  • Health Checks: Ensures endpoints are alive and ready to serve traffic.
  • Use Case: When you encounter issues like "connection refused after deploy", "stale IPs in cache", or "503 from load balancer minutes after a host died".

Quick Start

Use the service-discovery skill to get the list of healthy instances for the "payments" service.

Frequently Asked Questions about service-discovery

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I find healthy service instances in a dynamic autoscaling environment?

To find healthy service instances in dynamic fleets, you query a service registry using client-side or server-side discovery, which filters out dead endpoints based on active health checks. This returns a live list of available nodes for connection.

Why am I getting connection refused errors after a deployment or when load balancers return 503s?

Connection refused errors and 503 responses after deployments often happen because clients or load balancers hold stale IPs from cached service instances. Propagating health-check updates through a service registry removes dead hosts from the active pool.

What is the difference between client-side and server-side service discovery?

Client-side service discovery lets clients directly query a registry to select healthy instances via local caching, while server-side discovery delegates instance selection to a load balancer acting on the client's behalf.

Does this service discovery approach work with Consul, etcd, and Kubernetes?

Yes, this service discovery approach supports Consul, etcd, and Kubernetes. It integrates with these registries to retrieve healthy instances using mechanisms like DNS or direct API queries.

How do I handle stale IPs in my local cache during dynamic fleet scaling?

To handle stale IPs in local cache during dynamic scaling, implement client-side service discovery with active health-check propagation. This ensures your local cache automatically receives updates and removes unreachable instances.

Do I need a service registry to perform client-side discovery?

Yes, you need a service registry and proper client configuration to perform service discovery. The registry stores instance locations, while health checks ensure the returned endpoints are actually alive and ready for traffic.