BlogIstio

Why does an EnvoyFilter stop working after an upgrade?

Scott Sternloff

By Scott Sternloff, Senior Enterprise Architect

LinkedIn · Updated · 4 min read

Why does an EnvoyFilter stop working after an upgrade?
On this page

An EnvoyFilter that inserts a patch before or after another filter depends on that filter still being there and on ordering by creation time. If the filter it points at is not older than the patch, Istio ignores the patch without an error, and the reference warns that EnvoyFilter configuration needs monitoring across proxy version upgrades. Setting an explicit priority, or using INSERT_FIRST, removes the dependency.

The EnvoyFilter reference carries its own warning: any Envoy configuration supplied this way should be monitored across Istio proxy version upgrades, because deprecated fields are removed and replaced. EnvoyFilter is the one Istio API that reaches into Envoy's internals, so it ages differently from the rest.

What exactly goes wrong?

Istio's common-problems page describes the case. A filter patch uses INSERT_BEFORE with the istio.stats filter as its anchor. By default patches are applied in order of creation time, so the patch only works if istio.stats is older than it. Otherwise the INSERT_BEFORE is silently ignored.

EnvoyFilter ordering facts from the Istio reference, read 4 December 2026
RuleWhat it means for an upgrade
Root namespace first, then workload namespaceA mesh-wide filter always lands before a team's own filter
Same workload: creation time orderRe-created or re-applied filters change position without any edit
Behavior is undefined if filters conflictTwo teams patching one listener is a latent fault
Sort key: priority, creation time, resource namePriority is the only knob you set on purpose
proxyVersion is a regular expression on ISTIO_VERSIONA match tied to one release stops matching the next

How do you fix it?

Pick the smallest change that removes the dependency:

  • Use an operation that needs no anchor, such as INSERT_FIRST, where the position allows it.
  • Or add an explicit priority. The reference suggests starting with multiples of 10; the documentation's example uses priority: 10 so the patch runs after istio.stats, which sits at the default of 0.
  • Match proxies with a proxyVersion expression that covers both the old and the new release during the move, then tighten it afterwards.

Which EnvoyFilters are most at risk?

Filters with four traits fail first. The reference makes each of them visible:

  • Patches that anchor on an Istio-internal filter name such as istio.stats, whose position depends on creation order.
  • Matches that pin proxyVersion to one release, because the expression is tested against the proxy's reported Istio version.
  • Filters in the config root namespace, which apply to every sidecar and gateway in the mesh, not just one team's workloads.
  • Several filters on one workload, where the documentation says the result is undefined if they conflict.

A fix with an explicit priority looks like this:

apiVersion: networking.istio.io/v1alpha3
kind: EnvoyFilter
metadata:
  name: custom-tcp-filter
  namespace: prod
spec:
  priority: 10
  configPatches:
  - applyTo: NETWORK_FILTER
    match:
      context: SIDECAR_OUTBOUND
      listener:
        portNumber: 443
        filterChain:
          filter:
            name: istio.stats
    patch:
      operation: INSERT_BEFORE
      # value: your filter goes here

Before you keep any filter through an upgrade, ask whether it is still needed. Many were written to fill a gap that a later release closed, so read the release notes for the version you are moving to.

How do you test before the upgrade reaches production?

Use a revision-based upgrade, not an in-place one, so the old control plane keeps serving while you test. The revisions and tags how-to covers the mechanics. For EnvoyFilters specifically:

  1. Inventory every filter: kubectl get envoyfilter -A, with owner and purpose.
  2. Dump the listener of a representative pod on the old revision: istioctl proxy-config listeners <pod> -o json.
  3. Move one test namespace to the new revision, restart its pods, dump the same listener.
  4. Diff the two. A missing filter in the chain is the failure this post is about.

Run istioctl x precheck before installing the new revision, as Istio's canary upgrade guide recommends.

Where does AceMQ help?

A filter someone wrote years ago that nobody owns is the usual risk. AceMQ's Istio support covers upgrade review, including an EnvoyFilter inventory, and the revision-based upgrade page describes the typical scope. AceMQ ships no Istio distribution, so a bug in a filter a vendor ships stays with that vendor. Send your Istio version, revision and cluster count; AceMQ replies to quote requests within 1 hour.

Sources

Frequently Asked Questions

Why did my EnvoyFilter stop working after an Istio upgrade?

If it uses INSERT_BEFORE relative to another filter, it depends on creation-time ordering, and Istio ignores the patch silently if the filter it points at is not older than the patch.

Does Istio log an error when an EnvoyFilter patch is ignored?

For the INSERT_BEFORE case in the documentation, no. Nothing in the error log shows that the filter was not added to the chain.

How do I make EnvoyFilter ordering explicit?

Set priority on the EnvoyFilter, or use an operation that does not depend on another filter, such as INSERT_FIRST.

Scott Sternloff

Author

Scott SternloffSenior Enterprise Architect

Senior Enterprise Architect at AceMQ. Writes the technical coverage here: RabbitMQ, Kafka and Redis architecture, clustering and migrations.

Talk to an engineer

Need a hand with Istio?

Senior engineers who run it in production. Get a quote or a free consultation, no sales pitch.

Free Consultation

Get Expert Eyes on Your Istio Environment

Whether you're troubleshooting a production incident, planning a migration, or want a second opinion on your architecture — our team is ready. No pitch, just answers.

Email Us