Skip to content

ExtAuth CircuitBreaker Thresholds Not Updated in Envoy Proxy After SecurityPolicy Update #5371

Closed

Description

@json-openai

Description:

What issue is being seen? Describe what should be happening instead of
the bug, for example: The expected value isn't returned, etc.

We tried to update the circuitBreaker thresholds of the ExtAuth service (HTTP) through its backendSettings. The updated SecurityPolicy was successfully applied to Kubernetes, but the circuit breaker thresholds of the corresponding cluster config were not updated in the Envoy Proxy pods (verified via config_dump).

Repro steps:

Include sample requests, environment, etc. All data and inputs
required to reproduce the bug.

Here's the SecurityPolicy that we used to set up an ExtAuth service.

apiVersion: gateway.envoyproxy.io/v1alpha1
kind: SecurityPolicy
metadata:
...
  name: fake-security-policy
spec:
  authorization:
    ...
  extAuth:
    failOpen: true
    headersToExtAuth: []
    http:
      backendRefs:
      - group: ""
        kind: Service
        name: fake-service
        port: fake-port
      backendSettings:
        circuitBreaker:
          maxConnections: 30000
          maxParallelRequests: 1024
          maxParallelRetries: 1024
          maxPendingRequests: 1024
      headersToBackend:
        ...
      path: /fake_path
  targetRefs:
    ...

It was applied two days ago. Here's the status of the security policy from the output of kubectl describe securitypolicy fake-security-policy

Status:
  Ancestors:
    Ancestor Ref:
      Group:      gateway.networking.k8s.io
      Kind:       Gateway
      Name:       envoy-gateway
      Namespace:  envoy-gateway
    Conditions:
      Last Transition Time:  2025-02-25T17:55:10Z
      Message:               Policy has been accepted.
      Reason:                Accepted
      Status:                True
      Type:                  Accepted
    Controller Name:         gateway.envoyproxy.io/gatewayclass-controller

Here is the corresponding cluster configuration dump from an Envoy Proxy pod:

  {
   "@type": "type.googleapis.com/envoy.admin.v3.ClustersConfigDump",
   "version_info": "63187",
   ...
   "dynamic_active_clusters": [
    ...
    {
     "version_info": "f91211d7deb02f8d0acb0632d832a4fdaa18ef9d0dc3b2b5fdaf0235116fa70a",
     "cluster": {
      "@type": "type.googleapis.com/envoy.config.cluster.v3.Cluster",
      "name": "securitypolicy/namespace/fake-security-policy/extauth/0",
      "type": "EDS",
      "eds_cluster_config": {
       "eds_config": {
        "ads": {},
        "resource_api_version": "V3"
       },
       "service_name": "securitypolicy/namespace/fake-security-policy/extauth/0"
      },
      "connect_timeout": "...",
      "per_connection_buffer_limit_bytes": ...,
      "lb_policy": "LEAST_REQUEST",
      "circuit_breakers": {
       "thresholds": [
        {
         "max_retries": 1024
        }
       ]
      },
      "dns_lookup_family": "V4_PREFERRED",
      "outlier_detection": {},
      "common_lb_config": {
       "locality_weighted_lb_config": {}
      },
      "ignore_health_on_host_removal": true
     },
     "last_updated": "2025-02-20T22:51:37.009Z"
    },

The maxConnections threshold we set in the SecurityPolicy is missing from the circuit breaker configuration. The last_updated field of the cluster config (2025-02-20T22:51:37.009Z) is older than the security policy application time (2025-02-25T17:55:10Z). It appears that Envoy Gateway somehow skipped applying the circuit breaker backendSetting from the security policy accordingly.

Note: If there are privacy concerns, sanitize the data prior to
sharing.

Environment:

Include the environment like gateway version, envoy version and so on.

v1.2.5

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions