• 安装部署
  • kk最新版本支持集群开启IPV6/IPV4双栈吗?

24sama 这样的话,在指定配置文件的host中是不是就不仅要录入主机的ipv4的地址,也需要ipv6的地址了?

    24sama 好的,谢谢,我研究下,第一次接触,谢谢你的帮助

    24sama

    你好,我按照链接做了之后,使用下面网址中提供的验证方法,发现节点地址块已经拿到,但是节点是否检测到 IPv4 和 IPv6 接口时只有IPv4的地址,这可能是什么原因呢?主机也有IPv6地址

    https://kubernetes.io/zh/docs/tasks/network/validate-dual-stack/

    kubeadm-config.yaml中也添加了node-ip部分

      tttt
      不是很清楚你具体执行的流程。看你的图片显示的是JoinConfiguration,所以盲猜你是在一个原来未开启双栈的集群中添加一个配置了双栈的新节点,所以这个可能是导致问题的原因。

      • tttt 回复了此帖

        24sama

        初始集群的时候时这样的,应该也是开启了双栈

        按照这种方式部署,开启了IPv6之后,发现通过IPv6的Service IP访问,当轮询到本节点上的pod时可以通,但是轮询到跨节点时无法访问通;但是直接访问Pod的IPv6地址,不管是本节点还是跨节点都可以访问通。这可能是是哪里的问题导致的?IPv4的ServiceIP和PodIP跨节点和不跨节点也都是通的,只有IPv6的Service IP跨节点时不通。

          tttt 这个问题解决了,是kubelet启动参数中有个node-ip,需要同时指定ipv4、ipv6地址

          24sama 这个service也是这样配置的。通过ipvsadm -L -n可以看到通过clusterIp的轮询配置了。

          看配置是正确的,而且通过nodeport方式,通过主机IPv6地址和端口 [fd15:4ba5:5a2b:1008:5bbf:f87b:b3f7:dd1d]:31363是可以访问到pod的,但是就是在集群内部通过clusterIp和端口[2001:db8:42:1::7e3d]:80访问的时候,只有轮询到本节点上的pod的时候才能通,轮询到其他节点上的pod的时候就通不了,这个很奇怪

          [root@m-192-168-239-132 ~]# ipvsadm -L -n
          IP Virtual Server version 1.2.1 (size=4096)
          Prot LocalAddress:Port Scheduler Flags
            -> RemoteAddress:Port           Forward Weight ActiveConn InActConn
          TCP  192.168.239.132:31363 rr
            -> 10.244.80.1:80               Masq    1      0          0         
            -> 10.244.198.1:80              Masq    1      0          0         
            -> 10.244.242.1:80              Masq    1      0          0         
          TCP  10.96.0.1:443 rr
            -> 192.168.239.132:6443         Masq    1      2          0         
            -> 192.168.239.133:6443         Masq    1      1          0         
            -> 192.168.239.134:6443         Masq    1      1          0         
          TCP  10.96.0.3:53 rr
            -> 10.244.177.1:53              Masq    1      0          0         
            -> 10.244.177.3:53              Masq    1      0          0         
          TCP  10.96.0.3:9153 rr
            -> 10.244.177.1:9153            Masq    1      0          0         
            -> 10.244.177.3:9153            Masq    1      0          0         
          TCP  10.96.236.88:80 rr
            -> 10.244.80.1:80               Masq    1      0          0         
            -> 10.244.198.1:80              Masq    1      0          0         
            -> 10.244.242.1:80              Masq    1      0          0         
          TCP  10.244.198.0:31363 rr
            -> 10.244.80.1:80               Masq    1      0          0         
            -> 10.244.198.1:80              Masq    1      0          0         
            -> 10.244.242.1:80              Masq    1      0          0         
          UDP  10.96.0.3:53 rr
            -> 10.244.177.1:53              Masq    1      0          0         
            -> 10.244.177.3:53              Masq    1      0          0         
          TCP  [fd15:4ba5:5a2b:1008:5bbf:f87b:b3f7:dd1d]:31363 rr
            -> [2001:db8:42:3:cd72:9fc4:393a:5000]:80 Masq    1      0          0         
            -> [2001:db8:42:29:6b93:3214:3a8b:3600]:80 Masq    1      0          0         
            -> [2001:db8:42:bc:152b:e0e1:f20c:c600]:80 Masq    1      0          0         
          TCP  [2001:db8:42:1::7e3d]:80 rr
            -> [2001:db8:42:3:cd72:9fc4:393a:5000]:80 Masq    1      0          0         
            -> [2001:db8:42:29:6b93:3214:3a8b:3600]:80 Masq    1      0          0         
            -> [2001:db8:42:bc:152b:e0e1:f20c:c600]:80 Masq    1      0          0         
          [root@m-192-168-239-132 ~]# curl -g [2001:db8:42:1::7e3d]:80
          ^C
          [root@m-192-168-239-132 ~]# curl -g [2001:db8:42:1::7e3d]:80
          <!DOCTYPE html>
          <html>
          <head>
          <title>Welcome to nginx!</title>
          <style>
          html { color-scheme: light dark; }
          body { width: 35em; margin: 0 auto;
          font-family: Tahoma, Verdana, Arial, sans-serif; }
          </style>
          </head>
          <body>
          <h1>Welcome to nginx!</h1>
          <p>If you see this page, the nginx web server is successfully installed and
          working. Further configuration is required.</p>
          
          <p>For online documentation and support please refer to
          <a href="http://nginx.org/">nginx.org</a>.<br/>
          Commercial support is available at
          <a href="http://nginx.com/">nginx.com</a>.</p>
          
          <p><em>Thank you for using nginx.</em></p>
          </body>
          </html>
          [root@m-192-168-239-132 ~]# curl -g [2001:db8:42:1::7e3d]:80
          ^C
          [root@m-192-168-239-132 ~]# curl -g [2001:db8:42:1::7e3d]:80
          ^C
          [root@m-192-168-239-132 ~]# curl -g [2001:db8:42:1::7e3d]:80
          <!DOCTYPE html>
          <html>
          <head>
          <title>Welcome to nginx!</title>
          <style>
          html { color-scheme: light dark; }
          body { width: 35em; margin: 0 auto;
          font-family: Tahoma, Verdana, Arial, sans-serif; }
          </style>
          </head>
          <body>
          <h1>Welcome to nginx!</h1>
          <p>If you see this page, the nginx web server is successfully installed and
          working. Further configuration is required.</p>
          
          <p>For online documentation and support please refer to
          <a href="http://nginx.org/">nginx.org</a>.<br/>
          Commercial support is available at
          <a href="http://nginx.com/">nginx.com</a>.</p>
          
          <p><em>Thank you for using nginx.</em></p>
          </body>
          </html>
          [root@m-192-168-239-132 ~]# 

            tttt 这个是用的k8s官网上的service地址段和pod地址段吧,官网上这两个ipv6的地址段是有重合的,要修改一下,就可以通了。pod的包含了service的。

              2 年 后

              [未知用户]

              能否出个kk改造ipv4/ipv6双栈的教程?非常感谢!