企业🤖AI智能体构建引擎,智能编排和调试,一键部署,支持私有化部署方案 广告
添加chart仓库 ```shell helm repo add [repoName] [URL] # harbor HTTP示例:helm repo add --username <username> --password <password> [repoName] http://x.x.x.x:8021/chartrepo/<project> # harbor HTTPS示例:helm repo add --ca-file <ca file> --cert-file <cert file> --key-file <key file> --username <username> --password <password> [repoName] https://x.x.x.x:8021/chartrepo/<project> ``` 删除chart仓库 ```shell helm repo remove [NAME] helm repo rm [NAME] ``` 根据关键字检索chart包 ```shell helm search repo traefik [-l] # 说明:-l 详细打印每个版本信息。 ``` 从chart仓库中拉取chart到本地 ```shell helm pull repoName/chartName [--untar] [--version chartVersion] # 示例:helm pull traefik/traefik --untar # 说明:chartName是repo_name/path_to_chart ``` 查看chart包默认的值 ```shell helm show values chartName # 示例:helm show values traefik/traefik ``` 将chart包发布到k8s集群中安装部署 ```shell helm install releaseName chartName [-n NAMESPACE] [-f valuesFile ] [--version chartVersion] # 示例1:helm install traefik traefik/traefik -n kube-system --version 21.1.0 # 示例2:helm install traefik traefik/traefik -n kube-system -f ./values-prod.yaml # 说明:releaseName是helm安装资源的名称,chartName是repo_name/path_to_chart ``` 查看发布到k8s中的chart对应的release ```shell helm list [-n namespace] ``` 将部署到k8s中的release升级,即相当于应用升级 ```shell helm upgrade releaseName chartName [-n namespace] # 示例:helm upgrade traefik traefik/traefik ``` 将部署到k8s中的release卸载掉 ```shell helm uninstall releaseName [-n NAMESPACE] # 示例:helm uninstall traefik -n kube-system ``` 查看release的发布历史(包括安装、升级、回滚) ```shell helm history releaseName # 示例:helm history traefik ``` 将release回退到前一个或若干个版本(k8s中会同步回退) ```shell helm rollback releaseName revision # 示例:helm rollback traefik 1 ``` 检查chart包中的文件内容是否正确 ```shell helm lint chartName [--version chartVersion] # 示例:helm lint traefik-21.1.0.tgz # 说明:包可以是chart目录、chart压缩包和repo_name/path_to_chart ``` 上传chart到chart仓库 ```shell helm push file repoName # 示例:helm push demo.tgz library --username=admin --password=Harbor12345 # 示例:helm push demo library --username=admin --password=Harbor12345 ``` 获取用户安装 release 参数 ```shell helm get values releaseName # 示例:helm get values traefik ```