{"id":10020429,"date":"2024-11-30T17:32:06","date_gmt":"2024-11-30T09:32:06","guid":{"rendered":"https:\/\/itmax.cn\/?p=10020429"},"modified":"2024-11-30T17:32:06","modified_gmt":"2024-11-30T09:32:06","slug":"kubernetes-%e9%9b%86%e7%be%a4%e7%bd%91%e7%bb%9c%ef%bc%9aflannel-%e4%b8%8e-calico-%e7%9a%84%e5%8c%ba%e5%88%ab","status":"publish","type":"post","link":"https:\/\/itmax.cn\/?p=10020429","title":{"rendered":"Kubernetes \u96c6\u7fa4\u7f51\u7edc\uff1aFlannel \u4e0e Calico \u7684\u533a\u522b"},"content":{"rendered":"<p>\u6709\u8bfb\u8005\u63d0\u95ee\uff1a<code>Flannel<\/code> \u4e0e <code>Calico<\/code> \u7684\u533a\u522b\u3002\u6587\u672c\u5c06\u89e3\u6790\u4e00\u4e0b\u8fd9\u4e24\u4e2a\u7ec4\u4ef6\u3002<\/p>\n<h2>Flannel<\/h2>\n<p><code>Flannel<\/code> \u7684\u67b6\u6784\u975e\u5e38\u7b80\u5355\uff0c\u53ea\u6709\u4e24\u4e2a\u7ec4\u4ef6\uff1a<code>flanneld<\/code> \u548c <code>flannel-cni-plugin<\/code>\u3002<\/p>\n<p>\u5728\u529f\u80fd\u7279\u6027\u4e0a\uff0c<code>Flannel<\/code> \u6709\u4e09\u4e2a\u90e8\u5206\uff1a<\/p>\n<ul>\n<li>\u4f7f\u7528 <code>kubernetes API<\/code> \u6216 <code>etcd<\/code> \u5b58\u50a8\u6570\u636e\u3002<\/li>\n<li><code>IPAM<\/code>\uff0c\u7ed9\u8282\u70b9\u7684 Pod \u5206\u914d IP \u5730\u5740\u8303\u56f4\uff08<code>podCIDR<\/code>\uff09\u3002<\/li>\n<li>\u914d\u7f6e\u540e\u7aef\u8f6c\u53d1\u6570\u636e\u5305\u3002<\/li>\n<\/ul>\n<p><code>Flannel<\/code> \u652f\u6301\u4ee5\u4e0b\u540e\u7aef\u673a\u5236\u8fdb\u884c\u6570\u636e\u5305\u8f6c\u53d1\uff1a<\/p>\n<ul>\n<li><code>VXLAN<\/code>\uff1a\u4f7f\u7528 Linux kernel \u7684 <code>VXLAN<\/code> \u5c01\u5305\u5e76\u8f6c\u53d1\uff0c\u8fd9\u79cd\u65b9\u5f0f\u5c5e\u4e8e <code>Overlay<\/code> \u7f51\u7edc\u3002<\/li>\n<li><code>host-gw<\/code>\uff1a<code>Flannel<\/code> \u4f1a\u76f4\u63a5\u5728\u8282\u70b9\u4e0a\u521b\u5efa IP \u8def\u7531\uff0c\u8fd9\u79cd\u65b9\u5f0f\u4f9d\u8d56\u8282\u70b9\u4e4b\u95f4\u7684 L2\uff08\u4e8c\u5c42\u7f51\u7edc\uff09\u7684\u8fde\u901a\u6027\u3002<\/li>\n<li><code>WireGuard<\/code>\uff1a\u4f7f\u7528 kernel \u7684 <code>WireGuard<\/code> \u5c01\u88c5\u5e76\u52a0\u5bc6\u6570\u636e\u5305\u3002<\/li>\n<li><code>UDP<\/code>\uff1a\u4ec5\u8c03\u8bd5\u4f7f\u7528\u3002<\/li>\n<li>\u8fd8\u6709\u4e00\u4e9b\u5b9e\u9a8c\u6027\u540e\u7aef\uff0c\u672c\u6587\u4e0d\u505a\u8d58\u8ff0\u3002<\/li>\n<\/ul>\n<h3>\u7f51\u7edc\u6a21\u578b<\/h3>\n<h4><code>host-gw<\/code><\/h4>\n<p><code>host-gw<\/code> \u5355\u8bcd\u7f29\u5199\u7684\u610f\u601d\u662f\u4f7f\u7528 host \u4e3b\u673a\u7684 gateway\u3002\u8fd9\u79cd\u65b9\u5f0f\u4e0d\u4f1a\u989d\u5916\u5730\u5c01\u88c5\u6570\u636e\u5305\uff0c\u4f46\u8981\u6c42\u8282\u70b9\u4e4b\u95f4\u7684 L2 \u8fde\u901a\u6027\u3002<\/p>\n<p>\u4f7f\u7528 <code>host-gw<\/code> \u65f6\uff0c<code>Flannel<\/code> \u505a\u7684\u4e8b\u60c5\u5c31\u662f\u901a\u8fc7 <code>github.com\/vishvananda\/netlink<\/code> \u8fd9\u4e2a\u7b2c\u4e09\u65b9\u5e93\u53bb\u914d\u7f6e\u4e3b\u673a\u8def\u7531\u8868\uff0c\u5373\u6267\u884c <code>ip route ...<\/code> \u547d\u4ee4\uff0c\u4f8b\u5982\uff1a<\/p>\n<pre><code class=\"sh\">ip route add &lt;destination&gt; via &lt;gateway&gt; dev &lt;device&gt;<\/code><\/pre>\n<p>\u5047\u8bbe\u6211\u4eec\u6709\u4ee5\u4e0b\u4e09\u4e2a\u8282\u70b9\uff1a<\/p>\n<ul>\n<li><code>node01<\/code>\uff1a\u4e3b\u673a IP \u662f <code>192.168.1.1<\/code>\uff0cpodCIDR \u662f <code>10.244.1.0\/24<\/code>\u3002<\/li>\n<li><code>node02<\/code>\uff1a\u4e3b\u673a IP \u662f <code>192.168.1.2<\/code>\uff0cpodCIDR \u662f <code>10.244.2.0\/24<\/code>\u3002<\/li>\n<li><code>node03<\/code>\uff1a\u4e3b\u673a IP \u662f <code>192.168.1.3<\/code>\uff0cpodCIDR \u662f <code>10.244.3.0\/24<\/code>\u3002<\/li>\n<\/ul>\n<p>\u90a3\u4e48\u4f7f\u7528 <code>host-gw<\/code> \u65f6\uff0c<code>Flannel<\/code> \u4f1a\u628a <code>node01<\/code> \u7684\u4e3b\u673a\u8def\u7531\u8868\u914d\u7f6e\u4e3a\u7c7b\u4f3c\u4ee5\u4e0b\u5f62\u5f0f\uff1a<\/p>\n<pre><code class=\"sh\"># node01 \u672c\u5730\u8def\u7531\n10.244.1.0\/24 dev flannel.1 proto kernel scopee link\n\n# node02 \u8def\u7531\n10.244.2.0\/24 via 192.168.1.2 dev eth0\n\n# node03 \u8def\u7531\n10.244.3.0\/24 via 192.168.1.3 dev eth0<\/code><\/pre>\n<p>\u5728 <code>node02<\/code> \u8282\u70b9\u4e0a\u540c\u6837\u914d\u7f6e\u7c7b\u4f3c\u7684\u4e3b\u673a\u8def\u7531\u8868\uff1a<\/p>\n<pre><code class=\"sh\"># node01 \u8def\u7531\n10.244.1.0\/24 via 192.168.1.1 dev eth0\n\n# node02 \u672c\u5730\u8def\u7531\n10.244.2.0\/24 dev flannel.1 proto kernel scopee link\n\n# node03 \u8def\u7531\n10.244.3.0\/24 via 192.168.1.3 dev eth0<\/code><\/pre>\n<p>\u5176\u5b83\u8282\u70b9\u7c7b\u4f3c\u3002<\/p>\n<p>\u5f53 <code>node01<\/code> \u8282\u70b9\u4e0a\u7684 Pod \u60f3\u8981\u5411 <code>node02<\/code> \u8282\u70b9\u4e0a\u7684 Pod \u53d1\u9001\u6570\u636e\u65f6\uff0c\u4f1a\u5148\u6839\u636e\u4ee5\u4e0a\u8def\u7531\u8868\u5f97\u77e5\u76ee\u6807 IP \u5730\u5740\uff0c\u7136\u540e\u901a\u8fc7 <code>ARP<\/code> \u534f\u8bae\u5f97\u5230\u8be5\u5730\u5740\u5bf9\u5e94\u7684 <code>MAC<\/code> \u5730\u5740\uff08<code>L2<\/code> \u6570\u636e\u94fe\u8def\u5c42\u5730\u5740\uff09\uff0c\u518d\u628a\u6570\u636e\u5305\u5c01\u88c5\u4e3a\u6570\u636e\u5e27\u4f20\u8f93\u3002 <\/p>\n<p><code>L2<\/code> \u7684\u8fde\u901a\u6027\u8981\u6c42\u8282\u70b9\u4e4b\u95f4\u80fd\u591f\u5728\u6570\u636e\u94fe\u8def\u5c42\u76f4\u63a5\u901a\u4fe1\uff0c\u8fd9\u901a\u5e38\u610f\u5473\u7740\u8282\u70b9\u5fc5\u987b\u4f4d\u4e8e\u540c\u4e00\u5e7f\u64ad\u57df\uff08\u5982\u540c\u4e00\u4e2a\u5b50\u7f51\uff09\u3002\u6b64\u65f6\uff0c\u6570\u636e\u5e27\u53ef\u4ee5\u901a\u8fc7\u4e8c\u5c42\u8bbe\u5907\uff08\u5982\u4ea4\u6362\u673a\uff09\u57fa\u4e8e\u76ee\u6807 <code>MAC<\/code> \u5730\u5740\u76f4\u63a5\u8f6c\u53d1\uff0c\u800c\u65e0\u9700\u4e09\u5c42\u8bbe\u5907\uff08\u5982\u8def\u7531\u5668\uff09\u8fdb\u884c IP \u5c42\u8f6c\u53d1\u3002\u5e7f\u64ad\u57df\u7684\u8303\u56f4\u51b3\u5b9a\u4e86 <code>L2<\/code> \u901a\u4fe1\u7684\u6709\u6548\u8303\u56f4\u3002<\/p>\n<p>\u5982\u679c\u8282\u70b9\u4f4d\u4e8e\u4e0d\u540c\u5b50\u7f51\u6216\u901a\u8fc7\u8def\u7531\u5668\u8fde\u63a5\uff0c\u5c3d\u7ba1\u6e90\u8282\u70b9\u53ef\u4ee5\u901a\u8fc7\u8def\u7531\u8868\u5f97\u77e5\u76ee\u6807 IP \u5730\u5740\uff0c\u4f46\u7531\u4e8e\u76ee\u6807 IP \u4e0d\u5728\u672c\u5730\u5b50\u7f51\uff0c\u6e90\u8282\u70b9\u9700\u8981\u901a\u8fc7 <code>ARP<\/code> \u83b7\u53d6\u4e0b\u4e00\u8df3\u8def\u7531\u5668\u7684 <code>MAC<\/code> \u5730\u5740\uff0c\u800c\u975e\u76ee\u6807\u8282\u70b9\u7684 <code>MAC<\/code> \u5730\u5740\u3002\u6570\u636e\u5e27\u9996\u5148\u53d1\u9001\u5230\u8def\u7531\u5668\uff0c\u8def\u7531\u5668\u5728\u8f6c\u53d1\u65f6\u6839\u636e\u76ee\u6807\u7f51\u7edc\u91cd\u65b0\u5c01\u88c5\u5e27\u3002\u8fd9\u79cd\u573a\u666f\u4e0b\uff0c<code>host-gw<\/code> \u6a21\u5f0f\u4f9d\u8d56\u7684\u76f4\u63a5\u4e8c\u5c42\u8f6c\u53d1\u673a\u5236\u65e0\u6cd5\u5b9e\u73b0\u3002<\/p>\n<p><code>host-gw<\/code> \u6a21\u5f0f\u6570\u636e\u8f6c\u53d1\u4e0a\u80fd\u5f97\u5230\u66f4\u9ad8\u7684\u6027\u80fd\uff0c\u6ca1\u6709\u989d\u5916\u7684\u5c01\u5305\u8fc7\u7a0b\uff0cL2 \u76f4\u8fde\uff0c\u4f46\u662f\u7531\u4e8e\u6bcf\u4e2a\u8282\u70b9\u90fd\u8981\u914d\u7f6e\u5168\u91cf\u7684\u4e3b\u673a\u8def\u7531\u8868\uff0c\u5f53\u8282\u70b9\u6570\u91cf\u5e9e\u5927\u3001\u8282\u70b9\u4e0a\u4e0b\u7ebf\u9891\u7e41\u65f6\u4f1a\u6709\u4e0d\u5c0f\u7684\u6311\u6218\u3002<\/p>\n<p>\u66f4\u591a\u5173\u4e8e L2 \u76f4\u8fde\u7684\u89c4\u6a21\u95ee\u9898\uff0c\u53ef\u4ee5\u53c2\u8003 <a href=\"https:\/\/link.segmentfault.com\/?enc=M0NNRx4Vtw0qg2rZZpJAsg%3D%3D.R%2Bw28LIXOA%2F2wDz1z5A7b615D6tHEflrd%2B1CWZsgi%2F9gFzPOZChE4wcuXeB83q0Ha8A7rCREpEd9os9SU0muQ8InIsZB55F9qJ0TJjHhn75ghPw4an%2B71VCyo3n%2FZsax\" rel=\"nofollow noopener noreferrer\" target=\"_blank\">Concerns over Ethernet at scale<\/a>\u3002<\/p>\n<h4><code>VXLAN<\/code><\/h4>\n<p>\u5982\u679c\u65e0\u6cd5\u4fdd\u8bc1 <code>L2<\/code> \u7684\u76f4\u63a5\u8fde\u901a\u6027\uff0c\u5219\u9700\u8981\u4f7f\u7528 <code>VXLAN<\/code> \u8fd9\u79cd <code>Overlay<\/code> \u7684\u65b9\u5f0f\uff0c\u5728\u539f\u6709\u6570\u636e\u5e27\u4e4b\u5916\u8fdb\u884c\u4e00\u5c42\u989d\u5916\u7684\u5c01\u88c5\u3002<\/p>\n<p><img decoding=\"async\"   referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/remote\/1460000045522476\" alt=\"\" title=\"\"><\/p>\n<p>\u6b64\u65f6\uff0c\u5373\u4f7f\u8282\u70b9\u4f4d\u4e8e\u4e0d\u540c\u7684\u5b50\u7f51\uff0c\u6216\u901a\u8fc7\u8def\u7531\u5668\u7b49\u8bbe\u5907\u7ec4\u7f51\u90fd\u6ca1\u6709\u5173\u7cfb\uff0c\u4f46\u662f <code>VXLAN<\/code> \u8981\u6c42 L3 \u5fc5\u987b\u8fde\u901a\uff0c\u5373\u901a\u8fc7\u8282\u70b9\u7684 IP \u5730\u5740\u80fd\u591f\u8fdb\u884c\u901a\u4fe1\u3002\u56e0\u6b64\uff0c<code>VXLAN<\/code> \u4e5f\u79f0\u4e3a <code>L2 over L3<\/code>\uff0c\u4e0d\u7528\u7ba1\u4e0b\u5c42 L2 \u662f\u4ec0\u4e48\u6837\u7684\uff0c\u53ea\u8981 L3 \u8fde\u901a\u5373\u53ef\u3002<\/p>\n<p><code>Flannel<\/code> \u5728 <code>VXLAN<\/code> \u6a21\u5f0f\u4e0b\u505a\u7684\u4e8b\u60c5\u4e5f\u662f\u901a\u8fc7 <code>github.com\/vishvananda\/netlink<\/code> \u8fd9\u4e2a\u7b2c\u4e09\u65b9\u5e93\u53bb\u6267\u884c <code>ip link ...<\/code> \u547d\u4ee4\uff1a<\/p>\n<pre><code class=\"sh\">ip link add &lt;vxlan-name&gt; type vxlan id &lt;vxlan-id&gt; dev &lt;device&gt; ...<\/code><\/pre>\n<p>\u8fd9\u4e5f\u5c31\u662f\u8bf4 <code>Flannel<\/code> \u672c\u8eab\u4e0d\u8fdb\u884c\u4efb\u4f55\u6570\u636e\u5305\u7684\u5c01\u88c5\u548c\u8f6c\u53d1\uff0c\u662f\u7cfb\u7edf\u5185\u6838\u5728\u505a\u5b9e\u9645\u7684\u5de5\u4f5c\u3002<\/p>\n<h2>Calico<\/h2>\n<p><code>Calico<\/code> \u7684\u67b6\u6784\u5219\u66f4\u52a0\u590d\u6742\uff0c\u7531\u591a\u4e2a\u7ec4\u4ef6\u6784\u6210\u3002<\/p>\n<p><img decoding=\"async\"   referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/remote\/1460000045522477\" alt=\"\" title=\"\" loading=\"lazy\"><\/p>\n<p>\u5176\u4e2d\uff1a<\/p>\n<ul>\n<li><code>Calico API server<\/code>\uff1a\u7528\u6237\u53ef\u4ee5\u4f7f\u7528 kubectl \u76f4\u63a5\u7ba1\u7406 Calico \u8d44\u6e90\u3002<\/li>\n<li><code>Calico kube-controllers<\/code>\uff1a\u76d1\u63a7\u8d44\u6e90\u5e76\u6267\u884c\u64cd\u4f5c\u3002<\/li>\n<li><code>Datastore plugin<\/code>\uff1a\u4f7f\u7528 <code>kubernetes API<\/code> \u6216 <code>etcd<\/code> \u5b58\u50a8\u6570\u636e\u3002<\/li>\n<li><code>Typha<\/code>\uff1a\u4f5c\u4e3a\u6570\u636e\u5b58\u50a8\u548c <code>Felix<\/code> \u5b9e\u4f8b\u4e4b\u95f4\u7684\u5b88\u62a4\u8fdb\u7a0b\u8fd0\u884c\uff0c\u51cf\u5c11\u6570\u636e\u5b58\u50a8\u7684\u8d1f\u8f7d\u4ee5\u589e\u52a0\u96c6\u7fa4\u89c4\u6a21\u3002\u5728\u5927\u89c4\u6a21\uff08100 \u4e2a\u8282\u70b9\u4ee5\u4e0a\uff09\u7684\u96c6\u7fa4\u4e2d\u5fc5\u4e0d\u53ef\u5c11\u3002<\/li>\n<li><code>Felix<\/code>\uff1a\u8fd0\u884c\u5728\u6bcf\u4e2a\u8282\u70b9\u4e0a\uff0c\u63a7\u5236\u8282\u70b9\u7684\u7f51\u7edc\u63a5\u53e3\u3001\u8def\u7531\u3001ACL \u6d41\u91cf\u63a7\u5236\u548c\u5b89\u5168\u7b56\u7565\u3001\u4ee5\u53ca\u62a5\u544a\u72b6\u6001\u7b49\u3002<\/li>\n<li><code>BIRD<\/code>\uff1a\u5728\u627f\u8f7d <code>Felix<\/code> \u7684\u6bcf\u4e2a\u8282\u70b9\u4e0a\u8fd0\u884c\uff0c\u4ece <code>Felix<\/code> \u83b7\u53d6\u8def\u7531\u5e76\u5206\u53d1\u7ed9\u7f51\u7edc\u4e2d\u7684 <code>BGP<\/code> \u5bf9\u7b49\u70b9\uff0c\u7528\u4e8e\u4e3b\u673a\u95f4\u8def\u7531\u3002<\/li>\n<li><code>confd<\/code>\uff1a\u76d1\u63a7\u6570\u636e\u5b58\u50a8\u4e2d BGP \u914d\u7f6e\u548c AS \u53f7\u3001\u65e5\u5fd7\u7ea7\u522b\u548c IPAM \u7b49\u5168\u5c40\u9ed8\u8ba4\u503c\u7684\u53d8\u5316\uff0c\u52a8\u6001\u751f\u6210 <code>BIRD<\/code> \u914d\u7f6e\u6587\u4ef6\uff0c\u5e76\u89e6\u53d1 BIRD \u52a0\u8f7d\u65b0\u7684\u914d\u7f6e\u3002<\/li>\n<li><code>Dikastes<\/code>\uff1a\u53ef\u9009\uff0c\u4e3a Istio \u670d\u52a1\u7f51\u683c\u6267\u884c\u7f51\u7edc\u7b56\u7565\u3002\u4f5c\u4e3a Istio Envoy \u7684 sidecar \u4ee3\u7406\u5728\u96c6\u7fa4\u4e0a\u8fd0\u884c\u3002<\/li>\n<li><code>CNI plugin<\/code> \u548c <code>IPAM plugin<\/code>\u3002<\/li>\n<li><code>calicoctl<\/code>\uff1a\u547d\u4ee4\u884c\u5de5\u5177\u3002<\/li>\n<\/ul>\n<p><code>Calico<\/code> \u548c <code>Flannel<\/code> \u4e00\u6837\u4f7f\u7528 <code>kubernetes API<\/code> \u6216 <code>etcd<\/code> \u5b58\u50a8\u6570\u636e\uff0c\u4e0d\u540c\u7684\u662f <code>Calico<\/code> \u5728\u6570\u636e\u5b58\u50a8\u4e0e\u6d88\u8d39\u8005\u4e4b\u95f4\u589e\u52a0\u4e86\u4e00\u4e2a\u4e2d\u95f4\u5c42 <code>Typha<\/code>\uff0c\u51cf\u5c11\u4e86\u5b58\u50a8\u4fa7\u7684\u8d1f\u62c5\uff0c\u4ee5\u652f\u6301\u66f4\u5927\u89c4\u6a21\u7684\u96c6\u7fa4\u3002<\/p>\n<p><code>Calico<\/code> \u548c <code>Flannel<\/code> \u4e00\u6837\u90fd\u652f\u6301 <code>IPAM<\/code>\uff08\u7ed9\u8282\u70b9\u5206\u914d <code>podCIDR<\/code>\uff09\uff0c\u4e0d\u540c\u7684\u662f <code>Flannel<\/code> \u662f\u9759\u6001\u7684\uff0c\u800c <code>Calico<\/code> \u53ef\u4ee5\u52a8\u6001\u5206\u914d\u3002<\/p>\n<h3>\u7f51\u7edc\u6a21\u578b<\/h3>\n<p><code>Calico<\/code> \u652f\u6301 <code>Overlay<\/code> \u7684\u7f51\u7edc\u6a21\u578b\uff0c\u5305\u62ec <code>VXLAN<\/code> \u548c <code>IP-in-IP<\/code>\uff08<code>IPIP<\/code> \u5728 <code>Flannel<\/code> \u4e2d\u5904\u4e8e\u5b9e\u9a8c\u6027\u9636\u6bb5\uff09\uff0c\u5b83\u540c\u6837\u662f\u4f7f\u7528 <code>vishvananda\/netlink<\/code> \u8fd9\u4e2a\u7b2c\u4e09\u65b9\u5e93\u53bb\u914d\u7f6e\u7cfb\u7edf\u5185\u6838\uff0c\u7531\u5185\u6838\u8fdb\u884c\u5c01\u5305\u548c\u8f6c\u53d1\u3002\u6362\u53e5\u8bdd\u8bf4\uff0c\u5982\u679c\u4e24\u8005\u90fd\u4f7f\u7528 <code>VXLAN<\/code>\uff0c\u90a3\u4e48\u5c01\u5305\u548c\u8f6c\u53d1\u6027\u80fd\u6ca1\u6709\u4efb\u4f55\u5dee\u522b\u3002<\/p>\n<p><code>Calico<\/code> \u652f\u6301 <code>non-overlay<\/code> \u6a21\u5f0f\uff0c\u7c7b\u4f3c\u4e8e <code>Flannel<\/code> \u4e2d\u7684 <code>host-gw<\/code>\uff0c\u4f46 <code>Calico<\/code> \u7684\u5b9e\u73b0\u65b9\u5f0f\u6709\u533a\u522b\uff0c\u6bcf\u4e2a\u8282\u70b9\u8d1f\u8d23\u8def\u7531\u81ea\u5df1\u7684 Pod \u5b50\u7f51\uff0c\u5e76\u901a\u8fc7 <code>BGP<\/code> \u534f\u8bae\u5c06\u8def\u7531\u4fe1\u606f\u5206\u53d1\u7ed9\u5176\u4ed6\u8282\u70b9\uff0c\u80fd\u591f\u5b9e\u73b0\u66f4\u7075\u6d3b\u7684\u8def\u7531\u63a7\u5236\uff0c\u652f\u6301\u66f4\u590d\u6742\u7684\u7f51\u7edc\u62d3\u6251\u3002<\/p>\n<p><code>Calico<\/code> \u901a\u8fc7 <code>BGP<\/code> \u534f\u8bae\u53ef\u4ee5\u652f\u6301 Pod IP \u5728\u96c6\u7fa4\u5916\u90e8\u53ef\u8def\u7531\uff0c\u800c <code>Flannel<\/code> \u5e76\u4e0d\u652f\u6301\u8fd9\u70b9\u3002<\/p>\n<p>\u6b64\u5916\uff0c<code>Calico<\/code> \u9488\u5bf9\u4e0d\u540c\u7684\u4e91\u4f9b\u5e94\u5546\u73af\u5883\u505a\u4e86\u8d34\u5fc3\u7684\u9002\u914d\uff0c\u5e76\u4e14\u989d\u5916\u652f\u6301 <code>eBPF<\/code>\u3001<code>Prometheus<\/code> \u76d1\u63a7\u3001<code>network policy<\/code> \u7f51\u7edc\u7b56\u7565\u548c\u6d41\u91cf\u7ba1\u63a7\uff08<code>Flannel<\/code> \u5e76\u4e0d\u652f\u6301\u8fd9\u4e9b\uff09\u3002<\/p>\n<h2>\u603b\u7ed3<\/h2>\n<p><code>Flannel<\/code> \u7684\u67b6\u6784\u975e\u5e38\u7b80\u5355\uff0c\u5728\u5c0f\u89c4\u6a21\u96c6\u7fa4\u4e0a\u80fd\u591f\u5f88\u597d\u7684\u5de5\u4f5c\u3002<\/p>\n<p><code>Calico<\/code> \u7684\u67b6\u6784\u66f4\u52a0\u590d\u6742\uff0c\u4e0d\u4ec5\u652f\u6301 <code>Flannel<\/code> \u5177\u5907\u7684\u6240\u6709\u529f\u80fd\uff0c\u8fd8\u63d0\u4f9b\u4e86\u66f4\u591a\u7684\u7f51\u7edc\u6a21\u578b\uff08\u5982 <code>IPIP<\/code>\u3001<code>BGP<\/code>\uff09\uff0c\u5e76\u652f\u6301 <code>eBPF<\/code>\u3001\u76d1\u63a7\u3001\u7f51\u7edc\u7b56\u7565\u548c\u6d41\u91cf\u7ba1\u63a7\u7b49\u8bf8\u591a\u529f\u80fd\uff0c\u9002\u7528\u4e8e\u66f4\u5927\u89c4\u6a21\u7684\u96c6\u7fa4\u3002<\/p>\n<hr>\n<p>(\u6211\u662f\u51cc\u865a\uff0c\u5173\u6ce8\u6211\uff0c\u65e0\u5e7f\u544a\uff0c\u4e13\u6ce8\u6280\u672f\uff0c\u4e0d\u717d\u52a8\u60c5\u7eea\uff0c\u6b22\u8fce\u4e0e\u6211\u4ea4\u6d41)<\/p>\n<hr>\n<p>\u53c2\u8003\u8d44\u6599\uff1a<\/p>\n<ul>\n<li><em><a href=\"https:\/\/link.segmentfault.com\/?enc=QfaD6WxEXouSOwmnrBVajQ%3D%3D.%2Fa0xNRZb2hhrEexxC8VByFaMPdhIHaeTHiQ%2FDzFX4Cc4Sw5rJUSpzWi0%2F%2Favie3q\" rel=\"nofollow noopener noreferrer\" target=\"_blank\">https:\/\/github.com\/flannel-io\/flannel<\/a><\/em><\/li>\n<li><em><a href=\"https:\/\/link.segmentfault.com\/?enc=LPm%2FhbZ%2FeQ01sCh3eCbYWA%3D%3D.Ogc1YLaTcFV%2F%2B8eePiAuSTA6XEKopNBI%2BHs0pnXkze08Y%2FfAqq6OiZxDjZe2VililNIF3KlibHH43UgDWOQ1WGpgJCFpVINY8Cz7QLKN79M%3D\" rel=\"nofollow noopener noreferrer\" target=\"_blank\">https:\/\/docs.tigera.io\/calico\/latest\/networking\/determine-bes&#8230;<\/a><\/em><\/li>\n<\/ul>\n<p><a href=\"https:\/\/segmentfault.com\/a\/1190000045522474\">https:\/\/segmentfault.com\/a\/1190000045522474<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6709\u8bfb\u8005\u63d0\u95ee\uff1aFlannel \u4e0e Calico \u7684\u533a\u522b\u3002\u6587\u672c\u5c06\u89e3\u6790\u4e00\u4e0b\u8fd9\u4e24\u4e2a\u7ec4\u4ef6\u3002 Flannel Flanne [&hellip;]<\/p>\n","protected":false},"author":7,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[4],"tags":[],"class_list":["post-10020429","post","type-post","status-publish","format-standard","hentry","category-share"],"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/itmax.cn\/index.php?rest_route=\/wp\/v2\/posts\/10020429","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/itmax.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/itmax.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/itmax.cn\/index.php?rest_route=\/wp\/v2\/users\/7"}],"replies":[{"embeddable":true,"href":"https:\/\/itmax.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=10020429"}],"version-history":[{"count":0,"href":"https:\/\/itmax.cn\/index.php?rest_route=\/wp\/v2\/posts\/10020429\/revisions"}],"wp:attachment":[{"href":"https:\/\/itmax.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=10020429"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/itmax.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=10020429"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/itmax.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=10020429"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}