2

Flannel 网络理解

 2 years ago
source link: http://www.chenshake.com/the-flannel-network-understands-that-the/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

 

昨晚参加了一个k8s的网络培训,老师讲的内容不深,不过也确实解答了我以前对这个的疑问。这里我就总结一下我对这个的理解。

Flannel的网络,至少5个backend。

  • UDP:需要进入内核转两次,性能差,基本不会生产使用
  • vxlan:性能不错,和ipip原理基本相似
  • ipip: 性能不错,
  • host-gw:性能最好,有局限性,必须在一个二层上.
  • directrouting (host-gw+vxlan):两个结合,高性能和跨网段都可以。不过应该带来复杂性。

其实肯定就要回答,他们间有啥区别。Flannel网络的资料,基本都是在github上,不多。

官方github

#For Kubernetes v1.17+ 
kubectl apply -f https://raw.githubusercontent.com/coreos/flannel/master/Documentation/kube-flannel.yml

这是你装完K8s后,部署flannel的网络,你需要根据你选择的网络,来修改kube-flannel.yaml 就可以,或者部署后,你可以修改configmap来修改。

  net-conf.json: |
    {
      "Network": "10.244.0.0/16",
      "Backend": {
        "Type": "vxlan" #host-gw,udp,ipip
      }
    }
---
     "Backend": {
        "Type": "vxlan",
        "Directrouting": true #加一行这个
  • https://www.cnblogs.com/sandshell/p/11769642.html

 Posted by 陈沙克 at 5:04 PM

 Leave a Reply Cancel reply

Your Comment

Name (required)

E-mail (required)

Website

Save my name, email, and website in this browser for the next time I comment.

This site uses Akismet to reduce spam. Learn how your comment data is processed.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK