Bulk route name and matcher updates

When you apply a policy to a route in a RouteTable resource by using the applyToRoutes destination selector, an EnvoyFilter resource is created that applies the policy to the route’s internal name. The internal name for a route is generated as follows:

  • If the route in the RouteTable has a name defined, this name is used to generate the internal name.
  • If the route in the RouteTable does not have a name, the internal name is derived by hashing the RouteTable’s matchers.

If you update the internal name, such as by changing the route name or updating the route’s matchers, the following changes are performed in Gloo Mesh Enterprise:

  • The corresponding Istio VirtualService is updated with the new internal name.
  • A new EnvoyFilter is generated that targets the new internal name.
  • The old EnvoyFilter is deleted.

An internal name change is only fully processed when both the VirtualService and the EnvoyFilter are updated. In large environments or when you perform a bulk update of your RouteTables, VirtualService updates might be processed before the update of the EnvoyFilter or vice versa. This can lead to policies temporarily not being applied in your environment.

If you plan an update of your RouteTables, keep the following best practices in mind to mitigate the risk of this update.

  • Always specify a name for your routes in a RouteTable. This way, no EnvoyFilters must be updated when you change the route’s matchers.
  • Update one route at a time. Name and matcher updates for a single route are processed immediately with minimal impact.
  • For bulk updates, follow one of the following paths. The path that is right for you depends on your environment. If you are unsure how to proceed, contact Solo Support.
    • Option 1: Temporarily duplicate your routes. For example, you add the new route names and matchers after the old ones in the same RouteTable. When a request for a route comes in, Envoy selects the first route it matches on (the old one). Then, you wait for the corresponding VirtualServices and EnvoyFilters to be in place before you start removing the old routes from your RouteTable. Keep in mind that this approach temporarily increases translation time and configuration size.
    • Option 2: Scale down the Istio control plane istiod. Then, apply the route updates to your RouteTables. Wait for all the EnvoyFilters to be re-created. Then, scale up istiod again to apply your changes at once.