<p>How can I make <code>Skaffold</code> forward privileged/protected/special ports which have numbers below <code>1024</code>? In my <code>skaffold.yaml</code> I added:</p>
<pre class="lang-yaml prettyprint-override"><code>portForward:
- resourceType: service
  resourceName: foo
  port: 80
  localPort: 80
</code></pre>
<p>It works fine for all unprotected ports, but in case of port <code>80</code>, <code>Skaffold</code> automatically picks another unprotected port instead of <code>80</code>.</p>
<p>According to the documentation <code>Skaffold</code> runs <code>kubectl port-forward</code> on each of user-defined ports, so I granted the <code>kubectl</code> binary the capability to open privileged ports with this command <code>sudo setcap CAP_NET_BIND_SERVICE=+eip /path/to/kubectl</code>.</p>
<p>Everything works fine when directly running <code>kubectl port-forward services/foo 80:80</code>, but when I run <code>skaffold dev --port-forward</code> it still picks another unprotected port.</p>
<p>I have been using <code>Skaffold v1.28.1</code> with <code>Minikube v1.22.0</code> on <code>Ubuntu 20.04</code>.</p>

adrihanu
<p>I solved the issue by granting the capability to open privileged ports for both <code>skaffold</code> and <code>kubectl</code> binaries:</p>
<pre class="lang-sh prettyprint-override"><code>sudo setcap CAP_NET_BIND_SERVICE=+eip /usr/local/bin/kubectl;
sudo setcap CAP_NET_BIND_SERVICE=+eip /usr/local/bin/skaffold;
</code></pre>
