{"id":558,"date":"2020-07-14T08:06:56","date_gmt":"2020-07-14T00:06:56","guid":{"rendered":"http:\/\/www.luyouli.com\/?p=558"},"modified":"2020-07-14T08:06:56","modified_gmt":"2020-07-14T00:06:56","slug":"kubernetes-v1-18-3-%e5%88%87%e6%8d%a2ipvs","status":"publish","type":"post","link":"https:\/\/www.luyouli.com\/?p=558","title":{"rendered":"kubernetes v1.18.3 \u5207\u6362IPVS"},"content":{"rendered":"\n<p>\u4e3a\u4ec0\u4e48\u5207\u6362IPVS\u5462\uff0c\u4e24\u70b9\u539f\u56e0\uff1a\u7b2c\u4e00\u662fIPVS\u6027\u80fd\u597d\uff08PS\uff1a\u5c31\u51e0\u5343\u53f0Pod\u6ca1\u611f\u89c9\u5230\uff09\uff0c\u7b2c\u4e8c\u662f\u56e0\u4e3aiptables\u6bcf\u6b21\u91cd\u542f\u5b8c\u5c31\u8981\u5904\u7406\u4e0bFORWARD\u94fe\u7684\u95ee\u9898\uff0c\u70e6\u5f97\u5f88<\/p>\n\n\n\n<p>1\u3001\u68c0\u67e5\u5185\u6838\u662f\u5426\u652f\u6301ipvs<\/p>\n\n\n\n<p># lsmod|grep ip_vs<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"906\" height=\"220\" src=\"https:\/\/www.luyouli.com\/wp-content\/uploads\/2020\/07\/image.png\" alt=\"\" class=\"wp-image-559\"\/><\/figure>\n\n\n\n<p>2\u3001\u5982\u679c\u6ca1\u6709\u5c31\u52a0\u8f7d<\/p>\n\n\n<p><!--more--><\/p>\n\n\n<pre class=\"wp-block-preformatted\">modprobe <em>-- ip_vs<\/em>\nmodprobe <em>-- ip_vs_rr<\/em>\nmodprobe <em>-- ip_vs_wrr<\/em>\nmodprobe <em>-- ip_vs_sh<\/em>\nmodprobe <em>-- nf_conntrack_ipv4<\/em><\/pre>\n\n\n\n<p>3\u3001\u5b89\u88c5ipvs<\/p>\n\n\n\n<p># yum install ipvsadm ipset -y<\/p>\n\n\n\n<p>4\u3001\u4fee\u6539kube-proxy\u914d\u7f6e<\/p>\n\n\n\n<p># kubectl edit configmap kube-proxy -n kube-system<\/p>\n\n\n\n<p>metricsBindAddress: &#8220;&#8221;<br>mode: &#8220;&#8221;<br>nodePortAddresses: null<\/p>\n\n\n\n<p>\u6539\u4e3a<\/p>\n\n\n\n<p>metricsBindAddress: &#8220;&#8221;<br>mode: &#8220;ipvs&#8221;<br>nodePortAddresses: null<\/p>\n\n\n\n<p>5\u3001\u5220\u9664kube-proxy<\/p>\n\n\n\n<p>\u5230\u4e86\u6700\u86cb\u75bc\u7684\u65f6\u5019\u4e86\uff0c\u6309\u7406\u8bf4\u7f16\u8f91\u4e86\u914d\u7f6e\u6587\u4ef6\u5e94\u8be5\u7acb\u5373\u751f\u6548\u7684\uff0c\u4f46\u662f\u600e\u4e48\u67e5\u770b\u90fd\u8fd8\u662f\u539f\u6765\u7684\u914d\u7f6e\uff0c\u6700\u540e\u4e0d\u5f97\u5df2\u5220\u9664\u4e86pod<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1091\" height=\"317\" src=\"https:\/\/www.luyouli.com\/wp-content\/uploads\/2020\/07\/image-1.png\" alt=\"\" class=\"wp-image-560\"\/><figcaption>IPVS\u4e0d\u751f\u6548<\/figcaption><\/figure>\n\n\n\n<p># kubectl delete pod kube-proxy-sjgjc -n kube-system<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"620\" height=\"48\" src=\"https:\/\/www.luyouli.com\/wp-content\/uploads\/2020\/07\/image-2.png\" alt=\"\" class=\"wp-image-561\"\/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"601\" height=\"196\" src=\"https:\/\/www.luyouli.com\/wp-content\/uploads\/2020\/07\/image-3.png\" alt=\"\" class=\"wp-image-562\"\/><figcaption>\u65b0\u7684kube-proxy\u8d77\u6765\u4e86<\/figcaption><\/figure>\n\n\n\n<p># kubectl logs kube-proxy-zdvgm -n kube-system  <\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"921\" height=\"239\" src=\"https:\/\/www.luyouli.com\/wp-content\/uploads\/2020\/07\/image-4.png\" alt=\"\" class=\"wp-image-563\"\/><figcaption>IPVS\u8d77\u6765\u4e86<\/figcaption><\/figure>\n\n\n\n<p>\u81ea\u6b64\uff0c\u518d\u4e5f\u4e0d\u7528\u6298\u817e\u8fd9\u4e2a\u7834FORWARD\u94fe\u4e86<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4e3a\u4ec0\u4e48\u5207\u6362IPVS\u5462\uff0c\u4e24\u70b9\u539f\u56e0\uff1a\u7b2c\u4e00\u662fIPVS\u6027\u80fd\u597d\uff08PS\uff1a\u5c31\u51e0\u5343\u53f0Pod\u6ca1\u611f\u89c9\u5230\uff09\uff0c\u7b2c\u4e8c\u662f\u56e0\u4e3aiptable [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[20],"tags":[],"class_list":["post-558","post","type-post","status-publish","format-standard","hentry","category-kubernetes"],"blocksy_meta":{"styles_descriptor":{"styles":{"desktop":"","tablet":"","mobile":""},"google_fonts":[],"version":6}},"views":5380,"_links":{"self":[{"href":"https:\/\/www.luyouli.com\/index.php?rest_route=\/wp\/v2\/posts\/558","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.luyouli.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.luyouli.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.luyouli.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.luyouli.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=558"}],"version-history":[{"count":1,"href":"https:\/\/www.luyouli.com\/index.php?rest_route=\/wp\/v2\/posts\/558\/revisions"}],"predecessor-version":[{"id":564,"href":"https:\/\/www.luyouli.com\/index.php?rest_route=\/wp\/v2\/posts\/558\/revisions\/564"}],"wp:attachment":[{"href":"https:\/\/www.luyouli.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=558"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.luyouli.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=558"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.luyouli.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=558"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}