在Helm图表中使用Requirements.lock文件 [英] Use of Requirements.lock file in Helm charts

查看:503
本文介绍了在Helm图表中使用Requirements.lock文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试了解Requirements.lock文件的用法.对于使用从属图表,我们可以使用Requirements.yaml.根据文档

I am trying to understand the usage of Requirements.lock file . For using a dependent chart , we can make use of Requirements.yaml . Based on documentation

Requirements.lock :根据requirements.lock文件重建图表/目录

Requirements.lock : rebuild the charts/ directory based on the requirements.lock file

Requirements.yaml :根据以下内容更新图表/ requirements.yaml

Requirements.yaml : update charts/ based on the contents of requirements.yaml

有人可以解释锁文件的区别和用法吗,我们是否也需要检查存储库中的requirements.lock文件?

Can someone explain the difference and usage of lock file and do we need to checking requirements.lock file in the repo too ?

推荐答案

这篇文章说得很好:

requirements.yaml文件非常类似于运行时语言的依赖项文件(例如Python的requirements.txt),可让您管理图表的依赖项及其版本.更新依赖项时,将生成一个锁定文件,以便后续获取依赖项时使用已知的有效版本.

Much like a runtime language dependency file (such as Python’s requirements.txt), the requirements.yaml file allows you to manage your chart’s dependencies and their versions. When updating dependencies, a lockfile is generated so that subsequent fetching of dependencies use a known, working version.

requirements.yaml 文件仅列出图表所需的直接依赖项.这样一来,您就可以更轻松地关注图表.

The requirements.yaml file lists only the immediate dependencies that your chart needs. This makes it easier for you to focus on your chart.

requirements.lock 文件列出了直接依存关系的确切版本,以及它们的依存关系依存关系等等.这使得helm可以精确地跟踪整个依赖关系树并完全按照上一次工作的方式重新创建它-即使某些依赖关系(或它们的依赖关系)稍后会更新.

The requirements.lock file lists the exact versions of immediate dependencies and their dependencies and their dependencies and so forth. This allows helm to precisely track the entire dependency tree and recreate it exactly as it last worked--even if some of the dependencies (or their dependencies) are updated later.

大致是这样的:

  1. 您创建初始的 requirements.yaml 文件.您运行helm install并且 helm 会在构建依赖关系树时创建 requirements.lock 文件.
  2. 在下一个helm install上, helm 将确保其使用在 requirements.lock 文件中标识的相同版本.
  3. 稍后,您将更新 requirements.yaml 文件.您运行helm install(或helm upgrade),并且 helm 将注意到您的更改并更新 requirements.lock 文件以反映这些更改.
  1. You create the initial requirements.yaml file. You run helm install and helm creates the requirements.lock file as it builds the dependency tree.
  2. On the next helm install, helm will ensure that it uses the same versions identified in the requirements.lock file.
  3. At some later date, you update the requirements.yaml file. You run helm install (or helm upgrade) and helm will notice your changes and update the requirements.lock file to reflect them.

这篇关于在Helm图表中使用Requirements.lock文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆