概述
Helm 仓库(Repository)是存储 Helm 图表(Chart)的地方,类似于软件包管理器的仓库(如 apt、yum 仓库)。
Helm 仓库是一个 HTTP 服务器,用于存储和共享 Helm Chart 的压缩包(.tgz 文件)及相关索引文件(index.yaml)。
索引文件(index.yaml)记录了仓库中所有 Chart 的元数据(名称、版本、描述等),供 Helm 客户端查询和下载。
常见的仓库类型
? 官方仓库:Helm 官方维护的仓库(已归档,现推荐使用Artifact Hub查找社区 Chart)。
? 社区仓库:如Bitnami、Jetstack等组织提供的仓库。
? 私有仓库:企业内部自建的仓库,用于管理私有 Chart。
常用的helm仓库
? bitnami:https://charts.bitnami.com/bitnami
? grafana:https://grafana.github.io/helm-charts
? prometheus:https://prometheus-community.github.io/helm-charts
? harbor:https://helm.goharbor.io
? minio-operator:https://operator.min.io
Helm仓库管理常用配置
添加仓库
将仓库地址添加到 Helm 客户端的本地配置中
| | | |---| --- | | |# 语法 | | |helm repoadd[仓库名称] [仓库地址]| | | | | |# 示例 | | |[root@master ~]# helm repo add prometheus https://prometheus-community.github.io/helm-charts | | |"prometheus"hasbeenaddedto your repositories| | | [root@master ~]# helm repo add grafana https://grafana.github.io/helm-charts | | |"grafana"hasbeenaddedto your repositories|
更新仓库索引
Helm 客户端需要定期更新仓库索引,以获取最新的 Chart 列表和版本信息。
| | | |--- | --- | | |[root@master~]# helm repoupdate| | |Hang tight while we grab the latestfromyour chart repositories...| | |...Successfully got anupdatefromthe "grafana" chart repository| | |...Unabletogetanupdatefromthe "prometheus" chart repository (https://prometheus-community.github.io/helm-charts):| | |read tcp [fdbdff:318:3ebb:26f3:26ff:6026]:39074->[2606:50c0:8001::153]:443: read: connection resetbypeer| | |UpdateComplete. ?Happy Helming!?|
列出本地仓库
查看当前配置的所有仓库及其地址。
| | | | --- | --- | | | [root@master ~]# helm repo list | | | NAME URL | | | prometheus https://prometheus-community.github.io/helm-charts | | | grafana https://grafana.github.io/helm-charts |
删除仓库(Remove Repository)
从本地配置中移除不再需要的仓库。
| | | | --- | --- | | |#语法 | | | helm reporemove[仓库名称] | | | | | |# 示例 | | | [root@master ~]# helm repo remove grafana | | |"grafana"has been removedfromyour repositories | | | [root@master ~]# helm repo list | | | NAME URL | | | prometheus https://prometheus-community.github.io/helm-charts |
搜索仓库中的 Chart(Search Charts)
从仓库中搜索符合条件的 Chart,支持模糊匹配。
| | | | --- | --- | | |# 语法 | | | helm search repo [关键词] | | | | | |# 示例 | | | [root@master ~]# helm search repo grafana | | | NAME CHART VERSION APP VERSION DESCRIPTION | | | grafana/grafana 9.2.2 12.0.1 The leading toolforquerying and visualizing t... | | | grafana/grafana-agent 0.42.0 v0.42.0 Grafana Agent | | | grafana/grafana-agent-operator 0.5.1 0.44.2 A Helm chartforGrafana Agent Operator | | | grafana/grafana-operator v5.18.0 v5.18.0 Helm chartforthe Grafana Operator | | | grafana/grafana-sampling 1.1.5 v1.7.5 A Helm chartfora layered OTLPtailsampling a... |
查看指定仓库中Chart的版本
| | | | --- | --- | | |# 语法 | | | helm search repo [chart名称] --versions | | | | | |# 示例 | | | [root@master ~]# helm search repo prometheus/kube-prometheus-stack --versions | | | NAME CHART VERSION APP VERSION DESCRIPTION | | | prometheus/kube-prometheus-stack 72.9.1 v0.82.2 kube-prometheus-stack collects Kubernetes manif... | | | prometheus/kube-prometheus-stack 72.9.0 v0.82.2 kube-prometheus-stack collects Kubernetes manif... | | | prometheus/kube-prometheus-stack 72.8.0 v0.82.2 kube-prometheus-stack collects Kubernetes manif... | | | prometheus/kube-prometheus-stack 72.7.0 v0.82.2 kube-prometheus-stack collects Kubernetes manif... | | | prometheus/kube-prometheus-stack 72.6.4 v0.82.2 kube-prometheus-stack collects Kubernetes manif... | | | prometheus/kube-prometheus-stack 72.6.3 v0.82.2 kube-prometheus-stack collects Kubernetes manif... | | | prometheus/kube-prometheus-stack 72.6.2 v0.82.2 kube-prometheus-stack collects Kubernetes manif... | | | prometheus/kube-prometheus-stack 72.6.1 v0.82.2 kube-prometheus-stack collects Kubernetes manif... | | | prometheus/kube-prometheus-stack 72.5.3 v0.82.2 kube-prometheus-stack collects Kubernetes manif... | | | prometheus/kube-prometheus-stack 72.5.2 v0.82.2 kube-prometheus-stack collects Kubernetes manif... | | | prometheus/kube-prometheus-stack 72.5.1 v0.82.2 kube-prometheus-stack collects Kubernetes manif... | | | prometheus/kube-prometheus-stack 72.5.0 v0.82.2 kube-prometheus-stack collects Kubernetes manif... | | | prometheus/kube-prometheus-stack 72.4.0 v0.82.2 kube-prometheus-stack collects Kubernetes manif... | | | prometheus/kube-prometheus-stack 72.3.1 v0.82.0 kube-prometheus-stack collects Kubernetes manif... |
拉取远程仓库的chart
| | | | --- | --- | | | # 语法,--version对应的是chart version,--untar自动解压, | | | #--destination:指定下载的 Chart 文件(.tgz)保存的目标目录(默认当前目录)。 | | | #--repo[仓库URL] 直接从指定 URL 下载 Chart,而不使用已添加的仓库名称。 | | | helm pull[chart名出]--version[版本号]--untar--destination[/path]--repo[仓库URL]| | | | | | # 示例 | | |[root@master ~]# helm pull prometheus/kube-prometheus-stack--version72.9.0| | |[root@master ~]# ll kube-prometheus-stack-72.9.0.tgz| | | -rw-r--r--1root root814664Jun 314:45kube-prometheus-stack-72.9.0.tgz |
私有仓库相关命令
创建仓库索引文件
为本地 Chart 目录生成 index.yaml,用于搭建私有仓库。
| | | | --- | --- | | | helm repo index[目录路径]--url[仓库URL]|
推送 Chart 到私有仓库
| | | | --- | --- | | | helm push[Chart路径][仓库名称]|
链接:https://www.cnblogs.com/huangSir-devops/p/18908212
-
服务器
+关注
关注
13文章
9826浏览量
88224 -
HTTP
+关注
关注
0文章
526浏览量
33660 -
软件包
+关注
关注
0文章
111浏览量
11950
原文标题:5分钟学会Helm仓库高效管理:命令行技巧全解析
文章出处:【微信号:magedu-Linux,微信公众号:马哥Linux运维】欢迎添加关注!文章转载请注明出处。
发布评论请先 登录
RFID智能仓库管理方案
仓库管理小程序求助
【GoKit申请】仓库管理系统
【DNA Kit申请】仓库管理系统
使用Helm 在容器服务k8s集群一键部署wordpress
如何配置Yum仓库?
RFID仓库管理系统为传统的仓库管理带来了变革
Helm的一些概念及用法

评论