<p>Envoy is using all the memory and the pods are getting evicted. Is there a way to set limit to how much memory envoy proxy can use in the envoy configuration file?</p>

<p>You can probably do that by configuring the <code>overload-manager</code> in the <code>bootstrap</code> configuration for Envoy. Here's a <a href="https://www.envoyproxy.io/docs/envoy/latest/configuration/operations/overload_manager/overload_manager#overload-manager" rel="nofollow noreferrer">documentation</a> link for more details. It is done simply by adding <code>overload-manager</code> section as follows:</p>
<pre><code>overload_manager:
  refresh_interval: 0.25s
  resource_monitors:
  - name: &quot;envoy.resource_monitors.fixed_heap&quot;
    typed_config:
      &quot;@type&quot;: type.googleapis.com/envoy.extensions.resource_monitors.fixed_heap.v3.FixedHeapConfig
      # TODO: Tune for your system.
      max_heap_size_bytes: 2147483648  # 2 GiB &lt;==== fix this!
  actions:
  - name: &quot;envoy.overload_actions.shrink_heap&quot;
    triggers:
    - name: &quot;envoy.resource_monitors.fixed_heap&quot;
      threshold:
        value: 0.95
  - name: &quot;envoy.overload_actions.stop_accepting_requests&quot;
    triggers:
    - name: &quot;envoy.resource_monitors.fixed_heap&quot;
      threshold:
        value: 0.98
</code></pre>
