{"id":535,"date":"2020-03-06T10:04:41","date_gmt":"2020-03-06T02:04:41","guid":{"rendered":"https:\/\/www.yinyubo.cn\/?p=535"},"modified":"2022-05-17T09:41:35","modified_gmt":"2022-05-17T01:41:35","slug":"helm-3","status":"publish","type":"post","link":"https:\/\/www.yinyubo.com\/?p=535","title":{"rendered":"\u4f7f\u7528helm\u52a8\u6001\u66f4\u65b0k8s\u91cc\u7684docker\u955c\u50cf\u5173\u952e\u70b9"},"content":{"rendered":"<h1 id=\"id-\u4f7f\u7528helm\u52a8\u6001\u66f4\u65b0k8s\u91cc\u7684deployment\u5173\u952e\u70b9-\u9700\u6c42\u5206\u6790\">\u9700\u6c42\u5206\u6790<\/h1>\n<p>1.\u6211\u4eec\u4f7f\u7528helm\u6765\u5b9e\u73b0\u5e94\u7528\u7a0b\u5e8f\u7684\u66f4\u65b0\u3002<br \/>\n2.\u5e94\u7528\u7a0b\u5e8f\u66f4\u65b0\u7684\u5173\u952e\u5c31\u662f\u955c\u50cf\u3002\u6bcf\u6b21\u6211\u4eec\u7684\u4ee3\u7801\u5408\u5165develop\u5206\u652f\u4e4b\u540e\uff0c\u90fd\u4f1a\u4ea7\u751f\u4e00\u4e2a\u65b0\u7684docker\u955c\u50cf\u3002<br \/>\n3.\u6211\u4eec\u9700\u8981\u8ba9helm\u77e5\u9053\u6211\u4eec\u4f7f\u7528\u4e86\u6700\u65b0\u7684docker\u955c\u50cf\u3002\u8fd9\u6837\u90e8\u7f72\u7684\u5e94\u7528\u624d\u662f\u6700\u65b0\u7684\u3002<br \/>\n4.helm\u5305\u662f\u901a\u8fc7nexus\u4e0a\u4f20\u7684\uff0c\u4ece\u8bbe\u8ba1\u4e0a\u6765\u8bf4\uff0c\u4e0d\u9002\u5408\u6bcf\u4e00\u6b21cd\u6d41\u7a0b\u5c31\u4ea7\u751f\u4e00\u4e2ahelm\u5305\u5e76\u4e0a\u4f20\uff0chelm\u672c\u8eab\u4e5f\u6ca1\u6709\u63d0\u4f9b\u4e0a\u4f20\u63a5\u53e3\u3002helm\u5305\u7684\u8bbe\u8ba1\u662f\u5e0c\u671b\u4e00\u4e2ahelm\u5305\u80fd\u4e00\u76f4\u901a\u7528\u4e8e\u67d0\u4e00\u7c7b\u7a0b\u5e8f\u3002<br \/>\n5.\u7efc\u4e0a\u6240\u8ff0\uff0c\u6211\u4eec\u7684cd\u6d41\u7a0b\u7684\u5173\u952e\u662f\uff0c\u5728helm\u5305\u4e0d\u66f4\u65b0\u7684\u60c5\u51b5\u4e0b\uff0c\u8ba9helm\u5305\u80fd\u6bcf\u6b21cd\u6d41\u7a0b\u540e\uff0c\u901a\u8fc7developmengt.yaml\u4f7f\u7528\u6700\u65b0\u7684docker\u955c\u50cf\u5728K8S\u4e0a\u8fdb\u884c\u90e8\u7f72<\/p>\n<hr \/>\n<h1 id=\"id-\u4f7f\u7528helm\u52a8\u6001\u66f4\u65b0k8s\u91cc\u7684deployment\u5173\u952e\u70b9-\u4f7f\u7528\u8bef\u533a\">\u4f7f\u7528\u8bef\u533a<\/h1>\n<p>\u8bef\u4ee5\u4e3adevelopmengt.yaml\u91cc\u914d\u7f6econtainer.image\u7684tag\u4e3alatest,imagePullPolicy\u4e3aalways\uff0c\u5c31\u80fd\u6bcf\u6b21\u90e8\u7f72\u7684\u65f6\u5019\u62c9\u53d6\u6700\u65b0\u7684\u955c\u50cf\u3002<br \/>\n\u63a5\u4e0b\u6765\uff0c\u6211\u4eec\u770b\u770b\u9ed8\u8ba4\u914d\u7f6e<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-536 size-full\" src=\"https:\/\/yinyubo-1257235934.cos.ap-nanjing.myqcloud.com\/content\/Image-1-2.png\" alt=\"\" width=\"574\" height=\"308\" \/><br \/>\n\u6211\u4eec\u7ecf\u5e38\u4f1a\u9519\u8bef\u7684\u914d\u7f6eChart.Appversion\u4e3alatest\uff0c\u5982\u4e0b\u56fe<br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-537 size-full\" src=\"https:\/\/yinyubo-1257235934.cos.ap-nanjing.myqcloud.com\/content\/Image-2-5.png\" alt=\"\" width=\"682\" height=\"113\" \/><\/p>\n<pre class=\"lang:python decode:true \">helm upgrade [RELEASE] [CHART] [flags]\n\u4f8b\u5982\uff1a helm upgrade lizhenwei nginx-chart<\/pre>\n<p class=\"auto-cursor-target\">\u539f\u56e0\u662f\uff1a\u5bf9\u4e8ehelm\u6765\u8bf4\uff0c<span style=\"color: #ff6600;\"><strong>\u53c2\u6570<\/strong><\/span>\u6ca1\u6709\u4efb\u4f55\u53d8\u5316\uff0cchart\u7248\u672c\u4e5f\u6ca1\u6709\u53d8\u5316\uff0c\u6240\u4ee5\u662f\u4e0d\u4f1a\u53bb\u66f4\u65b0\u7684<\/p>\n<hr \/>\n<h1 id=\"id-\u4f7f\u7528helm\u52a8\u6001\u66f4\u65b0k8s\u91cc\u7684deployment\u5173\u952e\u70b9-\u6b63\u786e\u7528\u6cd5\" class=\"auto-cursor-target\">\u6b63\u786e\u7528\u6cd5<\/h1>\n<p>\u6211\u4eec\u7684chart\u4e0d\u4f1a\u53bb\u4e0d\u505c\u7684\u66f4\u65b0\uff0c\u6240\u4ee5\u6211\u4eec\u8981\u505a\u7684\u662f<span style=\"color: #ff6600;\">\u53c2\u6570<\/span>\u7684\u66f4\u65b0\u3002<br \/>\n\u6240\u4ee5\u6211\u4eec\u8981\u8ba9docker\u7684<span style=\"color: #ff6600;\">\u955c\u50cftag\u52a8\u8d77\u6765<\/span>\u3002<br \/>\n1.\u6bcf\u6b21\u7684CICD\u6d41\u7a0b\u9664\u4e86\u4e0a\u4f20latest\u955c\u50cf\u4ee5\u5916\uff0c\u8fd8\u8981\u518d\u4e0a\u4f20\u4e00\u4e2a\u5e26<span style=\"color: #ff6600;\">tag\u53f7<\/span>\u7684\u955c\u50cf\uff0ctag\u53f7\u53ef\u4ee5\u7528<span style=\"color: #ff6600;\">git\u7684commitHash\u503c<\/span>\u6765\u533a\u5206\uff0c\u4e00\u822c\u6765\u8bf4\uff0c\u6709\u4e2a8\u4f4d\u7684hash\u503c\u5c31\u591f\u4e86<br \/>\n2.helm\u7684development.yaml\u91cc\u7684\u955c\u50cftag\u8981\u8fdb\u884c\u5bf9\u5e94\u7684\u4fee\u6539\uff0c\u5982\u4e0b<\/p>\n<pre class=\"lang:python decode:true \"><code class=\"EnlighterJSRAW\" data-enlighter-language=\"golang\">image: \"{{ .Values.image.repository }}:{{ .Values.commitHash }}\"\n<\/code><\/pre>\n<p class=\"auto-cursor-target\">Values.commitHash\u662f\u6765\u81eavalues.yaml\u6587\u4ef6\u4e2d\u7684commitHash\u53c2\u6570<\/p>\n<p class=\"auto-cursor-target\">3.helm\u7684upgrade\u547d\u4ee4\u589e\u52a0comitHash\u53c2\u6570\u3002\u5347\u7ea7\u547d\u4ee4\u91cc\u589e\u52a0set\u53c2\u6570<\/p>\n<div class=\"code panel pdl conf-macro output-block\" data-hasbody=\"true\" data-macro-name=\"code\">\n<div class=\"codeContent panelContent pdl\">\n<div>\n<div id=\"highlighter_89890\" class=\"syntaxhighlighter sh-confluence nogutter  java\">\n<pre class=\"lang:python decode:true \"><code class=\"EnlighterJSRAW\" data-enlighter-language=\"golang\">helm upgrade -i dev-ui sfere\/cloudview-ui --set commitHash=$commitHash\n<\/code><\/pre>\n<div id=\"main-content\" class=\"wiki-content\">\n<p class=\"auto-cursor-target\"><span class=\"auto-cursor-target\">\u56e0\u4e3acommitHash\u53c2\u6570\u7684\u6539\u53d8\uff0c\u6240\u4ee5\u5bf9\u4e8ehelm\u6765\u8bf4\uff0c\u4ea7\u751f\u4e86\u53c2\u6570\u53d8\u5316\uff0chelm\u662f\u4f1a\u53bb\u8fdb\u884c\u66f4\u65b0\u64cd\u4f5c\uff0c\u8fd9\u4e2a\u65f6\u5019\u5c31\u4f1a\u53bb\u628a\u53c2\u6570\u586b\u5165development.yaml\u7684image\u9009\u9879\u91cc\uff0c\u4ece\u800c\u89e6\u53d1\u62c9\u53d6\u65b0\u4ee3\u7801\uff0c\u66f4\u65b0\u5e94\u7528<\/span><\/p>\n<\/div>\n<div id=\"likes-and-labels-container\">\n<div id=\"likes-section\" class=\"no-print\"><\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u9700\u6c42\u5206\u6790 1.\u6211\u4eec\u4f7f\u7528helm\u6765\u5b9e\u73b0\u5e94\u7528\u7a0b\u5e8f\u7684\u66f4\u65b0\u3002 2.\u5e94\u7528\u7a0b\u5e8f\u66f4\u65b0\u7684\u5173\u952e\u5c31\u662f\u955c\u50cf\u3002\u6bcf\u6b21\u6211\u4eec\u7684\u4ee3\u7801\u5408\u5165dev [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":["post-535","post","type-post","status-publish","format-standard","hentry","category-k8s"],"_links":{"self":[{"href":"https:\/\/www.yinyubo.com\/index.php?rest_route=\/wp\/v2\/posts\/535","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.yinyubo.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.yinyubo.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.yinyubo.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.yinyubo.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=535"}],"version-history":[{"count":2,"href":"https:\/\/www.yinyubo.com\/index.php?rest_route=\/wp\/v2\/posts\/535\/revisions"}],"predecessor-version":[{"id":893,"href":"https:\/\/www.yinyubo.com\/index.php?rest_route=\/wp\/v2\/posts\/535\/revisions\/893"}],"wp:attachment":[{"href":"https:\/\/www.yinyubo.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=535"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.yinyubo.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=535"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.yinyubo.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=535"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}