<p>I'm setting up a k8s cluster on GKE.  A wildcard DNS <code>*.server.com</code> will point to a Ingress controller.  Internally to the cluster, there will be webserver pods, each exposing a unique service.  The Ingress controller will use the server name to route to the various services. </p>

<p>Servers will be created and destroyed on a nearly daily basis.  I'd like to know if there's a way to add and remove a named server from the ingress controller without editing the whole list of named servers.  </p>

<p>It appears like you're planning to host multiple domain names on a single Load Balancer (==single <code>Ingress</code> resource). If not, this answer doesn't apply.</p>

<p>You can do this by configuring <code>Ingress</code> with a long list of domain names like:</p>

<pre><code>spec:
  rules:
  - host: cats.server.com
    http:
      paths:
      - path: /*
        backend:
          serviceName: cats
          servicePort: 8080
  - host: dogs.server.com
    http:
      paths:
      - path: /*
        backend:
          serviceName: dogs
          servicePort: 8080
  - [...]
</code></pre>

<p>If that's your intention, <strong>there's no way of doing this without editing this whole list</strong> and applying it to the cluster every time.</p>

<p>You can build a tool to construct this manifest file, then apply the changes. The Ingress controller is smart enough that existing domains will not see a downtime if they're still on the list.</p>

<p>However the domains you removed from the list will also be removed from the URL Map of the load balancer and hence stop accepting the traffic.</p>
