简体   繁体   中英

Login error from kubernetes pod to SQL Server 2019 Linux

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 :

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)

System.ComponentModel.Win32Exception (2): No such file or directory

This error doesn't occur if I run the app locally or deploy it as a Linux service using the same connection string:

Data Source=<ip>;Initial Catalog=<DatabaseName>;User Id=<user>;Password=<pass>

Both Encrypt=False and TrustServerCertificate=True don't work.

Thanks.

I finally found the problem. The real error was actually a connection problem but I've deployed the pod with linked injected and the "No such file or directory" 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 curl ipconfig.me/ip I got the real IP. After whitelisting the IP everything works fine even with linkerd.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM