简体   繁体   English

使用 Google Serverless VPC 访问具有云功能的 GKE pod

[英]Access GKE pods with Cloud functions using Google Serverless VPC

I have created a GKE private cluster, with some pods live in it.我创建了一个 GKE 私有集群,里面有一些 pod。 Now I want to integrate my pods with cloud function provided by GCP.现在我想将我的 pod 与 GCP 提供的云 function 集成。 To achieve this, I use Serverless VPC access, because my GKE cluster lived on a custom.network on another region and use Internal Load Balancer for my pods.为实现这一点,我使用无服务器 VPC 访问,因为我的 GKE 集群位于另一个区域的 custom.network 上,并为我的 pod 使用内部负载均衡器。

It seems successful, because I have tested to access my pods internal IP from GCE lived in the same.network and tested to access my GCE VM from Cloud Function, but when I try to access my pod internal IP from the Cloud Function, it always returns timeout.这似乎是成功的,因为我已经测试从 GCE 访问我的 pod 内部 IP 生活在 same.network 并测试从云 Function 访问我的 GCE VM,但是当我尝试从云 Function 访问我的 pod 内部 IP 时,它总是返回超时。

The HTTP request failed with error %s
Get http://172.16.0.42: dial tcp 172.16.0.42:80: i/o timeout

I expect the Serverless VPC access will connect my cloud function to my pod Internal IP, like it connects my cloud function to GCP VM with same.network with my pod.我希望无服务器 VPC 访问将我的云 function 连接到我的 pod 内部 IP,就像它将我的云 function 连接到具有与我的 pod 相同的网络的 GCP VM。

I know that the question was asked almost 3 years ago.我知道这个问题是大约 3 年前提出的。 May answer will be useful for somebody.可能回答对某人有用。

We can make internal load balancer using LoadBalancer type and annotation cloud.google.com/load-balancer-type: "Internal"我们可以使用LoadBalancer类型和注释cloud.google.com/load-balancer-type: "Internal"创建内部负载均衡器

Should be smth like this:应该是这样的:

apiVersion: v1
kind: Service
metadata:
  name: service_name
  annotations:
    cloud.google.com/load-balancer-type: "Internal"
  labels:
...
spec:
  type: LoadBalancer
  selector:
...
  ports:
...

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

相关问题 如何使用无服务器 VPC 访问云功能 - How to use Serverless VPC access for Cloud functions 如何通过 GKE pod 访问 Google Cloud Storage 中的文件 - How to access Files in Google Cloud Storage through GKE pods 从GKE上的pod访问GCP Cloud DNS - Access GCP Cloud DNS from pods on GKE 如何设置 GKE 集群和 GKE pod 必须与存储在谷歌云秘密管理器上的云 sql 和云 sql 密码进行通信 - How to setup GKE Cluster and GKE pods has to communicate with cloud sql and cloud sql password stored on google cloud secret manager 使用 Google IAM 进行 GKE 服务网络访问 - Using Google IAM for GKE service web access 无法访问Google Cloud上公开的外部IP的Kubernetes Pod - Cannot access Kubernetes pods exposed external ip on google cloud 使用 Google Cloud - GKE 的 Web 应用程序部署方法 - Web application deployment approach using Google Cloud - GKE 在GKE / Google Cloud上安装Istio - Installation of Istio on GKE / Google Cloud 无法使用谷歌云在牧场主的 kubernetes 上的 Pod 之间进行通信? - Unable to communicate between pods on kubernetes on rancher using google cloud? 在 Google Cloud 中监控 Kubernetes Pod - Monitoring Kubernetes Pods in Google Cloud
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM