Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Service resolver not visible in UI #21266

Open
kochen opened this issue Jun 6, 2024 · 0 comments
Open

Service resolver not visible in UI #21266

kochen opened this issue Jun 6, 2024 · 0 comments

Comments

@kochen
Copy link

kochen commented Jun 6, 2024

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
            }
          }
        }
      }
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

No branches or pull requests

1 participant