<p>On our current <code>Rancher environment</code>, we dynamically configure an <code>Nginx</code> configuration based on calls to the Rancher metadata, using labels on the containers to determine if that container is included in the <code>Nginx</code> routing.<br>
We use <code>confd</code> with a <code>Rancher</code> backend to accomplish this metadata check and to dynamically change/reload a new <code>Nginx</code> configuration.</p>

<p>We have started working on migrating to <code>Kubernetes</code> (AWS EKS).  Is there an equivalent to this <code>confd/Rancher</code> available for <code>Kubernetes</code> ?</p>

<p>Due to some technical reasons and time scoping reasons, we can't replace this <code>nginx</code> with an <code>ingress</code> equivalent at this time, so are looking into using annotations or labels on services/pods to keep a dynamic configuration capability.</p>

Steele
<p>To add a little further detail on what we eventually found thanks to Scott Anderson's answer.</p>

<p>Using the nginx custom template technique, we were able to dynamically configure the nginx configuration by using annotations in the Ingress resources and referencing them in the nginx custom template.</p>

<p>With an Ingress resource metadata defined as:</p>

<pre><code>metadata:
  name: foo
  annotations:
    kubernetes.io/ingress.class: "nginx-legacy"
    mycompany/bar: "path_to_service"
</code></pre>

<p>Within the custom Nginx template (location block), to see if the annotation is present:</p>

<pre><code>{{if index $ing.Annotations "mycompany/bar"}}
</code></pre>

<p>To get a value from an annotation:</p>

<pre><code>{{$bar:= index $ing.Annotations "mycompany/bar"}}
</code></pre>
