{"id":142,"date":"2024-03-21T21:51:00","date_gmt":"2024-03-21T13:51:00","guid":{"rendered":"https:\/\/www.xueyaa.top\/?p=142"},"modified":"2026-03-27T10:54:21","modified_gmt":"2026-03-27T02:54:21","slug":"helm%e5%85%a5%e9%97%a8","status":"publish","type":"post","link":"https:\/\/www.xueyaa.top\/?p=142","title":{"rendered":"helm\u5165\u95e8"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\" id=\"GjZrd\">1.1helm\u6982\u8ff0<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"a2z2m\">1\uff09\u4ec0\u4e48\u662fhelm\uff1f<\/h3>\n\n\n\n<pre id=\"g871b\" class=\"wp-block-code\"><code>helm\u6709\u70b9\u7c7b\u4f3c\u4e8eLinux\u7684yum\uff0capt\u5de5\u5177\uff0c\u5e2e\u52a9\u6211\u4eec\u7ba1\u7406K8S\u96c6\u7fa4\u7684\u8d44\u6e90\u6e05\u5355\u3002\n\nHelm \u5e2e\u52a9\u60a8\u7ba1\u7406 Kubernetes \u5e94\u7528\u2014\u2014 Helm Chart\uff0c\u5373\u4f7f\u662f\u6700\u590d\u6742\u7684 Kubernetes \u5e94\u7528\u7a0b\u5e8f\uff0c\u90fd\u53ef\u4ee5\u5e2e\u52a9\u60a8\u5b9a\u4e49\uff0c\u5b89\u88c5\u548c\u5347\u7ea7\u3002\n\nHelm Chart \u6613\u4e8e\u521b\u5efa\u3001\u53d1\u7248\u3001\u5206\u4eab\u548c\u53d1\u5e03\uff0c\u6240\u4ee5\u505c\u6b62\u590d\u5236\u7c98\u8d34\uff0c\u5f00\u59cb\u4f7f\u7528 Helm \u5427\u3002\n\nHelm \u662f CNCF \u7684\u6bd5\u4e1a\u9879\u76ee\uff0c\u7531 Helm \u793e\u533a\u7ef4\u62a4\u3002\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"CDXeS\">2\uff09helm\u7684\u67b6\u6784\u7248\u672c\u9009\u62e9<\/h3>\n\n\n\n<pre id=\"hPYGU\" class=\"wp-block-code\"><code>2019\u5e7411\u6708Helm\u56e2\u961f\u53d1\u5e03V3\u7248\u672c\uff0c\u76f8\u6bd4v2\u7248\u672c\u6700\u5927\u53d8\u5316\u662f\u5c06Tiller\u5220\u9664\uff0c\u5e76\u5927\u90e8\u5206\u4ee3\u7801\u91cd\u6784\u3002\n\nhelm v3\u76f8\u6bd4helm v2\u8fd8\u505a\u4e86\u5f88\u591a\u4f18\u5316\uff0c\u6bd4\u5982\u4e0d\u540c\u547d\u540d\u7a7a\u95f4\u8d44\u6e90\u540c\u540d\u7684\u60c5\u51b5\u5728v3\u7248\u672c\u662f\u5141\u8bb8\u7684\uff0c\u6211\u4eec\u5728\u751f\u4ea7\u73af\u5883\u4e2d\u4f7f\u7528\u5efa\u8bae\u5927\u5bb6\u4f7f\u7528v3\u7248\u672c\uff0c\u4e0d\u4ec5\u4ec5\u662f\u56e0\u4e3a\u5b83\u7248\u672c\u529f\u80fd\u8f83\u5f3a\uff0c\u800c\u4e14\u76f8\u5bf9\u6765\u8bf4\u4e5f\u66f4\u52a0\u7a33\u5b9a\u4e86\u3002\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"U9Iyi\">3\uff09helm\u7684\u76f8\u5173\u672f\u8bed<\/h3>\n\n\n\n<pre id=\"g2fgU\" class=\"wp-block-code\"><code>- Chart:\n\t\u662f\u7528\u6765\u7ba1\u7406k8s\u96c6\u7fa4\u7684\u8d44\u6e90\u6e05\u5355\uff0c\u4ee5\u53caChart\u5e94\u7528\u4fe1\u606f(Chart.yaml)\uff0c\u53d8\u91cf\u5b9a\u4e49(values.yaml)\u6587\u4ef6\u7684\u96c6\u5408\u3002\n\tChart\u5206\u4e3a\u4e24\u79cd\u7c7b\u578b\uff0c'application' \u548c 'library'\u3002\n\t\t- application: \u53ef\u4ee5\u76f4\u63a5\u57fa\u4e8e\u8be5Chart\u8fdb\u884c\u90e8\u7f72\uff0c\u53ef\u4ee5\u5355\u72ec\u90e8\u7f72\u3002\n\t\t- library: \u53ea\u80fd\u88ab\u5176\u4ed6Chart\u5f15\u7528\uff0c\u4f5c\u4e3a\u4e00\u4e2a\u5e93\u5b58\u5728\uff0c\u65e0\u6cd5\u5355\u72ec\u90e8\u7f72\u3002\n\t\u503c\u5f97\u6ce8\u610f\u7684\u662f\uff0cChart\u53ea\u662f\u4e00\u5806\u6587\u4ef6\u96c6\u5408\uff0c\u53ef\u4ee5\u5bf9\u5176\u8fdb\u884c\u4fee\u6539\uff0c\u6253\u5305\uff0c\u4f20\u8f93\u7b49\u3002\n\t\n\n- Release:\n\t\u6211\u4eec\u53ef\u4ee5\u57fa\u4e8eChart\u8fdb\u884c\u90e8\u7f72\uff0c\u90e8\u7f72\u540e\u7684\u5e94\u7528\u6211\u4eec\u79f0\u4e4b\u4e3aRelease\uff0c\u5373\u5bf9\u5916\u53d1\u5e03\u7684\u7248\u672c\u3002\n\t\u6211\u4eec\u53ef\u4ee5\u5bf9\u540c\u4e00\u4e2aChart\u90e8\u7f72\u591a\u4e2a\u5e94\u7528\uff0c\u4e5f\u53ef\u4ee5\u57fa\u4e8eChart\u8fdb\u884c\u5347\u7ea7\u3002\n\t\u6211\u4eec\u4e5f\u53ef\u4ee5\u5bf9Release\u5355\u72ec\u8fdb\u884c\u56de\u6eda\u3002\n\t\n\u6e29\u99a8\u63d0\u793a:\n\tChart\u548cRelease\u7684\u5173\u7cfb\u6709\u70b9\u7c7b\u4f3c\u4e8e\u7a0b\u5e8f\u6587\u4ef6\u548c\u7a0b\u5e8f\u7684\u5173\u7cfb\uff0c\u6bd4\u5982:\"\u6e38\u620fexe\"\u548c\"\u8fd0\u884c\u7684\u6e38\u620f\"\u7684\u5173\u7cfb\u3002<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"WkJsC\">1.2\u5b89\u88c5helm<\/h2>\n\n\n\n<pre id=\"ewt2f\" class=\"wp-block-code\"><code>\t1.\u4e0b\u8f7dhelm\nwget https:\/\/get.helm.sh\/helm-v3.19.4-linux-amd64.tar.gz\n\n\n\t2.\u89e3\u538bhelm\u8f6f\u4ef6\u5305\n&#91;root@master231 ~]# tar xf helm-v3.19.4-linux-amd64.tar.gz  -C \/usr\/local\/bin\/ linux-amd64\/helm --strip-components=1   #\u53ea\u89e3\u538blinux-amd64\/helm,\u8e22\u9664linux-amd64\/\u8fd9\u4e00\u5c42\u76ee\u5f55,\u5269helm\n&#91;root@master231 ~]# \n&#91;root@master231 ~]# ll \/usr\/local\/bin\/helm \n-rwxr-xr-x 1 1001 1001 60182712 Dec 13 05:40 \/usr\/local\/bin\/helm*\n&#91;root@master231 ~]# \n\n\t3.\u67e5\u770bhelm\u7684\u7248\u672c\n&#91;root@master231 ~]# helm version\nversion.BuildInfo{Version:\"v3.19.4\", GitCommit:\"7cfb6e486dac026202556836bb910c37d847793e\", GitTreeState:\"clean\", GoVersion:\"go1.24.11\"}\n&#91;root@master231 ~]# \n\n\t4.\u914d\u7f6ehelm\u7684\u81ea\u52a8\u8865\u5168\u529f\u80fd\n&#91;root@master231 ~]# helm completion bash &gt; \/etc\/bash_completion.d\/helm\n&#91;root@master231 ~]# \n&#91;root@master231 ~]# echo 'source \/etc\/bash_completion.d\/helm' &gt;&gt; ~\/.bashrc \n\n\n\t5.\u9a8c\u8bc1\u81ea\u52a8\u8865\u5168\u529f\u80fd\n&#91;root@master231 ~]# source ~\/.bashrc \n&#91;root@master231 ~]# \n&#91;root@master231 ~]# helm   #\u8fde\u7eed\u63092\u6b21tab\u952e\u5373\u53ef\ncompletion  (generate autocompletion scripts for the specified shell)\ncreate      (create a new chart with the given name)\ndependency  (manage a chart's dependencies)\nenv         (helm client environment information)\nget         (download extended information of a named release)\nhelp        (Help about any command)\nhistory     (fetch release history)\ninstall     (install a chart)\nlint        (examine a chart for possible issues)\nlist        (list releases)\npackage     (package a chart directory into a chart archive)\nplugin      (install, list, or uninstall Helm plugins)\npull        (download a chart from a repository and (optionally) unpack it in local directory)\npush        (push a chart to remote)\nregistry    (login to or logout from a registry)\nrepo        (add, list, remove, update, and index chart repositories)\nrollback    (roll back a release to a previous revision)\nsearch      (search for a keyword in charts)\nshow        (show information of a chart)\nstatus      (display the status of the named release)\ntemplate    (locally render templates)\ntest        (run tests for a release)\nuninstall   (uninstall a release)\nupgrade     (upgrade a release)\nverify      (verify that a chart at the given path has been signed and is valid)\nversion     (print the client version information)<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"ZwMdF\">1.3helm\u7684Chart\u57fa\u672c\u7ba1\u7406<\/h2>\n\n\n\n<pre id=\"X01jr\" class=\"wp-block-code\"><code>\t1.\u521b\u5efaChart\n&#91;root@master231 ~]# mkdir -p \/oldboyedu\/manifests\/add-ons\/helm-Chart\n&#91;root@master231 ~]# \n&#91;root@master231 ~]# cd \/oldboyedu\/manifests\/add-ons\/helm-Chart\n&#91;root@master231 helm-Chart]# \n&#91;root@master231 helm-Chart]#  apt -y install tree\n&#91;root@master231 helm-Chart]# \n&#91;root@master231 helm-Chart]# helm create oldboyedu-linux\nCreating oldboyedu-linux\n&#91;root@master231 helm-Chart]# \n&#91;root@master231 helm-Chart]# ll\ntotal 12\ndrwxr-xr-x 3 root root 4096 Dec 17 15:32 .\/\ndrwxr-xr-x 7 root root 4096 Dec 17 15:31 ..\/\ndrwxr-xr-x 4 root root 4096 Dec 17 15:32 oldboyedu-linux\/   #\u591a\u4e86\u4e00\u4e2a\u76ee\u5f55\n&#91;root@master231 helm-Chart]# \n\n\n\t2.\u67e5\u770bChart\u7ed3\u6784\n&#91;root@master231 helm-Chart]# tree oldboyedu-linux\noldboyedu-linux\/\n\u251c\u2500\u2500 charts   # \u5305\u542bchart\u4f9d\u8d56\u7684\u5176\u4ed6chart\n\u251c\u2500\u2500 Chart.yaml  # \u5305\u542b\u4e86chart\u4fe1\u606f\u7684YAML\u6587\u4ef6\n\u251c\u2500\u2500 templates  # \u6a21\u677f\u76ee\u5f55\uff0c \u5f53\u548cvalues \u7ed3\u5408\u65f6\uff0c\u53ef\u751f\u6210\u6709\u6548\u7684Kubernetes manifest\u6587\u4ef6\n\u2502   \u251c\u2500\u2500 deployment.yaml  # deployment\u8d44\u6e90\u6e05\u5355\u6a21\u677f\u3002\n\u2502   \u251c\u2500\u2500 _helpers.tpl  # \u81ea\u5b9a\u4e49\u6a21\u677f\n\u2502   \u251c\u2500\u2500 hpa.yaml  # hpa\u8d44\u6e90\u6e05\u5355\u6a21\u677f\u3002\n\u2502   \u251c\u2500\u2500 ingress.yaml  # Ingress\u8d44\u6e90\u6e05\u5355\u6a21\u677f\u3002\n\u2502   \u251c\u2500\u2500 NOTES.txt  # \u53ef\u9009: \u5305\u542b\u7b80\u8981\u4f7f\u7528\u8bf4\u660e\u7684\u7eaf\u6587\u672c\u6587\u4ef6\n\u2502   \u251c\u2500\u2500 serviceaccount.yaml # sa\u8d44\u6e90\u6e05\u5355\u6a21\u677f\u3002\n\u2502   \u251c\u2500\u2500 service.yaml  # svc\u8d44\u6e90\u6e05\u5355\u6a21\u677f\u3002\n\u2502   \u2514\u2500\u2500 tests  # \u6d4b\u8bd5\u76ee\u5f55\n\u2502       \u2514\u2500\u2500 test-connection.yaml\n\u2514\u2500\u2500 values.yaml  # chart \u9ed8\u8ba4\u7684\u914d\u7f6e\u503c\n\n3 directories, 10 files\n&#91;root@master231 helm-Chart]#\n\t\n\t\n\t3.\u4fee\u6539\u9ed8\u8ba4\u7684values.yaml\n&#91;root@master231 helm-Chart]# egrep \"repository:|tag:\" oldboyedu-linux\/values.yaml \n  repository: nginx\n  tag: \"\"\n&#91;root@master231 helm-Chart]# \n&#91;root@master231 helm-Chart]# sed -i \"\/repository\\:\/s#nginx#registry.cn-hangzhou.aliyuncs.com\/yinzhengjie-k8s\/apps#\" oldboyedu-linux\/values.yaml\n&#91;root@master231 helm-Chart]# \n&#91;root@master231 helm-Chart]# sed -ri '\/tag\\:\/s#tag: \"\"#tag: v1#' oldboyedu-linux\/values.yaml \n&#91;root@master231 helm-Chart]# \n&#91;root@master231 helm-Chart]# egrep \"repository:|tag:\" oldboyedu-linux\/values.yaml \n  repository: registry.cn-hangzhou.aliyuncs.com\/yinzhengjie-k8s\/apps\n  tag: v1\n&#91;root@master231 helm-Chart]# \n\n\n\t4.\u57fa\u4e8eChart\u5b89\u88c5\u670d\u52a1 \u53d1\u884cRelease\n&#91;root@master231 helm-Chart]# kubectl get deploy,hpa,svc,sa,po -o wide -n kube-public \nNAME                     SECRETS   AGE\nserviceaccount\/default   1         17d\n&#91;root@master231 helm-Chart]# \n&#91;root@master231 helm-Chart]# helm -n kube-public install xiuxian oldboyedu-linux\nNAME: xiuxian\nLAST DEPLOYED: Wed Dec 17 15:38:55 2025\nNAMESPACE: kube-public\nSTATUS: deployed\nREVISION: 1\nNOTES:\n1. Get the application URL by running these commands:\n  export POD_NAME=$(kubectl get pods --namespace kube-public -l \"app.kubernetes.io\/name=oldboyedu-linux,app.kubernetes.io\/instance=xiuxian\" -o jsonpath=\"{.items&#91;0].metadata.name}\")\n  export CONTAINER_PORT=$(kubectl get pod --namespace kube-public $POD_NAME -o jsonpath=\"{.spec.containers&#91;0].ports&#91;0].containerPort}\")\n  echo \"Visit http:\/\/127.0.0.1:8080 to use your application\"\n  kubectl --namespace kube-public port-forward $POD_NAME 8080:$CONTAINER_PORT\n&#91;root@master231 helm-Chart]# \n\n\n\t5.\u67e5\u770bRelease\u5217\u8868\u5e76\u67e5\u770bK8S\u7684\u8d44\u6e90\u53d8\u5316\n&#91;root@master231 helm-Chart]# helm list -n kube-public \nNAME   \tNAMESPACE  \tREVISION\tUPDATED                                \tSTATUS  \tCHART                \tAPP VERSION\nxiuxian\tkube-public\t1       \t2025-12-17 15:38:55.471776112 +0800 CST\tdeployed\toldboyedu-linux-0.1.0\t1.16.0     \n&#91;root@master231 helm-Chart]# \n#helm\u81ea\u5df1\u5168\u90fd\u7ed9\u521b\u5efa\u4e86\n&#91;root@master231 helm-Chart]# kubectl get deploy,hpa,svc,sa,po -o wide -n kube-public \nNAME                                      READY   UP-TO-DATE   AVAILABLE   AGE    CONTAINERS        IMAGES                                                      SELECTOR\ndeployment.apps\/xiuxian-oldboyedu-linux   1\/1     1            1           2m4s   oldboyedu-linux   registry.cn-hangzhou.aliyuncs.com\/yinzhengjie-k8s\/apps:v1   app.kubernetes.io\/instance=xiuxian,app.kubernetes.io\/name=oldboyedu-linux\n\nNAME                              TYPE        CLUSTER-IP      EXTERNAL-IP   PORT(S)   AGE    SELECTOR\nservice\/xiuxian-oldboyedu-linux   ClusterIP   10.200.136.76   &lt;none&gt;        80\/TCP    2m4s   app.kubernetes.io\/instance=xiuxian,app.kubernetes.io\/name=oldboyedu-linux\n\nNAME                                     SECRETS   AGE\nserviceaccount\/default                   1         17d\nserviceaccount\/xiuxian-oldboyedu-linux   1         2m4s\n\nNAME                                           READY   STATUS    RESTARTS   AGE    IP             NODE        NOMINATED NODE   READINESS GATES\npod\/xiuxian-oldboyedu-linux-6847ff7955-2xtnm   1\/1     Running   0          2m4s   10.100.1.226   worker232   &lt;none&gt;           &lt;none&gt;\n&#91;root@master231 helm-Chart]# \n\n\n\t6.\u6d4b\u8bd5\u8bbf\u95ee\n&#91;root@master231 helm-Chart]# curl 10.100.1.226\n&lt;!DOCTYPE html&gt;\n&lt;html&gt;\n  &lt;head&gt;\n    &lt;meta charset=\"utf-8\"\/&gt;\n    &lt;title&gt;yinzhengjie apps v1&lt;\/title&gt;\n    &lt;style&gt;\n       div img {\n          width: 900px;\n          height: 600px;\n          margin: 0;\n       }\n    &lt;\/style&gt;\n  &lt;\/head&gt;\n\n  &lt;body&gt;\n    &lt;h1 style=\"color: green\"&gt;\u51e1\u4eba\u4fee\u4ed9\u4f20 v1 &lt;\/h1&gt;\n    &lt;div&gt;\n      &lt;img src=\"1.jpg\"&gt;\n    &lt;div&gt;\n  &lt;\/body&gt;\n\n&lt;\/html&gt;\n&#91;root@master231 helm-Chart]# \n&#91;root@master231 helm-Chart]# curl 10.200.136.76\n&lt;!DOCTYPE html&gt;\n&lt;html&gt;\n  &lt;head&gt;\n    &lt;meta charset=\"utf-8\"\/&gt;\n    &lt;title&gt;yinzhengjie apps v1&lt;\/title&gt;\n    &lt;style&gt;\n       div img {\n          width: 900px;\n          height: 600px;\n          margin: 0;\n       }\n    &lt;\/style&gt;\n  &lt;\/head&gt;\n\n  &lt;body&gt;\n    &lt;h1 style=\"color: green\"&gt;\u51e1\u4eba\u4fee\u4ed9\u4f20 v1 &lt;\/h1&gt;\n    &lt;div&gt;\n      &lt;img src=\"1.jpg\"&gt;\n    &lt;div&gt;\n  &lt;\/body&gt;\n\n&lt;\/html&gt;\n&#91;root@master231 helm-Chart]# \n\n\n\t7.\u5378\u8f7d\u670d\u52a1\n&#91;root@master231 helm-Chart]# helm list -n kube-public \nNAME   \tNAMESPACE  \tREVISION\tUPDATED                                \tSTATUS  \tCHART                \tAPP VERSION\nxiuxian\tkube-public\t1       \t2025-12-17 15:38:55.471776112 +0800 CST\tdeployed\toldboyedu-linux-0.1.0\t1.16.0     \n&#91;root@master231 helm-Chart]# \n&#91;root@master231 helm-Chart]# helm  -n kube-public  uninstall xiuxian \nrelease \"xiuxian\" uninstalled\n&#91;root@master231 helm-Chart]# \n&#91;root@master231 helm-Chart]# helm list -n kube-public \nNAME\tNAMESPACE\tREVISION\tUPDATED\tSTATUS\tCHART\tAPP VERSION\n&#91;root@master231 helm-Chart]# \n&#91;root@master231 helm-Chart]# kubectl get deploy,hpa,svc,sa,po -o wide -n kube-public \nNAME                     SECRETS   AGE\nserviceaccount\/default   1         17d\n&#91;root@master231 helm-Chart]#<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"tBgZY\">1.4helm\u7684\u4e24\u79cd\u5347\u7ea7\u65b9\u5f0f\u6848\u4f8b<\/h2>\n\n\n\n<pre id=\"gdpkz\" class=\"wp-block-code\"><code>\t1.\u5b89\u88c5\u65e7\u7684\u670d\u52a1\n&#91;root@master231 helm-Chart]# helm -n kube-public install xiuxian oldboyedu-linux\nNAME: xiuxian\nLAST DEPLOYED: Wed Dec 17 16:09:12 2025\nNAMESPACE: kube-public\nSTATUS: deployed\nREVISION: 1\nNOTES:\n1. Get the application URL by running these commands:\n  export POD_NAME=$(kubectl get pods --namespace kube-public -l \"app.kubernetes.io\/name=oldboyedu-linux,app.kubernetes.io\/instance=xiuxian\" -o jsonpath=\"{.items&#91;0].metadata.name}\")\n  export CONTAINER_PORT=$(kubectl get pod --namespace kube-public $POD_NAME -o jsonpath=\"{.spec.containers&#91;0].ports&#91;0].containerPort}\")\n  echo \"Visit http:\/\/127.0.0.1:8080 to use your application\"\n  kubectl --namespace kube-public port-forward $POD_NAME 8080:$CONTAINER_PORT\n&#91;root@master231 helm-Chart]# \n&#91;root@master231 helm-Chart]# kubectl get deploy,hpa,svc,sa,po -o wide -n kube-public\nNAME                                      READY   UP-TO-DATE   AVAILABLE   AGE   CONTAINERS        IMAGES                                                      SELECTOR\ndeployment.apps\/xiuxian-oldboyedu-linux   1\/1     1            1           20s   oldboyedu-linux   registry.cn-hangzhou.aliyuncs.com\/yinzhengjie-k8s\/apps:v1   app.kubernetes.io\/instance=xiuxian,app.kubernetes.io\/name=oldboyedu-linux\n\nNAME                              TYPE        CLUSTER-IP     EXTERNAL-IP   PORT(S)   AGE   SELECTOR\nservice\/xiuxian-oldboyedu-linux   ClusterIP   10.200.198.9   &lt;none&gt;        80\/TCP    20s   app.kubernetes.io\/instance=xiuxian,app.kubernetes.io\/name=oldboyedu-linux\n\nNAME                                     SECRETS   AGE\nserviceaccount\/default                   1         17d\nserviceaccount\/xiuxian-oldboyedu-linux   1         20s\n\nNAME                                           READY   STATUS    RESTARTS   AGE   IP             NODE        NOMINATED NODE   READINESS GATES\npod\/xiuxian-oldboyedu-linux-6847ff7955-mkrv7   1\/1     Running   0          20s   10.100.1.227   worker232   &lt;none&gt;           &lt;none&gt;\n&#91;root@master231 helm-Chart]# \n\n\t2.\u6d4b\u8bd5\u8bbf\u95eesvc\n&#91;root@worker232 ~]# curl 10.200.198.9\n&lt;!DOCTYPE html&gt;\n&lt;html&gt;\n  &lt;head&gt;\n    &lt;meta charset=\"utf-8\"\/&gt;\n    &lt;title&gt;yinzhengjie apps v1&lt;\/title&gt;\n    &lt;style&gt;\n       div img {\n          width: 900px;\n          height: 600px;\n          margin: 0;\n       }\n    &lt;\/style&gt;\n  &lt;\/head&gt;\n\n  &lt;body&gt;\n    &lt;h1 style=\"color: green\"&gt;\u51e1\u4eba\u4fee\u4ed9\u4f20 v1 &lt;\/h1&gt;\n    &lt;div&gt;\n      &lt;img src=\"1.jpg\"&gt;\n    &lt;div&gt;\n  &lt;\/body&gt;\n\n&lt;\/html&gt;\n&#91;root@worker232 ~]# \n\n\t\n\t3.\u4fee\u6539\u8981\u5347\u7ea7\u7684\u76f8\u5173\u53c2\u6570\n&#91;root@master231 helm-Chart]# egrep \"replicaCount|tag:\" oldboyedu-linux\/values.yaml\nreplicaCount: 1\n  tag: v1\n&#91;root@master231 helm-Chart]# \n&#91;root@master231 helm-Chart]# sed -i '\/replicaCount\/s#1#3#' oldboyedu-linux\/values.yaml \n&#91;root@master231 helm-Chart]# \n&#91;root@master231 helm-Chart]# sed -i \"\/tag:\/s#v1#v2#\" oldboyedu-linux\/values.yaml \n&#91;root@master231 helm-Chart]# \n&#91;root@master231 helm-Chart]# egrep \"replicaCount|tag:\" oldboyedu-linux\/values.yaml\nreplicaCount: 3\n  tag: v2\n&#91;root@master231 helm-Chart]# \n\n\n\t4.\u57fa\u4e8e\u6587\u4ef6\u65b9\u5f0f\u5347\u7ea7\n&#91;root@master231 helm-Chart]# helm -n kube-public upgrade xiuxian -f oldboyedu-linux\/values.yaml oldboyedu-linux\nRelease \"xiuxian\" has been upgraded. Happy Helming!\nNAME: xiuxian\nLAST DEPLOYED: Wed Dec 17 16:12:43 2025\nNAMESPACE: kube-public\nSTATUS: deployed\nREVISION: 2\nNOTES:\n1. Get the application URL by running these commands:\n  export POD_NAME=$(kubectl get pods --namespace kube-public -l \"app.kubernetes.io\/name=oldboyedu-linux,app.kubernetes.io\/instance=xiuxian\" -o jsonpath=\"{.items&#91;0].metadata.name}\")\n  export CONTAINER_PORT=$(kubectl get pod --namespace kube-public $POD_NAME -o jsonpath=\"{.spec.containers&#91;0].ports&#91;0].containerPort}\")\n  echo \"Visit http:\/\/127.0.0.1:8080 to use your application\"\n  kubectl --namespace kube-public port-forward $POD_NAME 8080:$CONTAINER_PORT\n&#91;root@master231 helm-Chart]# \n&#91;root@master231 helm-Chart]# helm list -n kube-public \nNAME   \tNAMESPACE  \tREVISION\tUPDATED                                \tSTATUS  \tCHART                \tAPP VERSION\nxiuxian\tkube-public\t2       \t2025-12-17 16:12:43.388020459 +0800 CST\tdeployed\toldboyedu-linux-0.1.0\t1.16.0     \n&#91;root@master231 helm-Chart]# \n\n\t5.\u9a8c\u8bc1\u5347\u7ea7\u6548\u679c\n&#91;root@master231 helm-Chart]# kubectl get deploy,hpa,svc,sa,po -o wide -n kube-public \nNAME                                      READY   UP-TO-DATE   AVAILABLE   AGE    CONTAINERS        IMAGES                                                      SELECTOR\ndeployment.apps\/xiuxian-oldboyedu-linux   3\/3     3            3           4m1s   oldboyedu-linux   registry.cn-hangzhou.aliyuncs.com\/yinzhengjie-k8s\/apps:v2   app.kubernetes.io\/instance=xiuxian,app.kubernetes.io\/name=oldboyedu-linux\n\nNAME                              TYPE        CLUSTER-IP     EXTERNAL-IP   PORT(S)   AGE    SELECTOR\nservice\/xiuxian-oldboyedu-linux   ClusterIP   10.200.198.9   &lt;none&gt;        80\/TCP    4m1s   app.kubernetes.io\/instance=xiuxian,app.kubernetes.io\/name=oldboyedu-linux\n\nNAME                                     SECRETS   AGE\nserviceaccount\/default                   1         17d\nserviceaccount\/xiuxian-oldboyedu-linux   1         4m1s\n\nNAME                                           READY   STATUS    RESTARTS   AGE   IP             NODE        NOMINATED NODE   READINESS GATES\npod\/xiuxian-oldboyedu-linux-5576db869d-4pp7b   1\/1     Running   0          28s   10.100.2.161   worker233   &lt;none&gt;           &lt;none&gt;\npod\/xiuxian-oldboyedu-linux-5576db869d-8rbsf   1\/1     Running   0          25s   10.100.0.82    master231   &lt;none&gt;           &lt;none&gt;\npod\/xiuxian-oldboyedu-linux-5576db869d-hzw6n   1\/1     Running   0          30s   10.100.1.228   worker232   &lt;none&gt;           &lt;none&gt;\n&#91;root@master231 helm-Chart]# \n&#91;root@master231 helm-Chart]# curl 10.200.198.9\n&lt;!DOCTYPE html&gt;\n&lt;html&gt;\n  &lt;head&gt;\n    &lt;meta charset=\"utf-8\"\/&gt;\n    &lt;title&gt;yinzhengjie apps v2&lt;\/title&gt;\n    &lt;style&gt;\n       div img {\n          width: 900px;\n          height: 600px;\n          margin: 0;\n       }\n    &lt;\/style&gt;\n  &lt;\/head&gt;\n\n  &lt;body&gt;\n    &lt;h1 style=\"color: red\"&gt;\u51e1\u4eba\u4fee\u4ed9\u4f20 v2 &lt;\/h1&gt;\n    &lt;div&gt;\n      &lt;img src=\"2.jpg\"&gt;\n    &lt;div&gt;\n  &lt;\/body&gt;\n\n&lt;\/html&gt;\n&#91;root@master231 helm-Chart]# \n\n\n\t6.\u57fa\u4e8e\u73af\u5883\u53d8\u91cf\u65b9\u5f0f\u5347\u7ea7\n&#91;root@master231 helm-Chart]# helm -n kube-public upgrade xiuxian --set replicaCount=5,image.tag=v3 oldboyedu-linux\nRelease \"xiuxian\" has been upgraded. Happy Helming!\nNAME: xiuxian\nLAST DEPLOYED: Wed Dec 17 16:15:29 2025\nNAMESPACE: kube-public\nSTATUS: deployed\nREVISION: 3\nNOTES:\n1. Get the application URL by running these commands:\n  export POD_NAME=$(kubectl get pods --namespace kube-public -l \"app.kubernetes.io\/name=oldboyedu-linux,app.kubernetes.io\/instance=xiuxian\" -o jsonpath=\"{.items&#91;0].metadata.name}\")\n  export CONTAINER_PORT=$(kubectl get pod --namespace kube-public $POD_NAME -o jsonpath=\"{.spec.containers&#91;0].ports&#91;0].containerPort}\")\n  echo \"Visit http:\/\/127.0.0.1:8080 to use your application\"\n  kubectl --namespace kube-public port-forward $POD_NAME 8080:$CONTAINER_PORT\n&#91;root@master231 helm-Chart]# \n&#91;root@master231 helm-Chart]# helm -n kube-public list\nNAME   \tNAMESPACE  \tREVISION\tUPDATED                                \tSTATUS  \tCHART                \tAPP VERSION\nxiuxian\tkube-public\t3       \t2025-12-17 16:15:29.682751815 +0800 CST\tdeployed\toldboyedu-linux-0.1.0\t1.16.0     \n&#91;root@master231 helm-Chart]# \n\n\n\t7.\u518d\u6b21\u9a8c\u8bc1\u5347\u7ea7\u6548\u679c\n&#91;root@master231 helm-Chart]# kubectl get deploy,hpa,svc,sa,po -o wide -n kube-public \nNAME                                      READY   UP-TO-DATE   AVAILABLE   AGE     CONTAINERS        IMAGES                                                      SELECTOR\ndeployment.apps\/xiuxian-oldboyedu-linux   5\/5     5            5           6m53s   oldboyedu-linux   registry.cn-hangzhou.aliyuncs.com\/yinzhengjie-k8s\/apps:v3   app.kubernetes.io\/instance=xiuxian,app.kubernetes.io\/name=oldboyedu-linux\n\nNAME                              TYPE        CLUSTER-IP     EXTERNAL-IP   PORT(S)   AGE     SELECTOR\nservice\/xiuxian-oldboyedu-linux   ClusterIP   10.200.198.9   &lt;none&gt;        80\/TCP    6m53s   app.kubernetes.io\/instance=xiuxian,app.kubernetes.io\/name=oldboyedu-linux\n\nNAME                                     SECRETS   AGE\nserviceaccount\/default                   1         17d\nserviceaccount\/xiuxian-oldboyedu-linux   1         6m53s\n\nNAME                                         READY   STATUS    RESTARTS   AGE   IP             NODE        NOMINATED NODE   READINESS GATES\npod\/xiuxian-oldboyedu-linux-7d8557d5-czqgk   1\/1     Running   0          35s   10.100.2.163   worker233   &lt;none&gt;           &lt;none&gt;\npod\/xiuxian-oldboyedu-linux-7d8557d5-fw5w8   1\/1     Running   0          35s   10.100.0.83    master231   &lt;none&gt;           &lt;none&gt;\npod\/xiuxian-oldboyedu-linux-7d8557d5-pjcv7   1\/1     Running   0          33s   10.100.1.231   worker232   &lt;none&gt;           &lt;none&gt;\npod\/xiuxian-oldboyedu-linux-7d8557d5-sfqck   1\/1     Running   0          33s   10.100.2.164   worker233   &lt;none&gt;           &lt;none&gt;\npod\/xiuxian-oldboyedu-linux-7d8557d5-zls6c   1\/1     Running   0          35s   10.100.1.229   worker232   &lt;none&gt;           &lt;none&gt;\n&#91;root@master231 helm-Chart]# \n&#91;root@master231 helm-Chart]# curl 10.200.198.9\n&lt;!DOCTYPE html&gt;\n&lt;html&gt;\n  &lt;head&gt;\n    &lt;meta charset=\"utf-8\"\/&gt;\n    &lt;title&gt;yinzhengjie apps v3&lt;\/title&gt;\n    &lt;style&gt;\n       div img {\n          width: 900px;\n          height: 600px;\n          margin: 0;\n       }\n    &lt;\/style&gt;\n  &lt;\/head&gt;\n\n  &lt;body&gt;\n    &lt;h1 style=\"color: pink\"&gt;\u51e1\u4eba\u4fee\u4ed9\u4f20 v3 &lt;\/h1&gt;\n    &lt;div&gt;\n      &lt;img src=\"3.jpg\"&gt;\n    &lt;div&gt;\n  &lt;\/body&gt;\n\n&lt;\/html&gt;\n&#91;root@master231 helm-Chart]# <\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>1.1helm\u6982\u8ff0 1\uff09\u4ec0\u4e48\u662fhelm\uff1f 2\uff09helm\u7684\u67b6\u6784\u7248\u672c\u9009\u62e9 3\uff09helm\u7684\u76f8\u5173\u672f\u8bed 1.2\u5b89\u88c5hel [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":56,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":["post-142","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-linux"],"_links":{"self":[{"href":"https:\/\/www.xueyaa.top\/index.php?rest_route=\/wp\/v2\/posts\/142","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.xueyaa.top\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.xueyaa.top\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.xueyaa.top\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.xueyaa.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=142"}],"version-history":[{"count":3,"href":"https:\/\/www.xueyaa.top\/index.php?rest_route=\/wp\/v2\/posts\/142\/revisions"}],"predecessor-version":[{"id":152,"href":"https:\/\/www.xueyaa.top\/index.php?rest_route=\/wp\/v2\/posts\/142\/revisions\/152"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.xueyaa.top\/index.php?rest_route=\/wp\/v2\/media\/56"}],"wp:attachment":[{"href":"https:\/\/www.xueyaa.top\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=142"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.xueyaa.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=142"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.xueyaa.top\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=142"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}