如何从萨格人笔记本中访问IP白名单的API?

发布于 2025-02-10 06:27:00 字数 240 浏览 4 评论 0原文

我已经在AWS EKS托管的Kubernetes群集中部署了一个烧瓶应用程序及其容器,并且该集群的安全组是IP白名单。

我使用eksctl创建了集群,为其创建了一个RDS实例,并使用其Helm Chart部署了该应用程序。

我正在尝试从AWS SageMaker笔记本实例中访问烧瓶应用程序的API,但是由于IP白名单,我无法连接。连接时间输出。

谁能告诉我如何将笔记本实例添加到我的白名单中?

I have deployed a Flask application and its containers in an AWS EKS managed Kubernetes cluster, and the cluster's security group is IP whitelist secured.

I created the cluster using eksctl, created an RDS instance for it, and deployed the application using it's helm chart.

I am trying to access the APIs of the flask application from within a AWS Sagemaker Notebook instance, but because of the IP whitelist, I am unable to connect. The connection times-out instead.

Can anyone tell me how I can add the Notebook instance to my whitelist?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

爱给你人给你 2025-02-17 06:27:00

由于API是IP白名单,因此您需要将SageMaker实例的公共IP添加到白名单中,以便从笔记本电脑上连接到API。

  1. 打开一个sagemaker笔记本实例,然后在单元格中运行以下命令。

    !curl ifconfig.me

    这将返回一个IP地址,例如13.232.97.17

  2. 从EC2控制台页面转到群集的安全组。它将具有一个名称,例如eks-cluster-sg-clusername-uniqueid

  3. 编辑安全组的入站规则,并为SageMaker Notebook实例添加新条目。

     类型协议
       自定义TCP TCP< port_number>自定义13.232.97.17/32
     

    并添加适当的描述。

现在,您应该能够通过笔记本访问API。

Since the API is IP whitelist secured, you will need to add the public IP of your Sagemaker instance to the whitelist in order to connect to the API from the notebook.

  1. Open a Sagemaker notebook instance, and run the following command in a cell.

    !curl ifconfig.me

    This will return an IP address such as 13.232.97.17.

  2. Go to your cluster's security group from EC2 console page. It will have a name such as eks-cluster-sg-cluserName-uniqueID.

  3. Edit the security group's inbound rules, and add a new entry for the sagemaker notebook instance.

       Type          Protocol
       Custom TCP    TCP    <port_number>    Custom    13.232.97.17/32
    

    and add an appropriate description.

Now, you should be able to access the API via the notebook.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文