{"id":19,"date":"2022-03-16T01:34:54","date_gmt":"2022-03-15T17:34:54","guid":{"rendered":"https:\/\/maoyulong.club:30443\/?p=19"},"modified":"2022-03-16T01:42:28","modified_gmt":"2022-03-15T17:42:28","slug":"kubernetes-%e7%a6%bb%e7%ba%bf%e9%83%a8%e7%bd%b2%e6%9c%8d%e5%8a%a1%e6%8c%87%e5%8d%97","status":"publish","type":"post","link":"https:\/\/blog.maoyulong.club\/?p=19","title":{"rendered":"kubernetes \u79bb\u7ebf\u90e8\u7f72\u670d\u52a1\u6307\u5357"},"content":{"rendered":"<p>\u5f53\u6211\u4eec\u7684\u670d\u52a1\u5668\u5904\u5728\u4e00\u4e2a\u7eaf\u5185\u7f51\u73af\u5883\u7684\u65f6\u5019\uff0c\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7sealos\u6765\u5b9e\u73b0\u79bb\u7ebf\u90e8\u7f72k8s \u4f46\u662f\u4e00\u4e9b\u670d\u52a1\u7684\u955c\u50cf\u662f\u62c9\u4e0d\u4e0b\u6765\u7684\uff0c\u7279\u522b\u7684\uff0c\u524d\u671f\u6ca1\u6709\u90e8\u7f72harbor\u548c\u90e8\u7f72harbor\u7684\u65f6\u5019\uff0c\u6211\u4eec\u53ef\u4ee5\u5c06\u955c\u50cf\u63d0\u524d\u6253\u5305\u5b89\u88c5\uff0c\u751a\u81f3\u4e8e\u662f\u76f4\u63a5\u90e8\u7f72\u67e5\u770b\u7f3a\u7701\u7684\u955c\u50cf\u518d\u4e0a\u4f20<\/p>\n<p>\u901a\u8fc7\u672c\u5730\u8fdb\u884c\u4e00\u4e9b\u6253\u5305\uff0c\u4ee5\u90e8\u7f72kubesphere \u4e3a\u4f8b\uff0c\u8fd9\u662f\u4ed6\u7684\u6700\u5c0f\u5b89\u88c5\u6559\u7a0b\uff1a<\/p>\n<p><a href=\"https:\/\/kubesphere.com.cn\/docs\/quick-start\/minimal-kubesphere-on-k8s\/\" target=\"_blank\"  rel=\"nofollow\" >\u5728 Kubernetes \u4e0a\u6700\u5c0f\u5316\u5b89\u88c5 KubeSphere<\/a><\/p>\n<p>\u901a\u8fc7yaml\u6587\u4ef6\u6211\u4eec\u77e5\u9053\uff0ckubesphere\/ks-installer\u662f\u5fc5\u8981\u7684\uff0c\u5f53\u7136installer\u53ef\u80fd\u4f1a\u4e0b\u4e00\u4e9b\u5d3d\uff0c\u6211\u4eec\u53ef\u4ee5\u4e4b\u540e\u518d\u6765\u4e0a\u4f20<\/p>\n<pre><code class=\"language-shell\" lang=\"shell\">docker pull kubesphere\/ks-installer:v3.2.1\ndocker save -o 1.tar kubesphere\/ks-installer:v3.2.1\n<\/code><\/pre>\n<p>\u8fd9\u662f\u6211\u4eec\u7684\u7b2c\u4e00\u6b65\uff0c\u7b80\u5355\u7684\u7528shell\u811a\u672c\u6539\u5199\u4e3a\uff1a<\/p>\n<pre><code class=\"language-shell\" lang=\"shell\">rm -rf .\/*.tar\ninum=1\nfor i in $*\ndo\n    echo start pull\n    for j in {1..5}\n    do\n        #docker pull kubesphere\/ks-installer:v3.2.1\n        docker pull $i\n        if [ \"$?\" = \"0\" ]\n        then\n            break\n        fi\n        echo try $j\n    done\n    docker save -o $inum.tar $i\n    if [ \"$?\" != \"0\" ]\n    then\n        echo falseWrite\n        exit\n    fi\n    docker rmi $i\n    ((inum++))\ndone\nexec pull.sh\n<\/code><\/pre>\n<p>\u81f3\u4e8e\u4e3a\u4ec0\u4e48\u6dfb\u52a0\u5931\u8d25\u540e\u7684\u91cd\u8bd5\uff0c\u5728\u6ca1\u6709\u66f4\u6362\u56fd\u5185\u6e90\u7684\u60c5\u51b5\u4e0b\u6709\u4e0d\u9519\u7684\u6548\u679c<\/p>\n<p>\u540c\u65f6\u5524\u51fapull\u7684\u811a\u672c<\/p>\n<p>\u901a\u8fc7scp\u5c06tar\u5305\u63a8\u9001\u5230\u670d\u52a1\u7aef<\/p>\n<p>\u90a3\u4e48\u63a8\u9001\u5230\u670d\u52a1\u5668\u7aef\u4e4b\u540e\u6211\u4eec\u9700\u8981\u505a\u4e9b\u4ec0\u4e48<\/p>\n<p>ctr image import\u53ef\u4ee5\u5bfc\u5165\u955c\u50cf\uff0c\u4f46\u8fd9\u91cc\u9700\u8981\u5f15\u5165\u4e00\u4e2actr\u72ec\u6709\u7684\u7279\u6027\uff0c\u540d\u79f0\u7a7a\u95f4<\/p>\n<p>\u8fd9\u4e2a\u540d\u79f0\u7a7a\u95f4\u4e0d\u662fk8s\u7684\u90a3\u4e2a\u6982\u5ff5\uff0c\u4f46\u662fk8s\u786e\u5b9e\u6ca1\u6709\u7528\u5b83\u9ed8\u8ba4\u7684\u540d\u79f0\u7a7a\u95f4<\/p>\n<p>\u901a\u8fc7<\/p>\n<pre><code class=\"language-shell\" lang=\"shell\">ctr ns ls\n<\/code><\/pre>\n<p>\u53ef\u4ee5\u770b\u5230 k8s \u7528\u7684k8s.io<\/p>\n<p>\u90a3\u4e48\u8fd9\u4e2ashell \u7684\u540e\u534a\u6bb5\u4e5f\u7b97\u5b8c\u6210\u4e86\uff1a<\/p>\n<pre><code class=\"language-shell\" lang=\"shell\">scp *.tar name@host:~\/image\nssh name@host &lt;&lt; eeooff\ncd image\nctr -n=k8s.io image import *.tar\nrm -rf *\nexit\neeooff\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u5f53\u6211\u4eec\u7684\u670d\u52a1\u5668\u5904\u5728\u4e00\u4e2a\u7eaf\u5185\u7f51\u73af\u5883\u7684\u65f6\u5019\uff0c\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7sealos\u6765\u5b9e\u73b0\u79bb\u7ebf\u90e8\u7f72k8s \u4f46\u662f\u4e00\u4e9b\u670d\u52a1\u7684\u955c\u50cf\u662f\u62c9\u4e0d\u4e0b\u6765\u7684\uff0c\u7279\u522b\u7684\uff0c\u524d\u671f &#8230;<\/p>","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":["post-19","post","type-post","status-publish","format-standard","hentry","category-4"],"_links":{"self":[{"href":"https:\/\/blog.maoyulong.club\/index.php?rest_route=\/wp\/v2\/posts\/19","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.maoyulong.club\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.maoyulong.club\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.maoyulong.club\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.maoyulong.club\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=19"}],"version-history":[{"count":1,"href":"https:\/\/blog.maoyulong.club\/index.php?rest_route=\/wp\/v2\/posts\/19\/revisions"}],"predecessor-version":[{"id":20,"href":"https:\/\/blog.maoyulong.club\/index.php?rest_route=\/wp\/v2\/posts\/19\/revisions\/20"}],"wp:attachment":[{"href":"https:\/\/blog.maoyulong.club\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=19"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.maoyulong.club\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=19"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.maoyulong.club\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=19"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}