<p>I have an app where I regularly need to add new domains.
Right now I need to add or delete an ingress every time I add or remove a domain.</p>
<p>I would like to automate this.</p>
<p>I have a ui where a user has a list of registered domains and can add a domain to the app.
So when the user sets this up I want to automatically update the ingress.</p>
<p>The way I would go about this is via a service account that manages these ingresses.
Are there any best practices for this or are there ingress controllers that already have an api for this?</p>

errnesto
<p>Ingress controllers don't have any API exposed for this and don't need to. You will need to call kubernetes REST API to update the ingress resource. You can use kubernetes client libraries available in multiple languages to perform this using a service account or kubeconfig file.</p>
<p>You will need to define RBAC using Role and Rolebinding to authorize the service account or the user used to call the REST API.</p>
<p>Use PUT or PATCH to change host in below API</p>
<pre><code>/apis/networking.k8s.io/v1/namespaces/{namespace}/ingresses
</code></pre>
<p>When an ingress resource is updated this way ingress controller will be notified with the change because ingress controller watches on ingress resource for any change.</p>
