<p>I'd like to know if it's possible to get information from a pod when it's just created.</p>

<p>I'm spending time in developing a kubernetes controller process that reacts itself when a pod is created in cluster.</p>

<p>When a pod is just created, the service has to be able to get some basic information from pod. For example, ip, annotations...</p>

<p>I'd like to use a java service.</p>

<p>Any ideas?</p>

Jordi
<p>You can use kubernetes</p>

<blockquote>
  <p>api-server</p>
</blockquote>

<p>to get information regarding </p>

<blockquote>
  <p>endpoints (service)</p>
</blockquote>

<p>. Kubernetes expose its API via REST so, you can use anything to communicate. Also, verify the results using '<code>kubectl</code>' tool while development. For example, if you want to monitor pods related to service say, myservice.</p>

<pre><code>kubectl get endpoints &lt;myservice_pod&gt; --watch
</code></pre>

<p>This will notify you with any activity with pods related to myservice. IMO, in java you have to use polling mechanism to mimic <code>--watch</code> functionality. </p>
