【问题标题】:using weave virtual network in kubernetes with weave pod behind nat在 nat 后面使用 weave pod 在 kubernetes 中使用 weave 虚拟网络
【发布时间】:2017-09-26 19:12:19
【问题描述】:

我想在 NAT 后面的节点中部署一个带有 weave 虚拟网络的 kubernetes 集群。 (例如在openstack中使用浮动IP)

这是一个例子:

Kube Master:weave pod 在这里运行

  • 内部IP:192.168.0.10
  • 外网IP:172.10.0.10

Kube 节点(工作者)

  • 内部IP:172.10.0.11

在 kube 节点(worker)上运行的 pod 中的日志如下所示:

$ docker logs -f <id-of-weaveworks/weave-kube>
INFO: 2017/04/28 15:31:00.627655 Command line options: map[ipalloc-range:10.32.0.0/12 nickname:rpi3-kube status-addr:0.0.0.0:6782 docker-api: datapath:datapath http-addr:127.0.0.1:6784 ipalloc-init:consensus=3 no-dns:true port:6783 conn-limit:30]
INFO: 2017/04/28 15:31:00.628107 Communication between peers is unencrypted.
INFO: 2017/04/28 15:31:00.888331 Our name is 8e:0e:19:5d:4e:5e(rpi3-kube)
INFO: 2017/04/28 15:31:00.889315 Launch detected - using supplied peer list: [192.168.0.12 192.168.0.10 172.10.0.11]
INFO: 2017/04/28 15:31:00.890130 Checking for pre-existing addresses on weave bridge
INFO: 2017/04/28 15:31:00.903121 [allocator 8e:0e:19:5d:4e:5e] No valid persisted data
INFO: 2017/04/28 15:31:00.999661 [allocator 8e:0e:19:5d:4e:5e] Initialising via deferred consensus
INFO: 2017/04/28 15:31:01.001342 Sniffing traffic on datapath (via ODP)
INFO: 2017/04/28 15:31:01.004907 ->[192.168.0.10:6783] attempting connection
INFO: 2017/04/28 15:31:01.005712 ->[192.168.0.12:6783] attempting connection
INFO: 2017/04/28 15:31:01.007297 ->[172.10.0.11:6783] attempting connection
INFO: 2017/04/28 15:31:01.010285 ->[172.10.0.11:38918] connection accepted
INFO: 2017/04/28 15:31:01.019476 ->[147.214.99.166:6783|8e:0e:19:5d:4e:5e(rpi3-kube)]: connection shutting down due to error: cannot connect to ourself
INFO: 2017/04/28 15:31:01.021265 ->[147.214.99.166:38918|8e:0e:19:5d:4e:5e(rpi3-kube)]: connection shutting down due to error: cannot connect to ourself
INFO: 2017/04/28 15:31:01.042197 Listening for HTTP control messages on 127.0.0.1:6784
INFO: 2017/04/28 15:31:01.051546 Listening for metrics requests on 0.0.0.0:6782
INFO: 2017/04/28 15:33:08.225310 ->[192.168.0.10:6783] error during connection attempt: dial tcp4 :0->192.168.0.10:6783: getsockopt: connection timed out

kubernetes 集群配置正确,广播地址为:172.10.0.10

【问题讨论】:

    标签: kubernetes nat weave


    【解决方案1】:

    我目前的解决方法是在 weave 配置文件中修复节点的 IP:

    wget https://git.io/weave-kube-1.6      
    vim weave-kube-1.6  
    

    并使用您的 IP 进行修改

      containers:
        - name: weave
          env:
          - name: KUBE_PEERS
            value: "172.10.0.10 172.10.0.11"
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-05-04
      • 1970-01-01
      • 2018-08-24
      • 2023-03-19
      • 2020-02-05
      • 2023-03-26
      • 1970-01-01
      • 2020-09-09
      相关资源
      最近更新 更多