I came across this and realized that EnvoyFilters can be used for injecting headers for outbound http traffic.
My use case wants me to add headers for http as well as https traffic. As such I tried to use the Egress gateway for it. This is what I did
- Deploy an egress gateway in my k8s cluster
- Change the outbound mesh traffic to registry only
- Create a service entry for a particular host
- Create a gateway kubernetes object which routes the requests from the egress gateway to a particular URL and listens at a particular port
- Create a virtualService which serves the purpose of making sure that the routing of all http requests that are going to a particular URL are redirected to the egress gateway service and then the egress gateway can send it to its destination which is the final URL
All of this is good, but this can only be done for one particular remote service outside the mesh and for every service I want to add , I would have to add its url in the preexisting serviceentry and basically go over the full loop again.
Is there a way I can do that for all requests going out of my mesh ?