快速编写通用helm chart

helm 版本 v3.7+

创建helm chart

helm create <NAME>

修改 Chart.yaml

version: 0.1.0 # chart版本
appVersion: "x.x.x" # chart 只有一个服务一般同镜像tag

# 如果需要发布在 https://artifacthub.io/, 酌情添加修改下面内容,不需要的可以忽略
home: https://github.com/xxxxxxxxxxxxx/xxxxxx
keywords:
  - xxxxxx
  - xxxxxx-chart
source:
  - https://github.com/xxxxxxxxxxxxx/xxxxxx
  - https://github.com/xxxxxxxxxxxxx/xxxxxx-chart
maintainers:
  - name: ss75710541
    email: 75710541@qq.com
    url: https://github.com/ss75710541
annotations:
  artifacthub.io/links: |
    - name: Chart Source
      url: https://github.com/xxxxxxxxxxxxx/xxxxxx-chart
    - name: Source
      url: https://github.com/xxxxxxxxxxxxx/xxxxxx

修改 values.yaml

secret env 示例

dev-mysql.env

修改 deployment.yaml

修改 templates/deployment.yaml

增加 env / envFrom / extraVolumeMounts / extraVolume 相关内容

使用helm-docs 自动生成helm chart REDAME.md

Mac 安装helm-docs

其它平台安装参考:https://github.com/norwoodj/helm-docs

创建模板文件 README.md.gotmpl

生成 README.md

Last updated

Was this helpful?