<p>So I am using the <a href="https://kubernetes.github.io/ingress-nginx/" rel="nofollow noreferrer">nginx ingress</a> and installed it trough the helm chart:</p>
<pre><code>helm install --set controller.kind=DaemonSet --set controller.service.annotations.&quot;service\.beta\.kubernetes\.io/do-loadbalancer-size-slug&quot;=&quot;lb-large&quot; --set controller.service.annotations.&quot;service\.beta\.kubernetes\.io/do-loadbalancer-hostname&quot;=&quot;some\.url\.com&quot; ingress-nginx ingress-nginx/ingress-nginx
</code></pre>
<p>This automatically created a loadbalancer on digital ocean as well.</p>
<p>As far as I understand until now, referencing <a href="https://kubernetes.github.io/ingress-nginx/user-guide/custom-errors/" rel="nofollow noreferrer">this</a> i have to:</p>
<ol>
<li>Create a docker image which will act as default backend, like <a href="https://github.com/kubernetes/ingress-nginx/tree/main/images/custom-error-pages" rel="nofollow noreferrer">this</a>.</li>
<li>Have to set the following things in the helm chart:
<ul>
<li>defaultBackend.enable =&gt; true</li>
<li>defaultBackend.image =&gt; The image created in step 1.</li>
<li>controller.config.custom-http-errors =&gt; [404, 503, ..] (all the errors i want to be handled by the default backend (<a href="https://github.com/kubernetes/ingress-nginx/blob/main/docs/user-guide/nginx-configuration/configmap.md" rel="nofollow noreferrer">config values reference</a>).</li>
</ul>
</li>
<li>Upgrade the helm chart.</li>
</ol>
<p>Would this be the right and also easiest approach or is there a simpler way?</p>
<p>Also would upgrading the helm chart, remove the old loadbalancer and create a new one?</p>

<blockquote>
<p>Would this be the right and also easiest approach or is there a simpler way?</p>
</blockquote>
<p>The steps presented in the question based on <a href="https://kubernetes.github.io/ingress-nginx/examples/customization/custom-errors/" rel="nofollow noreferrer">official NGINX Ingress Controller wiki</a> are correct and seems to be easiest approach.</p>
<blockquote>
<p>Also would upgrading the helm chart, remove the old loadbalancer and create a new one?</p>
</blockquote>
<p>After using command <code>helm upgrade</code> the LoadBalancer will stay the same - the IP address won't change.
By running <code>helm list</code> command you can see that upgrade took place, by checking <code>REVISION</code> and <code>UPDATED</code> fields.</p>
<pre><code>NAME            NAMESPACE       REVISION        UPDATED                                 STATUS          CHART                   APP VERSION
ingress-nginx   default         4               2021-09-06 10:38:14.447456942 +0000 UTC deployed        ingress-nginx-3.35.0    0.48.1
</code></pre>
