{"id":218692,"date":"2021-05-30T08:58:04","date_gmt":"2021-05-30T00:58:04","guid":{"rendered":"https:\/\/lrxjmw.cn\/?p=218692"},"modified":"2021-05-19T14:58:46","modified_gmt":"2021-05-19T06:58:46","slug":"kubernetes-operation-process","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/kubernetes-operation-process.html","title":{"rendered":"Kubernetes\u7684\u8fd0\u884c\u6d41\u7a0b\u662f\u600e\u6837\u7684\uff1f"},"content":{"rendered":"\n\n\n
\u5bfc\u8bfb<\/td>\n\u5982\u679c\u60f3\u4e86\u89e3\u5bb9\u5668\u3001\u5fae\u670d\u52a1\u67b6\u6784\u3001\u73b0\u4ee3\u5e94\u7528\u7a0b\u5e8f\u5f00\u53d1\u548c\u4e91\u539f\u751f\u8ba1\u7b97\uff0c\u5219\u9700\u8981\u4e86\u89e3Kubernetes\u3002<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

\"\"<\/p>\n

Kubernetes\u662f\u73b0\u4ee3\u5fae\u670d\u52a1\u4e2d\u6700\u7a81\u51fa\u7684\u6280\u672f\u4e4b\u4e00\u3002\u5b83\u65e8\u5728\u4f7f\u5bb9\u5668\u5316\u5e94\u7528\u7a0b\u5e8f\u7684\u5fae\u670d\u52a1\u96c6\u7fa4\u7ba1\u7406\u66f4\u7b80\u5355\u3001\u66f4\u81ea\u52a8\u5316\u3002\u672c\u6587\u4ece\u6982\u5ff5\u4e0a\u8be6\u7ec6\u4ecb\u7ecd\u4e86\u8fd9\u4e00\u6838\u5fc3\u6280\u672f\u7684\u5de5\u4f5c\u539f\u7406\u3002<\/p>\n

\u4e86\u89e3Kubernetes\u7684\u4e00\u79cd\u6709\u7528\u65b9\u6cd5\u662f\u5c06\u5176\u89c6\u4e3a\u5bb9\u5668\u7684\u5206\u5e03\u5f0f\u64cd\u4f5c\u7cfb\u7edf\u3002Kubernetes\u63d0\u4f9b\u4e86\u534f\u8c03\u5bb9\u5668\uff08\u6700\u5e38\u89c1\u7684Docker\u5bb9\u5668\uff09\u548c\u8fd0\u884c\u5728\u5176\u4e0a\u7684\u57fa\u7840\u7ed3\u6784\u5bb9\u5668\u7684\u4ea4\u4e92\u548c\u7f29\u653e\u6240\u9700\u7684\u5de5\u5177\u548c\u547d\u4ee4\u3002Kubernetes\u662f\u4e00\u4e2a\u8bbe\u8ba1\u7528\u4e8e\u5404\u79cd\u573a\u666f\u7684\u901a\u7528\u5de5\u5177\uff0c\u5b83\u662f\u4e00\u4e2a\u975e\u5e38\u7075\u6d3b\u4f46\u53c8\u590d\u6742\u7684\u7cfb\u7edf\u3002<\/p>\n

Kubernetes\u5de5\u4f5c\u8282\u70b9\u548c\u63a7\u5236\u5e73\u9762<\/strong><\/div>\n

Kubernetes\u5206\u6709\u4e24\u4e2a\u65b9\u9762\uff1a\u5de5\u4f5c\u8282\u70b9\u548c\u63a7\u5236\u5e73\u9762\u3002\u5de5\u4f5c\u8282\u70b9\u662f\u5b9e\u9645\u7684\u5bb9\u5668\u5316\u5e94\u7528\u7a0b\u5e8f\u4ee5\u53ca\u5fc5\u8981\u7684Kubernetes\u5de5\u5177\u6240\u5728\u7684\u4f4d\u7f6e\u3002\u63a7\u5236\u5e73\u9762\u662f\u7ba1\u7406\u96c6\u7fa4\u5de5\u5177\u6240\u5728\u7684\u4f4d\u7f6e\u3002\u56fe1\u5bf9\u6b64\u67b6\u6784\u8fdb\u884c\u4e86\u9ad8\u5c42\u6b21\u7684\u7814\u7a76\u3002<\/p>\n

\"\"<\/p>\n

\u5982\u56fe\u4e00\u6240\u793a\uff0c\u8be5\u4f53\u7cfb\u7ed3\u6784\u5206\u4e3a\u5de5\u4f5c\u8282\u70b9\u548c\u8d1f\u8d23\u8fd0\u884c\u5de5\u4f5c\u8d1f\u8f7d\u4ee5\u53ca\u8fd0\u884c\u7ba1\u7406\u5de5\u5177\u7684\u5934\u8282\u70b9\u3002<\/p>\n

\u4e24\u79cd\u60c5\u51b5\u4e0b\u7684\u8282\u70b9\u90fd\u662f\u5728\u865a\u62df\u673a\u6216\u5b9e\u9645\u7684\u673a\u5668\u4e2d\u6267\u884c\u7684\u3002<\/p>\n

\u6269\u5c55Kubernetes Worker\u8282\u70b9\u4e0e\u5de5\u4f5c\u8d1f\u8f7d<\/strong><\/div>\n

\u9700\u8981\u6ce8\u610f\u7684\u662f\uff0cKubernetes\u5e95\u5c42\u57fa\u7840\u8bbe\u65bd\u662f\u8fd0\u884c\u5de5\u4f5c\u8282\u70b9\u5de5\u4f5c\u8d1f\u8f7d\u65f6\u53ef\u7528\u7684\u8d44\u6e90\uff08\u8ba1\u7b97\u3001\u5185\u5b58\u3001\u78c1\u76d8\u548c\u7f51\u7edc\uff09\uff0c\u4f46\u5b83\u5e76\u4e0d\u76f4\u63a5\u63a7\u5236\u5b83\u4eec\u3002Kubernetes\u8d1f\u8d23\u6269\u5c55\u5de5\u4f5c\u8d1f\u8f7d\uff0c\u4f46\u66f4\u9ad8\u7ea7\u522b\u7684\u673a\u5236\uff08\u5982\u516c\u5171\u4e91\u81ea\u52a8\u6269\u5c55\u6216\u624b\u52a8\u5e72\u9884\uff09\u8d1f\u8d23\u8c03\u6574\u8282\u70b9\u7684\u53ef\u7528\u6027\u3002\u56e0\u6b64\uff0c\u53ef\u4ee5\u4f7f\u7528\u63a7\u5236\u5668\u4e0e\u5916\u90e8\u7cfb\u7edf\u8fdb\u884c\u4ea4\u4e92\u3002<\/p>\n

Kubernetes Worker\u8282\u70b9\u7ec4\u4ef6<\/strong><\/div>\n

\u56fe2\u5c55\u793a\u4e86Kubernetes Worker\u8282\u70b9\u7684\u57fa\u672c\u5143\u7d20\u3002<\/p>\n

\"\"<\/p>\n

Kubelet<\/strong><\/div>\n

kubelet\u662f\u8fd0\u884c\u5728\u5de5\u4f5c\u8282\u70b9\u4e0a\u7684\u4e00\u4e2a\u201c\u5c0f\u201d\u7a0b\u5e8f\uff0c\u8d1f\u8d23\u5728\u63a7\u5236\u5e73\u9762\u548c\u8282\u70b9\u4e4b\u95f4\u8fdb\u884c\u5e73\u8861\u3002kubelet\u6838\u5fc3\u76ee\u7684\u662f\u6267\u884cpods\u4e0a\u6765\u81ea\u5934\u8282\u70b9\u96c6\u7fa4\u7684\u6307\u4ee4\uff0c\u5e76\u62a5\u544a\u5de5\u4f5c\u8d1f\u8f7d\u5f53\u524d\u7684\u72b6\u6001\u3002<\/p>\n

Kube Proxy<\/strong><\/div>\n

Kube Proxy\u8d1f\u8d23\u5728\u8282\u70b9\u4e0a\u5b9e\u65bd\u7f51\u7edc\u89c4\u5219\uff0c\u5e76\u5141\u8bb8\u8fdb\u51fa\u8282\u70b9\u7684\u6d41\u91cf\u3002<\/p>\n

Kube Proxy\u4e0d\u540c\u4e8e\u5165\u53e3\uff0c\u5165\u53e3\u5728\u96c6\u7fa4\u7ea7\u522b\u64cd\u4f5c\uff0c\u5e76\u5b9a\u4e49\u8fdb\u5165\u96c6\u7fa4\u7684\u7f51\u7edc\u8def\u7531\u89c4\u5219\u3002<\/p>\n

Pod<\/strong><\/div>\n

Pod\u662f\u8282\u70b9\u4e0a\u7684\u79bb\u6563\u5de5\u4f5c\u5355\u5143\uff0c\u5177\u6709\u590d\u5236\u6027\u3002\u5b83\u4eec\u662f\u5c01\u88c5\u4e00\u4e2a\u6216\u591a\u4e2a\u5bb9\u5668\u5316\u5e94\u7528\u7a0b\u5e8f\u7684\u62bd\u8c61\u3002Pod\u53ef\u4ee5\u5bf9\u4e00\u8d77\u8fd0\u884c\u7684\u5bb9\u5668\u8fdb\u884c\u5206\u7ec4\u548c\u9694\u79bb\uff0c\u5e76\u4e14\u540c\u4e00\u53f0\u673a\u5668\u4e0a\u7684pod\u4e4b\u95f4\u4e5f\u53ef\u4ee5\u901a\u4fe1\u3002\u5bb9\u5668\u548cPod\u4e4b\u95f4\u7684\u5173\u7cfb\u7531Kubernetes\u90e8\u7f72\u63cf\u8ff0\u7b26\u63a7\u5236\u3002<\/p>\n

Deployment\u548cReplicaSet<\/strong><\/div>\n

Pod\u901a\u5e38\u4f5c\u4e3aReplicaSet\u7684\u4e00\u90e8\u5206\u8fdb\u884c\u914d\u7f6e\u548c\u90e8\u7f72\u3002ReplicaSet\u5b9a\u4e49Pod\u6240\u9700\u7684\u8fd0\u884c\u65f6\u7279\u5f81\uff0c\u5e76\u4f7fKubernetes\u5de5\u4f5c\u4ee5\u4fdd\u6301\u8be5\u72b6\u6001\u3002ReplicaSet\u901a\u5e38\u7531Deployment\u5b9a\u4e49\uff0cDeployment\u5b9a\u4e49\u4e86ReplicaSet\u53c2\u6570\u548c\u7ba1\u7406\u96c6\u7fa4\u65f6\u8981\u4f7f\u7528\u7684\u65b9\u6cd5\uff08\u5373pod\u662f\u66f4\u65b0\u8fd8\u662f\u91cd\u65b0\u521b\u5efa\uff09\u3002<\/p>\n

Sidecar<\/strong><\/div>\n

\u5728Pod\u7ea7\u522b\uff0c\u989d\u5916\u7684\u529f\u80fd\u662f\u901a\u8fc7Sidecar\u63d2\u4ef6\u5b9e\u73b0\u7684\u3002Sidecar\u53ef\u4ee5\u5904\u7406\u8bf8\u5982Pod\u7ea7\u522b\u7684\u65e5\u5fd7\u8bb0\u5f55\u548c\u4fe1\u606f\u6536\u96c6\u4e4b\u7c7b\u7684\u4efb\u52a1\u3002<\/p>\n

\u56fe3\u66f4\u8be6\u7ec6\u5730\u4ecb\u7ecd\u4e86\u5de5\u4f5c\u7a0b\u5e8f\u8282\u70b9\u4e2d\u7684Pod\u3002<\/p>\n

\"\"<\/p>\n

Kubernetes control plane<\/strong><\/div>\n

\u63a5\u4e0b\u6765\u5230\u4e86\u63a7\u5236\u5668\u7aef\uff0c\u4e86\u89e3Kubernetes\u5982\u4f55\u64cd\u4f5c\u6765\u63a7\u5236\u96c6\u7fa4\u7684\u64cd\u4f5c\u3002<\/p>\n

\u56fe4\u8be6\u7ec6\u4ecb\u7ecd\u4e86\u5934\u8282\u70b9\u7ec4\u4ef6\u3002<\/p>\n

\"\"<\/p>\n

Etcd<\/strong><\/div>\n

\u6700\u5bb9\u6613\u7406\u89e3\u7684\u7ec4\u4ef6\u662fetcd\uff08\u53d1\u97f3\u4e3a\u201c et-cee-dee\u201d\uff09\u3002Etcd\u662f\u4e00\u4e2a\u5206\u5e03\u5f0f\u5bf9\u8c61\u5b58\u50a8\uff0c\u5145\u5f53\u6574\u4e2a\u96c6\u7fa4\u7684\u914d\u7f6e\u548c\u72b6\u6001\u8bb0\u5f55\u6570\u636e\u5e93\u3002<\/p>\n

API Server<\/strong><\/div>\n

API\u670d\u52a1\u5668\uff08API Server\uff09\u662f\u96c6\u7fa4\u7684\u4e2d\u592e\u901a\u4fe1\u673a\u5236\u3002\u5f53\u63a7\u5236\u5e73\u9762\u3001\u5de5\u4f5c\u8282\u70b9\u548c\u7ba1\u7406\u5458\u901a\u8fc7Kubernetes\u547d\u4ee4\u884c\u5de5\u5177\uff08\u5982kubectl\uff09\u6216\u5176\u4ed6UI\u5e94\u7528\u914d\u7f6e\u66f4\u6539\u65f6\uff0cAPI Server\u5219\u53ef\u4ee5\u4ee3\u7406\u5b83\u4eec\u4e4b\u95f4\u7684\u4ea4\u4e92\u3002<\/p>\n

Scheduler<\/strong><\/div>\n

\u8c03\u5ea6\u7a0b\u5e8f\uff08Scheduler\uff09\u8d1f\u8d23\u6807\u8bc6\u8fd0\u884cPod\u7684\u8282\u70b9\u3002\u6839\u636ePod\u7684\u7279\u6027\u548c\u53ef\u7528\u8282\u70b9\u7684\u73b0\u6709\u72b6\u6001\u6240\u4f7f\u7528\u7684\u65b9\u6cd5\u662f\u4e0d\u540c\uff0c\u4f46\u662f\u5176\u76ee\u6807\u90fd\u662f\u8fbe\u5230\u81ea\u5b9a\u4e49\u7f16\u5199\u7684\u7a0b\u5ea6\u3002\u8c03\u5ea6\u7a0b\u5e8f\u5728\u6267\u884c\u5de5\u4f5c\u65f6\u4e0eAPI\u670d\u52a1\u5668\u8fdb\u884c\u4ea4\u4e92\u3002<\/p>\n

Controller<\/strong><\/div>\n

\u63a7\u5236\u5668\uff08Controller\uff09\u7ec4\u4ef6\u8d1f\u8d23\u5c06\u96c6\u7fa4\u4fdd\u6301\u5728\u914d\u7f6e\u65f6\u6240\u9700\u7684\u72b6\u6001\uff0c\u5e76\u5728\u96c6\u7fa4\u504f\u79bb\u63a7\u5236\u65f6\u5c06\u5176\u79fb\u5411\u8be5\u72b6\u6001\u3002\u63a7\u5236\u5668\u7684\u4f5c\u7528\u5c31\u50cf\u4e00\u79cd\u6052\u6e29\u5668\uff0c\u5b83\u6307\u5b9a\u6240\u9700\u7684\u72b6\u6001\uff0c\u7136\u540e\u5de5\u4f5c\u6765\u7ef4\u6301\u5b83\u3002
\n\u5728Kubernetes\u4e2d\uff0c\u53ef\u4ee5\u521b\u5efa\u4e00\u4e2a\u5bf9\u8c61\uff0c\u7528\u4e8e\u8bb0\u5f55\u5728etcd\u4e2d\u7684\u6301\u4e45\u5b9e\u4f53\u3002\u7136\u540e\uff0c\u63a7\u5236\u5668\u5c06\u6267\u884c\u64cd\u4f5c\u4ee5\u786e\u4fdd\u5bf9\u8c61\u5177\u6709\u6240\u9700\u7684\u5c5e\u6027\u3002<\/p>\n

\u4f8b\u5982\uff0cReplicaSet\uff08\u4e0a\u9762\u8ba8\u8bba\u8fc7\uff09\u6839\u636e\u4f7f\u7528\u6807\u51c6\u5b9a\u4e49\u8fd0\u884cpod\u3002\u76f8\u5bf9\u4e8e\u8be5ReplicaSet\u7684\u7fa4\u96c6\u7684\u5b9e\u9645\u72b6\u6001\u662f\u72b6\u6001\u3002ReplicaSet\u662f\u5bf9\u8c61\uff0c\u6307\u5b9a\u7684pod\u8ba1\u6570\u662fspec\u3002\u96c6\u7fa4\u76f8\u5bf9\u4e8e\u8be5ReplicaSet\u7684\u5b9e\u9645\u72b6\u6001\u662fstatus\u3002\u63a7\u5236\u5668\u4ece\u96c6\u7fa4\u63a5\u6536\u5173\u4e8e\u6b64\u72b6\u6001\u7684\u4e00\u81f4\u62a5\u544a\uff0c\u5e76\u901a\u8fc7\u521b\u5efa\u6216\u9500\u6bc1pod\u6765\u91c7\u53d6\u63aa\u65bd\u4f7f\u72b6\u6001\u4e0e\u89c4\u8303\u4e00\u81f4\u3002<\/p>\n

\u5bb9\u5668\u56fe\u50cf\u5b58\u50a8\u5e93<\/strong><\/div>\n

\u6700\u540e\u4e00\u4e2a\u7ec4\u4ef6\u662f\u6620\u50cf\u5b58\u50a8\u5e93\uff08\u4e5f\u79f0\u4e3a\u56fe\u50cf\u6ce8\u518c\u8868\uff09\u3002\u6b64\u7ec4\u4ef6\u5b58\u5728\u4e8e\u96c6\u7fa4\u4e4b\u5916\uff0c\u7ba1\u7406\u5458\u548c\u63a7\u5236\u5e73\u9762\u53ef\u4ee5\u8bbf\u95ee\u5b83\u4ee5\u4e0b\u8f7d\u6240\u9700\u7684\u5bb9\u5668\u5b9a\u4e49\u3002\u6ce8\u518c\u4e2d\u5fc3\u7531\u5305\u62ecDocker Hub\u5728\u5185\u7684\u5404\u79cd\u7ec4\u7ec7\u6258\u7ba1\uff0c\u53ef\u4ee5\u662f\u516c\u5171\u7684\uff0c\u4e5f\u53ef\u4ee5\u662f\u79c1\u6709\u7684\u3002\u4e3b\u8981\u7684\u4e91\u63d0\u4f9b\u5546\u90fd\u4e3a\u4f01\u4e1a\u63d0\u4f9b\u6258\u7ba1\u5b58\u50a8\u5e93\u3002<\/p>\n

Kubernetes\u89c4\u5219\u5bb9\u5668<\/strong><\/div>\n

\u73b0\u5728\u5df2\u7ecf\u4e86\u89e3\u4e86Kubernetes\u67b6\u6784\u4ee5\u53caKubernetes\u662f\u5982\u4f55\u5b9e\u73b0\u7684\u3002\u7531\u4e8e\u5176\u90e8\u7f72\u3001\u7ba1\u7406\u548c\u6269\u5c55\u57fa\u4e8e\u5bb9\u5668\u7684\u5e94\u7528\u7a0b\u5e8f\uff0c\u53ef\u89c1Kubernetes\u4e0d\u662f\u4e00\u4e2a\u7b80\u5355\u7684\u7cfb\u7edf\u3002Kubernetes\u5177\u6709\u9ad8\u5ea6\u7684\u53ef\u914d\u7f6e\u6027\u548c\u7075\u6d3b\u6027\uff0c\u53ef\u4ee5\u5904\u7406\u610f\u60f3\u4e0d\u5230\u7684\u60c5\u51b5\u3002<\/p>\n

Kubernetes\u662f\u5f53\u524d\u8f6f\u4ef6\u67b6\u6784\u65b9\u6cd5\u4e2d\u7684\u6700\u7a81\u51fa\u7684\u6280\u672f\u4e4b\u4e00\u3002\u56e0\u6b64\uff0c\u5bf9DevOps\u3001\u5bb9\u5668\u3001\u4e91\u672c\u5730\u5e94\u7528\u7a0b\u5e8f\u548c\u5fae\u670d\u52a1\u4f53\u7cfb\u7ed3\u6784\u611f\u5174\u8da3\u7684\u4eba\u6765\u8bf4\uff0c\u8fd9\u4e9bKubernetes\u7684\u77e5\u8bc6\u90fd\u662f\u5fc5\u4e0d\u53ef\u5c11\u7684\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"

Kubernetes\u662f\u73b0\u4ee3\u5fae\u670d\u52a1\u4e2d\u6700\u7a81\u51fa\u7684\u6280\u672f\u4e4b\u4e00\u3002\u5b83\u65e8\u5728\u4f7f\u5bb9\u5668\u5316\u5e94\u7528\u7a0b\u5e8f\u7684\u5fae\u670d\u52a1\u96c6\u7fa4\u7ba1\u7406\u66f4\u7b80\u5355\u3001\u66f4\u81ea\u52a8\u5316\u3002\u672c […]<\/p>\n","protected":false},"author":317,"featured_media":193764,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[],"class_list":["post-218692","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-thread"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/218692","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/users\/317"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=218692"}],"version-history":[{"count":2,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/218692\/revisions"}],"predecessor-version":[{"id":218699,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/218692\/revisions\/218699"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/193764"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=218692"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=218692"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=218692"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}