快速上手
安装Helm
根据官方文档介绍,选择对应的安装方式。
1、二进制版本安装
2、包管理器安装(比如brew install kubernetes-helm)
3、脚本安装
# 确认helm版本root@master:~# helm versionversion.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 …
<a name="u3eGf"></a>## 安装Charthelm install命令可以从多个来源进行安装:- chart 的仓库(如上所述)- 本地 chart 压缩包(helm install foo foo-0.1.1.tgz)- 解压后的 chart 目录(helm install foo path/to/foo)- 完整的 URL(helm install foo https://example.com/charts/foo-1.2.3.tgz)使用helm install命令来安装一个新的 helm 包。最简单的使用方法只需要传入两个参数:你命名的release名字(或者--generate-name)和你想安装的chart的名称。```bash# 查看chart基本信息[root@harbor ~]# helm show chart bitnami/nginxannotations:category: InfrastructureapiVersion: v2appVersion: 1.19.10dependencies:- name: commonrepository: https://charts.bitnami.com/bitnamitags:- bitnami-commonversion: 1.x.xdescription: Chart for the nginx serverhome: https://github.com/bitnami/charts/tree/master/bitnami/nginxicon: https://bitnami.com/assets/stacks/nginx/img/nginx-stack-220x234.pngkeywords:- nginx- http- web- www- reverse proxymaintainers:- email: containers@bitnami.comname: Bitnaminame: nginxsources:- https://github.com/bitnami/bitnami-docker-nginx- http://www.nginx.orgversion: 8.9.0# 部署chart[root@harbor ~]# helm install bitnami/nginx --generate-nameError: Kubernetes cluster unreachable# 查看部署状态$ helm listNAME VERSION UPDATED STATUS CHARTsmiling-penguin 1 Wed Sep 28 12:59:46 2016 DEPLOYED mysql-0.1.0
# 解决无法执行helm的问题[root@liaoxb-nroow6grda6k-master-0]# helm-bash: helm: 未找到命令[root@liaoxb-nroow6grda6k-master-0 bin]# ll /usr/local/bin/总用量 333996-rwxr-xr-x 1 root root 45109248 6月 17 00:09 helm-rwxr-xr-x 1 root root 148447816 6月 23 00:26 kubectl-rwxr-xr-x 1 root root 148447816 6月 23 00:26 kubelet[root@liaoxb-nroow6grda6k-master-0 ~]# export PATH=/usr/local/bin:$PATH[root@liaoxb-nroow6grda6k-master-0 istio-1.8.1]# helm versionversion.BuildInfo{Version:"v3.6.1", GitCommit:"61d8e8c4a6f95540c15c6a65f36a6dd0a45e7a2f", GitTreeState:"clean", GoVersion:"go1.16.5"}# 添加稳定的仓库[root@liaoxb-nroow6grda6k-master-0 ~]# helm repo add bitnami https://charts.bitnami.com/bitnami"bitnami" has been added to your repositories[root@liaoxb-nroow6grda6k-master-0 ~]# helm repo updateHang tight while we grab the latest from your chart repositories......Successfully got an update from the "bitnami" chart repositoryUpdate Complete. ⎈Happy Helming!⎈# helm部署istio[root@liaoxb-nroow6grda6k-master-0 ~]# cd istio-1.8.1/[root@liaoxb-nroow6grda6k-master-0 istio-1.8.1]# ll总用量 24drwxr-x--- 2 root root 22 12月 8 2020 bin-rw-r--r-- 1 root root 11348 12月 8 2020 LICENSEdrwxr-xr-x 5 root root 52 12月 8 2020 manifests-rw-r----- 1 root root 853 12月 8 2020 manifest.yaml-rw-r--r-- 1 root root 5866 12月 8 2020 README.mddrwxr-xr-x 19 root root 307 12月 8 2020 samplesdrwxr-x--- 3 root root 83 12月 8 2020 tools[root@liaoxb-nroow6grda6k-master-0 istio-1.8.1]# helm install istio-base manifests/charts/base -n istio-systemNAME: istio-baseLAST DEPLOYED: Wed Jun 23 13:26:37 2021NAMESPACE: istio-systemSTATUS: deployedREVISION: 1TEST SUITE: None
