How to reach a service subset from the service mesh

OK, Found this thread which put me on track. So, I now have 3 service-resolver

  • The main one which split my pg service into two subsets (master and replica)
Kind = "service-resolver"
Name = "pg"
DefaultSubset = "master"
Subsets = {
  "master" = {
    filter = "\"master\" in Service.Tags"
  }
  "replica" = {
    filter = "\"replica\" in Service.Tags"
  }
}
  • A virtual service for pg-master
Kind = "service-resolver"
Name = "pg-master"
Redirect {
  Service = "pg"
  ServiceSubset = "master"
}
  • A virtual service for pg-replica
Kind = "service-resolver"
Name = "pg-replica"
Redirect {
  Service = "pg"
  ServiceSubset = "replica"
}

So everything should be in place. Yet, if I try to use “pg-master” or “pg-replica” in an upstream (as destination_name), I can’t get it to work (I will get something like “read tcp 127.0.0.1:60284->127.0.0.1:5432: read: connection reset by peer”).

One thing that’s not clear in the doc : the intention should target the virtual service “pg-master”, or the real service “pg” (I’ve added both anyway for now, so the problem shouldn’t be on the intentions.

Anyone could help ?