无法使用Kubeadm从Kubernetes群集连接Azure数据库

时间:2020-07-10 10:02:29

标签: docker ubuntu kubernetes azure-sql-database kubeadm

我有一个MVC应用程序,该应用程序使用Azure SQL数据库进行数据存储。我已经为它创建了一个docker镜像。

后来,我已经使用Kubeadm在Ubuntu 18.4上设置了Kubernetes集群。 Linux VM是在Azure云上创建的。

最初,我已将我的应用程序部署在单节点群集上,并且该应用程序按预期运行,没有任何SQL连接问题。然后,我在云上创建了两个VM,并将其分别用作Node 1(主节点)和Node2。现在,在将我的应用程序部署到Node 2机器上之后,我面临一个SQL连接问题。

Unhandled Exception: System.Data.SqlClient.SqlException: A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: TCP Provider, error: 35 - An internal exception was caught) ---> System.Net.Internals.SocketExceptionFactory+ExtendedSocketException: Resource temporarily unavailable

我尝试并验证了以下选项-

  1. 将IP添加到Azure SQL数据库防火墙设置
  2. 从Linux机器尝试使用sqlcmd连接SQL数据库
  3. POD网络已正确安装(calico)
  4. 尝试在VM上为SQL端口1433添加出站规则
  5. 我已经在VM上创建了一个SQL数据库,并试图从MVC应用程序连接此数据库,并且它也正在工作。

有人可以帮助我诊断和解决此问题吗?如果您需要更多详细信息,请告诉我。

0 个答案:

没有答案
相关问题