Reviewed-by: gtema <artem.goncharov@gmail.com> Co-authored-by: Dong, Qiu Jian <qiujiandong1@huawei.com> Co-committed-by: Dong, Qiu Jian <qiujiandong1@huawei.com>
12 KiB
Preparing a Chart
You can prepare a chart using one of the following methods:
Customizing a Chart
- Customize the content of a chart as required.
For details about how to create a chart, see https://helm.sh/docs/chart_template_guide/getting_started/.
- Set the chart directory structure and name the chart based on the requirements defined in Chart Specifications.
Using a Kubernetes Official Chart
- Visit https://artifacthub.io/ to obtain the required chart.
- Log in to a Linux host.
- Upload the chart obtained in 1.
- Run the following command to compress the chart.
- If the Helm client is not installed on the Linux host, run the following command:
tar pzcf {name}-{version}.tgz {name}/
In the preceding command,
{name} indicates the actual chart name.
{version} indicates the actual chart version.
- If the Helm client is installed on the Linux host, run the following command:
In the preceding command, replace {name} with the actual chart name.
- If the Helm client is not installed on the Linux host, run the following command:
- Set the chart directory structure and name the chart based on the requirements defined in Chart Specifications.
Chart Specifications
This section uses the redis chart as an example to illustrate the chart specifications.
- Naming Requirement
A chart package is named in the format of {name}-{version}.tgz, where {version} indicates the version number in the format of Major version number.Minor version number.Revision number, for example, redis-0.4.2.tgz.
The chart name {name} can contain a maximum of 64 characters.
The version number must comply with the semantic versioning rules.
- The main and minor version numbers are mandatory, and the revision number is optional.
- The major and minor version numbers and revision number must be integers, greater than or equal to 0, and less than or equal to 99.
- Directory Structure
The directory structure of a chart is as follows:
redis/ templates/ values.yaml README.md Chart.yaml .helmignore
As listed in Table 1, the parameters marked with * are mandatory.