【问题标题】:GKE egress networking in 1.9.6-gke.1 to GCE Instance1.9.6-gke.1 中的 GKE 出口网络到 GCE 实例
【发布时间】:2018-10-03 17:02:39
【问题描述】:

我使用的是 google kubernetes 引擎,我需要运行找到的 filebeat daemonset (https://www.elastic.co/guide/en/beats/filebeat/master/running-on-kubernetes.html)。我创建集群:

gcloud container clusters create test_cluster \
     --cluster-version "1.9.6-gke.1" \
     --node-version "1.9.6-gke.1" \
     --zone "us-east1-c" \
     --machine-type n1-standard-4 \
     --scopes "https://www.googleapis.com/auth/compute","https://www.googleapis.com/auth/devstorage.full_control","https://www.googleapis.com/auth/sqlservice.admin","https://www.googleapis.com/auth/log    ging.write","https://www.googleapis.com/auth/pubsub","https://www.googleapis.com/auth/servicecontrol","https://www.googleapis.com/auth/service.management.readonly","https://www.googleapis.com/auth/tra    ce.append" \
     --num-nodes "1" \
     --network "main-network" \
     --subnetwork "main-subnetwork" \
     --no-enable-cloud-monitoring \
     --no-enable-cloud-logging \
     --no-enable-legacy-authorization \
     --disk-size "50"

当我将 --cluster-version--node-version 设置为 1.8.8-gke.0 时,它可以工作,但是当我将其更改为 1.9.6-gke.1 时,filebeat pod 无法访问我正在运行 logstash 的 GCE 实例。

集群和 GCE 实例都在同一个网络上运行,我确信这不是谷歌云的防火墙问题,因为如果我 gcloud compute ssh 进入 GKE 实例并执行 nc -vz -w 5 10.0.0.18 5044 它连接正常。

当我让集群运行 1.8.8-gke.0 时,filebeat pod 连接到 logstash 并且运行 traceroute 10.0.0.18 显示它连接正常。当我使用1.9.6-gke.1 创建集群时,traceroute 10.0.0.18 显示以下内容:

[root@filebeat-56wtj filebeat]# traceroute 10.0.0.18 
traceroute to 10.0.0.18 (10.0.0.18), 30 hops max, 60 byte packets
 1  gateway (10.52.0.1)  0.063 ms  0.016 ms  0.012 ms
 2  * * *
 3  * * *
 4  * * *
 5  * * *
 6  * * *

编辑:请注意,这不是特定于 filebeat 容器的,我用另一个容器尝试过,它也无法访问 GCE 实例。

【问题讨论】:

    标签: kubernetes google-compute-engine google-kubernetes-engine filebeat gke-networking


    【解决方案1】:

    您可以在此处阅读 [1]:“从 Kubernetes 版本 1.9.x 开始,自动防火墙规则发生了变化,因此 Kubernetes Engine 集群中的工作负载无法与位于同一网络但在外部的其他 Compute Engine 虚拟机通信集群。出于安全原因进行此更改。

    您可以通过在集群上设置新的防火墙规则来复制旧集群(1.8.x 和更早版本)的行为。”

    [1]https://cloud.google.com/kubernetes-engine/release-notes#known-issues

    【讨论】:

      猜你喜欢
      • 2017-11-26
      • 2022-11-17
      • 1970-01-01
      • 2019-06-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多