About simple transformations
Apply simple header and body transformations on a route with powerful Inja templates.
Simple vs. staged transformations
Simple transformations are configured in the transformation attribute of a GlooTrafficPoliy. The configuration format is the same as the transformation attribute in the kgateway TrafficPolicy. This way, you can easily migrate your transformation configuration when moving from kgateway to Gloo Gateway.
Simple transformations are applied as regular transformations after the external auth filter in the Envoy filter chain. Keep in mind that you can apply one transformation per route at a time. If you want to apply multiple transformations to a route, consider using staged transformations instead.
Staged transformations also come with advanced transformation templating features. For example, you can define matchers to configure when to apply transformations based on header, query parameter, or body information that is present in a request or response. You can also leverage extractors to extract specific information from headers, query parameters, or body by using regular expressions and further transform them with Inja templates. Because changing request parameters can impact the routing decision, you can instruct Gloo Gateway to redo the routing decision based on the transformation results.
Because simple transformations use the same format as transformations in the kgateway TrafficPolicy, you can continue to use your kgateway TrafficPolicy resource. No migration to the GlooTrafficPolicy is required. However, keep in mind that if you plan to use staged transformation features, you must migrate your configuration to the glooTransformation attribute of the GlooTrafficPolicy, which configures a staged transformation. You cannot use transformation and glooTransformation attributes in a GlooTrafficPolicy side-by-side.
Configuration format
For more information about how to configure simple transformations in a GlooTrafficPolicy, see Templating language.