Helm 依賴關係

helm dependency

管理圖表的依賴關係

概要

管理圖表的依賴關係。

Helm 圖表將其依賴關係儲存在「charts/」中。對於圖表開發人員來說,在「Chart.yaml」中管理依賴關係通常更容易,它會宣告所有依賴關係。

dependency 命令會對該檔案進行操作,使其易於在所需的依賴關係與儲存在「charts/」目錄中的實際依賴關係之間同步。

例如,此 Chart.yaml 宣告了兩個依賴關係

# Chart.yaml
dependencies:
- name: nginx
  version: "1.2.3"
  repository: "https://example.com/charts"
- name: memcached
  version: "3.2.1"
  repository: "https://another.example.com/charts"

「name」應該是圖表的名稱,其中該名稱必須與該圖表的「Chart.yaml」檔案中的名稱相符。

「version」欄位應包含語義版本或版本範圍。

「repository」URL 應指向圖表倉庫。Helm 預期透過將「/index.yaml」附加到 URL,它應該能夠擷取圖表倉庫的索引。注意:「repository」可以是別名。別名必須以「alias:」或「@」開頭。

從 2.2.0 版開始,repository 可以定義為儲存在本機的依賴關係圖表目錄的路徑。路徑應以「file://」前綴開頭。例如,

# Chart.yaml
dependencies:
- name: nginx
  version: "1.2.3"
  repository: "file://../dependency_chart/nginx"

如果依賴關係圖表是在本機擷取的,則不需要透過「helm add repo」將倉庫新增到 helm。在此情況下也支援版本匹配。

選項

  -h, --help   help for dependency

從父命令繼承的選項

      --burst-limit int                 client-side default throttling limit (default 100)
      --debug                           enable verbose output
      --kube-apiserver string           the address and the port for the Kubernetes API server
      --kube-as-group stringArray       group to impersonate for the operation, this flag can be repeated to specify multiple groups.
      --kube-as-user string             username to impersonate for the operation
      --kube-ca-file string             the certificate authority file for the Kubernetes API server connection
      --kube-context string             name of the kubeconfig context to use
      --kube-insecure-skip-tls-verify   if true, the Kubernetes API server's certificate will not be checked for validity. This will make your HTTPS connections insecure
      --kube-tls-server-name string     server name to use for Kubernetes API server certificate validation. If it is not provided, the hostname used to contact the server is used
      --kube-token string               bearer token used for authentication
      --kubeconfig string               path to the kubeconfig file
  -n, --namespace string                namespace scope for this request
      --qps float32                     queries per second used when communicating with the Kubernetes API, not including bursting
      --registry-config string          path to the registry config file (default "~/.config/helm/registry/config.json")
      --repository-cache string         path to the file containing cached repository indexes (default "~/.cache/helm/repository")
      --repository-config string        path to the file containing repository names and URLs (default "~/.config/helm/repositories.yaml")

另請參閱

於 2024 年 1 月 24 日由 spf13/cobra 自動產生