values.yml格式
时间: 2023-07-01 13:17:44 浏览: 65
`values.yml` 是一个 YAML 格式的文件,它的格式应该是类似于以下示例的键值对列表:
```yaml
key1: value1
key2: value2
nested_key:
nested_key1: nested_value1
nested_key2: nested_value2
list_key:
- item1
- item2
- item3
```
其中,`key1` 和 `key2` 是顶级键。`nested_key` 是一个嵌套的键,它包含两个子键 `nested_key1` 和 `nested_key2`。`list_key` 是一个列表键,它包含三个元素 `item1`、 `item2` 和 `item3`。
在 Helm chart 中,您可以使用这些键来定义变量,例如:
```yaml
image:
repository: myapp
tag: 1.0.0
replicaCount: 3
resources:
limits:
cpu: 500m
memory: 1Gi
requests:
cpu: 200m
memory: 512Mi
```
在安装 Helm chart 时,可以通过传递 `--set` 参数来覆盖这些变量的值,例如:
```bash
helm install mychart ./mychart --set image.tag=2.0.0 --set replicaCount=5
```
这将使用 `values.yml` 文件中定义的变量,但将 `image.tag` 和 `replicaCount` 覆盖为新的值。
相关推荐
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)