'Redirect traffic to external FQDN for only a single pod
I'm setting up a kubernetes test environment for an application. One of the pods of the application tries to contact a license server with the FQDN of an external host. I need to redirect this request to the kubernetes service of a license server that is running in a pod in the same cluster. Approaches that don't work:
- Changing the configuration to access a different server. The FQDN is hardcoded :(
- Using hostAliases. The IP address of the license server service may change, so it needs to be resolved dynamically.
- Modifing kubernetes DNS configuration. This makes the redirection active for the full cluster, which could have unwanted side effects.
We're using vanilla Kubernetes with istio.
Any ideas?
I'm thinking about adding a sidecar container to the application with it's own tiny DNS server. This could simply forward the request for the external FQDN to a service name. I'm hoping there's a simpler solution, because figuring out the DNS configuration and how to make my sidecar work together with istio sounds like quite a challenge.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
