1. helm dependency

管理 chart 依赖

Helm chart 依赖存储在 'charts/'。对于 chart 开发者,管理依赖比声明了所有依赖的 'Chart.yaml' 文件更容易。

依赖命令对该文件进行操作,使得存储在 '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 名称,必须匹配 'Chart.yaml'文 件中名称。
  • version 字段应该包含一个语义化的版本或版本范围。
  • repository 的 URL 应该指向 Chart 仓库。Helm 希望通过附加 /index.yaml 到URL,应该能检索 chart 库索引。

[!NOTE|style:flat] 注意:'repository' 不能是别名。别名必须以'alias:'或'@'开头。

从 2.2.0 开始,仓库可以被定义为本地存储的依赖chart的目录路径。路径应该以 "file://" 前缀开头,比如:

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

如果在本地检索依赖 chart,不需要使用 helm add repo 将仓库加入到 helm。该示例中也支持版本匹配。

1.1. 可选项

  -h, --help   help for dependency

1.2. 从父命令继承的命令

      --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-token string           bearer token used for authentication
      --kubeconfig string           path to the kubeconfig file
  -n, --namespace string            namespace scope for this request
      --registry-config string      path to the registry config file (default "~/.config/helm/registry.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")

1.3. 请参阅

Copyright © 温玉 2021 | 浙ICP备2020032454号 all right reserved,powered by Gitbook该文件修订时间: 2022-01-08 03:09:47

results matching ""

    No results matching ""