{"id":74875,"date":"2023-09-08T14:09:16","date_gmt":"2023-09-08T06:09:16","guid":{"rendered":"http:\/\/gulass.cn\/?p=74875"},"modified":"2023-09-08T14:09:16","modified_gmt":"2023-09-08T06:09:16","slug":"meizu-k8s","status":"publish","type":"post","link":"https:\/\/gulass.cn\/meizu-k8s.html","title":{"rendered":"\u9b45\u65cf\u5bb9\u5668\u4e91\u5e73\u53f0\u81ea\u52a8\u5316\u8fd0\u7ef4\u5b9e\u8df5"},"content":{"rendered":"
\u5bfc\u8bfb<\/td>\n | \u9b45\u65cf\u5bb9\u5668\u4e91\u5e73\u53f0\u4e3b\u8981\u662f\u57fa\u4e8e k8s \u7684\u6280\u672f\u3002\u5c06\u4ece\u4ee5\u4e0b\u516d\u4e2a\u65b9\u9762\u4ecb\u7ecd\u9b45\u65cf\u5bb9\u5668\u4e91\u7684\u5b9e\u8df5\u8fc7\u7a0b\uff0c\u5206\u522b\u662f\u57fa\u672c\u4ecb\u7ecd\u3001k8s \u96c6\u7fa4\u3001\u5bb9\u5668\u7f51\u7edc\u3001\u5916\u90e8\u8bbf\u95ee4\/7\u5c42\u8d1f\u8f7d\u5747\u8861\u3001\u76d1\u63a7\/\u544a\u8b66\/\u65e5\u5fd7\u3001\u4e1a\u52a1\u53d1\u5e03\/\u955c\u50cf\/\u591a\u673a\u623f\u3002 \n<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n 1\u3001\u57fa\u672c\u4ecb\u7ecd<\/strong><\/div>\n \u9b45\u65cf\u4e91\u5e73\u53f0\u7684\u5b9a\u4f4d\u662f\u79c1\u6709\u4e91\u5e73\u53f0\uff0c\u4e3b\u8981\u662f\u7528\u4e8e\u652f\u6491\u5728\u7ebf\u4e1a\u52a1\uff0c\u7528\u4ee5\u66ff\u6362\u4f20\u7edf\u7684\u865a\u62df\u5316\u65b9\u5f0f\u3002\u76ee\u524d\u73b0\u72b6\u662f2017\u5e74\u5b8c\u6210\u5168\u56fd\u4e09\u4e2a\u6570\u636e\u4e2d\u5fc3\u7684\u5efa\u8bbe\uff0c\u5e74\u5185\u5b8c\u621090%\u4e1a\u52a1\u7684\u8fc1\u79fb\u3002<\/p>\n \u6211\u4eec\u662f\u4ee5\u5c0f\u56e2\u961f\u7d27\u8ddf k8s \u793e\u533a\u6b65\u4f10\uff0c\u5feb\u901f\u8fed\u4ee3\u3001\u4f4e\u6210\u672c\u8bd5\u9519\u7684\u65b9\u5f0f\u6765\u6784\u5efa\u6211\u4eec\u7684\u5e73\u53f0\u7684\u3002\u540c\u65f6\uff0c\u9488\u5bf9\u4e00\u4e9b\u6211\u4eec\u9047\u5230\u7684\u95ee\u9898\uff0c\u505a\u4e00\u4e9b\u5c40\u90e8\u521b\u65b0\uff0c\u5728\u4fdd\u8bc1\u7cfb\u7edf\u6838\u5fc3\u7684\u968f\u793e\u533a\u7a33\u5b9a\u5347\u7ea7\u7684\u524d\u63d0\u4e0b\uff0c\u89e3\u51b3\u597d\u975e\u529f\u80fd\u6027\u95ee\u9898\u3002<\/p>\n <\/p>\n 2\u3001k8s \u96c6\u7fa4<\/strong><\/div>\n \u5bf9\u4e8e k8s \u96c6\u7fa4\u6784\u5efa\uff0c\u5c06\u4ece k8s \u7684\u5355\u4e00\u955c\u50cf\u3001k8s \u96c6\u7fa4 master\u3001minion \u4e09\u4e2a\u65b9\u9762\u5206\u522b\u5c55\u5f00\u4ecb\u7ecd\u3002<\/p>\n 2.1 \u5355\u4e00\u955c\u50cf<\/strong><\/span><\/div>\n <\/p>\n k8s\u00a0\u96c6\u7fa4\u7684\u5b89\u88c5\u90e8\u7f72\u662f\u5229\u7528\u5355\u4e00\u955c\u50cf\u00a0+ docker run\u00a0\u5b9e\u73b0\u4e00\u952e\u5b89\u88c5\u3002\u4e3a\u6b64\u5c06\u6240\u6709 k8s \u76f8\u5173\u7684\u63cf\u8ff0\u6587\u4ef6\u3001\u811a\u672c\u548c\u4e8c\u8fdb\u5236\u5168\u90e8\u6253\u5305\u6210\u955c\u50cf\uff0c\u76ee\u7684\u662f\u5b9e\u73b0\u96c6\u7fa4\u7684\u5feb\u901f\u90e8\u7f72\u548c\u5347\u7ea7\u3002<\/p>\n 2.2Master<\/strong><\/span><\/div>\n <\/p>\n \u4e3a\u4e86\u80fd\u591f\u5b9e\u73b0\u81ea\u52a8\u52a0\u8f7d\uff0ck8s \u96c6\u7fa4\u6838\u5fc3\u7ec4\u4ef6\u4f7f\u7528\u4e86 Static Pod \u65b9\u5f0f\u3002\u5728\u81ea\u52a8\u4fee\u590d\u65b9\u9762\uff0ckubelet probe\u00a0\u53ef\u4ee5\u5b9e\u73b0\u00a0Pod\u00a0\u7684\u81ea\u68c0\uff0c\u914d\u7f6e\u4e86\u81ea\u52a8\u91cd\u542f\u3002\u5982\u679c\u9700\u8981\u5bf9\u6838\u5fc3\u7ec4\u4ef6\u8fdb\u884c\u5347\u7ea7\uff0c\u6307\u5b9a\u7edf\u4e00\u955c\u50cf\u7684\u7248\u672c\u53f7\u5373\u53ef\u5b9e\u73b0\u6838\u5fc3\u7ec4\u4ef6\u5347\u7ea7\u66f4\u65b0\u3002<\/p>\n <\/p>\n controller manager \u548c scheduler \u670d\u52a1\u5728\u4e09\u53f0\u7269\u7406\u673a\u5b9e\u73b0\u96c6\u7fa4 master \u9ad8\u53ef\u7528\u3002API Server\u00a0\u7684\u9ad8\u53ef\u7528\u65e2\u53ef\u4ee5\u901a\u8fc7\u8d1f\u8f7d\u5747\u8861\u65b9\u5f0f\u5b9e\u73b0\uff0c\u4e5f\u80fd\u901a\u8fc7\u00a0DNS\u00a0\u65b9\u5f0f\u5b9e\u73b0\u3002<\/p>\n <\/p>\n \u96c6\u7fa4\u00a0controller mananger \u91cd\u542f\u53ef\u80fd\u4f1a\u51fa\u73b0\u00a0Node\u00a0\u72b6\u6001\u4e0d\u540c\u6b65\u7684\u95ee\u9898\uff0c\u56e0\u6b64\u5bf9\u4e8e\u6838\u5fc3\u7ec4\u4ef6\u72b6\u6001\uff0c\u9700\u8981\u914d\u7f6e\u544a\u8b66\u5e76\u53ca\u65f6\u68c0\u67e5\u6709\u65e0\u5f02\u5e38\u72b6\u6001\u3002<\/p>\n 2.3 minion<\/strong><\/span><\/div>\n \u786c\u4ef6\u65b9\u9762\u5e76\u6ca1\u6709\u56fa\u5b9a\u7684\u914d\u7f6e\uff0c\u5c3d\u91cf\u5229\u7528\u73b0\u6709\u7684\u8d44\u6e90\u3002\u5728\u6211\u4eec\u7684\u96c6\u7fa4\u4e2d\uff0c\u5e38\u89c1\u00a0minion\u00a0\u7684\u914d\u7f6e\u662f\u00a024\u6838 CPU(with ht)\u3001128GB \u5185\u5b58\u4ee5\u53ca\u5343\u5146\u7f51\u5361\u3002<\/p>\n <\/p>\n k8s \u96c6\u7fa4\u4e2d minion \u4f5c\u4e3a\u8ba1\u7b97\u8282\u70b9\uff0c\u5176\u4e0a\u4e3b\u8981\u662f\u5404\u79cd\u4e1a\u52a1\u7684\u5bb9\u5668\u548c Systempods\u3002<\/p>\n \u5bf9\u4e8e minion \u8282\u70b9\u505a\u4e86\u4e09\u4e2a\u65b9\u9762\u53c2\u6570\u7684\u4f18\u5316\uff0c\u4e2d\u65ad\u76f8\u5173\u3001TCPbacklog \u548c swap\u3002<\/p>\n <\/p>\n minion \u8282\u70b9\u64cd\u4f5c\u7cfb\u7edf\u4f7f\u7528\u7684\u662f centos 7\uff0cdocker storage \u4f7f\u7528\u7684 devicemapper driver\uff0c\u65e5\u5fd7\u57fa\u672c\u5199\u5230\u5916\u6302\u7684 EmptyDir volume\uff0cdocker \u5b58\u50a8\u4f7f\u7528\u5f97\u5f88\u5c11\u3002<\/p>\n \u6211\u4eec\u4e3a\u00a0EmptyDir Volume\u00a0\u4e13\u95e8\u5f00\u8f9f\u4e86\u666e\u901a\u5206\u533a\uff0c\u6ca1\u6709\u4f7f\u7528\u00a0lvm\uff0c\u56e0\u4e3a\u65e5\u5fd7\u91cf\u4e0d\u597d\u9884\u4f30\uff0c\u906d\u9047\u8fc7\u56e0\u4e3a\u00a0lvm metadata\u00a0\u7684\u4e8b\u6545\u3002<\/p>\n <\/p>\n \u4f7f\u7528\u00a0Device Mapper\u00a0\u8fd8\u906d\u9047\u8fc7\u00a0kernel issue\uff0c\u56e0\u6b64\u9700\u8981\u66f4\u65b0\u5185\u6838\u3002<\/p>\n <\/p>\n \u9ed8\u8ba4\u5185\u6838\u662f3.10\u7248\u672c\uff0c\u957f\u671f\u7ef4\u62a4\u7684\u5185\u6838\u7248\u672c\u7684\u662f\u6211\u4eec\u9700\u8981\u7684\u3002\u800c\u4e14\u8003\u8651\u5230\u8981\u5bf9\u67d0\u4e9b\u5185\u6838\u6a21\u5757\u505a\u00a0hacking\uff0c4.0\u53ca\u4ee5\u4e0a\u53d8\u5316\u8f83\u5927\uff0chackingtcp_v4_syn_recv_sock \u5b58\u5728\u95ee\u9898\uff0c\u6240\u4ee5\u6211\u4eec\u6700\u7ec8\u9009\u62e9\u4e86\u81ea\u884c\u7f16\u8bd1\u00a03.16\u5185\u6838\u3002<\/p>\n \u8003\u8651\u5230\u548c\u00a0CMDB\u00a0\u7684\u7ed3\u5408\uff0cminion \u8282\u70b9\u6253\u4e0a\u4e86\u00a0Label\uff0c\u4f8b\u5982\u6807\u8bb0\u5b83\u7684\u529f\u80fd\u662f\u4ec0\u4e48\uff0c\u7269\u7406\u4f4d\u7f6e\u4fe1\u606f,\u673a\u67dc\u7b49\u3002\u8fd9\u4e9b\u4fe1\u606f\u5bf9\u4e8e\u00a0Pod\u00a0\u8c03\u5ea6\u975e\u5e38\u91cd\u8981\u3002\u5305\u62ec\u00a0Pod\u00a0\u7684\u00a0Node\u00a0\u4eb2\u548c\u6027\uff0cPod\u00a0\u4eb2\u548c\u6027\u548c\u53cd\u4eb2\u548c\u6027\u3002<\/p>\n 3\u3001\u5bb9\u5668\u7f51\u7edc<\/strong><\/div>\n <\/p>\n \u5bb9\u5668\u7f51\u7edc\u7684\u65b9\u9762\u6211\u4eec\u91c7\u7528\u7684\u662f calico \u7684\u65b9\u6848\u3002\u4e3b\u673a\u901a\u8fc7 BGP \u76f4\u63a5\u548c\u6838\u5fc3\u8def\u7531\u8bbe\u5907\u5bf9\u63a5\uff0c\u8fd9\u91cc\u4e5f\u53ef\u4ee5\u7528 RouteReflector \u66ff\u4ee3\u3002<\/p>\n \u63a7\u5236\u5c42\u9762\u8d70 BGP\uff0c\u6570\u636e\u5c42\u9762\u8d70\u4e09\u5c42\u8def\u7531\u3002\u7f51\u7edc\u5c01\u5305\u4f1a\u7ecf\u8fc7\u4e3b\u673a\u7684\u00a0netfilter\u6846\u67b6,\u6700\u540e\u7ecf\u7531\u4e3b\u673a\u00a0forward chain \u8fdb\u5165\u5bb9\u5668\uff0c\u9ed8\u8ba4\u90fd\u4f1a\u88ab\u00a0conntrack\u3002\u90e8\u7f72\u65b9\u9762\uff0cCalico\u00a0\u901a\u8fc7 k8s \u7684 Daemonset \u65b9\u5f0f\uff0c\u90e8\u7f72\u975e\u5e38\u65b9\u4fbf<\/p>\n <\/p>\n \u4f18\u5316\u4e3b\u8981\u662f\u9488\u5bf9 conntrack\uff0c\u5efa\u8bae\u5c3d\u91cf\u4f7f\u7528\u00a0headless service\uff0c\u5c11\u4ea7\u751f\u00a0iptables rule\u3002\u540c\u65f6\uff0c\u5bf9 conntrack \u7528\u91cf\u8fdb\u884c\u76d1\u63a7\u3002\u5bb9\u9519\u65b9\u9762\uff0c\u5bb9\u5668\u4f1a\u4e3b\u52a8\u53bb\u00a0 ping\u00a0\u4ea4\u6362\u673a\uff0c\u786e\u4fdd\u7f51\u7edc\u7684\u8fde\u901a\u6027\u3002\u5f53 calico \u51fa\u73b0\u95ee\u9898\u7684\u65f6\u5019\uff0c\u5bb9\u5668\u662f\u4e0d\u4f1a\u52a0\u5165\u670d\u52a1\u7684\uff0c\u7531\u6b64\u6765\u4fdd\u8bc1\u670d\u52a1\u7684\u53ef\u9760\u6027\u3002<\/p>\n \u5bf9\u4e8e\u6211\u4eec\u7cfb\u7edf\uff0c\u7edd\u5927\u90e8\u5206\u6d41\u91cf\u6765\u81ea\u5916\u90e8 LVS\uff0c\u5176\u53ef\u4fe1\u4efb\u5ea6\u9ad8\uff0c\u9ed8\u8ba4\u7684\u65b9\u5f0f\u4f1a\u4ea7\u751f\u5927\u91cf\u7684 conntrack \u8bb0\u5f55\uff0c\u6240\u4ee5\u5e94\u5f53\u628a\u00a0LVS \u8fc7\u6765\u7684\u6d41\u91cf\u76f4\u63a5\u7ed9\u00a0bypass conntrack\u3002<\/p>\n \u7ecf\u8fc7\u751f\u4ea7\u5b9e\u8df5\u6548\u679c\u9a8c\u8bc1\uff0cno mesh \u6a21\u5f0f\u7684\u7a33\u5b9a\u6027\u8981\u4f18\u4e8e\u00a0mesh\u00a0\u6a21\u5f0f\u3002\u5f02\u5e38\u5904\u7406\u4e3b\u8981\u5206\u4e3a POD\u00a0\u4e3b\u52a8\u68c0\u6d4b\u7f51\u7edc\u548c calico \u7684\u6574\u4f53\u5065\u5eb7\u76d1\u63a7\u544a\u8b66\u3002<\/p>\n 4\u3001\u5916\u90e8\u8bbf\u95ee4\/7\u5c42\u8d1f\u8f7d\u5747\u8861<\/strong><\/div>\n \u6211\u4eec\u505a\u7684\u662f\u5bf9\u5916\u670d\u52a1\uff0c\u5927\u90e8\u5206\u6d41\u91cf\u90fd\u662f\u4ece\u5916\u90e8\u6253\u8fdb\u6765\u7684\uff0c\u7ec8\u7aef\u7528\u6237\u90fd\u662f\u5916\u90e8\u7684\u5ba2\u6237\uff0c\u6240\u4ee5\u9488\u5bf9\u5916\u90e8\u7684\u8bbf\u95ee\u505a\u4e864\u5c42\u548c7\u5c42\u7684\u8d1f\u8f7d\u5747\u8861\u3002\u6211\u4eec\u505a\u7684\u662f\u5bf9\u5916\u670d\u52a1\uff0c\u5927\u90e8\u5206\u6d41\u91cf\u90fd\u662f\u4ece\u5916\u90e8\u6253\u8fdb\u6765\u7684\uff0c\u7ec8\u7aef\u7528\u6237\u90fd\u662f\u5916\u90e8\u7684\u5ba2\u6237\uff0c\u6240\u4ee5\u9488\u5bf9\u5916\u90e8\u7684\u8bbf\u95ee\u505a\u4e864\u5c42\u548c7\u5c42\u7684\u8d1f\u8f7d\u5747\u8861\u3002<\/p>\n \u57284\u5c42\u63a5\u5165\u4e0a\u91c7\u7528\u4e86\u662f\u963f\u91cc\u5f00\u6e90\u7684\u00a0Fullnat LVS \u65b9\u6848\uff0c\u770b\u4e2d\u4e86\u5b83\u8fd0\u7ef4\u65b9\u4fbf\u3001\u6c34\u5e73\u6269\u5c55\u6027\u597d\u3002\u5de5\u4f5c\u57284\u5c42\u7684 LVS \u670d\u52a1\u65e2\u53ef\u4ee5\u652f\u6301 TCP \u540c\u65f6\u4e5f\u652f\u6301\u00a0 UDP\uff0c\u6d41\u91cf\u4ececlient \u7aef\u7ecf\u8fc7 LVS \u505a\u00a0Fullnat\u00a0\u540e\u5230\u8fbe minion\uff0c\u5e94\u7b54\u76f4\u63a5\u8def\u7531\u56de\u5bf9\u5e94\u7684LVS\u3002<\/p>\n \u5bf9\u4e8e4\u5c42\u8d1f\u8f7d\u5747\u8861\u7684\u914d\u7f6e\uff0c\u662f\u901a\u8fc7\u81ea\u52a8\u5316\u65b9\u5f0f\u6765\u5b9e\u73b0\u7684\uff0c\u65e0\u9700\u4eba\u5de5\u914d\u7f6e\uff0c\u53ef\u4ee5\u81ea\u52a8\u5728\u8def\u7531\u8bbe\u5907\u5ba3\u544a\u00a0vip\uff0c\u5e76\u751f\u6210\u5bf9\u5e94\u7684\u00a0ECMP\u00a0\u8def\u7531\u3002LVS \u7684\u00a0VirtualServer\u00a0\u914d\u7f6e\u4e5f\u662f\u81ea\u52a8\u751f\u6210\u7684\uff0cVirtualServer\u00a0\u5230\u00a0EndPoint ip\u00a0\u7684\u81ea\u52a8\u6620\u5c04\u3002<\/p>\n \u6211\u4eec\u5bf9\u00a0LVS\u00a0\u63a7\u5236\u7a0b\u5e8f\u505a\u4e86\u6539\u9020\uff0c\u66b4\u9732\u4e86\u4e00\u4e9b\u6307\u6807\uff0c\u5305\u62ec\u7f51\u7edc\u548c\u5e94\u7528\u670d\u52a1\u76f8\u5173\u7684\u6570\u636e\uff0c\u5e76\u4ee5\u6b64\u5b9e\u73b0\u4e86\u00a0Grafana\u00a0\u53ef\u89c6\u5316\u548c\u76d1\u63a7\u544a\u8b66\u3002<\/p>\n \u4e00\u65b9\u9762\u662f\u5bf9 LVS \u6574\u4f53\u6d41\u91cf\u5f02\u5e38\u544a\u8b66\uff0c\u53e6\u4e00\u65b9\u9762 realserver (Pod) \u505a\u9ad8\u5ef6\u8fdf\u5f02\u5e38\u68c0\u6d4b\u544a\u8b66\u3002<\/p>\n \u4e03\u5c42\u8d1f\u8f7d\u5747\u8861\u91c7\u7528\u7684\u662f POD \u91cc\u9762\u8dd1 nginx+ingress controller\uff0c\u5b83\u7684\u5b9a\u4f4d\u662f\u4e1a\u52a1\u4e13\u5c5e\u7684\u53cd\u5411\u4ee3\u7406\uff0c\u80fd\u591f\u5b9e\u73b0\u81ea\u52a8\u6269\u7f29\u5bb9\uff0c\u9762\u5411\u7684\u00a0upstream\u00a0\u4e3b\u8981\u662f\u00a0 Jetty\u00a0\u4e1a\u52a1\u5bb9\u5668\u3002<\/p>\n \u7531\u4e8e\u56db\u5c42\u8d1f\u8f7d\u5747\u8861\u91c7\u7528\u7684\u662f FullnatLVS\uff0c\u771f\u6b63\u7684\u7ec8\u7aef ip \u5730\u5740\u5df2\u7ecf\u88ab\u9690\u85cf\u8d77\u6765\u4e86\uff0c\u9700\u8981\u4ece TCPoption \u4e2d\u83b7\u53d6\u3002realserver \u9ed8\u8ba4\u53d6\u5230\u7684\u662f LVS \u7684 local ip \u5730\u5740\uff0c\u9700\u8981\u4f7f\u7528 TOA \u6a21\u5757\u6765\u83b7\u53d6\u7ec8\u7aef ip\u3002<\/p>\n \u5f00\u6e90\u7248\u672c\u7684\u00a0TOA\u00a0\u4e00\u76f4\u6ca1\u6709\u5347\u7ea7\uff0c\u4e3a\u6b64\u6211\u4eec\u5c06\u5176\u79fb\u690d\u5230\u00a03.16\uff0c\u5bf9\u4e8e\u5927\u591a\u6570\u4e1a\u52a1\u6765\u8bf4\uff0c\u5ba2\u6237\u7aef\u00a0ip\u00a0\u5730\u5740\u662f\u4e0d\u53ef\u6216\u7f3a\u7684\u3002<\/p>\n \u5728\u628a nginx \u5bb9\u5668\u5316\u4e4b\u540e\uff0c\u8e29\u4e86\u4e00\u4e9b\u5751\uff0c\u5176\u4e2d\u4e00\u4e2a\u662f\u5ef6\u8fdf\u8fc7\u9ad8\u3002\u4ece access.log \u770b\uff0cupstream \u7684 RT \u65f6\u95f4\u957f\u8fbe\u51e0\u79d2\uff0c\u800c\u76f4\u63a5\u8bbf\u95ee upstream Pod \u670d\u52a1\u53c8\u662f\u5f88\u5feb\u7684\uff0c\u8bf4\u660e\u662f nginx \u7684\u95ee\u9898\u3002\u7ecf\u5206\u6790\u540e\u53d1\u73b0\u914d\u7f6e\u4e0d\u5408\u7406\uff0cnginx \u5bb9\u5668\u5316\u4e4b\u540e\u7f3a\u5c11\u5bf9 worker \u6570\u91cf\u548c\u4eb2\u548c\u6027\u7684\u4f18\u5316\u3002<\/p>\n \u6309\u7167\u9ed8\u8ba4\u914d\u7f6e\uff0c\u4e00\u53f024\u6838 CPU \u7684\u673a\u5668\u4e0a\uff0c\u5bf9\u4e8e\u4e00\u4e2a\u4e1a\u52a1\u7684\u00a0nginx\uff0c\u81ea\u52a8\u914d\u7f6e\u4e3a\u00a024\u4e2a\u00a0worker\u00a0\u8fdb\u7a0b\uff0c\u800c\u00a0cpu limit\u00a0\u5f80\u5f80\u53ea\u8bbe\u7f6e\u6210\u00a05\u30016\u4e2a\u6838\uff0cworker\u00a0\u6ca1\u6709\u00a0cpu\u00a0\u8d44\u6e90\u5bfc\u81f4\u9ad8\u5ef6\u8fdf\u3002\u540c\u65f6\uff0c\u8c03\u6574 worker\u00a0\u8fdb\u7a0b\u7684\u4eb2\u548c\u6027\uff0c\u9632\u6b62\u538b\u529b\u5806\u79ef\u5728\u524d\u51e0\u4e2a\u6838\u4e0a\u3002<\/p>\n Nginx \u52a8\u6001\u7f29\u5bb9\u9700\u8003\u8651\u67d4\u6027\uff0c\u6bd4\u5982\u67d0\u4e1a\u52a1\u539f\u6765\u67093\u4e2a Nginx \u5bb9\u5668\uff0c\u73b0\u5728\u8981\u7f29\u62102\u4e2a\uff0c\u88ab\u505c\u6389\u8fd9\u4e2a Nginx \u5bb9\u5668\u9700\u8981\u505a\u4e00\u4e9b\u4f18\u96c5\u9000\u51fa\u7684\u51c6\u5907\u5de5\u4f5c\uff0c\u5426\u5219\u53ef\u80fd\u5bfc\u81f4\u670d\u52a1\u6574\u4f53\u54cd\u5e94\u5ef6\u8fdf\u9661\u589e\u3002<\/p>\n \u8fd9\u4e2a POD \u4e00\u5f00\u59cb\u5c31\u4ece LB \u4e0a\u88ab\u6458\u6389\u4e86\uff0c\u6211\u4eec\u5229\u7528 Pod \u7684 prestop hook\uff0c\u7b49\u5f85\u5e76\u4f18\u96c5\u9000\u51fa\u3002<\/p>\n \u6269\u5bb9\u65f6\uff0c\u9700\u8981\u8003\u8651\u542f\u52a8\u65f6\u95f4\u548c\u70ed\u8eab\u95ee\u9898\u3002\u6709\u7684\u4e1a\u52a1\u53ef\u80fd\u9700\u8981\u51e0\u79d2\u6216\u51e0\u5341\u79d2\uff0c\u8981\u6709\u5145\u8db3\u7684\u521d\u59cb\u5316\u65f6\u95f4\uff0c\u5426\u5219\uff0c\u8bf7\u6c42\u8fc7\u53bb\u5c31\u4f1a\u5931\u8d25\u3002<\/p>\n \u5982\u679c\u00a0Probe Timeout\u00a0\u8bbe\u7f6e\u5f97\u6bd4\u8f83\u5c0f\uff0c\u4f1a\u5bfc\u81f4\u00a0Pod\u00a0\u88ab\u5f3a\u5236\u91cd\u542f\u6216\u8005\u6458\u9664\uff0c\u5bfc\u81f4\u6574\u4f53\u670d\u52a1\u7684\u96ea\u5d29\u3002\u5728\u5b9e\u9645\u8fd0\u884c\u8fc7\u7a0b\u4e2d\uff0c\u5e94\u6839\u636e\u76d1\u63a7\u60c5\u51b5\u5bf9\u00a0CPU request\u00a0\u548c\u00a0Hpa\u00a0\u914d\u7f6e\u6301\u7eed\u4f18\u5316\u3002<\/p>\n 5\u3001\u76d1\u63a7\/\u544a\u8b66\/\u65e5\u5fd7<\/strong><\/div>\n <\/p>\n \u76d1\u63a7\u91c7\u7528\u7684\u662f prometheus\uff0c\u5f00\u7bb1\u5373\u7528\u7684\u6574\u4f53\u65b9\u6848\u3002\u90e8\u7f72\u65b9\u9762\u662f\u5728 k8s \u4e0a\u90e8\u7f72\u6210\u00a0Daemonsets\u00a0\u6216\u8005\u00a0Deployment\uff0c\u9488\u5bf9\u5176\u7279\u70b9\u4f1a\u8c03\u5ea6\u5230\u7279\u5b9a\u7684\u673a\u578b\uff0c\u901a\u8fc7\u7c7b\u578b\u62c6\u5206\u6210\u51e0\u79cd map \u6765\u65b9\u4fbf\u7ba1\u7406\u3002<\/p>\n \u76d1\u63a7\u6307\u6807\u5305\u62ec\u4e24\u4e2a\u65b9\u9762\uff0c\u4e00\u4e2a\u662f\u786c\u6307\u6807\uff0c\u4f8b\u5982\uff0c\u4ece nginx \u83b7\u53d6\u5f53\u524d\u4e1a\u52a1\u7684qps\u3001http code \u5206\u5e03\u3001\u5f53\u524d\u6574\u4e2a\u4e1a\u52a1\u7684\u8d44\u6e90\u6d88\u8017\u60c5\u51b5\u4ee5\u53ca\u540e\u7aef\u7684 jetty \u6d88\u8017\u60c5\u51b5\u3002<\/p>\n \u53e6\u4e00\u65b9\u9762\u662f\u4e1a\u52a1\u7684\u8f6f\u6307\u6807\uff0c\u6307\u7684\u662f\u5185\u90e8\u6307\u6807\uff0c\u4e3b\u8981\u5305\u62ec jvm \u7684\u6307\u6807\uff0c\u5185\u90e8\u7684logger \u76f8\u5173\uff0c\u5982\u00a0error\u00a0\u8ba1\u6570\u5668\u3002<\/p>\n \u65e5\u5fd7\u7684\u5904\u7406\u662f\u6536\u96c6\u5230 elasticsearch \u5904\u7406\u7684\u3002ES \u7684\u90e8\u7f72\u548c prometheus \u7c7b\u4f3c\u4e5f\u662f POD \u7684\u65b9\u5f0f\u3002\u90e8\u7f72 ES \u7684 datanode\u3001master \u548c client \u9700\u8981\u5173\u6ce8\u7ebf\u7a0b\u6570\u636e\u548c CPU limit \u7684\u5339\u914d\u95ee\u9898\u3002<\/p>\n \u65e5\u5fd7\u6536\u96c6\u5bb9\u5668\u8bd5\u8fc7\u4f7f\u7528\u00a0fluentd \u8fdb\u884c\u6536\u96c6\uff0c\u4e0e\u4e1a\u52a1\u5bb9\u5668\u5171\u4eab\u4e00\u4e2a\u5b58\u50a8\uff0c\u53d1\u73b0\u6709\u65e5\u5fd7\u6ede\u540e\u548c\u8d44\u6e90\u6d88\u8017\u9ad8\u7684\u95ee\u9898\u3002\u7528 filebeat \u5bb9\u5668\u66ff\u4ee3 fluentd \u4e4b\u540e,\u8d44\u6e90\u5360\u7528\u7387\u5f88\u5c0f\uff0c\u6d88\u8017\u4e0d\u52300.1\u6838\u3001\u5185\u5b58\u4e0d\u5230\u00a0100M\u00a0\u5c31\u53ef\u4ee5\u5b9e\u73b0\u6bd4\u8f83\u597d\u7684\u65e5\u5fd7\u4f20\u8f93\u6548\u679c\u3002<\/p>\n 6\u3001\u4e1a\u52a1\u53d1\u5e03\/\u955c\u50cf\/\u591a\u673a\u623f<\/strong><\/div>\n <\/p>\n \u4e1a\u52a1\u53d1\u5e03\u8003\u8651\u5230\u6548\u7387\u548c\u4ea4\u4e92\u6027\uff0c\u9700\u8981\u7ed9\u7528\u6237\u63d0\u4f9b\u4e00\u4e2a\u4ea4\u4e92\u754c\u9762\uff0c\u80fd\u591f\u751f\u6210\u00a0k8s\u7684\u8d44\u6e90\u63cf\u8ff0\u6587\u4ef6\uff0c\u5e76\u80fd\u6267\u884c\u5177\u4f53\u7684\u00a0Action\uff0c\u5982\u521b\u5efa\/\u66f4\u65b0\/\u5220\u9664\u3002<\/p>\n \u5b9e\u73b0\u4e0a\u662f\u901a\u8fc7\u00a0json schema \u7684\u65b9\u5f0f\u6765\u63cf\u8ff0\u6240\u6709\u53c2\u6570\uff0c\u9ed8\u8ba4\u503c+\u7ed3\u5408\u7528\u6237\u8f93\u5165\u6700\u7ec8\u751f\u6210\u00a0k8s\u00a0\u7684\u8d44\u6e90\u63cf\u8ff0\u6587\u4ef6\u3002<\/p>\n \u5229\u7528 ansible \u8c03\u7528 kubectl \u6765\u5b9e\u73b0\u81ea\u52a8\u5316\u90e8\u7f72\u3002\u5b9e\u73b0\u4e86\u90e8\u7f72\u8fdb\u5ea6\uff0c\u53d1\u5e03\u5386\u53f2\u7ba1\u7406\uff0c\u6a21\u677f\u5316\u90e8\u7f72\u3002\u5bf9\u4e8e\u591a\u96c6\u7fa4\u7ba1\u7406\uff0cansible \u901a\u8fc7\u5207\u6362\u4e0d\u540c\u00a0k8s\u00a0\u96c6\u7fa4\u7684\u00a0context\uff0c\u53d1\u5e03\u4e1a\u52a1\u5230\u4e0d\u540c\u673a\u623f\u3002<\/p>\n \u5bf9\u4e8e\u955c\u50cf\u7684\u9009\u62e9\u6211\u4eec\u7684\u539f\u5219\u5c31\u662f\u591f\u5c0f\u3001\u591f\u7528\uff0c\u4e3a\u4e86\u4fdd\u8bc1\u517c\u5bb9\u6027\u6211\u4eec\u52a0\u5165 glibc \u652f\u6301\u3002Docker \u5176\u5b9e\u63a8\u8350\u53ea\u8dd1\u4e00\u4e2a\u8fdb\u7a0b\uff0c\u4f46\u5f88\u591a\u4e1a\u52a1\u90fd\u662f\u9700\u8981\u591a\u4e2a\u8fdb\u7a0b\u914d\u5408\u7684\uff0cS6 \u7528\u4e8e\u5e94\u5bf9\u8fd9\u79cd\u573a\u666f\uff0c\u4f5c\u4e3a\u8fdb\u7a0b\u548c\u670d\u52a1\u7684\u7ba1\u7406\u5668\u6765\u5b9e\u73b0\u4e00\u4e9b\u6bd4\u8f83\u590d\u6742\u7684\u529f\u80fd\u3002<\/p>\n \u603b\u7684\u6765\u8bf4\uff0c\u8fd9\u662f\u4e00\u5957\u4f4e\u6210\u672c\u7684\u79c1\u6709\u4e91\u5b9e\u73b0\u65b9\u6848\uff0c\u6838\u5fc3\u90e8\u5206\u6301\u7eed\u4eab\u53d7\u5230\u00a0k8s\u00a0\u7684\u7ea2\u5229\uff0c\u53ef\u4ee5\u96c6\u4e2d\u529b\u91cf\u89e3\u51b3\u00a04\/7\u00a0\u5c42\u8d1f\u8f7d\u5747\u8861\u53ca\u4e00\u4e9b\u975e\u529f\u80fd\u6027\u95ee\u9898\u3002\u540c\u65f6\uff0c\u5229\u7528k8s\u6838\u5fc3\u7cfb\u7edf\u7684\u80fd\u529b\uff0c\u5feb\u901f\u6784\u5efa\u5916\u90e8\u652f\u6491\u7cfb\u7edf\uff0c\u5982\u76d1\u63a7\u3001\u544a\u8b66\u3001\u65e5\u5fd7\u3001\u53d1\u5e03\u7cfb\u7edf\u7b49\uff0c\u5728\u5f88\u5927\u7a0b\u5ea6\u4e0a\u63d0\u9ad8\u4e86\u6548\u7387\u548c\u53ef\u7ef4\u62a4\u6027\u3002<\/p>\n \n |