hashicorp / hashicorp/consul

Service resolver not visible in UI

Open
#21,266 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
30.1k
Forks
4.6k
Avg merge
1d 18h
Merged PRs (30d)
39

Description

Overview of the Issue

Service resolvers added to a tagged service with multiple instances (different tags) is not completely shown in the (routing) UI of the service.


Reproduction Steps

End goal is to be able to connect from a Nomad Job to a specifically tagged instance of the service (i,e the primary - see steps to reproduce)

Steps to reproduce this issue:

  1. Have a service with multiple instances, each instance tagged with a different tag.
    In this case, we have a patroni cluster consisting of (at least) 2 instances, one instances tagged as primary the other tagged as replica - service name is postgres-16.
  2. Add service resolvers to be able to target a specific tag of the service.
    Based on these example: https://discuss.hashicorp.com/t/how-to-reach-a-service-subset-from-the-service-mesh/45162/2
    create 2 service resolvers:
Kind = "service-resolver"
Name = "postgres-16"
DefaultSubset = "replica-16"
Subsets = {
  "primary-16" = {
    filter = "\"primary\" in Service.Tags"
  }
  "replica-16" = {
    filter = "\"replica\" in Service.Tags"
  }
}
Kind = "service-resolver"
Name = "replica-16"
Redirect {
  Service = "postgres-16"
  ServiceSubset = "replica-16"
}
Kind = "service-resolver"
Name = "primary-16"
Redirect {
  Service = "postgres-16"
  ServiceSubset = "primary-16"
}
  1. verify all 3 service resolvers are written into configuration:
$ consul config list -kind service-resolver
postgres-16
primary-16
replica-16
  1. looking at the Consul UI - service routing:
image

(shows the main resolver and the default subset)

Trying to access the services from a Nomad Job, works only for the main postgres-16 service but not the tagged/filtered services:

      connect {
        sidecar_service {
          proxy {
            upstreams {
              destination_name = "postgres-16"
              local_bind_port  = 5432
            }
            upstreams {
              destination_name = "primary-16"
              local_bind_port  = 5433
            }
            upstreams {
              destination_name = "replica-16"
              local_bind_port  = 5434
            }
          }
        }
      }

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the Consul UI service-routing view and the service-resolver configuration represented by consul config list -kind service-resolver; compare the displayed data with the three resolvers in the reproduction. Verify the result against the Nomad upstream destinations, and consider the issue done when the tagged primary and replica resolvers are shown and usable alongside the main resolver.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
backend, frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.