{"id":227418,"date":"2023-12-21T05:59:18","date_gmt":"2023-12-20T21:59:18","guid":{"rendered":"https:\/\/www.idc.net\/help\/227418\/"},"modified":"2023-12-21T05:59:18","modified_gmt":"2023-12-20T21:59:18","slug":"%e3%80%90%e4%ba%91%e5%8e%9f%e7%94%9f%e3%80%91helm-%e5%b8%b8%e7%94%a8%e5%91%bd%e4%bb%a4%ef%bc%88chart-%e5%ae%89%e8%a3%85%e3%80%81%e5%8d%87%e7%ba%a7%e3%80%81%e5%9b%9e%e6%bb%9a%e3%80%81%e5%8d%b8%e8%bd%bd","status":"publish","type":"post","link":"https:\/\/idc.net\/help\/227418\/","title":{"rendered":"\u3010\u4e91\u539f\u751f\u3011Helm \u5e38\u7528\u547d\u4ee4\uff08chart \u5b89\u88c5\u3001\u5347\u7ea7\u3001\u56de\u6eda\u3001\u5378\u8f7d\u7b49\u64cd\u4f5c\uff09"},"content":{"rendered":"<h1>\u3010\u4e91\u539f\u751f\u3011Helm \u5e38\u7528\u547d\u4ee4\uff08chart \u5b89\u88c5\u3001\u5347\u7ea7\u3001\u56de\u6eda\u3001\u5378\u8f7d\u7b49\u64cd\u4f5c\uff09<\/h1>\n<p><span>\u4f5c\u8005\uff1aliugp<\/span> 2023-02-07 07:56:05<br \/>\n<i><\/i><br \/>\n<span>\u4e91\u8ba1\u7b97<\/span> \u8981\u91cd\u5199chart\u4e2d\u7684\u503c\uff0c\u4f7f\u7528--values\u53c2\u6570\u4f20\u9012\u4e00\u4e2a\u6587\u4ef6\u6216\u8005\u4f7f\u7528--set\u53c2\u6570\u5728\u547d\u4ee4\u884c\u4f20\u9012\u914d\u7f6e\uff0c\u5f3a\u5236\u4f7f\u7528\u5b57\u7b26\u4e32\u8981\u7528--set-string\u3002\u5f53\u503c\u672c\u8eab\u5bf9\u4e8e\u547d\u4ee4\u884c\u592a\u957f\u6216\u8005\u662f\u52a8\u6001\u751f\u6210\u7684\u65f6\u5019\uff0c\u53ef\u4ee5\u4f7f\u7528--set-file\u8bbe\u7f6e\u72ec\u7acb\u7684\u503c\u3002 <\/p>\n<h2>\u4e00\u3001\u6982\u8ff0<\/h2>\n<p>Helm \u9488\u5bf9Kubernetes\u7684Helm\u5305\u7ba1\u7406\u5668\u3002Helm\u7684\u4e00\u822c\u64cd\u4f5c\uff1a<\/p>\n<ul>\n<li>helm search: \u2003\u2003\u641c\u7d22chart<\/li>\n<li>helm pull: \u2003\u2003\u2003\u4e0b\u8f7dchart\u5230\u672c\u5730\u76ee\u5f55\u67e5\u770b<\/li>\n<li>helm install: \u2003\u2003\u4e0a\u4f20chart\u5230Kubernetes<\/li>\n<li>helm list: \u2003\u2003\u2003\u2002\u5217\u51fa\u5df2\u53d1\u5e03\u7684chart<\/li>\n<\/ul>\n<pre># \u67e5\u770b\u5e2e\u52a9<br>helm <span style=\"color: #6a737d\">--help<\/span><\/pre>\n<p style=\"text-align: center\">\n<p style=\"text-align:center\">\n<\/p>\n<p>\u5b98\u65b9\u6587\u6863\uff1ahttps:\/\/helm.sh\/zh\/docs\/helm\/helm\/<\/p>\n<p>Helm \u67b6\u6784\u548c\u57fa\u7840\u8bed\u6cd5\u8bb2\u89e3\u53ef\u4ee5\u53c2\u8003\u6211\u8fd9\u7bc7\u6587\u7ae0\uff1a\u3010\u4e91\u539f\u751f\u3011Helm \u67b6\u6784\u548c\u57fa\u7840\u8bed\u6cd5\u8be6\u89e3<\/p>\n<h2>\u4e8c\u3001Helm \u4ed3\u5e93\uff08helm repo\uff09<\/h2>\n<blockquote style=\"margin-top: 5px;margin-bottom: 5px;padding-left: 1em;margin-left: 0px\">\n<p>\u6dfb\u52a0\u3001\u5217\u51fa\u3001\u5220\u9664\u3001\u66f4\u65b0\u548c\u7d22\u5f15chart\u4ed3\u5e93\u3002<\/p>\n<\/blockquote>\n<h3>1\uff09\u6dfb\u52a0chart\u4ed3\u5e93<\/h3>\n<pre>helm repo add bitnami https<span>:<\/span><span style=\"color: #d73a49\">\/\/<\/span>charts<span style=\"color: #005cc5\">.bitnami<\/span><span style=\"color: #005cc5\">.com<\/span><span style=\"color: #d73a49\">\/<\/span>bitnami<\/pre>\n<h3>2\uff09\u5217\u51fa\u5df2\u6dfb\u52a0\u7684\u4ed3\u5e93<\/h3>\n<pre>helm repo list<\/pre>\n<h3>3\uff09\u4ecechart\u4ed3\u5e93\u4e2d\u66f4\u65b0\u672c\u5730\u53ef\u7528chart\u7684\u4fe1\u606f<\/h3>\n<pre>helm repo <span style=\"color: #d73a49\">update<\/span> bitnami<\/pre>\n<h3>4\uff09\u5220\u9664\u4e00\u4e2a\u6216\u591a\u4e2a\u4ed3\u5e93<\/h3>\n<pre>helm repo remove bitnami<\/pre>\n<h2>\u4e09\u3001\u521b\u5efachart\uff08helm create\uff09<\/h2>\n<p>\u4f7f\u7528\u7ed9\u5b9a\u540d\u79f0\u521b\u5efa\u65b0\u7684chart\uff0c\u8be5\u547d\u4ee4\u521b\u5efachart\u76ee\u5f55\u548cchart\u7528\u5230\u7684\u516c\u5171\u6587\u4ef6\u76ee\u5f55\u3002<\/p>\n<p>\u6bd4\u5982'helm create foo'\u4f1a\u521b\u5efa\u4e00\u4e2a\u76ee\u5f55\u7ed3\u6784\u770b\u8d77\u6765\u50cf\u8fd9\u6837\uff1a<\/p>\n<pre>$ helm <span style=\"color: #d73a49\">create<\/span> foo<br>foo<span style=\"color: #d73a49\">\/<\/span><br>\u251c\u2500\u2500 <span style=\"color: #005cc5\">.helmignore<\/span>   # Contains patterns to ignore when packaging Helm charts.<br>\u251c\u2500\u2500 Chart<span style=\"color: #005cc5\">.yaml<\/span>    # Information about your chart<br>\u251c\u2500\u2500 <span style=\"color: #d73a49\">values<\/span><span style=\"color: #005cc5\">.yaml<\/span>   # The default <span style=\"color: #d73a49\">values<\/span> for your templates<br>\u251c\u2500\u2500 charts<span style=\"color: #d73a49\">\/<\/span>       # Charts that this chart depends <span style=\"color: #d73a49\">on<\/span><br>\u2514\u2500\u2500 templates<span style=\"color: #d73a49\">\/<\/span>    # The template files<br>    \u2514\u2500\u2500 tests<span style=\"color: #d73a49\">\/<\/span>    # The test files<\/pre>\n<h2>\u56db\u3001chart \u5305\u5b89\u88c5\uff08helm install\uff09<\/h2>\n<p>\u8be5\u547d\u4ee4\u7528\u4e8e\u5b89\u88c5chart\u5305\u3002\u5b89\u88c5\u53c2\u6570\u5fc5\u987b\u662fchart\u7684\u5f15\u7528\uff0c\u4e00\u4e2a\u6253\u5305\u540e\u7684chart\u8def\u5f84\uff0c\u672a\u6253\u5305\u7684chart\u76ee\u5f55\u6216\u8005\u662f\u4e00\u4e2aURL\u3002<\/p>\n<p>\u8981\u91cd\u5199chart\u4e2d\u7684\u503c\uff0c\u4f7f\u7528--values\u53c2\u6570\u4f20\u9012\u4e00\u4e2a\u6587\u4ef6\u6216\u8005\u4f7f\u7528--set\u53c2\u6570\u5728\u547d\u4ee4\u884c\u4f20\u9012\u914d\u7f6e\uff0c\u5f3a\u5236\u4f7f\u7528\u5b57\u7b26\u4e32\u8981\u7528--set-string\u3002\u5f53\u503c\u672c\u8eab\u5bf9\u4e8e\u547d\u4ee4\u884c\u592a\u957f\u6216\u8005\u662f\u52a8\u6001\u751f\u6210\u7684\u65f6\u5019\uff0c\u53ef\u4ee5\u4f7f\u7528--set-file\u8bbe\u7f6e\u72ec\u7acb\u7684\u503c\u3002<\/p>\n<pre>helm install <span style=\"color: #d73a49\">-<\/span>f myvalues<span style=\"color: #005cc5\">.yaml<\/span> myredis .<span style=\"color: #d73a49\">\/<\/span>redis<br><br>helm install <span style=\"color: #6a737d\">--set name=prod myredis .\/redis<\/span><br><br>helm install <span style=\"color: #6a737d\">--set-string long_int=1234567890 myredis .\/redis<\/span><br><br>helm install <span style=\"color: #6a737d\">--set-file my_script=dothings.sh myredis .\/redis<\/span><\/pre>\n<h2>\u4e94\u3001\u7ba1\u7406chart\u4f9d\u8d56\uff08helm dependency\uff09<\/h2>\n<ul>\n<li>Helm chart\u5c06\u4f9d\u8d56\u5b58\u50a8\u5728'charts\/'\u3002\u5bf9\u4e8echart\u5f00\u53d1\u8005\uff0c\u7ba1\u7406\u4f9d\u8d56\u6bd4\u58f0\u660e\u4e86\u6240\u6709\u4f9d\u8d56\u7684'Chart.yaml'\u6587\u4ef6\u66f4\u5bb9\u6613\u3002<\/li>\n<li>\u4f9d\u8d56\u547d\u4ee4\u5bf9\u8be5\u6587\u4ef6\u8fdb\u884c\u64cd\u4f5c\uff0c\u4f7f\u5f97\u5b58\u50a8\u5728'charts\/'\u76ee\u5f55\u7684\u9700\u8981\u7684\u4f9d\u8d56\u548c\u5b9e\u9645\u4f9d\u8d56\u4e4b\u95f4\u540c\u6b65\u53d8\u5f97\u5f88\u5bb9\u6613\u3002<\/li>\n<\/ul>\n<p>\u6bd4\u5982Chart.yaml\u58f0\u660e\u4e86\u4e24\u4e2a\u4f9d\u8d56\uff1a<\/p>\n<pre># Chart<span style=\"color: #005cc5\">.yaml<\/span><br>dependencies<span>:<\/span><br><span style=\"color: #d73a49\">-<\/span> name<span>:<\/span> nginx<br>    version<span>:<\/span> <span style=\"color: #690\">\"1.2.3\"<\/span><br>    repository<span>:<\/span> <span style=\"color: #690\">\"https:\/\/example.com\/charts\"<\/span><br><span style=\"color: #d73a49\">-<\/span> name<span>:<\/span> memcached<br>    version<span>:<\/span> <span style=\"color: #690\">\"3.2.1\"<\/span><br>    repository<span>:<\/span> <span style=\"color: #690\">\"https:\/\/another.example.com\/charts\"<\/span><\/pre>\n<ul>\n<li>name&nbsp;\u662fchart\u540d\u79f0\uff0c\u5fc5\u987b\u5339\u914dChart.yaml\u6587\u4ef6\u4e2d\u540d\u79f0\u3002<\/li>\n<li>version&nbsp;\u5b57\u6bb5\u5e94\u8be5\u5305\u542b\u4e00\u4e2a\u8bed\u4e49\u5316\u7684\u7248\u672c\u6216\u7248\u672c\u8303\u56f4\u3002<\/li>\n<\/ul>\n<p>\u4ece2.2.0\u5f00\u59cb\uff0c\u4ed3\u5e93\u53ef\u4ee5\u88ab\u5b9a\u4e49\u4e3a\u672c\u5730\u5b58\u50a8\u7684\u4f9d\u8d56chart\u7684\u76ee\u5f55\u8def\u5f84\u3002\u8def\u5f84\u5e94\u8be5\u4ee5\"file:\/\/\"\u524d\u7f00\u5f00\u5934\uff0c\u6bd4\u5982\uff1a<\/p>\n<pre># Chart<span style=\"color: #005cc5\">.yaml<\/span><br>dependencies<span>:<\/span><br><span style=\"color: #d73a49\">-<\/span> name<span>:<\/span> nginx<br>    version<span>:<\/span> <span style=\"color: #690\">\"1.2.3\"<\/span><br>    repository<span>:<\/span> <span style=\"color: #690\">\"file:\/\/..\/dependency_chart\/nginx\"<\/span><\/pre>\n<h3>1\uff09\u5217\u4e3e\u6307\u5b9achart\u7684\u4f9d\u8d56<\/h3>\n<\/p>\n<pre># helm dependency list CHART<br>helm dependency list wordpress<\/pre>\n<\/p>\n<h3>2\uff09\u4f9d\u8d56\u5347\u7ea7<\/h3>\n<p>\u57fa\u4e8eChart.yaml\u5185\u5bb9\u5347\u7ea7charts\/<\/p>\n<pre># helm dependency <span style=\"color: #d73a49\">update<\/span> CHART <span style=\"color: #997\">[<\/span>flags<span style=\"color: #997\">]<\/span><br>helm dependency <span style=\"color: #d73a49\">update<\/span> wordpress<\/pre>\n<h2>\u516d\u3001Helm \u5217\u8868\uff08helm list\uff09<\/h2>\n<ul>\n<li>\u5217\u4e3e\u53d1\u5e03\u7248\u672c\uff0c\u8be5\u547d\u4ee4\u4f1a\u5217\u4e3e\u51fa\u6307\u5b9a\u547d\u540d\u7a7a\u95f4\u7684\u6240\u6709\u53d1\u5e03\u7248\u672c\uff0c(\u5982\u679c\u6ca1\u6709\u6307\u5b9a\u547d\u540d\u7a7a\u95f4\uff0c\u4f1a\u4f7f\u7528\u5f53\u524d\u547d\u540d\u7a7a\u95f4)\u3002<\/li>\n<li>\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u53ea\u4f1a\u5217\u4e3e\u51fa\u90e8\u7f72\u7684\u6216\u8005\u5931\u8d25\u7684\u53d1\u5e03\uff0c\u50cf--uninstalled\u6216\u8005--all\u4f1a\u4fee\u6539\u9ed8\u8ba4\u884c\u4e3a\u3002\u8fd9\u4e9b\u53c2\u6570\u53ef\u4ee5\u7ec4\u5408\u4f7f\u7528\uff1a--uninstalled --failed\u3002<\/li>\n<li>\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u6700\u591a\u8fd4\u56de256\u9879\uff0c\u4f7f\u7528--max\u9650\u5236\u6570\u91cf\uff0c--max\u8bbe\u7f6e\u4e3a0\u4e0d\u4f1a\u8fd4\u56de\u6240\u6709\u7ed3\u679c\uff0c\u800c\u662f\u8fd4\u56de\u670d\u52a1\u5668\u9ed8\u8ba4\u503c\uff0c\u53ef\u80fd\u8981\u6bd4256\u66f4\u591a\u3002\u540c\u65f6\u4f7f\u7528--max\u548c--offset\u53c2\u6570\u53ef\u4ee5\u7ffb\u9875\u663e\u793a\u3002<\/li>\n<\/ul>\n<pre># <span style=\"color: #d73a49\">-<\/span>A\u663e\u793a\u6240\u6709<br>helm list <span style=\"color: #6a737d\">--max=10 --offset=2 -A<\/span><\/pre>\n<h2>\u4e03\u3001\u5347\u7ea7\u7248\u672c\uff08helm upgrade\uff09<\/h2>\n<p>\u8be5\u547d\u4ee4\u5c06\u53d1\u5e03\u5347\u7ea7\u5230\u65b0\u7248\u7684chart\u3002\u5347\u7ea7\u53c2\u6570\u5fc5\u987b\u662f\u53d1\u5e03\u548cchart\u3002chart\u53c2\u6570\u53ef\u4ee5\u662f\uff1achart\u5f15\u7528('example\/mariadb')\uff0cchart\u76ee\u5f55\u8def\u5f84\uff0c\u6253\u5305\u7684chart\u6216\u8005\u5b8c\u6574URL\u3002\u5bf9\u4e8echart\u5f15\u7528\uff0c\u9664\u975e\u4f7f\u7528'--version'\u53c2\u6570\u6307\u5b9a\uff0c\u5426\u5219\u4f1a\u4f7f\u7528\u6700\u65b0\u7248\u672c\u3002<\/p>\n<pre>helm upgrade <span style=\"color: #6a737d\">--set foo=bar --set foo=newbar redis .\/redis<\/span><\/pre>\n<h2>\u516b\u3001\u53d1\u5e03\u5386\u53f2\uff08helm history\uff09<\/h2>\n<p>\u68c0\u7d22\u53d1\u5e03\u5386\u53f2\uff0c\u6253\u5370\u7ed9\u5b9a\u7248\u672c\u7684\u5386\u53f2\u4fee\u8ba2\u3002\u9ed8\u8ba4\u4f1a\u8fd4\u56de\u6700\u5927\u7684256\u4e2a\u5386\u53f2\u7248\u672c\u3002\u8bbe\u7f6e--max\u914d\u7f6e\u8fd4\u56de\u5386\u53f2\u5217\u8868\u7684\u6700\u5927\u957f\u5ea6\u3002<\/p>\n<p>\u5386\u53f2\u53d1\u5e03\u96c6\u5408\u4f1a\u88ab\u6253\u5370\u6210\u683c\u5f0f\u5316\u7684\u8868\u683c\uff0c\u4f8b\u5982\uff1a<\/p>\n<pre>$ helm history angry<span style=\"color: #d73a49\">-<\/span>bird<br>REVISION    UPDATED                     STATUS          CHART             APP VERSION     DESCRIPTION<br><span style=\"color: #005cc5\">1<\/span>           Mon Oct <span style=\"color: #005cc5\">3<\/span> <span style=\"color: #005cc5\">10<\/span><span>:<\/span><span style=\"color: #005cc5\">15<\/span><span>:<\/span><span style=\"color: #005cc5\">13<\/span> <span style=\"color: #005cc5\">2016<\/span>     superseded      alpine<span style=\"color: #d73a49\">-<\/span><span style=\"color: #005cc5\">0.1<\/span><span style=\"color: #005cc5\">.0<\/span>      <span style=\"color: #005cc5\">1.0<\/span>             Initial install<br><span style=\"color: #005cc5\">2<\/span>           Mon Oct <span style=\"color: #005cc5\">3<\/span> <span style=\"color: #005cc5\">10<\/span><span>:<\/span><span style=\"color: #005cc5\">15<\/span><span>:<\/span><span style=\"color: #005cc5\">13<\/span> <span style=\"color: #005cc5\">2016<\/span>     superseded      alpine<span style=\"color: #d73a49\">-<\/span><span style=\"color: #005cc5\">0.1<\/span><span style=\"color: #005cc5\">.0<\/span>      <span style=\"color: #005cc5\">1.0<\/span>             Upgraded successfully<br><span style=\"color: #005cc5\">3<\/span>           Mon Oct <span style=\"color: #005cc5\">3<\/span> <span style=\"color: #005cc5\">10<\/span><span>:<\/span><span style=\"color: #005cc5\">15<\/span><span>:<\/span><span style=\"color: #005cc5\">13<\/span> <span style=\"color: #005cc5\">2016<\/span>     superseded      alpine<span style=\"color: #d73a49\">-<\/span><span style=\"color: #005cc5\">0.1<\/span><span style=\"color: #005cc5\">.0<\/span>      <span style=\"color: #005cc5\">1.0<\/span>             Rolled back to <span style=\"color: #005cc5\">2<\/span><br><span style=\"color: #005cc5\">4<\/span>           Mon Oct <span style=\"color: #005cc5\">3<\/span> <span style=\"color: #005cc5\">10<\/span><span>:<\/span><span style=\"color: #005cc5\">15<\/span><span>:<\/span><span style=\"color: #005cc5\">13<\/span> <span style=\"color: #005cc5\">2016<\/span>     deployed        alpine<span style=\"color: #d73a49\">-<\/span><span style=\"color: #005cc5\">0.1<\/span><span style=\"color: #005cc5\">.0<\/span>      <span style=\"color: #005cc5\">1.0<\/span>             Upgraded successfully<\/pre>\n<h2>\u4e5d\u3001\u56de\u6eda\u7248\u672c\uff08helm rollback\uff09<\/h2>\n<blockquote style=\"margin-top: 5px;margin-bottom: 5px;padding-left: 1em;margin-left: 0px\">\n<p>\u56de\u6eda\u53d1\u5e03\u5230\u4e0a\u4e00\u4e2a\u7248\u672c\uff0c\u56de\u6eda\u547d\u4ee4\u7684\u7b2c\u4e00\u4e2a\u53c2\u6570\u662f\u53d1\u5e03\u7684\u540d\u79f0\uff0c\u7b2c\u4e8c\u662f\u4fee\u8ba2\uff08\u7248\u672c\uff09\u53f7\uff0c\u5982\u679c\u7701\u7565\u6b64\u53c2\u6570\uff0c\u4f1a\u56de\u6eda\u5230\u4e0a\u4e00\u4e2a\u7248\u672c\u3002<\/p>\n<\/blockquote>\n<pre># helm rollback <span style=\"color: #d73a49\">&lt;<\/span>RELEASE<span style=\"color: #d73a49\">&gt;<\/span> <span style=\"color: #997\">[<\/span>REVISION<span style=\"color: #997\">]<\/span> <span style=\"color: #997\">[<\/span>flags<span style=\"color: #997\">]<\/span><br># \u5148\u67e5\u770b\u5386\u53f2\u7248\u672c<br>helm history myharbor <span style=\"color: #d73a49\">-<\/span>n harbor<br># \u4e0d\u6307\u5b9a\u7248\u672c\u5c31\u56de\u9000\u4e0a\u4e2a\u7248\u672c<br>helm rollback myharbor <span style=\"color: #005cc5\">1<\/span> <span style=\"color: #d73a49\">-<\/span>n harbor<br>helm rollback myharbor <span style=\"color: #d73a49\">-<\/span>n harbor<\/pre>\n<h2>\u5341\u3001\u5c55\u793achart\uff08helm show\uff09<\/h2>\n<pre># helm show all <span style=\"color: #997\">[<\/span>CHART<span style=\"color: #997\">]<\/span> <span style=\"color: #997\">[<\/span>flags<span style=\"color: #997\">]<\/span><br># \u8be5\u547d\u4ee4\u68c0\u67e5chart<span style=\"color: #997\">(<\/span>\u76ee\u5f55\u3001\u6587\u4ef6\u6216URL<span style=\"color: #997\">)<\/span>\u5e76\u663e\u793a\u6240\u6709\u7684\u5185\u5bb9\uff08values<span style=\"color: #005cc5\">.yaml<\/span><span>,<\/span> Chart<span style=\"color: #005cc5\">.yaml<\/span><span>,<\/span> README\uff09<br>helm show all mysql<br><br># helm show <span style=\"color: #d73a49\">values<\/span> <span style=\"color: #997\">[<\/span>CHART<span style=\"color: #997\">]<\/span> <span style=\"color: #997\">[<\/span>flags<span style=\"color: #997\">]<\/span><br># \u8be5\u547d\u4ee4\u68c0\u67e5chart<span style=\"color: #997\">(<\/span>\u76ee\u5f55\u3001\u6587\u4ef6\u6216URL<span style=\"color: #997\">)<\/span>\u5e76\u663e\u793avalues<span style=\"color: #005cc5\">.yaml<\/span>\u6587\u4ef6\u7684\u5185\u5bb9<br>helm show <span style=\"color: #d73a49\">values<\/span> mysql<\/pre>\n<h2>\u5341\u4e00\u3001\u62c9\u53d6chart\uff08helm pull\uff09<\/h2>\n<p>\u4ece\u4ed3\u5e93\u4e0b\u8f7d\u5e76\uff08\u53ef\u9009\uff09\u5728\u672c\u5730\u76ee\u5f55\u89e3\u538b\u3002<\/p>\n<pre># helm pull <span style=\"color: #997\">[<\/span>chart URL <span style=\"color: #d73a49\">|<\/span> repo<span style=\"color: #d73a49\">\/<\/span>chartname<span style=\"color: #997\">]<\/span> <span style=\"color: #997\">[<\/span>...<span style=\"color: #997\">]<\/span> <span style=\"color: #997\">[<\/span>flags<span style=\"color: #997\">]<\/span><br># \u4ec5\u4e0b\u8f7d<br>helm pull bitnami<span style=\"color: #d73a49\">\/<\/span>redis<br># \u4e0b\u8f7d\u5e76\u89e3\u538b\u5230\u5f53\u524d\u76ee\u5f55<br>helm pull bitnami<span style=\"color: #d73a49\">\/<\/span>redis <span style=\"color: #6a737d\">--untar<\/span><\/pre>\n<h2>\u5341\u4e8c\u3001Helm \u6253\u5305\uff08helm package\uff09<\/h2>\n<ul>\n<li>\u5c06chart\u76ee\u5f55\u6253\u5305\u5230chart\u5f52\u6863\u4e2d\uff0c\u8be5\u547d\u4ee4\u5c06chart\u6253\u5305\u6210\u4e00\u4e2achart\u7248\u672c\u5305\u6587\u4ef6\u3002\u5982\u679c\u7ed9\u5b9a\u8def\u5f84\uff0c\u5c31\u4f1a\u5728\u8be5\u8def\u5f84\u4e2d\u67e5\u627echart\uff08\u5fc5\u987b\u5305\u542bChart.yaml\u6587\u4ef6\uff09\u7136\u540e\u5c06\u76ee\u5f55\u6253\u5305\u3002<\/li>\n<li>\u8981\u7b7e\u540d\u4e00\u4e2achart\uff0c\u4f7f\u7528--sign\u53c2\u6570\uff0c\u5728\u5927\u591a\u6570\u573a\u666f\u4e2d\uff0c\u4e5f\u8981\u63d0\u4f9b--keyring path\/to\/secret\/keys\u548c--key keyname\u3002<\/li>\n<\/ul>\n<pre>helm package mysql<span style=\"color: #d73a49\">\/<\/span><br># Successfully packaged chart <span style=\"color: #d73a49\">and<\/span> saved it to<span>:<\/span> <span style=\"color: #d73a49\">\/<\/span>opt<span style=\"color: #d73a49\">\/<\/span>k8s<span style=\"color: #d73a49\">\/<\/span>helm<span style=\"color: #d73a49\">\/<\/span>mysql<span style=\"color: #d73a49\">-<\/span><span style=\"color: #005cc5\">9.3<\/span><span style=\"color: #005cc5\">.1<\/span><span style=\"color: #005cc5\">.tgz<\/span><\/pre>\n<blockquote style=\"margin-top: 5px;margin-bottom: 5px;padding-left: 1em;margin-left: 0px\">\n<p>\u5982\u679c\u60f3\u5ffd\u7565helm\u4e2d\u7684\u6587\u4ef6\uff0c\u53ef\u4ee5\u5728.helmignore\u8fdb\u884c\u5339\u914d\uff0c\u8be5.helmignore\u6587\u4ef6\u652f\u6301Unix shell\u5168\u5c40\u5339\u914d\uff0c\u76f8\u5bf9\u8def\u5f84\u5339\u914d\u548c\u5426\u5b9a\uff08\u4ee5\uff01\u524d\u7f00\u53cd\u5411\u5339\u914d\uff09\u3002\u6bcf\u884c\u4ec5\u8003\u8651\u4e00\u79cd\u6a21\u5f0f\u3002\u793a\u4f8b\u5982\u4e0b\uff1a<\/p>\n<\/blockquote>\n<pre># .helmignore<br>.git<br>*\/temp*<br>*\/*\/temp*<br>temp?<\/pre>\n<\/p>\n<h2>\u5341\u4e09\u3001\u63a8\u9001chart\u5230harbor\uff08helm cm-push\uff09<\/h2>\n<blockquote style=\"margin-top: 5px;margin-bottom: 5px;padding-left: 1em;margin-left: 0px\">\n<p>\u5c06chart\u63a8\u9001\u5230\u8fdc\u7a0b\u3002<\/p>\n<\/blockquote>\n<h3>1\uff09\u5728\u7ebf\u5b89\u88c5<\/h3>\n<\/p>\n<pre>helm plugin install https:\/\/github.com\/chartmuseum\/helm-push<\/pre>\n<\/p>\n<h3>2\uff09\u79bb\u7ebf\u5b89\u88c5<\/h3>\n<p>\u4e0b\u8f7d\u5730\u5740\uff1ahttps:\/\/github.com\/chartmuseum\/helm-push\/tags<\/p>\n<pre># <span style=\"color: #005cc5\">1<\/span>\u3001\u4e0b\u8f7d\u5b89\u88c5\u5305<br>wget https<span>:<\/span><span style=\"color: #d73a49\">\/\/<\/span>github<span style=\"color: #005cc5\">.com<\/span><span style=\"color: #d73a49\">\/<\/span>chartmuseum<span style=\"color: #d73a49\">\/<\/span>helm<span style=\"color: #d73a49\">-<\/span>push<span style=\"color: #d73a49\">\/<\/span>releases<span style=\"color: #d73a49\">\/<\/span>tag<span style=\"color: #d73a49\">\/<\/span>v0<span style=\"color: #005cc5\">.10<\/span><span style=\"color: #005cc5\">.3<\/span><br><br># <span style=\"color: #005cc5\">2<\/span>\u3001\u67e5\u770bhelm\u7684plugin\u8def\u5f84\uff1ahelm env<br>helm env<br><br># <span style=\"color: #005cc5\">3<\/span>\u3001\u5728\u8be5\u8def\u5f84\u4e0b\u521b\u5efahelm<span style=\"color: #d73a49\">-<\/span>push\u6587\u4ef6\u5939\uff0c\u5e76\u5c06\u5b89\u88c5\u5305\u62f7\u8d1d\u5230\u8be5\u6587\u4ef6\u5939\u4e0b\u89e3\u538b\u5373\u53ef<br>mkdir <span style=\"color: #d73a49\">\/<\/span>root<span style=\"color: #d73a49\">\/<\/span><span style=\"color: #005cc5\">.local<\/span><span style=\"color: #d73a49\">\/<\/span>share<span style=\"color: #d73a49\">\/<\/span>helm<span style=\"color: #d73a49\">\/<\/span>plugins<span style=\"color: #d73a49\">\/<\/span>helm<span style=\"color: #d73a49\">-<\/span>push<br><br>wget https<span>:<\/span><span style=\"color: #d73a49\">\/\/<\/span>github<span style=\"color: #005cc5\">.com<\/span><span style=\"color: #d73a49\">\/<\/span>chartmuseum<span style=\"color: #d73a49\">\/<\/span>helm<span style=\"color: #d73a49\">-<\/span>push<span style=\"color: #d73a49\">\/<\/span>releases<span style=\"color: #d73a49\">\/<\/span>download<span style=\"color: #d73a49\">\/<\/span>v0<span style=\"color: #005cc5\">.10<\/span><span style=\"color: #005cc5\">.3<\/span><span style=\"color: #d73a49\">\/<\/span>helm<span style=\"color: #d73a49\">-<\/span>push_0<span style=\"color: #005cc5\">.10<\/span><span style=\"color: #005cc5\">.3_linux_amd64<\/span><span style=\"color: #005cc5\">.tar<\/span><span style=\"color: #005cc5\">.gz<\/span><br><br>tar zxvf <span style=\"color: #d73a49\">\/<\/span>root<span style=\"color: #d73a49\">\/<\/span><span style=\"color: #005cc5\">.local<\/span><span style=\"color: #d73a49\">\/<\/span>share<span style=\"color: #d73a49\">\/<\/span>helm<span style=\"color: #d73a49\">\/<\/span>plugins<span style=\"color: #d73a49\">\/<\/span>helm<span style=\"color: #d73a49\">-<\/span>push<span style=\"color: #d73a49\">\/<\/span>helm<span style=\"color: #d73a49\">-<\/span>push_0<span style=\"color: #005cc5\">.10<\/span><span style=\"color: #005cc5\">.3_linux_amd64<\/span><span style=\"color: #005cc5\">.tar<\/span><span style=\"color: #005cc5\">.gz<\/span> <span style=\"color: #d73a49\">-<\/span>C <span style=\"color: #d73a49\">\/<\/span>root<span style=\"color: #d73a49\">\/<\/span><span style=\"color: #005cc5\">.local<\/span><span style=\"color: #d73a49\">\/<\/span>share<span style=\"color: #d73a49\">\/<\/span>helm<span style=\"color: #d73a49\">\/<\/span>plugins<span style=\"color: #d73a49\">\/<\/span>helm<span style=\"color: #d73a49\">-<\/span>push<\/pre>\n<p>\u67e5\u770b\u63d2\u4ef6<\/p>\n<pre>helm plugin list<\/pre>\n<h3>3\uff09helm \u589e\u52a0harbor repo<\/h3>\n<\/p>\n<pre># chartrepo\uff0c\u56fa\u5b9a\u53c2\u6570\uff0cbigdata\u81ea\u5b9a\u4e49\u9879\u76ee<br>helm repo add local-harbor --username=admin --password=Harbor12345 https:\/\/myharbor.com\/chartrepo\/bigdata\/ --ca-file \/opt\/k8s\/helm\/ca.crt<\/pre>\n<\/p>\n<p>\u8bc1\u4e66\u76f4\u63a5\u5728harbor\u4e0a\u4e0b\u8f7d<\/p>\n<p style=\"text-align: center\">\n<p style=\"text-align:center\">\n<\/p>\n<h3>4\uff09\u793a\u4f8b\u6f14\u793a<\/h3>\n<pre># \u67e5\u770b\u5e2e\u52a9<br>helm cm<span style=\"color: #d73a49\">-<\/span>push <span style=\"color: #6a737d\">--help<\/span><br><br># \u63a8\u9001\uff0c\u63a5\u3010\u76ee\u5f55\u3011<br>helm cm<span style=\"color: #d73a49\">-<\/span>push mysql<span style=\"color: #d73a49\">\/<\/span> local<span style=\"color: #d73a49\">-<\/span>harbor <span style=\"color: #6a737d\">--ca-file \/opt\/k8s\/helm\/ca.crt<\/span><br><br># \u63a8\u9001\uff0c\u63a5\u3010\u538b\u7f29\u5305\u3011<br>helm cm<span style=\"color: #d73a49\">-<\/span>push wordpress<span style=\"color: #d73a49\">-<\/span><span style=\"color: #005cc5\">15.1<\/span><span style=\"color: #005cc5\">.5<\/span><span style=\"color: #005cc5\">.tgz<\/span> local<span style=\"color: #d73a49\">-<\/span>harbor <span style=\"color: #6a737d\">--ca-file \/opt\/k8s\/helm\/ca.crt<\/span><br><br># \u63a8\u9001\uff0c\u6307\u5b9a\u7248\u672c\uff0c<span style=\"color: #6a737d\">--version<\/span><br>helm cm<span style=\"color: #d73a49\">-<\/span>push mychart<span style=\"color: #d73a49\">\/<\/span> <span style=\"color: #6a737d\">--versinotallow=\"1.2.3\" local-harbor --ca-file \/opt\/k8s\/helm\/ca.crt <\/span><br><br># \u5f3a\u5236\u63a8\u9001\uff0c<span style=\"color: #6a737d\">--force<\/span><br>helm cm<span style=\"color: #d73a49\">-<\/span>push <span style=\"color: #6a737d\">--force mychart-0.3.2.tgz local-harbor<\/span><\/pre>\n<p>\u67e5\u770b<\/p>\n<p style=\"text-align: center\">\n<p style=\"text-align:center\">\n<\/p>\n<h2>\u5341\u56db\u3001\u641c\u7d22 hub\uff08helm search hub\uff09<\/h2>\n<p>\u5728Artifact Hub\u6216\u81ea\u5df1\u7684hub\u5b9e\u4f8b\u4e2d\u641c\u7d22chart\u3002Artifact Hub&nbsp;\u662f\u57fa\u4e8eweb\u9875\u9762\u7684\u5e94\u7528\uff0c\u652f\u6301CNCF\u9879\u76ee\u7684\u67e5\u627e\u3001\u5b89\u88c5\u548c\u53d1\u5e03\u5305\u53ca\u914d\u7f6e\u9879\uff0c\u5305\u62ec\u4e86\u516c\u5f00\u53d1\u5e03\u7684Helm chart\u3002\u5b83\u662fCNCF\u7684\u6c99\u76d2\u9879\u76ee\u3002\u53ef\u4ee5\u8bbf\u95eehttps:\/\/artifacthub.io\/<\/p>\n<pre># \u4e0d\u5e26\u53c2\u6570\uff0c\u5217\u51fa\u6240\u6709<br>helm search hub <br><br># \u6307\u5b9achart<br>helm search hub mysql<\/pre>\n<p style=\"text-align: center\">\n<p style=\"text-align:center\">\n<\/p>\n<h2>\u5341\u4e94\u3001\u641c\u7d22\u4ed3\u5e93\uff08helm search repo\uff09<\/h2>\n<blockquote style=\"margin-top: 5px;margin-bottom: 5px;padding-left: 1em;margin-left: 0px\">\n<p>\u7528chart\u4e2d\u5173\u952e\u5b57\u641c\u7d22\u4ed3\u5e93\uff0c\u641c\u7d22\u4f1a\u8bfb\u53d6\u7cfb\u7edf\u4e0a\u914d\u7f6e\u7684\u6240\u6709\u4ed3\u5e93\uff0c\u5e76\u67e5\u627e\u5339\u914d\u3002\u641c\u7d22\u8fd9\u4e9b\u4ed3\u5e93\u4f1a\u4f7f\u7528\u5b58\u50a8\u5728\u7cfb\u7edf\u4e2d\u7684\u5143\u6570\u636e\u3002\u5b83\u4f1a\u5c55\u793a\u627e\u5230\u6700\u65b0\u7a33\u5b9a\u7248\u672c\u7684chart\u3002\u5982\u679c\u6307\u5b9a\u4e86--devel\u53c2\u6570\uff0c\u8f93\u51fa\u4f1a\u5305\u62ec\u9884\u53d1\u5e03\u7248\u672c\u3002<\/p>\n<\/blockquote>\n<pre># Search for stable release versions matching the keyword <span style=\"color: #690\">\"nginx\"<\/span><br>$ helm search repo nginx<br><br># Search for release versions matching the keyword <span style=\"color: #690\">\"nginx\"<\/span><span>,<\/span> including pre<span style=\"color: #d73a49\">-<\/span>release versions<br>$ helm search repo nginx <span style=\"color: #6a737d\">--devel<\/span><br><br># Search for the latest stable release for nginx<span style=\"color: #d73a49\">-<\/span>ingress with a major version of <span style=\"color: #005cc5\">1<\/span><br>$ helm search repo nginx<span style=\"color: #d73a49\">-<\/span>ingress <span style=\"color: #6a737d\">--version ^1.0.0<\/span><\/pre>\n<h2>\u5341\u516d\u3001\u9a8c\u8bc1chart\uff08helm lint\uff09<\/h2>\n<blockquote style=\"margin-top: 5px;margin-bottom: 5px;padding-left: 1em;margin-left: 0px\">\n<p>\u8be5\u547d\u4ee4\u4f7f\u7528\u4e00\u4e2achart\u8def\u5f84\u5e76\u8fd0\u884c\u4e00\u7cfb\u5217\u7684\u6d4b\u8bd5\u6765\u9a8c\u8bc1chart\u7684\u683c\u5f0f\u662f\u5426\u6b63\u786e\u3002\u5982\u679c\u9047\u5230\u5f15\u8d77chart\u5b89\u88c5\u5931\u8d25\u7684\u60c5\u51b5\uff0c\u4f1a\u89e6\u53d1[ERROR]\u4fe1\u606f\uff0c\u5982\u679c\u9047\u5230\u8fdd\u53cd\u60ef\u4f8b\u6216\u5efa\u8bae\u7684\u95ee\u9898\uff0c\u4f1a\u89e6\u53d1[WARNING]\u3002<\/p>\n<\/blockquote>\n<pre># helm lint PATH <span style=\"color: #997\">[<\/span>flags<span style=\"color: #997\">]<\/span><br>helm lint .<span style=\"color: #d73a49\">\/<\/span>mysql<\/pre>\n<p style=\"text-align: center\">\n<p style=\"text-align:center\">\n<\/p>\n<\/p>\n<h2>\u5341\u4e03\u3001\u5e38\u7528\u547d\u4ee4\u603b\u7ed3<\/h2>\n<pre>helm version                            <span style=\"color: #d73a49\">\/\/<\/span> \u67e5\u770bhelm\u7248\u672c<br>helm <span style=\"color: #d73a49\">create<\/span> xxx                         <span style=\"color: #d73a49\">\/\/<\/span> \u521b\u5efa\u4e00\u4e2axxx charts<br>helm lint .<span style=\"color: #d73a49\">\/<\/span>xxx                         <span style=\"color: #d73a49\">\/\/<\/span> \u68c0\u67e5\u5305\u7684\u683c\u5f0f\u6216\u4fe1\u606f\u662f\u5426\u6709\u95ee\u9898<br>helm install xxx1 .<span style=\"color: #d73a49\">\/<\/span>xxx                 <span style=\"color: #d73a49\">\/\/<\/span> \u90e8\u7f72\u5b89\u88c5xxx\uff0c\u8bbe\u7f6e\u540d\u79f0\u4e3axxx1<br>helm list                               <span style=\"color: #d73a49\">\/\/<\/span> \u5217\u51fa\u5df2\u7ecf\u90e8\u7f72\u7684charts<br>helm history                            <span style=\"color: #d73a49\">\/\/<\/span> \u53d1\u5e03\u5386\u53f2<br>helm upgrade                            <span style=\"color: #d73a49\">\/\/<\/span> \u66f4\u65b0\u7248\u672c<br>helm rollback                           <span style=\"color: #d73a49\">\/\/<\/span> \u56de\u6eda\u7248\u672c<br>helm package .<span style=\"color: #d73a49\">\/<\/span>xxx                      <span style=\"color: #d73a49\">\/\/<\/span> \u6253\u5305charts<br>helm repo add <span style=\"color: #6a737d\">--username admin --password password myharbor xxx  \/\/ \u589e\u52a0repo<\/span><br>helm uninstall xxx1                     <span style=\"color: #d73a49\">\/\/<\/span> \u5378\u8f7d\u5220\u9664xxx1<br>helm pull                                <span style=\"color: #d73a49\">\/\/<\/span> \u62c9\u53d6chart\u5305<br>helm cm<span style=\"color: #d73a49\">-<\/span>push                            <span style=\"color: #d73a49\">\/\/<\/span> \u63a8\u9001chart\u5305<br>helm repo <span style=\"color: #d73a49\">update<\/span>                        <span style=\"color: #d73a49\">\/\/<\/span> \u66f4\u65b0\u4ed3\u5e93\u8d44\u6e90<br>helm search hub                         <span style=\"color: #d73a49\">\/\/<\/span> \u4ece Artifact Hub \u4e2d\u67e5\u627e\u5e76\u5217\u51fa helm charts\u3002Artifact Hub\u4e2d\u5b58\u653e\u4e86\u5927\u91cf\u4e0d\u540c\u7684\u4ed3\u5e93<br>helm search repo                        <span style=\"color: #d73a49\">\/\/<\/span> \u4ece\u4f60\u6dfb\u52a0\uff08\u4f7f\u7528 helm repo add\uff09\u5230\u672c\u5730 helm \u5ba2\u6237\u7aef\u4e2d\u7684\u4ed3\u5e93\u4e2d\u8fdb\u884c\u67e5\u627e\u3002\u8be5\u547d\u4ee4\u57fa\u4e8e\u672c\u5730\u6570\u636e\u8fdb\u884c\u641c\u7d22\uff0c\u65e0\u9700\u8fde\u63a5\u4e92\u8054\u7f51<\/pre>\n<p>Helm \u5e38\u7528\u547d\u4ee4\uff08chart \u5b89\u88c5\u3001\u5347\u7ea7\u3001\u56de\u6eda\u3001\u5378\u8f7d\u7b49\u64cd\u4f5c\uff09\u5c31\u5148\u5230\u8fd9\u91cc\u3002<\/p>\n<p><span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3010\u4e91\u539f\u751f\u3011Helm \u5e38\u7528\u547d\u4ee4\uff08chart \u5b89\u88c5\u3001\u5347\u7ea7\u3001\u56de\u6eda\u3001\u5378\u8f7d\u7b49\u64cd\u4f5c\uff09 \u4f5c\u8005\uff1aliugp 2023-02-0 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":227419,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[55],"tags":[],"class_list":["post-227418","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-cloud-phone"],"_links":{"self":[{"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/posts\/227418","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/comments?post=227418"}],"version-history":[{"count":0,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/posts\/227418\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/media\/227419"}],"wp:attachment":[{"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/media?parent=227418"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/categories?post=227418"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/tags?post=227418"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}