Skip to content

Add support for Consul service mesh discovery for EKS pods#135

Merged
duncaan merged 2 commits intomasterfrom
dschulze/sc-184030/support-consul-service-mesh-discovery
Jan 23, 2026
Merged

Add support for Consul service mesh discovery for EKS pods#135
duncaan merged 2 commits intomasterfrom
dschulze/sc-184030/support-consul-service-mesh-discovery

Conversation

@duncaan
Copy link
Copy Markdown
Member

@duncaan duncaan commented Jan 22, 2026

Current Behavior

The library currently supports EKS pod discovery through Consul catalog sync, which identifies Kubernetes pods by the external-source: kubernetes metadata set by the catalog sync process.

Why do we need this change?

We are migrating from Consul catalog sync to Consul service mesh with sidecar injection. Pods with service mesh sidecars are registered differently in Consul:

  • Managed by consul-k8s-endpoints-controller instead of catalog sync
  • Different metadata structure (Service.Meta vs Node.Meta)
  • Availability zone in Locality.Zone instead of Meta field

This change allows us to gradually migrate services to the mesh while maintaining discovery for both types of pods.

Implementation Details

  • Added map_k8s_consul_mesh_endpoint() method to handle Consul mesh pod metadata
  • Detection based on managed-by: consul-k8s-endpoints-controller in Service.Meta
  • Extracts pod name from Service.Meta instead of Service.ID
  • Extracts availability zone from Service.Locality.Zone
  • Includes additional Kubernetes metadata tags: k8s:namespace, k8s:service, k8s:pod-uid
  • Coexists with existing catalog sync detection - both methods work in parallel
  • Added comprehensive test coverage with anonymized test data

Dependencies (if any)

None

📇 [sc-184030]

Adds detection for Kubernetes pods managed by consul-k8s-endpoints-controller
(service mesh sidecar) alongside the existing catalog sync method. The new
discovery method extracts pod metadata from Consul mesh Service.Meta and
Locality fields, and includes additional Kubernetes metadata tags.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@duncaan duncaan merged commit e066216 into master Jan 23, 2026
12 checks passed
@duncaan duncaan deleted the dschulze/sc-184030/support-consul-service-mesh-discovery branch January 23, 2026 20:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants