快速上手

安装Helm

根据官方文档介绍,选择对应的安装方式。
1、二进制版本安装
2、包管理器安装(比如brew install kubernetes-helm)
3、脚本安装

  1. # 确认helm版本
  2. root@master:~# helm version
  3. version.BuildInfo{Version:"v3.0.3", GitCommit:"ac925eb7279f4a6955df663a0128044a8a6b7593", GitTreeState:"clean", GoVersion:"go1.13.6"}

仓库初始化

  • helm search hub从Artifact Hub中查找并列出 helm charts。 Artifact Hub中存放了大量不同的仓库。
  • helm search repo从你添加(使用helm repo add)到本地 helm 客户端中的仓库中进行查找。该命令基于本地数据进行搜索,无需连接互联网。 ```bash

    添加一个公开repo

    [root@harbor ~]# helm repo add bitnami https://charts.bitnami.com/bitnami “bitnami” has been added to your repositories [root@harbor ~]# helm repo list NAME URL bitnami https://charts.bitnami.com/bitnami

查询当前repo的所有chart列表

[root@harbor ~]# helm search repo nginx NAME CHART VERSION APP VERSION DESCRIPTION bitnami/nginx 8.9.0 1.19.10 Chart for the nginx server bitnami/nginx-ingress-controller 7.6.6 0.46.0 Chart for the nginx Ingress controller bitnami/kong 3.7.0 2.4.0 Kong is a scalable, open source API layer (aka …

  1. <a name="u3eGf"></a>
  2. ## 安装Chart
  3. helm install命令可以从多个来源进行安装:
  4. - chart 的仓库(如上所述)
  5. - 本地 chart 压缩包(helm install foo foo-0.1.1.tgz)
  6. - 解压后的 chart 目录(helm install foo path/to/foo)
  7. - 完整的 URL(helm install foo https://example.com/charts/foo-1.2.3.tgz)
  8. 使用helm install命令来安装一个新的 helm 包。最简单的使用方法只需要传入两个参数:你命名的release名字(或者--generate-name)和你想安装的chart的名称。
  9. ```bash
  10. # 查看chart基本信息
  11. [root@harbor ~]# helm show chart bitnami/nginx
  12. annotations:
  13. category: Infrastructure
  14. apiVersion: v2
  15. appVersion: 1.19.10
  16. dependencies:
  17. - name: common
  18. repository: https://charts.bitnami.com/bitnami
  19. tags:
  20. - bitnami-common
  21. version: 1.x.x
  22. description: Chart for the nginx server
  23. home: https://github.com/bitnami/charts/tree/master/bitnami/nginx
  24. icon: https://bitnami.com/assets/stacks/nginx/img/nginx-stack-220x234.png
  25. keywords:
  26. - nginx
  27. - http
  28. - web
  29. - www
  30. - reverse proxy
  31. maintainers:
  32. - email: containers@bitnami.com
  33. name: Bitnami
  34. name: nginx
  35. sources:
  36. - https://github.com/bitnami/bitnami-docker-nginx
  37. - http://www.nginx.org
  38. version: 8.9.0
  39. # 部署chart
  40. [root@harbor ~]# helm install bitnami/nginx --generate-name
  41. Error: Kubernetes cluster unreachable
  42. # 查看部署状态
  43. $ helm list
  44. NAME VERSION UPDATED STATUS CHART
  45. smiling-penguin 1 Wed Sep 28 12:59:46 2016 DEPLOYED mysql-0.1.0
  1. # 解决无法执行helm的问题
  2. [root@liaoxb-nroow6grda6k-master-0]# helm
  3. -bash: helm: 未找到命令
  4. [root@liaoxb-nroow6grda6k-master-0 bin]# ll /usr/local/bin/
  5. 总用量 333996
  6. -rwxr-xr-x 1 root root 45109248 6 17 00:09 helm
  7. -rwxr-xr-x 1 root root 148447816 6 23 00:26 kubectl
  8. -rwxr-xr-x 1 root root 148447816 6 23 00:26 kubelet
  9. [root@liaoxb-nroow6grda6k-master-0 ~]# export PATH=/usr/local/bin:$PATH
  10. [root@liaoxb-nroow6grda6k-master-0 istio-1.8.1]# helm version
  11. version.BuildInfo{Version:"v3.6.1", GitCommit:"61d8e8c4a6f95540c15c6a65f36a6dd0a45e7a2f", GitTreeState:"clean", GoVersion:"go1.16.5"}
  12. # 添加稳定的仓库
  13. [root@liaoxb-nroow6grda6k-master-0 ~]# helm repo add bitnami https://charts.bitnami.com/bitnami
  14. "bitnami" has been added to your repositories
  15. [root@liaoxb-nroow6grda6k-master-0 ~]# helm repo update
  16. Hang tight while we grab the latest from your chart repositories...
  17. ...Successfully got an update from the "bitnami" chart repository
  18. Update Complete. Happy Helming!⎈
  19. # helm部署istio
  20. [root@liaoxb-nroow6grda6k-master-0 ~]# cd istio-1.8.1/
  21. [root@liaoxb-nroow6grda6k-master-0 istio-1.8.1]# ll
  22. 总用量 24
  23. drwxr-x--- 2 root root 22 12 8 2020 bin
  24. -rw-r--r-- 1 root root 11348 12 8 2020 LICENSE
  25. drwxr-xr-x 5 root root 52 12 8 2020 manifests
  26. -rw-r----- 1 root root 853 12 8 2020 manifest.yaml
  27. -rw-r--r-- 1 root root 5866 12 8 2020 README.md
  28. drwxr-xr-x 19 root root 307 12 8 2020 samples
  29. drwxr-x--- 3 root root 83 12 8 2020 tools
  30. [root@liaoxb-nroow6grda6k-master-0 istio-1.8.1]# helm install istio-base manifests/charts/base -n istio-system
  31. NAME: istio-base
  32. LAST DEPLOYED: Wed Jun 23 13:26:37 2021
  33. NAMESPACE: istio-system
  34. STATUS: deployed
  35. REVISION: 1
  36. TEST SUITE: None