概述
Helm 倉(cāng)庫(kù)(Repository)是存儲(chǔ) Helm 圖表(Chart)的地方,類(lèi)似于軟件包管理器的倉(cāng)庫(kù)(如 apt、yum 倉(cāng)庫(kù))。
Helm 倉(cāng)庫(kù)是一個(gè) HTTP 服務(wù)器,用于存儲(chǔ)和共享 Helm Chart 的壓縮包(.tgz 文件)及相關(guān)索引文件(index.yaml)。
索引文件(index.yaml)記錄了倉(cāng)庫(kù)中所有 Chart 的元數(shù)據(jù)(名稱(chēng)、版本、描述等),供 Helm 客戶端查詢和下載。
常見(jiàn)的倉(cāng)庫(kù)類(lèi)型
? 官方倉(cāng)庫(kù):Helm 官方維護(hù)的倉(cāng)庫(kù)(已歸檔,現(xiàn)推薦使用Artifact Hub查找社區(qū) Chart)。
? 社區(qū)倉(cāng)庫(kù):如Bitnami、Jetstack等組織提供的倉(cāng)庫(kù)。
? 私有倉(cāng)庫(kù):企業(yè)內(nèi)部自建的倉(cāng)庫(kù),用于管理私有 Chart。
常用的helm倉(cāng)庫(kù)
? 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倉(cāng)庫(kù)管理常用配置
添加倉(cāng)庫(kù)
將倉(cāng)庫(kù)地址添加到 Helm 客戶端的本地配置中
| | | |---| --- | | |# 語(yǔ)法 | | |helm repoadd[倉(cāng)庫(kù)名稱(chēng)] [倉(cāng)庫(kù)地址]| | | | | |# 示例 | | |[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|
更新倉(cāng)庫(kù)索引
Helm 客戶端需要定期更新倉(cāng)庫(kù)索引,以獲取最新的 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!?|
列出本地倉(cāng)庫(kù)
查看當(dāng)前配置的所有倉(cāng)庫(kù)及其地址。
| | | | --- | --- | | | [root@master ~]# helm repo list | | | NAME URL | | | prometheus https://prometheus-community.github.io/helm-charts | | | grafana https://grafana.github.io/helm-charts |
刪除倉(cāng)庫(kù)(Remove Repository)
從本地配置中移除不再需要的倉(cāng)庫(kù)。
| | | | --- | --- | | |#語(yǔ)法 | | | helm reporemove[倉(cāng)庫(kù)名稱(chēng)] | | | | | |# 示例 | | | [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 |
搜索倉(cāng)庫(kù)中的 Chart(Search Charts)
從倉(cāng)庫(kù)中搜索符合條件的 Chart,支持模糊匹配。
| | | | --- | --- | | |# 語(yǔ)法 | | | helm search repo [關(guān)鍵詞] | | | | | |# 示例 | | | [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... |
查看指定倉(cāng)庫(kù)中Chart的版本
| | | | --- | --- | | |# 語(yǔ)法 | | | helm search repo [chart名稱(chēng)] --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... |
拉取遠(yuǎn)程倉(cāng)庫(kù)的chart
| | | | --- | --- | | | # 語(yǔ)法,--version對(duì)應(yīng)的是chart version,--untar自動(dòng)解壓, | | | #--destination:指定下載的 Chart 文件(.tgz)保存的目標(biāo)目錄(默認(rèn)當(dāng)前目錄)。 | | | #--repo[倉(cāng)庫(kù)URL] 直接從指定 URL 下載 Chart,而不使用已添加的倉(cāng)庫(kù)名稱(chēng)。 | | | helm pull[chart名出]--version[版本號(hào)]--untar--destination[/path]--repo[倉(cāng)庫(kù)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 |
私有倉(cāng)庫(kù)相關(guān)命令
創(chuàng)建倉(cāng)庫(kù)索引文件
為本地 Chart 目錄生成 index.yaml,用于搭建私有倉(cāng)庫(kù)。
| | | | --- | --- | | | helm repo index[目錄路徑]--url[倉(cāng)庫(kù)URL]|
推送 Chart 到私有倉(cāng)庫(kù)
| | | | --- | --- | | | helm push[Chart路徑][倉(cāng)庫(kù)名稱(chēng)]|
鏈接:https://www.cnblogs.com/huangSir-devops/p/18908212
-
服務(wù)器
+關(guān)注
關(guān)注
13文章
9699瀏覽量
87306 -
HTTP
+關(guān)注
關(guān)注
0文章
522瀏覽量
32468 -
軟件包
+關(guān)注
關(guān)注
0文章
109瀏覽量
11886
原文標(biāo)題:5分鐘學(xué)會(huì)Helm倉(cāng)庫(kù)高效管理:命令行技巧全解析
文章出處:【微信號(hào):magedu-Linux,微信公眾號(hào):馬哥Linux運(yùn)維】歡迎添加關(guān)注!文章轉(zhuǎn)載請(qǐng)注明出處。
發(fā)布評(píng)論請(qǐng)先 登錄
Kubernetes Helm入門(mén)指南

RFID智能倉(cāng)庫(kù)管理方案
倉(cāng)庫(kù)管理小程序求助
【GoKit申請(qǐng)】倉(cāng)庫(kù)管理系統(tǒng)
【DNA Kit申請(qǐng)】倉(cāng)庫(kù)管理系統(tǒng)
使用Helm 在容器服務(wù)k8s集群一鍵部署wordpress
mes系統(tǒng)在倉(cāng)庫(kù)管理的應(yīng)用

如何配置Yum倉(cāng)庫(kù)?
RFID倉(cāng)庫(kù)管理系統(tǒng)為傳統(tǒng)的倉(cāng)庫(kù)管理帶來(lái)了變革
如何開(kāi)發(fā)一個(gè)helm chart
Helm的一些概念及用法

評(píng)論