<p>My knowledge of k8 is fairly rudimentary. A service in our infrastructure exposes several endpoints. Each of these endpoints have different URL for client applications consumption and different URL within K8s. For e.g. the external URL could be <a href="https://some-vanity-url/api/v1/promotions/lotteries/state" rel="nofollow noreferrer">https://some-vanity-url/api/v1/promotions/lotteries/state</a> and the internal URL within K8s would be <a href="https://lottery-service-pod-name/v1/lotteries/state" rel="nofollow noreferrer">https://lottery-service-pod-name/v1/lotteries/state</a>. </p>

<p>Currently, the developers expose all the endpoints within a service as a key/value pair in their properties file and when the service is deployed, these key/value pairs are extracted and ingress rules are updated. To me this sounds messy. Is there a cleaner approach to achieving the same result which is compliant with K8 deployment?</p>

<p>Also, i feel like there should be some construct in K8, which would allow teams to define their endpoints and ingress should simply subscribe to those events and update its rules automatically. Is that feasible?</p>

Jimm
<p>You can have a script to replace values in your yaml file before sending it to kubectl. But now you have an additional, non kubernetes standard step in your deployment.</p>

<p>Ingress subscribe to let's say ConfigMap(stores the endpoints) change events is unlikely to happen because:</p>

<ol>
<li><p>every ingress controller needs to be updated to watch the referenced ConfigMap in addition to watching the Ingress.</p></li>
<li><p>every ingress controller needs to change how they work, and mount the ConfigMap referenced as a volume.</p></li>
<li><p>alter how Kubernetes watch service works, such that an Ingress change event is triggered when a referenced ConfigMap has a change event.</p></li>
</ol>
