1 安装

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
var_base=/root/helm
var_app=$var_base/helm
var_version=v3.12.0

mkdir -p $var_app
cd $var_app

wget https://get.helm.sh/helm-$var_version-linux-amd64.tar.gz
tar xf helm-$var_version-linux-amd64.tar.gz
ln -s $var_app/linux-amd64/helm /usr/local/bin/helm
helm search hub wordpress

source <(helm completion bash)
helm completion bash > /etc/bash_completion.d/helm

2 制作chart

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
varBaseChartDir='~/workspaces/develop/charts'
varChartName='demo'
mkdir -p ${varBaseChartDir}
cd ${varBaseChartDir}
helm create ${varChartName}
tree ${varChartName}

rm -rf ${varChartName}/templates/*

# 渲染成yaml
helm template --debug ${varChartName}

# 检查语法
helm lint --strict ${varChartName}

# 打包
helm package ${varChartName}

# 测试安装
helm upgrade --install --dry-run --debug \
  --namespace chart-test \
  --create-namespace \
  ${varChartName} ./${varChartName}

# 查看安装参数
helm get values <release-name> [flags]