Skip to content

Introduce support for section-specific annotations in HTTPRoute that propagate to specific route rule XDS metadata #5960

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
Tharsanan1 opened this issue May 8, 2025 · 3 comments
Labels

Comments

@Tharsanan1
Copy link

Description

Currently using httproute annotations i can add static xds metadata. But when we need to add specific static metadata to a specific xds route rule this is not supported. for this I m proposing the following annotation structure.

gateway.envoyproxy.io/rule.<rule-index>.match.<match-index>.<key>: <value>

  • rule.i: Targets the i-th rule in .spec.rules.
  • match.j: Targets the j-th match entry in .spec.rules[i].matches.
  • key: The metadata key you want applied in that scope.

Example

metadata:
  annotations:
    gateway.envoyproxy.io/not-rule-specific: value
    gateway.envoyproxy.io/rule.0.match.0.logging-level: debug
    gateway.envoyproxy.io/rule.1.match.1.logging-level: warn

Resulting XDS Metadata Translation:

name: httproute/namespace/myroute/rule/0/match/0/*
metadata:
  filter_metadata:
    envoy-gateway:
      resources:
        - kind: HTTPRoute
          name: myroute
          namespace: myns
          annotations:
            logging-level: debug
            not-rule-specific: value
...
...
name: httproute/namespace/myroute/rule/1/match/1/*
metadata:
  filter_metadata:
    envoy-gateway:
      resources:
        - kind: HTTPRoute
          name: myroute
          namespace: myns
          annotations:
            logging-level: warn
            not-rule-specific: value

Shall I implement this improvement and send a PR?

This kind of improvement is marked as future enhancement in the doc. link

@zirain
Copy link
Member

zirain commented May 9, 2025

I don't think annotation is the right direction.

@Tharsanan1
Copy link
Author

Tharsanan1 commented May 9, 2025

@zirain in the EnvoyGateway document it says in the future, it might be supported through annotations thats why, I have proposed this design. What do you think the right way to do this?

@arkodg
Copy link
Contributor

arkodg commented May 9, 2025

@Tharsanan1 I believe the design doc is referring to mapping a HTTPRoute Rule Name to a xDS Route metadata, but you're referring to bringing additional user specified kay, value pairs and setting them for a xDS Route metadata which maps to a specific HTTP Route Rule.
-1 to the approach you've mentioned, you could achieve the same goal by splitting up the rule into a dedicated HTTPRoute

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants