title: Kubernetes: Update IPs of pods in a custom loadbalancer after scaling
body: <p>I am using a custom loadbalancer for an UDP application that reads the target IPs from a SQL database.</p>
  
  <p>What is the best way to get the ip of the pods after scaling and insert it into the database used by the loadbalancer.</p>
  
  <p>One way I can think of is to use kubectl command to get the pod IPs and insert into DB but with this approach I'll need to keep track of the already inserted IPs and filter those from the command output.</p>
  
  <p>Below is the sample command I'll use to get the ip of the pods:</p>
  
  <pre><code>.\kubectl.exe get pods --selector=app=nginx-test -o=custom-columns=IP:.status.podIP
  </code></pre>
  
  <p>Is there another way or better way to do this?</p>
  
  <p>Thanks</p>