简体   繁体   English

Azure 容器实例不使用公共 IP

[英]Azure Container Instance not using public IP

Tldr: The issue is that the IP address the agent uses doesn't match the public IP address attached to the container Instance. Tldr:问题在于代理使用的 IP 地址与附加到容器实例的公共 IP 地址不匹配。 It's like it is using some hidden internal IP address that isn't visible to an end user.这就像它使用了一些最终用户不可见的隐藏内部 IP 地址。

Background: I setup a self-hosted DevOps agent in an Azure Container Instance.背景:我在 Azure 容器实例中设置了一个自托管的 DevOps 代理。 I added a public IP so I could whitelist it in my subscription, and the DevOps agent would have access to alter resource per Terraform templates.我添加了一个公共 IP,以便我可以将其列入我的订阅白名单,并且 DevOps 代理可以访问每个 Terraform 模板更改资源。

Problem: The agent is unable to alter resources that have firewall rules, despite adding the container Instance IP to the whitelist.问题:尽管将容器实例 IP 添加到白名单,代理仍无法更改具有防火墙规则的资源。 The error message states failure due to network access from an unapproved IP address.该错误消息指出由于来自未经批准的 IP 地址的网络访问而导致失败。 The issue is that the IP address the agent uses doesn't match the public IP address attached to the container Instance.问题是代理使用的 IP 地址与附加到容器实例的公共 IP 地址不匹配。 It's like it is using some hidden internal IP address that isn't visible to an end user.这就像它使用了一些最终用户不可见的隐藏内部 IP 地址。

Anyone encountered this before?有没有人遇到过这个? The whole reason I decided on a self-hosted agent was to avoid the IP hopping problem caused by using DevOps hosted agents.我决定使用自托管代理的全部原因是为了避免使用 DevOps 托管代理导致的 IP 跳跃问题。

I just tried with a simple curl container, outgoing IP is different with the IP the container is exposed on.我只是尝试了一个简单的 curl 容器,传出 IP 与容器公开的 IP 不同。 This is something I'd expect to see as well (I believe it would be using Kubernetes underneath).这也是我希望看到的(我相信它会在下面使用 Kubernetes)。 Nothing you can do about that.你对此无能为力。

You can create a container in the VNet, hence you won't need to whitelist random IP addresses.你可以在 VNet 中创建一个容器,因此你不需要将随机 IP 地址列入白名单。 or you can just create a VM assign a Public IP to it and whitelist that IP (that will always work).或者您可以创建一个 VM,为其分配一个公共 IP 并将该 IP 列入白名单(这将始终有效)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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