【问题标题】:How to connect from container in Azure Container Instances to an internal IP of VM in Azure如何从 Azure 容器实例中的容器连接到 Azure 中 VM 的内部 IP
【发布时间】:2017-11-20 14:14:56
【问题描述】:

我正在尝试使用 Azure 容器实例。我已经成功部署了一个容器,但我无法让它与我在 Azure 中部署的实例的内部 IP 进行通信。 容器接收到一个内部 IP 地址(作为环境变量)并尝试连接。我可以在日志中看到它无法打开连接。 网络策略(在目标 VM 和子网上)允许连接到此端口。

我该如何解决它? ACI 托管的容器部署在哪个子网中?我在没有公共 IP 的情况下创建了它(因为它只需要连接到内部服务)。

L

【问题讨论】:

    标签: azure docker azure-container-instances


    【解决方案1】:

    Azure 容器实例(在撰写本文时)无法在内部连接到 Vnet(以及其中的所有内容)。您唯一的选择是 - 外部连接。

    【讨论】:

      【解决方案2】:

      截至 2018 年 2 月 1 日,ACI 尚不支持 VNet,但这是我们积压的首要任务,因为我们知道需要在 VNet 中放置实例。我们正在积极开展这项工作,并且即将推出。

      【讨论】:

        【解决方案3】:

        现在好像是Azure does support it

        Azure 虚拟网络为您提供安全的专用网络 Azure 和本地资源。通过将容器组部署到 Azure 虚拟网络,您的容器可以与 虚拟网络中的其他资源。

        例如:

        az container create \
          --name appcontainer \
          --resource-group myResourceGroup \
          --image mcr.microsoft.com/azuredocs/aci-helloworld \
          --vnet aci-vnet \
          --vnet-address-prefix 10.0.0.0/16 \
          --subnet aci-subnet \
          --subnet-address-prefix 10.0.0.0/24
        

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 2019-06-11
          • 2021-11-26
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 2020-11-08
          • 1970-01-01
          • 1970-01-01
          相关资源
          最近更新 更多