{"id":63487,"date":"2023-07-19T10:10:14","date_gmt":"2023-07-19T02:10:14","guid":{"rendered":"http:\/\/lrxjmw.cn\/?p=63487"},"modified":"2023-07-19T10:10:14","modified_gmt":"2023-07-19T02:10:14","slug":"k8s-use-play","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/k8s-use-play.html","title":{"rendered":"\u5e26\u4f60\u73a9\u8f6cKubernetes"},"content":{"rendered":"\n\n\n
\u5bfc\u8bfb<\/td>\nKubernetes\u662f\u8457\u540d\u7684\u5bb9\u5668\u7ba1\u7406\u7cfb\u7edf\uff0c\u662f\u4e00\u4e2a\u6709\u8fd9\u5f88\u591a\u8d21\u732e\u8005\u7684\u5f00\u6e90\u5927\u9879\u76ee\uff0c\u5b83\u4f5c\u4e3a\u4e00\u4e2a\u4e0d\u6311\u98df\u7684\u5bb9\u5668\u7ba1\u7406\u6846\u67b6\uff0c\u53ef\u4ee5\u65e0\u5904\u4e0d\u5728\u3002\u8fd9\u4e24\u5929\u63a5\u89e6K8s\uff0c\u5e26\u4f60\u73a9\u8f6cK8s\uff0c\u8fd9\u4e2a\u6559\u7a0b\u53ef\u4ee5\u5927\u81f4\u8ba9\u4f60\u77e5\u9053\u8fd0\u884c\u66f4\u6539\u6e90\u7801\uff0c\u800c\u4e14\u4ece\u5934\u6d4b\u8bd5\u672c\u5730Kubernetes\u5e73\u53f0\u96c6\u7fa4\u3002<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

Kubernetes\u662f\u4e2a\u6709\u5f88\u591a\u8d21\u732e\u8005\u7684\u5f00\u6e90\u5927\u9879\u76ee\uff0c\u7406\u8bba\u4e0a\u5b83\u4f5c\u4e3a\u4e00\u4e2a\u4e0d\u6311\u98df\u7684\u5bb9\u5668\u7ba1\u7406\u6846\u67b6\uff0c\u53ef\u4ee5\u65e0\u5904\u4e0d\u5728\u3002\u4f46\u53ef\u60dc\u7684\u662f\uff0c\u65e0\u8bba\u5b9e\u9645\u7f16\u5199\u8fd8\u662f\u8d21\u732e\u6d4b\u8bd5\u4ee3\u7801\uff0c\u5f15\u5bfckubernetes server\u90fd\u4e0d\u592a\u5bb9\u6613\u3002\u91cc\u8fb9\u7684\u4e00\u4e9b\u6587\u4ef6\u5bf9\u4e8e\u6211\u6765\u8bf4\u6709\u4e9b\u4e71\uff0c\u4e0d\u662f\u6302\u4e86\u7684\u5c31\u662f\u8fc7\u65f6\u7684\u3002\u6e90\u6587\u4ef6\u66f4\u6539\u548c\u7f16\u8bd1\u8fd0\u884c\u7684\u793a\u4f8b\u975e\u5e38\u5c11\uff0c\u5982\u679c\u672c\u5730\u8dd1kubernets cluster\u5c31\u5fc5\u987b\u4ece\u5934\u5f00\u59cb\u6478\u7d22\u4e2d\u524d\u8fdb\u3002
\n\u4e0b\u9762\u5206\u4eab\u4e00\u4e9b\u6478\u7d22\u5fc3\u5f97\uff0c\u5c3d\u91cf\u4ece\u5934\u5f00\u59cb\u8be6\u7ec6\u8bb2\u89e3\uff0c\u5927\u5bb6\u4e00\u8d77\u804a\u804a\u3002<\/p>\n

\u6b65\u9aa41\uff1a\u521b\u5efa\u865a\u62df\u673a\u5e76\u8bbf\u95ee<\/strong><\/div>\n

\u65e2\u7136\u662f\u4ece\u5934\u5f00\u59cb\uff0c\u90a3\u5c31\u5f97\u505a\u505a\u6837\u5b50\u3002\u5148\u521b\u5efa\u4e2a\u65b0\u7684\u3001\u5e72\u51c0\u7684VM\u6765\u8fd0\u884c\u3002<\/p>\n

\"\"<\/p>\n

\u81f3\u6b64\uff0c\u65b0\u7684Google\u4e91\u5e73\u53f0VM\u5b9e\u4f8b\u521b\u5efa\u5b8c\u6210\uff0c\u8fd9\u662f\u4e2a\u5e72\u51c0\u65e0\u6c61\u67d3\u7684\u65b0\u73af\u5883\u3002<\/p>\n

\u6b65\u9aa42\uff1a\u4e3aKubernetes\u51c6\u5907\u865a\u62df\u673a<\/strong><\/div>\n

\u8fd9\u4e00\u6b65\u8981\u5b89\u88c5\uff1a<\/p>\n

\r\nGCC\uff0cMake\uff0csocat\u548cgit\uff1b\r\nDocker\uff1b\r\n\u5176\u4ed6\u7684\u770b\u81ea\u5df1\u9700\u6c42\uff0c\u6ca1\u5565\u9700\u6c42\u5c31\u4e0d\u7528\u7ba1\u4e86\u3002\r\n<\/pre>\n

ssh\u5230\u4e0a\u9762\u7684\u65b0VM\uff0c\u5b89\u88c5GCC\uff0cMake\uff0csocat\u548cgit\uff1a<\/p>\n

\"\"
\n\u5b89\u88c5etcd\uff1a<\/p>\n

\"\"
\n\u5b89\u88c5golang\uff08\u5e94\u8be5\u662f1.8+\u7248\u672c\uff09\uff1a<\/p>\n

\"\"<\/p>\n

\u6b65\u9aa43\uff1a\u83b7\u53d6Kubernetes\u6e90\u4ee3\u7801<\/strong><\/div>\n

\u5728\u8fd9\u4e2a\u6b65\u9aa4\uff0cGit Kubernetes\u6e90\u4ee3\u7801\u4f1a\u514b\u9686\u4e0b\u6765\u5e76\u6dfb\u52a0\u5230GOPATH\u3002\u6ce8\u610f\uff0c\u8fd9\u91cc\u8981\u7528\u2013depth 1\uff0c\u5373\u53ea\u8981\u6700\u65b0\u7248\u672c\u3002<\/p>\n

\"\"<\/p>\n

\u628aKubernetes sources\u6dfb\u52a0\u5230GOPATH\uff1a<\/p>\n

\"\"<\/p>\n

\u6b65\u9aa44\uff1a\u7f16\u8bd1\u5e76\u8fd0\u884cKubernetes<\/strong><\/div>\n

\u8fd9\u91cc\u4e0d\u96be\uff0c\u56e0\u4e3a\u5b83\u6b63\u597d\u6709\u4e2a\u53eblocal-up-cluster.sh\u7684\u597d\u8d27\u3002
\n\"\"<\/p>\n

\u8f93\u51fa\u663e\u793a\uff1a<\/p>\n

\"\"<\/p>\n

\u6b65\u9aa45\uff1a\u6d4b\u8bd5Kubernetes<\/strong><\/div>\n

\u865a\u62df\u673a\u6253\u5f00\u4e2a\u65b0\u7684shell\uff0ccd\u5230Kubernetes\u6e90\u76ee\u5f55GOPATH\uff0c\u7136\u540e\u5c31\u53ef\u4ee5\u6d4b\u8bd5\u4e86\uff1a<\/p>\n

\"\"<\/p>\n

\u6b65\u9aa46\uff1a\u66f4\u6539\u6e90\u4ee3\u7801<\/strong><\/div>\n

\u5728kubernetes-apiserver\u6dfb\u52a0\u65e5\u5fd7\u884c\u6765\u6539\u4e2aentry point\uff0c\u800c\u4e14\u8981\u4fdd\u8bc1\u8fd9\u6761\u4f60\u80fd\u5728\u65e5\u5fd7\u4e2d\u770b\u5230\uff1a
\n\"\"<\/p>\n

\u6b65\u9aa47\uff1a\u6d4b\u8bd5Kubernetes\u6e90\u4ee3\u7801\u7684\u66f4\u6539<\/strong><\/div>\n

\u505c\u6b62\u672c\u5730\u7fa4\u96c6\uff0c\u91cd\u542froot@instance-3:\/gopath\/src\/k8s.io\/kubernetes# hack\/local-up-cluster.sh<\/p>\n

\u5728\u5c3eapi server\u65e5\u5fd7\u884c\u68c0\u67e5\u4e0b\u662f\u5426\u51fa\u73b0\u4e86\u66f4\u6539\uff1a<\/p>\n

\"\"<\/p>\n

\u8fd9\u5c31\u662f\u4ece\u5934\u5f00\u59cb\u521b\u5efa\u672c\u5730\u7684Kubernetes\u96c6\u7fa4\u7684\u6587\u6863\uff0c\u4e0d\u9ebb\u70e6\uff0c\u4f46\u4e5f\u5305\u542b\u4e86\u4e00\u4e9b\u6bd4\u8f83\u91cd\u8981\u7684\u70b9\uff1a\u6267\u884c\u4e86\u51e0\u4e2a\u7b80\u5355\u7684\u6b65\u9aa4\uff0c\u83b7\u53d6\u4e00\u4e2aKubernetes\u96c6\u7fa4\uff0c\u5e76\u7f16\u8bd1\u5e76\u66f4\u6539\u4e86API\u670d\u52a1\u5668\uff0c\u7136\u540e\u67e5\u770b\u4e86\u66f4\u6539\u3002<\/p>\n

\u6587\u7ae0\u6765\u81ea\uff1a\u5fae\u4fe1\u516c\u4f17\u53f7\uff1aDevOps\u7814\u7a76\u9662<\/p>\n

\n

\u539f\u6587\u6765\u81ea\uff1a\u5fae\u4fe1\u516c\u4f17\u53f7\uff1aDevOps\u7814\u7a76\u9662<\/a><\/p>\n

\u539f\u6587\u6765\u81ea\uff1ahttp:\/\/www.yunweipai.com\/archives\/15169.html<\/a><\/p>\n

\u672c\u6587\u5730\u5740\uff1ahttp:\/\/lrxjmw.cn\/k8s-use-play.html<\/a>\u7f16\u8f91\u5458\uff1a\u9676\u6b66\u6770\uff0c\u5ba1\u6838\u5458\uff1a\u51af\u632f\u534e<\/span><\/p>\n<\/blockquote>\n","protected":false},"excerpt":{"rendered":"

\u53ef\u80fd\u6709\u70b9\u61d2\uff0c\u53cd\u6b63\u6211\u4e0d\u592a\u559c\u6b22\u5b9e\u64cd\uff0c\u56e0\u4e3a\u8d34\u56fe\u5f88\u9ebb\u70e6\u2026\u2026\u54b3\u54b3\uff0c\u8fd9\u4e24\u5929\u63a5\u89e6\uff0c\u5c31\u505a\u4e86\u4e2a\u6559\u7a0b\u3002\u8fd9\u4e2a\u6559\u7a0b\u53ef\u4ee5\u5927\u81f4\u8ba9\u4f60\u77e5\u9053\u8fd0\u884c\uff0c\u66f4\u6539\u6e90\u7801\uff0c\u800c\u4e14\u4ece\u5934\u6d4b\u8bd5\u672c\u5730Kubernetes\u5e73\u53f0\u96c6\u7fa4\u3002<\/p>\n","protected":false},"author":63,"featured_media":63513,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[],"class_list":["post-63487","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\/63487","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\/63"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=63487"}],"version-history":[{"count":5,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/63487\/revisions"}],"predecessor-version":[{"id":63758,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/63487\/revisions\/63758"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/63513"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=63487"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=63487"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=63487"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}