This software generates a Helm chart from the user's answers to a series of simple questions.
294
Helm chart generator (π 1.0.0-alpha version)
The idea to develop this generator came after realizing the problems that were facing developers in our team when they had to create a Helm chart from scratch for a custom containerized application to be deployed on a Kubernetes cluster. According to our experience, the translation of K8s simple manifests to customizable Helm charts is not so easy, and this process usually ends up in a set of packaged manifests that do not allow for as many configurations during installation.
Although there are several charts examples in repositories such as ArtifactHub and even well-defined and fully configurable charts for well-known or widely used applications (see Bitnami Helm chartsβ ), they can be difficult to use or understand for end users.
Therefore, this generator provides a basic but functional chart, which aims to serve as an starting point for developers that want to create a Helm chart for their developed applications from scratch, to avoid the so common "blank page syndrome", or even to create more basic but fully functional charts for that well-known or widely used applications (e.g. Wordpress, Nginx, ...) but with the user's own customizations.
Finally, the idea is to improve this generator with the help of the community to achieve the creation of a fully functional Helm chart with the minimal human interaction, for instance manual editing of templates and values, after the creation of the chart.
Currently, it can be run in 2 different ways:
When running the generator as a Docker container, it's needed to create a simple volume to store the generated charts in the host machine and also run the container in interactive mode.
Using the public Docker image from Dockerhubβ :
docker run -it --rm --name helm-chart-generator -v <path_in_host_machine>:/chart-generator/generated-charts ravaga/helm-chart-generator
For instance:
docker run -it --rm --name helm-chart-generator -v ./generated-charts:/chart-generator/generated-charts ravaga/helm-chart-generator
Otherwise, you can build and use your own Docker image:
docker build -t <your-tag> .
In the releases page, there ara available executable binaries for many platforms (Windows x64, Mac OS x64, Linux x64 and Linux ARM64).
Usage: helm-chart-generator [OPTIONS]...
Options:
-v, --version output the version number
-o, --charts-output-path <path> Set the output path of the generated chart
-h, --help display help for command
Example call:
$ helm-chart-generator -o ./generated-charts
Answer the general questions inquired by the generator:
Answer the specific component's questions inquired by the generator (the first group of questions is related to the main component):
Answer the specific component service's questions (if included) inquired by the generator:
Answer the specific Cron and CronJob (if included) questions inquired by the generator:
Answer the specific dependencies' (if included) questions inquired by the generator:
Finally, the Helm chart will be generated inside the generated-charts folder. If the generator has been run using Docker, the chart will be generated inside the specified Docker volume.
applicationname/
Chart.yaml # A YAML file containing general information about the chart.
.helmignore # The .helmignore file is used to specify files to not include in the chart.
values.yaml # The default configuration values for this chart. These values are grouped by the component or job that they belong to, inside a diferent object.
qa-values.yaml # A copy of the values.yaml file for development purposes.
charts/ # A directory containing any charts (subcharts) upon which this chart depends.
# The folder is initially empty, so the user must include inside it the needed subcharts, or manage them dynamically using the "helm dependency update" command.
crds/ # Custom Resource Definitions (empty folder).
templates/ # A directory of templates that, when combined with values,
# will generate valid Kubernetes manifest files.
NOTES.txt # A plain text file containing short usage notes. A default file is generated.
_helpers.tpl # A place to put template helpers that you can re-use throughout the chart.
# In this file are defined the application name, chart name, component name and labels, jobs name and labels.
componentN/ # A directory containing the componentN K8s controller (Deployment, StatefulSet or DaemonSet) manifest and its Services manifests.
# Additional manifests can be included (e.g. ConfigMaps) inside this folder.
# Note: a directory is created for each component.
jobs/ # A directory containing all the Jobs and CronJobs K8s manifests (only is created if the application has Jobs or CronJobs).
You have to install Helm in your local machine to be able to use the Helm CLI. In addition, you must have access to a K8s cluster in order to run the helm install commands.
Examine a generated chart for possible issues:
helm lint generated-charts/chart-name
Render chart templates locally and display the output. None of the server-side testing of chart validity is done.
helm template generated-charts/chart-name --debug
Test the installation of a generated chart without actually installing it (e.g. to inspect that the values of the values.yaml file are included in the K8s manifests, the labels are properly created, ...):
helm install <release-name> generated-charts/chart-name --debug --dry-run
For example:
helm install test generated-charts/chart-name --debug --dry-run
A folder of examples will be added to help users to improve their knowledge on the use of this tool. Each example will be divided into two folders:
This software is open-source, so it's open to any modifications and contributions. The only thing you have to do is to install the project depencencies by running the npm i command. Then, you can generate a chart by running npm run generate-chart. The Helm chart will be generated inside the generated-charts folder, in the same path as the code.
npm i
npm run generate-chart
ls generated-charts/<chart-name>
Copyright 2024 Rafael VaΓ±o Garcia (@ravaga)
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0β
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Content type
Image
Digest
sha256:015413cfbβ¦
Size
48.4 MB
Last updated
about 2 years ago
docker pull ravaga/helm-chart-generator