通过内部IP地址从Google Cloud Function访问VM实例 [英] Access VM instance from Google Cloud Function via internal ip address

查看:124
本文介绍了通过内部IP地址从Google Cloud Function访问VM实例的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Redis的VM实例在内部IP 10.132.0.3上运行,它的外部IP是35.233.12.123 我想从Google Cloud Function连接到它.但是没有通过内部ip的连接,而通过外部ip的连接起作用. 据我了解,Google的云功能无法通过内部IP地址访问VPC网络及其实例. 因此,问题是:

I have a VM instance with Redis running on internal ip 10.132.0.3 also it's external ip is 35.233.12.123 I'd like to connect to it from google cloud function. But there is no connection via internal ip, while connection via external ip works. As I understand Google's cloud functions don't have access to VPC networks and my instances in it via internal ip addresses. So the questiona are:

  1. 是否可以通过内部ip从云功能访问VM实例?

  1. Is it possible to access the VM instance by internal ip from cloud function somehow?

我想,外部IP属于Google,因此流量无论如何都不应超出Google数据中心的范围.因此,如果在我的情况下使用外部ip,这会影响连接速度吗?流量会被计费为外部流量吗?通过外部ip连接到我的Redis VM实例有什么弊端?

The external ip belongs to google so the traffic shouldn't go outside of the google's datacenter anyway, I suppose. So if to use external ip in my case will this have influence on connection speed? Will the traffic be billed as external? What are the downsides of connecting to my Redis VM instance via external ip?

推荐答案

  1. 是否可以通过内部ip从云访问VM实例 功能如何?
  1. Is it possible to access the VM instance by internal ip from cloud function somehow?

Google已宣布alpha使用VPC专用IP地址从Cloud Functions连接到Compute Engine的可用性.您需要在此处进行注册.

Google has announce alpha availability to connect from Cloud Functions to Compute Engine using VPC private IP addresses. You need to sign up here.

否则,您将需要使用Cloud Functions的公共IP地址到Compute Engine.

Otherwise you will need to use the public IP address from Cloud Functions to Compute Engine.

  1. 外部ip属于google,因此流量不应外传 我想还是Google数据中心的一部分.
  1. The external ip belongs to google so the traffic shouldn't go outside of the google's datacenter anyway, I suppose.

该问题的答案取决于执行云功能的区域以及计算实例上启用的网络类型(标准层或高级层).同一地区always中的流量通过Premium Tier传输,这意味着Google的私有骨干网.

The answer to this question depends on which region the Cloud Function executes in and the type of networking (Standard Tier or Premium Tier) enabled on your Compute Instance. Traffic within the same region always travels over Premium Tier which means Google's private backbone.

Premium Tier将通过Google的骨干网将流量路由到最接近客户端的出口点(云功能).这意味着您的流量将保持在Google的骨干上.

Premium Tier will route traffic thru Google's backbone to a exit point closest to the client (Cloud Functions). This means that your traffic will stay on Google's backbone.

Standard Tier不在Google的骨干网中旅行-但是,我找不到使用Standard Tier的地区之间Google流量的权威参考.我的理解是,使用标准层的区域间流量是通过公共Internet进行的.

Standard Tier does not travel on Google's backbone - however, I cannot find a authoritative reference for Google traffic between regions using Standard Tier. My understanding is that region to region traffic using Standard Tier is over the public Internet.

云网络服务层概述

云功能位置

因此,如果在我的情况下使用外部ip,将对 连接速度?

So if to use external ip in my case will this have influence on connection speed?

Internet和Intranet的流量性能受许多因素影响.高级层流量是配置完善的,低延迟,高度可靠的全球网络.这表明性能更高.

Internet and Intranet traffic performance is affected by many factors. Premium Tier traffic is a well-provisioned, low latency, highly reliable global network. This indicates higher performance.

是否将流量计为外部流量?

Will the traffic be billed as external?

我不确定100%,但是我认为所有离开该地区的流量都记为外部流量.

I am not 100% sure but I believe all traffic that exits a region is billed as external traffic.

定价

通过Redis VM实例连接到我的实例有什么弊端 外部IP?

What are the downsides of connecting to my Redis VM instance via external ip?

缺点是数据的安全性.所有流量都应加密,恕我直言,无一例外.

The downside is security of your data. All traffic should be encrypted, IMHO without exception.

这篇关于通过内部IP地址从Google Cloud Function访问VM实例的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆