<p>I've deployed a .NET app as a pod into a Kubernetes cluster but this error occurred when it tries to connect to a SQL Server 2019 :</p>
<blockquote>
<p>A connection was successfully established with the server, but then an error occurred during the pre-login handshake. (provider: TCP Provider, error: 0 - No such file or directory)</p>
<p>System.ComponentModel.Win32Exception (2): No such file or directory</p>
</blockquote>
<p>This error doesn't occur if I run the app locally or deploy it as a Linux service using the same connection string:</p>
<pre><code>Data Source=&lt;ip&gt;;Initial Catalog=&lt;DatabaseName&gt;;User Id=&lt;user&gt;;Password=&lt;pass&gt;
</code></pre>
<p>Both <code>Encrypt=False</code> and <code>TrustServerCertificate=True</code> don't work.</p>
<p>Thanks.</p>

Giuseppe Terrasi
<p>I finally found the problem. The real error was actually a connection problem but I've deployed the pod with linked injected and the &quot;No such file or directory&quot; was returned by linkerd (I don't know how or why). Removing the injection, I got the real error. On the server firewall, I opened the 1443 port for the ingress IP which is different from the one presented by the pod to the server. So, I opened a bash inside the pod and with the command <code>curl ipconfig.me/ip</code> I got the real IP.
After whitelisting the IP everything works fine even with linkerd.</p>
