Score:-1

Call external api from same io docker

cn flag

i have a simple .NET api that calls an api of an external provider. This provider requires that i indicate from which IP i will call him to allow me. So i have two options:

  1. Deploy my api on IIS with a fixed ip
  2. Do the same from docker on Azure K8S if possible?

Is possibile from different pods "set the ip caller" ti be always the same?

Bye

Score:0
br flag

Yes, it is possible to set the IP caller always to be the same when calling an external API from different pods in Azure K8S. There are two ways do do this:

Use an Azure Load Balancer: You can create an Azure Load Balancer and assign it a static IP address. Then, you can configure your pods to use the load balancer as the outbound IP for calling the external API. This way, the IP caller will always be the static IP of the load balancer.

Use a Kubernetes Service with a Fixed IP: Another option is to create a Kubernetes Service with a fixed IP and use it as the outbound IP for calling the external API. To do this, you can use the spec.loadBalancerIP field in the Service object to specify a fixed IP. This will allow you to set the IP caller always to be the same, regardless of which pod is calling the external API.

You will need to ensure that your pods are correctly configured to use the load balancer or fixed IP service as the outbound IP when calling the external API.

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.