Deployment Charts
Last updated
Last updated
Devtron Apps leverage helm charts to carry out deployment of your images and configuration. Devtron includes predefined Helm charts (e.g., Deployment, Rollout, StatefulSet) that cover majority of your use cases.
For any use case not addressed by the default Helm charts, you can upload your own Helm chart and use it as a deployment chart in Devtron.
This video contains a quick walkthrough of the steps mentioned in the Preparing a Deployment Chart section of this page and the subsequent uploading of the deployment chart on Devtron.
You can use the following command to create a Helm chart:
Note:
Chart.yaml
is a metadata file that gets created when you create a helm chart. The following table consists the fields that are relevant to you inChart.yaml
.
Name
Name of the Helm chart (Required).
Version
This is the chart version. Update this value for each new version of the chart (Required).
Description
Give a description to your chart (Optional).
Click here to view a sample 'Chart.yaml' file.
The Image Descriptor Template file is a GO template that produces a valid JSON file upon processing. It allows Devtron to dynamically inject values from the CD pipeline into your Helm chart during deployment. Therefore, details like image repository, tag, and environment are automatically populated at the placeholders specified in .image_descriptor_template.json
.
In the root directory of your chart, create a file named .image_descriptor_template.json
using the following command:
Ensure the above file is created in the directory where the main Chart.yaml
exists (as shown below):
Paste the following content in .image_descriptor_template.json
file:
You can customize this template to include only the values your deployment needs. For instance, if you only require the image repository and tag, your template would look like:
In the root directory of your chart, Devtron expects an app-values.yaml
file. It uses this file to determine the values to be displayed on the deployment template as shown below.
The app-values.yaml
file is simply a subset of your values.yaml
file. Therefore, you can insert specific entries from values.yaml
that you wish to display.
However, if you upload the chart without an app-values.yaml
or with an empty one, your deployment template will appear blank (as shown below) or null.
The release-values.yaml
file contains essential values needed for deployment that aren’t covered by app-values.yaml. For example:
Some dynamic values (such as IMAGE_TAG
and IMAGE_REPO
from the image descriptor JSON file) are populated here because they are needed for deployment.
You can use autoPromotionSeconds
to decide how long to keep old pods running once the latest pods of new release are available.
In the root directory of your chart, create a file named release-values.yaml
with the following command:
Use the following content in the release-values.yaml
file (edit it as per your requirement):
The Helm chart to be uploaded must be packaged as a versioned archive file in the format: <helm-chart-name>-x.x.x.tgz
. Both <helm-chart-name>
and x.x.x
will be automatically fetched from the name and version fields present in the Chart.yaml file, respectively."
Run the following command to package the chart:
The above command will generate a <helm-chart-name>-x.x.x.tgz
file.
Go to Global Configurations → Deployment Charts.
Click Upload Chart.
Click Select .tgz file and upload your packaged deployment chart (in .tgz format).
The system initiates the validation of your uploaded chart. You may also click Cancel upload if you wish to abort the process.
In the uploading process, your file will be validated against the following criteria:
Supported archive template should be in *.tgz
format.
Chart.yaml
must include the name and the version number.
.image_descriptor_template.json
file should be present.
The following are interpretations of the validation checks performed:
Success
The files uploaded are validated (View Snapshot)
Enter a description for the chart and select Save or Cancel upload
Unsupported template
The archive file do not match the required template (View Snapshot)
Upload another chart or Cancel upload
New version detected
You are uploading a newer version of an existing chart (View Snapshot)
Enter a Description and select Save to continue uploading, or Cancel upload
Already exists
There already exists a chart with the same version (View Snapshot)
Edit the version and re-upload the same chart using Upload another chart.
Upload a new chart with a new name using Upload another chart
Cancel upload
To view the list of available deployment charts, go to Global Configurations → Deployment Charts page.
You can search a chart by its name, version, or description.
You can add new charts or chart versions by clicking Upload Chart.
Once you successfully upload a deployment chart, you can start using it as a deployment template for your application. Refer Deployment Template to know more.
The deployment strategy for a deployment chart is fetched from the chart template and cannot be configured in the CD pipeline.
This section is an extension of Customize GUI feature. Refer the document to know more about the significance of having a custom GUI schema for your deployment templates.
You can edit the GUI schema of the following deployment charts:
Default charts provided by Devtron (Deployment, Job & CronJob, Rollout Deployment, and StatefulSet)
Custom charts uploaded by you
In this example, we will edit the Deployment chart type provided by Devtron.
Click the edit button next to the chart as shown below.
A GUI schema is available for you to edit in case of Devtron charts. In case of custom charts, you may have to define a GUI schema yourself. To know how to create such GUI schema, refer RJSF JSON Schema Tool.
You may start editing the schema by excluding existing fields/objects or including more of them. Click the Refer YAML button to view all the supported fields.
While editing the schema, you may use the Preview GUI option for a real-time preview of your changes.
Click Save Changes.
Next, if you go to App Configuration → Base Configurations → Deployment Template, you will be able to see the deployment template fields (in GUI) as per your customized schema.