Chart模版构造和语法

本小节

  • 初始化一个chart,起个应用名字webapp

  • 查看预定义的Chart和Values两个变量结构与内容

  • 查看deployment文件使用上述变量

  • Helm有用的几个命令

我们再初始化一个chart

# 初始化一个chart,名字是webapp
helm create webapp

# 查看目录结构
tree webapp
webapp
├── Chart.yaml
├── charts
├── templates
│   ├── NOTES.txt
│   ├── _helpers.tpl
│   ├── deployment.yaml
│   ├── hpa.yaml
│   ├── ingress.yaml
│   ├── service.yaml
│   ├── serviceaccount.yaml
│   └── tests
│       └── test-connection.yaml
└── values.yaml

Chart.yaml (对应预定义的宏Chart变量)

values.yaml(对应预定义的Values变量)

templates/_helpers.tpl(定义其他变量)

templates/deployment.yaml

templates/service.yaml

常用的几个方法

helm template webapp

helm lint webapp

helm show all webapp

最后更新于

这有帮助吗?