<p>is it possible to chain requests through multiple backends with the new <a href="https://gateway-api.sigs.k8s.io/" rel="nofollow noreferrer">https://gateway-api.sigs.k8s.io/</a> ?</p>
<p>The idea is to have a flow depending on the response headers of each service ie:</p>
<p>Request -&gt; Gateway -&gt; [ first backend service &quot;Custom forward Header&quot; -&gt; second backend service -&gt; &quot;Custom forward Header&quot; -&gt; x service ] -&gt; Response</p>

Leonel Franchelli
<p>In the context of the <a href="https://gateway-api.sigs.k8s.io/" rel="nofollow noreferrer">Kubernetes Gateway API</a>, it is generally designed to manage <em>inbound</em> request traffic effectively through various kinds of Gateways, such as HTTPRoute, TCPRoute, etc.</p>
<p>This question is more about managing east/west traffic — that is, the traffic flowing between services inside the same Kubernetes cluster.</p>
<p>This should be possible with a service mesh: Leveraging a service mesh such as <a href="https://istio.io/" rel="nofollow noreferrer">Istio</a> or <a href="https://linkerd.io/" rel="nofollow noreferrer">Linkerd</a> can provide more sophisticated routing capabilities, including conditional routing based on headers.<br />
That is part of the <a href="https://gateway-api.sigs.k8s.io/concepts/gamma/" rel="nofollow noreferrer">GAMMA initiative</a>, which is still very much a work in progress.</p>
<p>In the meantime, &quot;<a href="https://wso2.com/library/blogs/the-future-of-api-gateways-on-kubernetes/" rel="nofollow noreferrer">The Future of API Gateways on Kubernetes</a>&quot; (Aug. 2023) from <a href="https://twitter.com/pubuduspace" rel="nofollow noreferrer">Pubudu Gunatilaka</a> (Senior Technical Lead @ WSO2) points to:</p>
<blockquote>
<p>In 2022, <a href="https://twitter.com/mattklein123" rel="nofollow noreferrer">Matt Klein</a>, the creator of Envoy, introduced a new project called <a href="https://gateway.envoyproxy.io/" rel="nofollow noreferrer"><strong>Envoy Gateway</strong></a>, specifically targeting API gateways.<br />
Envoy already had the necessary components for building an API gateway, including a proxy layer; a configurable filter architecture for network traffic filtering, routing, and processing; and xDS APIs for transmitting data to Envoy proxies.<br />
The open source Envoy Gateway project adds a management layer to handle an Envoy proxy as a standalone gateway or as a Kubernetes-managed API gateway.</p>
</blockquote>
<p>You do not need an Envoy Gateway, but, as <a href="https://imesh.ai/about-us.html" rel="nofollow noreferrer">Debasree Panda</a> confirms in &quot;<a href="https://imesh.ai/blog/what-is-envoy-gateway/" rel="nofollow noreferrer">What is Envoy Gateway, and why is it required for Kubernetes?</a>&quot;:</p>
<blockquote>
<p><a href="https://www.envoyproxy.io/" rel="nofollow noreferrer">Envoy proxy</a>, the data plane of Istio service mesh, is used for handling east-west traffic ( service-to-service communication within a data center)</p>
</blockquote>
<p>So you should be able to implement your use case, using for instance <a href="https://www.envoyproxy.io/docs/envoy/v1.27.0/configuration/http/http_filters/lua_filter.html#headers" rel="nofollow noreferrer">LUA filter / <code>headers()</code></a>.</p>
