Skip to content

AgentgatewayPolicy: Add frontend policy tests #12816

@npolshakova

Description

@npolshakova

The new frontend field on the AgentgatewayPolicy introduced in #12723 supports configuring:

  • tcp
  • tls
  • http
  • access logging
  • tracing (todo, no translation logic)

Tasks:

For example, configuring access logs:

apiVersion: gateway.kgateway.dev/v1alpha1
kind: AgentgatewayPolicy
metadata:
  name: access-log-header
  namespace: default
spec:
  targetRefs:
    - group: gateway.networking.k8s.io
      kind: Gateway
      name: http-gw-for-test
  frontend:
    accessLog:
      attributes:
        add:
          - name: x-user-id
            expression: "request.headers['x-user-id']"

You should be able to send a request:

curl -i http://localhost:8080/get -H 'Host: www.example.com' H 'x-user-id: alice'

Then see the x-user-id: alice header logged in the agentgateway proxy logs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions