{"id":11745,"date":"2023-08-10T08:29:56","date_gmt":"2023-08-10T00:29:56","guid":{"rendered":"http:\/\/92it.top\/?p=11745"},"modified":"2023-08-21T21:51:20","modified_gmt":"2023-08-21T13:51:20","slug":"k8s%e5%ad%a6%e4%b9%a0%e5%88%9d%e6%8e%a2-k8s%e5%8d%95%e8%8a%82%e7%82%b9%e7%8e%af%e5%a2%83%e6%90%ad%e5%bb%ba","status":"publish","type":"post","link":"https:\/\/92it.top\/?p=11745","title":{"rendered":"K8S\u5b66\u4e60\u521d\u63a2 K8S\u5355\u8282\u70b9\u73af\u5883\u642d\u5efa"},"content":{"rendered":"\n<p>\u8f6c\u8f7d\uff1a<a href=\"https:\/\/www.cnblogs.com\/edisonchou\/p\/aspnet_core_on_k8s_firststudy_part1.html\">https:\/\/www.cnblogs.com\/edisonchou\/p\/aspnet_core_on_k8s_firststudy_part1.html<\/a><\/p>\n\n\n\n<p>\u672c\u7bc7\u5df2\u52a0\u5165\u300a<a rel=\"noreferrer noopener\" href=\"https:\/\/www.cnblogs.com\/edisonchou\/p\/aspnet_core_k8s_artcles_index.html\" target=\"_blank\">.NET Core on K8S\u5b66\u4e60\u5b9e\u8df5\u7cfb\u5217\u6587\u7ae0\u7d22\u5f15<\/a>\u300b\uff0c\u53ef\u4ee5\u70b9\u51fb\u67e5\u770b\u66f4\u591a\u5bb9\u5668\u5316\u6280\u672f\u76f8\u5173\u7cfb\u5217\u6587\u7ae0\u3002<\/p>\n\n\n\n<p>\u5f53\u8fd1\u671f\u7684\u4e00\u4e2aApp\u4e0a\u7ebf\u540e\uff0c\u53d1\u73b0\u76ee\u524d\u7684docker\u5b9e\u4f8b\uff08\u5e94\u7528\u670d\u52a1BFF+\u4e2d\u53f0\u670d\u52a1+\u5de5\u5177\u670d\u52a1\uff09\u5df2\u7ecf\u5f88\u591a\u4e86\uff0c\u800c\u6211\u53f8\u76ee\u524d\u6ca1\u6709\u4e13\u4e1a\u7684\u8fd0\u7ef4\u4eba\u5458\uff0c\u53d1\u73b0\u8fd0\u7ef4\u7684\u6210\u672c\u9010\u6e10\u5f00\u59cb\u4e0a\u6765\uff0c\u6240\u4ee5\u5bb9\u5668\u7f16\u6392\u4e5f\u5c31\u9700\u8981\u63d0\u4e0a\u8bae\u7a0b\u3002\u56e0\u6b64\u6211\u51b3\u5b9a\u5f00\u59cb\u5b66\u4e60Kubernetes\uff0c\u4f1a\u5c06\u5b66\u4e60\u5f53\u4e2d\u7684\u8fc7\u7a0b\u8bb0\u5f55\u4e0b\u6765\uff0c\u9884\u8ba1\u4f1a\u5f62\u6210\u4e00\u4e2a\u7cfb\u5217\uff0c\u6682\u4e14\u547d\u540d\u4e3a\uff1a<strong>ASP.NET Core on K8S<\/strong>\uff0c\u800c\u8fd9\u4e2a\u7cfb\u5217\u4f1a\u75313\u4e2a\u90e8\u5206\u7ec4\u6210\uff0c\u4e14\u4f1a\u5728\u4e0d\u540c\u7684\u65f6\u671f\u5199\u5b8c\uff1a<\/p>\n\n\n\n<ul><li>ASP.NET Core on K8S\u5b66\u4e60\u521d\u63a2\uff1a\u5728Docker for Windows\u4e2d\u642d\u5efa\u5355\u8282\u70b9\u73af\u5883\uff0c\u521d\u6b65\u4e86\u89e3\u6709\u4e2a\u611f\u6027\u8ba4\u8bc6<\/li><li>ASP.NET Core on K8S\u6df1\u5165\u5b66\u4e60\uff1a\u5728Linux\u4e0a\u642d\u5efaK8S\u96c6\u7fa4\uff0c\u5bf9K8S\u7684\u4e00\u4e9b\u6838\u5fc3\u6982\u5ff5\u6709\u4e2a\u6df1\u5165\u7684\u8ba4\u8bc6<\/li><li>ASP.NET Core on ACK\/TKE\u5b9e\u6218\uff1a\u501f\u52a9\u963f\u91cc\u4e91\/\u817e\u8baf\u4e91\u5bb9\u5668\u670d\u52a1\u8fdb\u884c\u751f\u4ea7\u73af\u5883\u7684\u5bb9\u5668\u90e8\u7f72\u548c\u8fd0\u7ef4\u7684\u4e00\u4e9b\u5b9e\u6218\u603b\u7ed3<\/li><\/ul>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p>Section 1 &#8211;&nbsp;ASP.NET Core on K8S\u5b66\u4e60\u521d\u63a2\uff081\uff09K8S\u5355\u8282\u70b9\u73af\u5883\u642d\u5efa<\/p><p>Section 2 &#8211;&nbsp;<a href=\"https:\/\/www.cnblogs.com\/edisonchou\/p\/aspnet_core_on_k8s_firststudy_part2.html\" target=\"_blank\" rel=\"noreferrer noopener\">ASP.NET Core on K8S\u5b66\u4e60\u521d\u63a2\uff082\uff09K8S\u57fa\u672c\u6982\u5ff5\u5feb\u901f\u4e00\u89c8<\/a><\/p><p>Section 3 &#8211;&nbsp;<a href=\"https:\/\/www.cnblogs.com\/edisonchou\/p\/aspnet_core_on_k8s_firststudy_part3.html\" target=\"_blank\" rel=\"noreferrer noopener\">ASP.NET Core on K8S\u5b66\u4e60\u521d\u63a2\uff083\uff09\u90e8\u7f72API\u5230K8S<\/a><\/p><\/blockquote>\n\n\n\n<p><strong>\u4e00\u3001\u5173\u4e8eK8S<\/strong><\/p>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/92it.top\/wp-content\/uploads\/2023\/08\/\u56fe\u7247-67.png\" alt=\"\" class=\"wp-image-11746\" width=\"211\" height=\"206\" srcset=\"https:\/\/92it.top\/wp-content\/uploads\/2023\/08\/\u56fe\u7247-67.png 470w, https:\/\/92it.top\/wp-content\/uploads\/2023\/08\/\u56fe\u7247-67-300x292.png 300w, https:\/\/92it.top\/wp-content\/uploads\/2023\/08\/\u56fe\u7247-67-230x224.png 230w, https:\/\/92it.top\/wp-content\/uploads\/2023\/08\/\u56fe\u7247-67-350x341.png 350w\" sizes=\"(max-width: 211px) 100vw, 211px\" \/><\/figure><\/div>\n\n\n\n<p>\u5173\u4e8eK8S\uff0c\u5efa\u8bae\u9605\u8bfb\u300a<a href=\"https:\/\/www.jianshu.com\/p\/f1f94c6968f5\" target=\"_blank\" rel=\"noreferrer noopener\">10\u5206\u949f\u770b\u61c2Docker\u548cK8S<\/a>\u300b\uff0c\u8fd9\u51e0\u4e4e\u662f\u4e00\u7bc7\u4e0d\u7528\u8017\u8d39\u591a\u5c11\u8111\u7ec6\u80de\u7684\u6587\u7ae0\uff0c\u56e0\u4e3a\u8bb2\u7684\u5b9e\u5728\u662f\u592a\u901a\u4fd7\u6613\u61c2\u4e86\u3002<\/p>\n\n\n\n<p>\u603b\u4f53\u6765\u8bf4\uff0c\u5c31\u662f\u5728Docker\u5bb9\u5668\u6280\u672f\u88ab\u7092\u5f97\u70ed\u706b\u671d\u5929\u4e4b\u65f6\uff0c\u5927\u5bb6\u53d1\u73b0\uff0c\u5982\u679c\u60f3\u8981\u5c06Docker\u5e94\u7528\u4e8e\u5177\u4f53\u7684\u4e1a\u52a1\u5b9e\u73b0\uff0c\u662f\u5b58\u5728\u56f0\u96be\u7684\u2014\u2014\u7f16\u6392\u3001\u7ba1\u7406\u548c\u8c03\u5ea6\u7b49\u5404\u4e2a\u65b9\u9762\uff0c\u90fd\u4e0d\u5bb9\u6613\u3002\u4e8e\u662f\uff0c\u4eba\u4eec\u8feb\u5207\u9700\u8981\u4e00\u5957\u7ba1\u7406\u7cfb\u7edf\uff0c\u5bf9Docker\u53ca\u5bb9\u5668\u8fdb\u884c\u66f4\u9ad8\u7ea7\u66f4\u7075\u6d3b\u7684\u7ba1\u7406\u3002<\/p>\n\n\n\n<p>\u4e8e\u662f\uff0c\u6e90\u81ea\u4e8eGoogle\u7684K8S\u51fa\u73b0\u4e86\u3002K8S\u5c31\u662f\u57fa\u4e8e\u5bb9\u5668\u7684\u96c6\u7fa4\u7ba1\u7406\u5e73\u53f0\uff0c\u5b83\u7684\u5168\u79f0\uff0c\u662fKubernetes\u3002<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p>Kubernetes \u8fd9\u4e2a\u5355\u8bcd\u6765\u81ea\u4e8e\u5e0c\u814a\u8bed\uff0c\u542b\u4e49\u662f\u8235\u624b\u6216\u9886\u822a\u5458\u3002K8S\u662f\u5b83\u7684\u7f29\u5199\uff0c\u7528\u201c8\u201d\u5b57\u66ff\u4ee3\u4e86\u201cubernete\u201d\u8fd98\u4e2a\u5b57\u7b26\u3002<\/p><\/blockquote>\n\n\n\n<p>\u8fd9\u91cc\u4e0d\u518d\u8fc7\u591a\u89e3\u91ca\uff0c\u56e0\u4e3a\u4e0a\u9762\u7684\u6587\u7ae0\u91cc\u5df2\u7ecf\u8bb2\u7684\u5f88\u6e05\u695a\u4e86\uff0c\u7406\u6e05\u90a3\u4e9b\u7e41\u591a\u7684K8S\u6982\u5ff5\u7559\u5230\u540e\u9762\u518d\u6765\uff0c\u8fd9\u91cc\u4e3b\u8981\u662f\u5148\u73a9\u8d77\u6765\uff0c\u73a9\u4e86\u518d\u8bf4\u3002K8S\u7684\u73af\u5883\u642d\u5efa\u5728Windows\u548cLinux\u4e0b\uff0c\u8fd8\u53ef\u4ee5\u57fa\u4e8e\u4e91\u670d\u52a1\u63d0\u4f9b\u5546\u5c01\u88c5\u597d\u7684K8S\u670d\u52a1\u8fdb\u884c\u5feb\u901f\u6784\u5efa\uff0c\u8fd9\u91cc\u4e3a\u4e86\u5feb\u901f\u73a9\u73a9\uff0c\u9009\u62e9\u4e86\u5728Windows\u4e0b\u57fa\u4e8eDocker for Windows\u6765\u8fdb\u884c\u3002<\/p>\n\n\n\n<p><strong>\u4e8c\u3001\u5b89\u88c5\u6838\u5fc3\u6b65\u9aa4<\/strong><\/p>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<p><strong>2.1 \u524d\u7f6e\u6761\u4ef6<\/strong><\/p>\n\n\n\n<p>\u786e\u4fdd\u5f53\u524dWindows\u73af\u5883\u6709\u4ee5\u4e0b\u51e0\u4e2a\u5173\u952e\u70b9\uff1a<\/p>\n\n\n\n<ul><li>Windows 10 PRO\u4e13\u4e1a\u7248\u53ca\u4ee5\u4e0a<\/li><li>Hyper-V \u865a\u62df\u673a<\/li><li>Docker for Windows\uff0c\u8fd9\u91cc\u6f14\u793a\u7684\u662fDocker CE 18.06\u7248\u672c<\/li><\/ul>\n\n\n\n<p>\u4e3aDocker for Windows\u7684daemon\u914d\u7f6e\u955c\u50cf\u52a0\u901f\uff1a<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/92it.top\/wp-content\/uploads\/2023\/08\/\u56fe\u7247-68.png\" alt=\"\" class=\"wp-image-11748\" width=\"539\" height=\"345\" srcset=\"https:\/\/92it.top\/wp-content\/uploads\/2023\/08\/\u56fe\u7247-68.png 886w, https:\/\/92it.top\/wp-content\/uploads\/2023\/08\/\u56fe\u7247-68-300x192.png 300w, https:\/\/92it.top\/wp-content\/uploads\/2023\/08\/\u56fe\u7247-68-768x492.png 768w, https:\/\/92it.top\/wp-content\/uploads\/2023\/08\/\u56fe\u7247-68-830x532.png 830w, https:\/\/92it.top\/wp-content\/uploads\/2023\/08\/\u56fe\u7247-68-230x147.png 230w, https:\/\/92it.top\/wp-content\/uploads\/2023\/08\/\u56fe\u7247-68-350x224.png 350w, https:\/\/92it.top\/wp-content\/uploads\/2023\/08\/\u56fe\u7247-68-480x308.png 480w\" sizes=\"(max-width: 539px) 100vw, 539px\" \/><\/figure><\/div>\n\n\n\n<p><strong>2.2 \u4e0b\u8f7dK8S\u955c\u50cf<\/strong><\/p>\n\n\n\n<p>\u9996\u5148\uff0c\u4eceGit\u4e0a\u4e0b\u8f7dK8S\u6240\u9700\u7684docker\u955c\u50cf\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">git clone https:\/\/github.com\/AliyunContainerService\/k8s-for-docker-desktop\ncd k8s-for-docker-desktop<\/pre>\n\n\n\n<p>\u8fd9\u91cc\uff0c\u4e3a\u4e86\u5339\u914d18.06\u7248\u672c\uff08Docker CE\u7248\u672c\u53f7\u6216\u8005\u4f60\u7684Docker for Windows\u7684\u7248\u672c\u53f7\uff09\uff0c\u5207\u6362\u5230\u8be5\u9879\u76ee\u768418.09\u5206\u652f\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">git checkout 18.09<\/pre>\n\n\n\n<p><em><strong>Note\uff1a<\/strong><\/em>\u5173\u4e8e\u54ea\u4e2a\u7248\u672c\u5207\u6362\u5230\u54ea\u4e2a\u5206\u652f\uff0c\u8bf7\u53c2\u9605<a href=\"https:\/\/github.com\/AliyunContainerService\/k8s-for-docker-desktop\/tree\/18.09\" target=\"_blank\" rel=\"noreferrer noopener\">\u8fd9\u91cc<\/a>\u3002<\/p>\n\n\n\n<p>\u7136\u540e\uff0c\u5f00\u59cb\u52a0\u8f7d\u955c\u50cf\uff0c\u8fd9\u91cc\u901a\u8fc7PowerShell\u7684\u65b9\u5f0f\u52a0\u8f7d\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\"> .\\load_images.ps1<\/pre>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/92it.top\/wp-content\/uploads\/2023\/08\/\u56fe\u7247-69-1024x421.png\" alt=\"\" class=\"wp-image-11749\" width=\"583\" height=\"239\" srcset=\"https:\/\/92it.top\/wp-content\/uploads\/2023\/08\/\u56fe\u7247-69-1024x421.png 1024w, https:\/\/92it.top\/wp-content\/uploads\/2023\/08\/\u56fe\u7247-69-300x123.png 300w, https:\/\/92it.top\/wp-content\/uploads\/2023\/08\/\u56fe\u7247-69-768x316.png 768w, https:\/\/92it.top\/wp-content\/uploads\/2023\/08\/\u56fe\u7247-69-830x342.png 830w, https:\/\/92it.top\/wp-content\/uploads\/2023\/08\/\u56fe\u7247-69-230x95.png 230w, https:\/\/92it.top\/wp-content\/uploads\/2023\/08\/\u56fe\u7247-69-350x144.png 350w, https:\/\/92it.top\/wp-content\/uploads\/2023\/08\/\u56fe\u7247-69-480x198.png 480w, https:\/\/92it.top\/wp-content\/uploads\/2023\/08\/\u56fe\u7247-69.png 1040w\" sizes=\"(max-width: 583px) 100vw, 583px\" \/><\/figure><\/div>\n\n\n\n<p>\u5f53\u7136\uff0c\u4e5f\u53ef\u4ee5\u901a\u8fc7Bash Shell\u7684\u65b9\u5f0f\u52a0\u8f7d\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">.\/load_images.sh<\/pre>\n\n\n\n<p>\u6700\u540e\uff0c\u5728Docker for Windows\u4e2d\u542f\u7528K8S\uff1a<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/92it.top\/wp-content\/uploads\/2023\/08\/\u56fe\u7247-70-1024x714.png\" alt=\"\" class=\"wp-image-11750\" width=\"565\" height=\"393\" srcset=\"https:\/\/92it.top\/wp-content\/uploads\/2023\/08\/\u56fe\u7247-70-1024x714.png 1024w, https:\/\/92it.top\/wp-content\/uploads\/2023\/08\/\u56fe\u7247-70-300x209.png 300w, https:\/\/92it.top\/wp-content\/uploads\/2023\/08\/\u56fe\u7247-70-768x536.png 768w, https:\/\/92it.top\/wp-content\/uploads\/2023\/08\/\u56fe\u7247-70-830x579.png 830w, https:\/\/92it.top\/wp-content\/uploads\/2023\/08\/\u56fe\u7247-70-230x160.png 230w, https:\/\/92it.top\/wp-content\/uploads\/2023\/08\/\u56fe\u7247-70-350x244.png 350w, https:\/\/92it.top\/wp-content\/uploads\/2023\/08\/\u56fe\u7247-70-480x335.png 480w, https:\/\/92it.top\/wp-content\/uploads\/2023\/08\/\u56fe\u7247-70.png 1204w\" sizes=\"(max-width: 565px) 100vw, 565px\" \/><\/figure><\/div>\n\n\n\n<p><strong>2.3 \u5feb\u901f\u914d\u7f6eK8S<\/strong><\/p>\n\n\n\n<p>\uff08\u53ef\u9009\uff09\u5207\u6362\u8fd0\u884c\u4e0a\u4e0b\u6587\u81f3docker-for-desktop<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">kubectl config use-context docker-for-desktop<\/pre>\n\n\n\n<p>\u6838\u5fc3\uff1a\u9a8c\u8bc1Kubernetes\u96c6\u7fa4\u72b6\u6001<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">kubectl cluster-info\nkubectl get nodes<\/pre>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/92it.top\/wp-content\/uploads\/2023\/08\/\u56fe\u7247-71-1024x214.png\" alt=\"\" class=\"wp-image-11751\" width=\"616\" height=\"128\" srcset=\"https:\/\/92it.top\/wp-content\/uploads\/2023\/08\/\u56fe\u7247-71-1024x214.png 1024w, https:\/\/92it.top\/wp-content\/uploads\/2023\/08\/\u56fe\u7247-71-300x63.png 300w, https:\/\/92it.top\/wp-content\/uploads\/2023\/08\/\u56fe\u7247-71-768x161.png 768w, https:\/\/92it.top\/wp-content\/uploads\/2023\/08\/\u56fe\u7247-71-830x174.png 830w, https:\/\/92it.top\/wp-content\/uploads\/2023\/08\/\u56fe\u7247-71-230x48.png 230w, https:\/\/92it.top\/wp-content\/uploads\/2023\/08\/\u56fe\u7247-71-350x73.png 350w, https:\/\/92it.top\/wp-content\/uploads\/2023\/08\/\u56fe\u7247-71-480x100.png 480w, https:\/\/92it.top\/wp-content\/uploads\/2023\/08\/\u56fe\u7247-71.png 1062w\" sizes=\"(max-width: 616px) 100vw, 616px\" \/><\/figure><\/div>\n\n\n\n<p><em><strong>Note\uff1a<\/strong><\/em>\u6267\u884c\u4e86kubectl cluster-info\u4e4b\u540e\u5c31\u53ef\u4ee5\u770b\u5230\u5df2\u7ecf\u542f\u52a8\u4e86\u4e00\u4e2amaster\u8282\u70b9\uff0c\u4e5f\u5c31\u662fsingle-node\u6a21\u5f0f\u542f\u7528\u4e86\u3002<\/p>\n\n\n\n<p>\u9762\u677f\uff1a\u90e8\u7f72Kubernetes Dashboard<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">kubectl create -f kubernetes-dashboard.yaml<\/pre>\n\n\n\n<p>\u8bbf\u95ee\uff1a\u5f00\u542fAPI Server\u8bbf\u95ee\u4ee3\u7406\uff0c\u5411\u5916\u90e8\u63d0\u4f9b\u9762\u677f\u8bbf\u95ee<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">kubectl proxy<\/pre>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/92it.top\/wp-content\/uploads\/2023\/08\/\u56fe\u7247-72-1024x214.png\" alt=\"\" class=\"wp-image-11752\" width=\"529\" height=\"110\" srcset=\"https:\/\/92it.top\/wp-content\/uploads\/2023\/08\/\u56fe\u7247-72-1024x214.png 1024w, https:\/\/92it.top\/wp-content\/uploads\/2023\/08\/\u56fe\u7247-72-300x63.png 300w, https:\/\/92it.top\/wp-content\/uploads\/2023\/08\/\u56fe\u7247-72-768x161.png 768w, https:\/\/92it.top\/wp-content\/uploads\/2023\/08\/\u56fe\u7247-72-830x174.png 830w, https:\/\/92it.top\/wp-content\/uploads\/2023\/08\/\u56fe\u7247-72-230x48.png 230w, https:\/\/92it.top\/wp-content\/uploads\/2023\/08\/\u56fe\u7247-72-350x73.png 350w, https:\/\/92it.top\/wp-content\/uploads\/2023\/08\/\u56fe\u7247-72-480x100.png 480w, https:\/\/92it.top\/wp-content\/uploads\/2023\/08\/\u56fe\u7247-72.png 1032w\" sizes=\"(max-width: 529px) 100vw, 529px\" \/><\/figure><\/div>\n\n\n\n<p>\u7136\u540e\u5c31\u53ef\u4ee5\u901a\u8fc7\u4e0b\u9762\u8fd9\u4e2aURL\u8bbf\u95eeKubernetes\u7684Dashboard\uff1a<a href=\"http:\/\/localhost:8001\/api\/v1\/namespaces\/kube-system\/services\/https:kubernetes-dashboard:\/proxy\/#!\/overview?namespace=default\">http:\/\/localhost:8001\/api\/v1\/namespaces\/kube-system\/services\/https:kubernetes-dashboard:\/proxy\/#!\/overview?namespace=default<\/a><\/p>\n\n\n\n<p>\u4f46\u662f\uff0c\u4f60\u4f1a\u53d1\u73b0\u51fa\u73b0\u7684\u5982\u4e0b\u8fd9\u4e2a\u9875\u9762\uff0c\u4f60\u53ef\u4ee5\u9009\u62e9\u8df3\u8fc7 \u4e5f\u53ef\u4ee5\u9009\u62e9\u4e00\u4e2akubeconfig\u3002<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/92it.top\/wp-content\/uploads\/2023\/08\/\u56fe\u7247-73-1024x686.png\" alt=\"\" class=\"wp-image-11753\" width=\"439\" height=\"293\" srcset=\"https:\/\/92it.top\/wp-content\/uploads\/2023\/08\/\u56fe\u7247-73-1024x686.png 1024w, https:\/\/92it.top\/wp-content\/uploads\/2023\/08\/\u56fe\u7247-73-300x201.png 300w, https:\/\/92it.top\/wp-content\/uploads\/2023\/08\/\u56fe\u7247-73-768x514.png 768w, https:\/\/92it.top\/wp-content\/uploads\/2023\/08\/\u56fe\u7247-73-830x556.png 830w, https:\/\/92it.top\/wp-content\/uploads\/2023\/08\/\u56fe\u7247-73-230x154.png 230w, https:\/\/92it.top\/wp-content\/uploads\/2023\/08\/\u56fe\u7247-73-350x234.png 350w, https:\/\/92it.top\/wp-content\/uploads\/2023\/08\/\u56fe\u7247-73-480x322.png 480w, https:\/\/92it.top\/wp-content\/uploads\/2023\/08\/\u56fe\u7247-73.png 1054w\" sizes=\"(max-width: 439px) 100vw, 439px\" \/><\/figure><\/div>\n\n\n\n<p>\u5176\u4e2d\uff0ckubeconfig\u7684\u4f4d\u7f6e\uff08\u8fd9\u91cc\u662fWindows\u7cfb\u7edf\uff09\u4f4d\u4e8e\uff1a%UserProfile%.kube\\config\u3002\u5f53\u7136\uff0c\u8fd9\u91cc\u4e5f\u53ef\u4ee5\u9009\u62e9\u8df3\u8fc7\uff0c\u4e0d\u7528\u7ba1\u8fd9\u4e2aconfig\u3002\u5982\u679c\uff0c\u78b0\u5230\u63d0\u793a\u201cnot enough data to create auth\u201d\uff0c\u9700\u8981\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4\u6765\u8bbe\u7f6e\u4e00\u4e0bkubeconfig\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">$TOKEN=((kubectl -n kube-system describe secret default | Select-String \"token:\") -split \" +\")[1]\nkubectl config set-credentials docker-for-desktop --token=\"${TOKEN}\"<\/pre>\n\n\n\n<p>\u6700\u540e\uff0c\u53ef\u4ee5\u6b63\u5e38\u767b\u5f55\u540e\u770b\u5230Dashboard\u7684\u5168\u8c8c\u4e86\uff1a<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/92it.top\/wp-content\/uploads\/2023\/08\/\u56fe\u7247-74-1024x485.png\" alt=\"\" class=\"wp-image-11754\" width=\"496\" height=\"234\" srcset=\"https:\/\/92it.top\/wp-content\/uploads\/2023\/08\/\u56fe\u7247-74-1024x485.png 1024w, https:\/\/92it.top\/wp-content\/uploads\/2023\/08\/\u56fe\u7247-74-300x142.png 300w, https:\/\/92it.top\/wp-content\/uploads\/2023\/08\/\u56fe\u7247-74-768x364.png 768w, https:\/\/92it.top\/wp-content\/uploads\/2023\/08\/\u56fe\u7247-74-830x393.png 830w, https:\/\/92it.top\/wp-content\/uploads\/2023\/08\/\u56fe\u7247-74-230x109.png 230w, https:\/\/92it.top\/wp-content\/uploads\/2023\/08\/\u56fe\u7247-74-350x166.png 350w, https:\/\/92it.top\/wp-content\/uploads\/2023\/08\/\u56fe\u7247-74-480x227.png 480w, https:\/\/92it.top\/wp-content\/uploads\/2023\/08\/\u56fe\u7247-74.png 1052w\" sizes=\"(max-width: 496px) 100vw, 496px\" \/><\/figure><\/div>\n\n\n\n<p><em><strong>Note\uff1a<\/strong><\/em>\u5982\u679c\u60f3\u901a\u8fc7\u5176\u5b83\u4e3b\u673a\u8bbf\u95ee\u5e76\u4e14\u8ba9API Server\u80fd\u591f\u63a5\u53d7\u6240\u6709\u4e3b\u673a\u7684\u8bf7\u6c42\uff0c\u8bf7\u901a\u8fc7\u4ee5\u4e0b\u547d\u4ee4\u542f\u52a8API Server\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">kubectl proxy --address='0.0.0.0'  --accept-hosts='^*$'<\/pre>\n\n\n\n<p><strong>\u4e09\u3001\u5c0f\u7ed3<\/strong><\/p>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<p>\u672c\u7bc7\u7b80\u5355\u5730\u8bb0\u5f55\u4e00\u4e0b\u5982\u4f55\u5728Windows\u73af\u5883\u4e0b\u57fa\u4e8eDocker for Windows\u6765\u642d\u5efa\u4e00\u4e2a\u5355\u8282\u70b9\u7684K8S\u73af\u5883\uff0c\u4e0b\u4e00\u7bc7\u4f1a\u5c06ASP.NET Core\u4ee5Docker\u65b9\u5f0f\u52a0\u5165\u5230K8S\u96c6\u7fa4\u4e2d\u6258\u7ba1\uff0c\u64cd\u4f5cK8S\u6765\u7ba1\u7406Docker\u5b9e\u4f8b\u6765\u6709\u4e00\u4e2a\u611f\u6027\u8ba4\u8bc6\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u8f6c\u8f7d\uff1ahttps:\/\/www.cnblogs.com\/edisonchou\/p\/aspnet_core_on_ [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[29],"tags":[],"_links":{"self":[{"href":"https:\/\/92it.top\/index.php?rest_route=\/wp\/v2\/posts\/11745"}],"collection":[{"href":"https:\/\/92it.top\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/92it.top\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/92it.top\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/92it.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=11745"}],"version-history":[{"count":4,"href":"https:\/\/92it.top\/index.php?rest_route=\/wp\/v2\/posts\/11745\/revisions"}],"predecessor-version":[{"id":12038,"href":"https:\/\/92it.top\/index.php?rest_route=\/wp\/v2\/posts\/11745\/revisions\/12038"}],"wp:attachment":[{"href":"https:\/\/92it.top\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=11745"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/92it.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=11745"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/92it.top\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=11745"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}