{"id":8344,"date":"2018-02-04T22:46:25","date_gmt":"2018-02-04T14:46:25","guid":{"rendered":"http:\/\/jpuyy.com\/?p=8344"},"modified":"2018-02-04T22:54:56","modified_gmt":"2018-02-04T14:54:56","slug":"kubernetes%e6%9d%83%e5%a8%81%e6%8c%87%e5%8d%97%e8%af%bb%e5%90%8e%e6%80%bb%e7%bb%93","status":"publish","type":"post","link":"https:\/\/jpuyy.com\/?p=8344","title":{"rendered":"kubernetes\u6743\u5a01\u6307\u5357\u8bfb\u540e\u603b\u7ed3"},"content":{"rendered":"<p>k8s \u7684\u4f18\u70b9:<\/p>\n<p>1. \u5f00\u53d1\u548c\u8fd0\u7ef4\u7684\u9ad8\u624b\u7f16\u5199\uff0c\u4ea7\u54c1\u601d\u7ef4\u597d\uff0c\u8d34\u8fd1\u9700\u6c42\u3002\u638c\u63e1\u4e00\u4e9b\u7f51\u7edc\uff0clinux, iptables\uff0cdocker \u77e5\u8bc6\u7684\u5de5\u7a0b\u5e08\u5c31\u80fd\u642d\u8d77\u6765\u3002\u5c31\u50cf\u65e9\u671f\u7684 linux, HTTP \u4e00\u6837\u6709\u7f3a\u70b9\uff0c\u4f46\u6700\u6838\u5fc3\u529f\u80fd\u7b80\u5355\u9ad8\u6548;<br \/>\n2. k8s \u5c06\u81ea\u5df1\u6253\u9020\u6210\u4e00\u4e2a\u7f16\u6392\u5bb9\u5668\u7684\u5e73\u53f0\uff0c\u628a\u7ba1\u7406\u5bb9\u5668\u7684\u90e8\u5206\u62bd\u8c61\u6210 Container Runtime Interface, CRI\u3002\u7f16\u6392\u5bb9\u5668\u4e0d\u53ea\u53ef\u4ee5\u662f docker\uff0c\u8fd8\u53ef\u4ee5\u662f rkt;<br \/>\n3. \u628a\u81ea\u5df1\u62bd\u51fa\u6765\u5f53\u4e00\u4e2a\u5e73\u53f0\uff0c\u8ba1\u5212\u5c06\u81ea\u5efa\u673a\u623f\uff0c\u4e91\u4f9b\u5e94\u5546\u90fd\u7eb3\u5165\u7ba1\u7406\uff0c\u8de8\u673a\u623f\u8fc1\u79fb\u7b80\u5355\u3002\u611f\u89c9\u968f\u65f6\u53ef\u4ee5\u5bf9 docker \u548c \u4e00\u4e9b\u4e91\u670d\u52a1\u5546\u8fdb\u884c\u964d\u7ef4\u6253\u51fb;<br \/>\n4. \u914d\u7f6e\u7b80\u5355\u4e0a\u7ebf\u5c31\u7b80\u5355\uff0c\u7528\u7684\u4eba\u5c31\u591a\u3002<\/p>\n<p>\u5982\u679c\u4f7f\u7528 k8s\uff0c\u53ef\u80fd\u6709\u51e0\u4e2a\u9636\u6bb5\u5c31\u80fd\u5b8c\u5168\u63a5\u5165:<\/p>\n<p>1. Deployment \u529f\u80fd\uff0c\u7ed3\u5408\u81ea\u5df1\u7684 CI\/CD \u3002\u4e0d\u7ba1\u5355\u4f53\u5e94\u7528\u8fd8\u662f\u5fae\u670d\u52a1\uff0c\u81ea\u52a8\u89e3\u51b3\u5927\u90e8\u5206\u65e0\u72b6\u6001\u5e94\u7528\u4e0a\u7ebf\u53d8\u66f4\u9700\u6c42\uff0c\u540c\u65f6\u505a\u597d\u76d1\u63a7\u544a\u8b66\u548c\u65e5\u5fd7\u6536\u96c6\uff1b<br \/>\n2. \u4f7f\u7528 Service + dns \u529f\u80fd\uff0c\u628a\u5e94\u7528\u5305\u88c5\u6210\u4e00\u7cfb\u5217\u6709 load balancer \u548c \u79c1\u6709\u57df\u540d\u7684\u5fae\u670d\u52a1\uff0c\u57fa\u672c\u89e3\u51b3\u65e0\u72b6\u6001\u5e94\u7528\u4e0a\u7ebf\uff1b<br \/>\n3. Jobs \u529f\u80fd\uff0c\u5b9a\u65f6\u5904\u7406\u4efb\u52a1\uff1b<\/p>\n<p>\u4e0a\u9762\u95ee\u9898\u89e3\u51b3\u540e\uff0c\u53ef\u4ee5\u817e\u51fa\u5f88\u591a\u65f6\u95f4\u73a9\u70b9\u9ad8\u7ea7\u7684:<\/p>\n<p>4. Stateful Set + \u5b58\u50a8 + dns \u63d0\u4f9b\u6709\u72b6\u6001\u7684\u670d\u52a1\uff0c\u53ef\u914d\u7f6e\u96c6\u7fa4 redis, etcd, cassandra, mongodb\u7b49;<br \/>\n5. Ingress nginx \u63d0\u4f9b\u56db\u5c42 \u4e03\u5c42\u5165\u53e3;<br \/>\n6. \u73af\u5883\u53d8\u91cf\u690d\u5165 \u5bb9\u5668\u5185\u90e8\u8bbf\u95ee apiserver\uff0c\u57fa\u4e8e apiserver \u505a\u903b\u8f91\u529f\u80fd;<br \/>\n7. namespace \u9694\u9632\uff0c\u7f51\u7edc\u9694\u79bb;<br \/>\n8. \u8d44\u6e90\u914d\u989d\uff0c\u7cbe\u5fc3\u89c4\u5212 requests limits \u8bbe\u7f6e\uff0c\u63d0\u9ad8\u8d44\u6e90\u5229\u7528\u7387;<br \/>\n9. Helm \u7ba1\u7406\u8fd9\u4e9b k8s \u5e94\u7528\u914d\u7f6e\uff0c\u57fa\u7840\u8bbe\u65bd\u5373\u4ee3\u7801\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>k8s \u7684\u4f18\u70b9: 1. \u5f00\u53d1\u548c\u8fd0\u7ef4\u7684\u9ad8\u624b\u7f16\u5199\uff0c\u4ea7\u54c1\u601d\u7ef4\u597d\uff0c\u8d34\u8fd1\u9700\u6c42\u3002\u638c\u63e1\u4e00\u4e9b\u7f51\u7edc\uff0clinux, iptables\uff0cdocker \u77e5\u8bc6\u7684\u5de5\u7a0b\u5e08\u5c31\u80fd\u642d\u8d77\u6765\u3002\u5c31\u50cf\u65e9\u671f\u7684 linux, HTTP \u4e00\u6837\u6709\u7f3a\u70b9\uff0c\u4f46\u6700\u6838\u5fc3\u529f\u80fd\u7b80\u5355\u9ad8\u6548; 2. k8s \u5c06\u81ea\u5df1\u6253\u9020\u6210\u4e00\u4e2a\u7f16\u6392\u5bb9\u5668\u7684\u5e73\u53f0\uff0c\u628a\u7ba1\u7406\u5bb9\u5668\u7684\u90e8\u5206\u62bd\u8c61\u6210 Container Runtime Interface, CRI\u3002\u7f16\u6392\u5bb9\u5668\u4e0d\u53ea\u53ef\u4ee5\u662f docker\uff0c\u8fd8\u53ef\u4ee5\u662f rkt; 3. \u628a\u81ea\u5df1\u62bd\u51fa\u6765\u5f53\u4e00\u4e2a\u5e73\u53f0\uff0c\u8ba1\u5212\u5c06\u81ea\u5efa\u673a\u623f\uff0c\u4e91\u4f9b\u5e94\u5546\u90fd\u7eb3\u5165\u7ba1\u7406\uff0c\u8de8\u673a\u623f\u8fc1\u79fb\u7b80\u5355\u3002\u611f\u89c9\u968f\u65f6\u53ef\u4ee5\u5bf9 docker \u548c \u4e00\u4e9b\u4e91\u670d\u52a1\u5546\u8fdb\u884c\u964d\u7ef4\u6253\u51fb; 4. \u914d\u7f6e\u7b80\u5355\u4e0a\u7ebf\u5c31\u7b80\u5355\uff0c\u7528\u7684\u4eba\u5c31\u591a\u3002 \u5982\u679c\u4f7f\u7528 k8s\uff0c\u53ef\u80fd\u6709\u51e0\u4e2a\u9636\u6bb5\u5c31\u80fd\u5b8c\u5168\u63a5\u5165: 1. Deployment \u529f\u80fd\uff0c\u7ed3\u5408\u81ea\u5df1\u7684 CI\/CD \u3002\u4e0d\u7ba1\u5355\u4f53\u5e94\u7528\u8fd8\u662f\u5fae\u670d\u52a1\uff0c\u81ea\u52a8\u89e3\u51b3\u5927\u90e8\u5206\u65e0\u72b6\u6001\u5e94\u7528\u4e0a\u7ebf\u53d8\u66f4\u9700\u6c42\uff0c\u540c\u65f6\u505a\u597d\u76d1\u63a7\u544a\u8b66\u548c\u65e5\u5fd7\u6536\u96c6\uff1b 2. \u4f7f\u7528 Service + dns \u529f\u80fd\uff0c\u628a\u5e94\u7528\u5305\u88c5\u6210\u4e00\u7cfb\u5217\u6709 load balancer \u548c \u79c1\u6709\u57df\u540d\u7684\u5fae\u670d\u52a1\uff0c\u57fa\u672c\u89e3\u51b3\u65e0\u72b6\u6001\u5e94\u7528\u4e0a\u7ebf\uff1b 3. Jobs \u529f\u80fd\uff0c\u5b9a\u65f6\u5904\u7406\u4efb\u52a1\uff1b \u4e0a\u9762\u95ee\u9898\u89e3\u51b3\u540e\uff0c\u53ef\u4ee5\u817e\u51fa\u5f88\u591a\u65f6\u95f4\u73a9\u70b9\u9ad8\u7ea7\u7684: 4. Stateful Set + \u5b58\u50a8 + dns \u63d0\u4f9b\u6709\u72b6\u6001\u7684\u670d\u52a1\uff0c\u53ef\u914d\u7f6e\u96c6\u7fa4 redis, [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[185],"tags":[],"class_list":["post-8344","post","type-post","status-publish","format-standard","hentry","category-kubernetes"],"_links":{"self":[{"href":"https:\/\/jpuyy.com\/index.php?rest_route=\/wp\/v2\/posts\/8344","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jpuyy.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jpuyy.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jpuyy.com\/index.php?rest_route=\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/jpuyy.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=8344"}],"version-history":[{"count":4,"href":"https:\/\/jpuyy.com\/index.php?rest_route=\/wp\/v2\/posts\/8344\/revisions"}],"predecessor-version":[{"id":8348,"href":"https:\/\/jpuyy.com\/index.php?rest_route=\/wp\/v2\/posts\/8344\/revisions\/8348"}],"wp:attachment":[{"href":"https:\/\/jpuyy.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=8344"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jpuyy.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=8344"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jpuyy.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=8344"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}