{"id":158495,"date":"2019-09-28T08:00:03","date_gmt":"2019-09-28T00:00:03","guid":{"rendered":"https:\/\/lrxjmw.cn\/?p=158495"},"modified":"2019-09-20T14:59:44","modified_gmt":"2019-09-20T06:59:44","slug":"kubeadm-kubernetes","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/kubeadm-kubernetes.html","title":{"rendered":"\u5b9e\u8df5\u64cd\u4f5c\uff1a\u5728kubeadm\u5feb\u901f\u90e8\u7f72kubernetes 1.15.2 \u96c6\u7fa4"},"content":{"rendered":"
\u5bfc\u8bfb<\/td>\n | \u6bd4\u8d77\u4e8c\u8fdb\u5236\u5b89\u88c5\uff0c\u4f7f\u7528 kubeadm \u6765\u5feb\u901f\u90e8\u7f72 kubernetes \u96c6\u7fa4\u662f\u6bd4\u8f83\u65b9\u4fbf\u5feb\u6377\u7684\uff0c\u672c\u6587\u4f7f\u7528 kubeadm \u90e8\u7f72 kubernetes 1.15.2 \u96c6\u7fa4\uff0c\u5341\u5206\u949f\u5185\u5c31\u80fd\u641e\u5b9a\uff0c\u987a\u4fbf\u89e3\u51b3\u4e86\u4e00\u4e2a\u95ee\u9898\uff0c\u90a3\u5c31\u662f kubeadm \u7684\u8bc1\u4e66\u95ee\u9898\uff0c\u9ed8\u8ba4\u60c5\u51b5\u4e0b\u751f\u6210\u7684\u8bc1\u4e66\u6709\u6548\u671f\u662f\u4e00\u5e74\uff0c\u4e0b\u6587\u9488\u5bf9\u8fd9\u4e2a\u505a\u4e86\u8c03\u6574\u3002<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n \u6211\u8fd9\u91cc\u4f7f\u7528\u4e86\u4e24\u53f0\u670d\u52a1\u5668\uff0c\u4e00\u4e2a master \u4e00\u4e2a node\uff0c\u7cfb\u7edf\u91c7\u7528 Centos7.6-86_x64\uff0c\u4f60\u7684\u670d\u52a1\u5668\u9700\u8981\u6ee1\u8db3\u5982\u4e0b\u8981\u6c42\uff0c \u4e00\u5b9a\u8981\u5173\u95ed swap&selinux&firewall<\/span><\/p>\n \u81ea\u884c\u8bbe\u7f6e\u4e3b\u673a\u540d\u4fee\u6539 host \u6587\u4ef6\u5427\uff0c<\/p>\n \u5f00\u59cb\u5b89\u88c5 docker-ce\uff0c\u6240\u6709\u670d\u52a1\u5668\u6267\u884c\uff0c\u8fd9\u6b21\u7528\u7684\u662f\u963f\u91cc\u4e91\u7684\u6e90\uff0c<\/p>\n \u8fd9\u6837\u5c31\u53ef\u4ee5\u4e86\uff0c\u5b89\u88c5\u76ee\u524d\u6700\u65b0\u7248\u672c\uff0c\u4e5f\u5c31\u662f docker-ce 19.03.1\uff0c\u5176\u5b9e\u8fd8\u662f\u5efa\u8bae\u88c5 18.09.x \u7248\u672c\u7684 docker-ce\uff0c\u56e0\u4e3a\u76ee\u524d kubeadm \u652f\u6301\u5217\u8868\u91cc\u8fd8\u6ca1\u6709 19.x \u7248\u672c\u7684\uff0c\u6211\u88c5\u4e86 19.03.1 \u7528\u7740\u8c8c\u4f3c\u4e5f\u6ca1\u5565\u95ee\u9898\uff0c\u53ea\u662f\u5728\u521d\u59cb\u5316\u96c6\u7fa4\u7684\u65f6\u5019\u629b\u4e00\u6761\u8b66\u544a\uff0c\u5982\u679c\u60f3\u88c5\u8001\u7248\u672c\u53ef\u4ee5\u8fd9\u6837\u641c\u4e00\u4e0b\u3002<\/p>\n \u627e\u5230\u4e4b\u540e\u5c31\u53ef\u4ee5\u6307\u5b9a\u7248\u672c\u53f7\u4e86\u8fdb\u884c\u5b89\u88c5\u4e86\uff0c<\/p>\n docker-ce \u5b89\u88c5\u8fd9\u5757\u5c31\u8fd9\u4e48\u591a\uff0c\u5f00\u59cb\u73af\u5883\u521d\u59cb\u5316\u5427\u3002<\/p>\n \u521b\u5efa \/etc\/sysctl.d\/k8s.conf \u6587\u4ef6\uff0c\u5168\u90e8\u670d\u52a1\u5668\u6267\u884c\uff0c\u5c06\u6865\u63a5\u7684 IPv4 \u6d41\u91cf\u4f20\u9012\u5230 iptables \u7684\u94fe<\/p>\n \u52a0\u8f7d IPVS \u6a21\u5757\uff0c\u5168\u90e8\u670d\u52a1\u5668\u6267\u884c\uff0c<\/p>\n \u8fd8\u662f\u7528\u963f\u91cc\u4e91\u7684\u6e90\uff0c\u5168\u90e8\u670d\u52a1\u5668\u6267\u884c\uff0c\u987a\u4fbf\u5b89\u88c5\u4e86 ipset<\/p>\n \u6307\u5b9a\u7248\u672c\uff0c\u5b89\u88c5 1.15.2 \u7684\uff0c \u4e0b\u9762\u5f00\u59cb\u521d\u59cb\u5316\u96c6\u7fa4\u3002<\/p>\n \u4e0a\u9762\u63d0\u5230\u4e86\uff0c\u9ed8\u8ba4\u751f\u6210\u7684\u8bc1\u4e66\u6709\u6548\u671f\u662f\u4e00\u5e74\uff0c\u6211\u5728\u72d7\u5934\u7684\u5e2e\u52a9\u4e0b\u5c06 kubeadm \u751f\u6210\u7684\u8bc1\u4e66\u6709\u6548\u671f\u65f6\u95f4\u7531\u4e4b\u524d\u7684 1 \u5e74\u6539\u5230\u4e86\u5341\u5e74\uff0c\u8fd9\u4e2a\u4e0d\u662f\u5f88\u9ebb\u70e6\uff0c\u5927\u6982\u8fd9\u6837\u6539\uff0c<\/p>\n \u8fd9\u4e00\u6b65\u4e0d\u662f\u5fc5\u987b\u7684\uff0c\u770b\u81ea\u5df1\u7684\u60c5\u51b5\u5427\uff0c\u4ece\u6628\u5929\u4e0b\u5348\u5f00\u59cb\uff0c\u6211\u5c31\u5728\u627e\u5ef6\u957f\u8bc1\u4e66\u65f6\u95f4\u7684\u529e\u6cd5\uff0c\u7ed3\u679c\u90fd\u662f\u9700\u8981\u4fee\u6539 Kubernetes \u6e90\u7801\u540e\u91cd\u65b0\u91cd\u65b0\u7f16\u8bd1 kubeadm\uff0c\u6240\u4ee5\u6211\u4e5f\u6309\u7740\u4ed6\u4eec\u65b9\u6cd5\u8bd5\u4e86\u4e00\u4e0b\uff0c\u4e3b\u8981\u662f\u6839\u636e\u8fd9\u7bc7\u6587\u7ae0\uff0c\u6211\u62c9\u5b8c\u4ee3\u7801\u540e\u53d1\u73b0\u4ed6\u7684\u7f16\u8bd1\u73af\u5883\u955c\u50cf\u7248\u672c\u6709\u70b9\u4f4e\uff0c\u7f16\u8bd1\u5f53\u524d kubernetes \u6e90\u7801\u9700\u8981 go1.12.1 or later\uff0c\u800c\u4ed6\u7684\u7248\u672c\u662f go1.11.2\uff0c\u6240\u4ee5\u6211\u770b\u4e86\u4e00\u4e0b\u8fd9\u4e2a\u955c\u50cf\u7684\u5c42\u4fe1\u606f\uff0c\u57fa\u4e8e golang:latest \u955c\u50cf\u91cd\u505a\u4e86\u4e00\u4e2a\uff0c\u80fd\u7f16\u8bd1\u540e\u53d1\u73b0\u8fd9\u6837\u6539\u4e0d\u751f\u6548\uff0c\u8fd8\u662f\u9ed8\u8ba4\u7684\u4e00\u5e74\uff0c\u7ecf\u8fc7\u591a\u6b21\u6298\u817e\u548c\u72d7\u5934\u7684\u5e2e\u52a9\u7ec8\u4e8e\u662f\u6210\u529f\u4e86\uff0c\u5927\u6982\u662f\u8fd9\u6837\uff0c\u7f16\u8bd1\u73af\u5883\u955c\u50cf\u6211\u4e5f\u4f20\u5230 dockerhub \u4e0a\u4e86\uff0c\u76f4\u63a5\u62c9\u5c31\u53ef\u4ee5\u4e86\uff0c\u5148\u628a kubernetes \u6e90\u7801\u62c9\u4e0b\u6765\u5427\uff0c<\/p>\n \u62c9\u4e0b\u6765\u4e4b\u540e\u6302\u8f7d\u5230\u5bb9\u5668\u53bb\u7f16\u8bd1\uff0c\u73af\u5883\u90fd\u5f04\u597d\u4e86\uff0c<\/p>\n \u8fd9\u4e2a\u955c\u50cf\u5f88\u5927\uff0c\u5728 1.7G \u5de6\u53f3\uff0c\u8fd0\u884c\u4ee5\u4e0a\u547d\u4ee4\u540e\u53ef\u4ee5\u53bb\u5438\u6839\u70df\uff0c\u56de\u6765\u5c31\u5dee\u4e0d\u591a\u4e86\uff0c<\/p>\n \u62bd\u5b8c\u56de\u6765\u4e86\uff0c\u7136\u540e\u8fdb\u5165\u5230\u8fd9\u4e2a\u76ee\u5f55\uff0c<\/p>\n \u8fd9\u91cc\u5c31\u4e0d\u626f\u522b\u7684\u4e86\uff0c\u76f4\u63a5\u53bb\u6539\u8fd9\u4e2a\u6587\u4ef6\uff0c\u518d\u5f00\u4e00\u4e2a\u7a97\u53e3\u53bb\u7f16\u8f91\u4ed6\uff0c<\/p>\n \u9ed8\u8ba4\u662f\u4e00\u5e74\uff0c\u6211\u52a0\u4e86\u4e2a 0\uff0c\u4e5f\u5c31\u662f\u5341\u5e74\u4e86\uff0c\u5269\u4e0b\u7684\u4e0d\u8981\u52a8\uff0c\u4fdd\u5b58\u9000\u51fa\uff0c\u7136\u540e CertificateValidity \u88ab\u8fd9\u91cc\u5f15\u7528\uff0c<\/p>\n \u8fd9\u6837\u5c31\u884c\u4e86\uff0c\u91cd\u65b0\u7f16\u8bd1 kubeadm \u5373\u53ef\uff0c<\/p>\n <\/p>\n \u7f16\u8bd1\u6210\u529f\u540e\u4e8c\u8fdb\u5236\u6587\u4ef6\u5728.\/_output\/local\/bin\/linux\/amd64\/ \u76ee\u5f55\u4e0b\uff0c\u76f4\u63a5\u8986\u76d6\u6389 \/usr\/bin\/ \u4e0b\u7684 kubeadm \u5c31\u884c\u4e86\uff0c\u8fd9\u4e2a\u53ea\u5728 master \u8282\u70b9\u66ff\u6362\u6389\u5c31\u884c\u4e86\uff0c<\/p>\n \u5982\u679c\u4f60\u5acc\u9ebb\u70e6\u53ef\u4ee5\u76f4\u63a5\u7528\u6211\u8fd9\u4e2a\u7f16\u8bd1\u597d\u7684\uff0c\u6700\u8fd1\u53c8\u6539\u4e86\u4e00\u4e0b\u8bc1\u4e66\u7684\u6709\u6548\u671f\uff0c\u603b\u4e4b\u5728\u5ea7\u5404\u4f4d\u6709\u751f\u4e4b\u5e74\u662f\u770b\u4e0d\u5230\u5b83\u8fc7\u671f\u4e86\uff0c<\/p>\n \u597d\u4e86\uff0c\u4e0b\u9762\u53ef\u4ee5\u521d\u59cb\u5316\u96c6\u7fa4\u4e86\uff0c<\/p>\n \u8fd9\u91cc\u76f4\u63a5\u7528\u914d\u7f6e\u6587\u4ef6\u53bb\u521d\u59cb\u5316\u4e86\uff0c\u4e0d\u7528\u547d\u4ee4\u884c\uff0c\u914d\u7f6e\u6587\u4ef6\u5982\u4e0b\uff0c<\/p>\n \u955c\u50cf\u7528\u7684\u662f\u6211\u534e\u4e3a\u4e91\u4e0a\u7684\u955c\u50cf\uff0c\u542f\u7528\u4e86 ipvs \u4ee3\u7406\u6a21\u5f0f\uff0cpodSubnet \u7f51\u6bb5\u4e0d\u8981\u6539\u6492\uff0c\u5fc5\u987b\u662f\u8fd9\u4e2a\uff0c\u5c31\u8fd9\u6837\uff0c\u53ef\u4ee5\u521b\u5efa\u4e86\uff0c<\/p>\n \u770b\u5230\u8fd9\u4e2a\u5c31\u8868\u793a\u6210\u529f\u4e86\uff0c \u8ba9\u4f60\u6267\u884c\u4e09\u6761\u547d\u4ee4\uff0c\u6267\u884c\u4e00\u4e0b\u5c31\u5b8c\u4e86\uff0c\u6267\u884c\u5b8c\u4e4b\u540e\u770b\u4e00\u4e0b pod<\/p>\n <\/p>\n coredns \u5904\u4e8e pending \u72b6\u6001\uff0c\u6240\u4ee5\u73b0\u5728\u9700\u8981\u90e8\u7f72\u4e00\u4e0b\u5bb9\u5668\u7684\u7f51\u7edc\uff0c\u8fd8\u662f\u7528 flannel\uff0c<\/p>\n \u7f51\u7edc\u5bb9\u5668\u542f\u52a8\u540e\u96c6\u7fa4\u5c31\u7b97\u642d\u5efa\u5b8c\u4e86\uff0c<\/p>\n <\/p>\n \u7136\u540e\u770b\u770b\u4e00\u4e0b\u8bc1\u4e66\u7684\u6709\u6548\u671f\uff0c \u6ca1\u5565\u95ee\u9898\uff0c\u4e0b\u9762\u628a\u8282\u70b9\u52a0\u8fdb\u6765\u3002<\/p>\n \u5148\u5728 master \u770b\u4e00\u4e0b\u76ee\u524d\u53ef\u7528\u7684 token<\/p>\n \u52a0\u5165\u96c6\u7fa4\u7684\u547d\u540d\u683c\u5f0f\u5982\u4e0b\uff0c<\/p>\n master-IP:port \u4e0d\u7528\u8bf4\u4e86\uff0ctoken \u5c31\u662f\u4e0a\u9762\u547d\u4ee4\u67e5\u5230\u7684\u90a3\u4e2a\uff0c\u6700\u540e sha256 \u4e5f\u5c31\u662f ca \u8bc1\u4e66\u7684 sha256\uff0c\u83b7\u53d6\u547d\u4ee4\u5982\u4e0b\uff0c<\/p>\n \u6240\u4ee5\u6211\u8981\u5728 node \u8282\u70b9\u6267\u884c\u8fd9\u6761\uff0c<\/p>\n \u6267\u884c\u540e node \u4e5f\u4f1a\u8fdb\u884c\u4e00\u5b9a\u7684\u521d\u59cb\u5316\u5de5\u4f5c\uff0c\u4f1a\u542f\u52a8\u4e00\u4e2a flannel&kube-proxy \u5bb9\u5668\uff0c\u5728 master \u7b49\u7740\u5c31\u884c\u4e86\uff0c\u4e00\u4f1a node \u5c31\u4f1a\u53d8\u4e3a Ready\uff0c<\/p>\n \u6700\u540e\u6d4b\u8bd5\u4e00\u6ce2\u5427\uff0c\u5230\u5e95\u80fd\u4e0d\u80fd\u7528\uff0c\u8fd8\u662f\u8dd1\u4e2a nginx \u8bd5\u8bd5\uff0c<\/p>\n <\/p>\n \u8bbf\u95ee\u8bd5\u8bd5\uff0c \u518d\u6d4b\u4e00\u4e0b coredns\uff0c<\/p>\n <\/p>\n \u80fd\u67e5\u5230\uff0c\u6700\u540e\u786e\u8ba4\u4e00\u4e0b kube-proxy \u7528\u7684\u662f\u4e0d IPVS \u6a21\u5f0f\uff0c\u770b\u4e00\u4e0b kube-proxy \u7684\u65e5\u5fd7\u5c31\u77e5\u9053\u4e86\uff0c \u6211\u8fd9\u91cc\u4f7f\u7528\u4e86\u4e24\u53f0\u670d\u52a1\u5668\uff0c\u4e00\u4e2a master \u4e00\u4e2a node\uff0c\u7cfb\u7edf\u91c7\u7528 Centos7.6-86_x64\uff0c\u4f60\u7684\u670d […]<\/p>\n","protected":false},"author":668,"featured_media":142098,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[],"class_list":["post-158495","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\/158495","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\/668"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=158495"}],"version-history":[{"count":6,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/158495\/revisions"}],"predecessor-version":[{"id":158565,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/158495\/revisions\/158565"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/142098"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=158495"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=158495"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=158495"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}} |