{"id":1446,"date":"2023-03-23T22:13:42","date_gmt":"2023-03-23T14:13:42","guid":{"rendered":"https:\/\/www.appblog.cn\/?p=1446"},"modified":"2023-04-28T20:50:28","modified_gmt":"2023-04-28T12:50:28","slug":"kubernetes-1-15-install-and-deploy-of-helm-plugin","status":"publish","type":"post","link":"https:\/\/www.appblog.cn\/index.php\/2023\/03\/23\/kubernetes-1-15-install-and-deploy-of-helm-plugin\/","title":{"rendered":"Kubernetes 1.15\u5b89\u88c5\u90e8\u7f72helm\u63d2\u4ef6"},"content":{"rendered":"<h2>\u7b80\u5355\u4ecb\u7ecd<\/h2>\n<p>Helm\u5176\u5b9e\u5c31\u662f\u4e00\u4e2a\u57fa\u4e8eKubernetes\u7684\u7a0b\u5e8f\u5305\uff08\u8d44\u6e90\u5305\uff09\u7ba1\u7406\u5668\uff0c\u5b83\u5c06\u4e00\u4e2a\u5e94\u7528\u7684\u76f8\u5173\u8d44\u6e90\u7ec4\u7ec7\u6210\u4e3aCharts\uff0c\u5e76\u901a\u8fc7Charts\u7ba1\u7406\u7a0b\u5e8f\u5305\u3002\u518d\u7b80\u5355\u70b9\u8bf4\uff0c\u53ef\u4ee5\u5f53\u505aRHEL\/CentOS\u7cfb\u7edf\u4e2d\u7684yum\u673a\u5236\uff0c\u6709yum install\uff0c\u4e5f\u6709helm install\u7b49\u7b49\u3002\u5177\u4f53\u53ef\u4ee5\u53c2\u8003\u7f51\u4e0a\u5176\u4ed6\u4ecb\u7ecd\u3002<\/p>\n<p><!-- more --><\/p>\n<p>GitHub\uff1a<a target=\"_blank\" rel=\"noopener\" href=\"https:\/\/github.com\/helm\/helm\">https:\/\/github.com\/helm\/helm<\/a><br \/>\n\u5b98\u7f51\uff1a<a target=\"_blank\" rel=\"noopener\" href=\"https:\/\/helm.sh\/docs\/using_helm\/#quickstart-guide\">https:\/\/helm.sh\/docs\/using_helm\/#quickstart-guide<\/a><\/p>\n<h2>\u5177\u4f53\u6b65\u9aa4<\/h2>\n<h3>\u5b89\u88c5\u5ba2\u6237\u7aefHelm\u547d\u4ee4<\/h3>\n<p>\u53c2\u8003\uff1a<a target=\"_blank\" rel=\"noopener\" href=\"https:\/\/github.com\/helm\/helm\/releases\">https:\/\/github.com\/helm\/helm\/releases<\/a><\/p>\n<pre><code>[root@k8s-master ~]# wget https:\/\/storage.googleapis.com\/kubernetes-helm\/helm-v2.14.1-linux-amd64.tar.gz\n[root@k8s-master ~]# mv linux-amd64\/helm  \/usr\/local\/bin\/\n[root@k8s-master ~]# helm version<\/code><\/pre>\n<h3>\u5b89\u88c5Tiller\u670d\u52a1<\/h3>\n<p>Tiller\u662fhelm\u7684\u670d\u52a1\u5668\u7aef\uff0c\u4e00\u822c\u8fd0\u884c\u4e8ekubernetes\u96c6\u7fa4\u4e4b\u4e0a\uff0c\u5f53\u7136\u5c11\u4e0d\u4e86RBAC\u6388\u6743\uff0c\u4e8b\u5148\u521b\u5efa\u76f8\u5173\u7684ServiceAccount\u624d\u80fd\u8fdb\u884c\u5b89\u88c5\u3002<\/p>\n<p>\u4e0b\u9762\u7ed9\u51fa\u4e86\u4e00\u4e2a\u6837\u4f8byaml\u6e05\u5355\uff0c\u5b9a\u4e49\u4e86\u4e00\u4e2a\u540d\u4e3atiller\u7684ServiceAccount\uff0c\u5e76\u901a\u8fc7ClusterRoleBinding\u5c06\u5176\u7ed1\u5b9a\u81f3\u96c6\u7fa4\u7ba1\u7406\u5458\u89d2\u8272cluster-admin\uff0c\u4ece\u800c\u4f7f\u5f97\u5b83\u62e5\u6709\u96c6\u7fa4\u7ea7\u522b\u6240\u6709\u7684\u6700\u9ad8\u6743\u9650\uff1a<\/p>\n<pre><code>[root@k8s-master ~]# vim tiller-rbac-config.yaml<\/code><\/pre>\n<pre><code class=\"language-yml\">apiVersion: v1\nkind: ServiceAccount\nmetadata:\n  name: tiller\n  namespace: kube-system\n---\napiVersion: rbac.authorization.k8s.io\/v1\nkind: ClusterRoleBinding\nmetadata:\n  name: tiller\nroleRef:\n  apiGroup: rbac.authorization.k8s.io\n  kind: ClusterRole\n  name: cluster-admin\nsubjects:\n  - kind: ServiceAccount\n    name: tiller\n    namespace: kube-system<\/code><\/pre>\n<p>\u53d1\u5e03\u5230kubernetes\u96c6\u7fa4\u4e2d\u53bb\uff1a<\/p>\n<pre><code>[root@k8s-master ~]# kubectl apply -f tiller-rbac-config.yaml \nserviceaccount\/tiller created\nclusterrolebinding.rbac.authorization.k8s.io\/tiller created<\/code><\/pre>\n<p>\u63a5\u4e0b\u6765\uff0c\u521d\u59cb\u5316Tiller\u670d\u52a1\uff1a<\/p>\n<pre><code>[root@k8s-master ~]# helm init --upgrade --service-account tiller --tiller-image registry.cn-hangzhou.aliyuncs.com\/google_containers\/tiller:v2.14.1 --stable-repo-url https:\/\/kubernetes.oss-cn-hangzhou.aliyuncs.com\/charts\nCreating \/root\/.helm \nCreating \/root\/.helm\/repository \nCreating \/root\/.helm\/repository\/cache \nCreating \/root\/.helm\/repository\/local \nCreating \/root\/.helm\/plugins \nCreating \/root\/.helm\/starters \nCreating \/root\/.helm\/cache\/archive \nCreating \/root\/.helm\/repository\/repositories.yaml \nAdding stable repo with URL: https:\/\/kubernetes.oss-cn-hangzhou.aliyuncs.com\/charts \nAdding local repo with URL: http:\/\/127.0.0.1:8879\/charts \n$HELM_HOME has been configured at \/root\/.helm.\n\nTiller (the Helm server-side component) has been installed into your Kubernetes Cluster.\n\nPlease note: by default, Tiller is deployed with an insecure &#039;allow unauthenticated users&#039; policy.\nTo prevent this, run `helm init` with the --tiller-tls-verify flag.\nFor more information on securing your installation see: https:\/\/docs.helm.sh\/using_helm\/#securing-your-helm-installation<\/code><\/pre>\n<p>\u5982\u4e0a\u663e\u793a\uff0c\u521d\u59cb\u5316\u6210\u529f\uff01<\/p>\n<blockquote>\n<p>\u6ce8\u610f\uff1ahelm init\u547d\u4ee4\u8fdb\u884c\u521d\u59cb\u5316\u65f6\uff0cKubernetes\u96c6\u7fa4\u4f1a\u5230<code>gcr.io\/kubernetes-helm\/<\/code>\u4e0a\u83b7\u53d6\u6240\u9700\u7684\u955c\u50cf\uff0c\u88ab\u5899\uff0c\u6545\u6307\u5b9a\u66ff\u4ee3\u955c\u50cf\u53ef\u4ee5\u89e3\u51b3\u3002\u540c\u65f6\u8fd8\u8981\u5c06repo\u6e90\u66f4\u6362\u6210\u963f\u91cc\u7684\u955c\u50cf\uff0c\u66f4\u5feb\u66f4\u4fbf\u6377\u3002<\/p>\n<\/blockquote>\n<h3>helm\u547d\u4ee4\u4f7f\u7528<\/h3>\n<p>\uff081\uff09\u66f4\u65b0\u4f7f\u7528\u7684\u9ed8\u8ba4\u4ed3\u5e93\u5143\u6570\u636e\u4fe1\u606f<\/p>\n<pre><code>[root@k8s-master ~]# helm repo update\nHang tight while we grab the latest from your chart repositories...\n...Skip local chart repository\n...Successfully got an update from the &quot;stable&quot; chart repository\nUpdate Complete.<\/code><\/pre>\n<p>\uff082\uff09\u641c\u7d22\u5217\u51fa<\/p>\n<pre><code>[root@k8s-master ~]# helm search redis\nNAME               CHART VERSION    APP VERSION    DESCRIPTION                                                 \nstable\/redis       1.1.15           4.0.8          Open source, advanced key-value store. It is often referr...\nstable\/redis-ha    2.0.1                           Highly available Redis cluster with multiple sentinels an...\nstable\/sensu       0.2.0                           Sensu monitoring framework backed by the Redis transport<\/code><\/pre>\n<p>\uff083\uff09\u6253\u5370\u6307\u5b9aCharts\u8be6\u7ec6\u4fe1\u606f<\/p>\n<pre><code>[root@k8s-master ~]# helm inspect stable\/redis<\/code><\/pre>\n<p>\uff084\uff09\u5b89\u88c5<\/p>\n<pre><code>[root@k8s-master ~]# helm install stable\/redis -n redis    \/\/ -n \u7ed9\u4e2a\u540d\u5b57\uff0c\u4e5f\u53ef\u4ee5\u5728\u5b89\u88c5\u524d\u52a0\u4e2a --dry-run \u7528\u4f5c\u6d4b\u8bd5<\/code><\/pre>\n<p>\uff085\uff09\u67e5\u770b\u5df2\u7ecf\u5b89\u88c5<\/p>\n<pre><code>[root@k8s-master ~]# helm list<\/code><\/pre>\n<p>\uff086\uff09\u5220\u9664\u5df2\u7ecf\u5b89\u88c5\u7684<\/p>\n<pre><code>[root@k8s-master ~]# helm delete redis<\/code><\/pre>\n<p>\uff087\uff09\u5176\u4ed6<\/p>\n<pre><code>[root@k8s-master ~]# helm upgrade\n[root@k8s-master ~]# helm rollback\n[root@k8s-master ~]# helm history<\/code><\/pre>\n<p>\u81f3\u6b64\uff0cHelm\u7684\u5b89\u88c5\u548c\u7b80\u5355\u4f7f\u7528\u5230\u6b64\u5b8c\u6210\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u7b80\u5355\u4ecb\u7ecd Helm\u5176\u5b9e\u5c31\u662f\u4e00\u4e2a\u57fa\u4e8eKubernetes\u7684\u7a0b\u5e8f\u5305\uff08\u8d44\u6e90\u5305\uff09\u7ba1\u7406\u5668\uff0c\u5b83\u5c06\u4e00\u4e2a\u5e94\u7528\u7684\u76f8\u5173\u8d44\u6e90\u7ec4\u7ec7\u6210\u4e3a [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[10],"tags":[357,356],"class_list":["post-1446","post","type-post","status-publish","format-standard","hentry","category-k8s","tag-helm","tag-kubernetes"],"_links":{"self":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts\/1446","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/comments?post=1446"}],"version-history":[{"count":0,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts\/1446\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/media?parent=1446"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/categories?post=1446"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/tags?post=1446"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}