概述
Helm 倉庫(Repository)是存儲 Helm 圖表(Chart)的地方,類似于軟件包管理器的倉庫(如 apt、yum 倉庫)。
Helm 倉庫是一個 HTTP 服務器,用于存儲和共享 Helm Chart 的壓縮包(.tgz 文件)及相關索引文件(index.yaml)。
索引文件(index.yaml)記錄了倉庫中所有 Chart 的元數(shù)據(jù)(名稱、版本、描述等),供 Helm 客戶端查詢和下載。
常見的倉庫類型
? 官方倉庫:Helm 官方維護的倉庫(已歸檔,現(xiàn)推薦使用Artifact Hub查找社區(qū) Chart)。
? 社區(qū)倉庫:如Bitnami、Jetstack等組織提供的倉庫。
? 私有倉庫:企業(yè)內(nèi)部自建的倉庫,用于管理私有 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 |
私有倉庫相關命令
創(chuàng)建倉庫索引文件
為本地 Chart 目錄生成 index.yaml,用于搭建私有倉庫。
| | | | --- | --- | | | helm repo index[目錄路徑]--url[倉庫URL]|
推送 Chart 到私有倉庫
| | | | --- | --- | | | helm push[Chart路徑][倉庫名稱]|
鏈接:https://www.cnblogs.com/huangSir-devops/p/18908212
-
服務器
+關注
關注
13文章
9727瀏覽量
87430 -
HTTP
+關注
關注
0文章
523瀏覽量
32536 -
軟件包
+關注
關注
0文章
109瀏覽量
11897
原文標題:5分鐘學會Helm倉庫高效管理:命令行技巧全解析
文章出處:【微信號:magedu-Linux,微信公眾號:馬哥Linux運維】歡迎添加關注!文章轉(zhuǎn)載請注明出處。
發(fā)布評論請先 登錄
Kubernetes Helm入門指南

RFID智能倉庫管理方案
倉庫管理小程序求助
【GoKit申請】倉庫管理系統(tǒng)
【DNA Kit申請】倉庫管理系統(tǒng)
使用Helm 在容器服務k8s集群一鍵部署wordpress
如何配置Yum倉庫?
RFID倉庫管理系統(tǒng)為傳統(tǒng)的倉庫管理帶來了變革
Helm的一些概念及用法

評論