Dieser Inhalt ist in der von Ihnen ausgewählten Sprache nicht verfügbar.
Chapter 26. Validating Helm charts for certification
You can validate your Helm charts by using the chart-verifier CLI tool. Chart-verifier is a CLI based open source tool that runs a list of configurable checks to verify if your Helm charts have all the associated metadata and formatting required to meet the Red Hat Certification standards. It validates if the Helm charts are distribution ready and works seamlessly on the Red Hat OpenShift Container Platform and can be submitted as a certified Helm chart entry to the Red HatOpenShift Helm chart repository.
The tool also validates a Helm chart URL and provides a report in YAML format with human-readable descriptions in which each check has a positive or negative result. A negative result from a check indicates a problem with the chart, which needs correction. You can also customize the checks that you wish to execute during the verification process.
Red Hat strongly recommends using the latest version of the chart-verifier tool to validate your Helm charts on your local test environment. This enables you to check the results on your own during the chart development cycle, preventing the need to submit the results to Red Hat every time.
Additional resources
For more information about the chart-verifier CLI tool, see chart-verifier.
26.1. Preparing the test environment Link kopierenLink in die Zwischenablage kopiert!
The first step towards certifying your product is setting up the environment where you can run the tests. To run the full set of chart-verifier tests, you require access to the Red Hat OpenShift cluster environment. You can install the chart-verifier tool and execute all the chart related tests in this environment. You can disable these tests by using several configurable command line options, but it is mandatory to run the tests for the certification to be approved by Red Hat.
As an authorized Red Hat partner, you have free access to the Red Hat OpenShift Container Platform, and you can install a cluster in your own test environment using the Red Hat Partner Subscription (RHPS) program. To learn more about the benefits of software access as a part of the Red Hat Partner Connect program, see the program guide.
To set up your own test environment,
- Install a fully managed cluster by using Red Hat Managed Services Openshift cluster. This is a trial option that is valid only for 60 days.
- Install a self-managed cluster that you can install in your cloud environment, datacenter or computer. Through this option you can use your partner subscriptions, also known as NFRs, for permanent deployments.
For more information on setting up your environment, see Try Red Hat OpenShift.
Additional resources
To know more about installing the cluster and configuring your helm charts, see:
26.2. Running the Helm chart-verifier tool Link kopierenLink in die Zwischenablage kopiert!
The recommended directory structure for executing the chart-verifier tool is as follows:
Prerequisites
- A container engine in which Podman or Docker CLI is installed.
- Internet connection to check that the images are Red Hat certified.
- GitHub profile to submit the chart to the OpenShift Helm Charts Repository.
- Red Hat OpenShift Container Platform cluster.
Before running the chart-verifier tool, package your Helm chart by using the following command:
helm package <helmchart folder>
$ helm package <helmchart folder>
Copy to Clipboard Copied! Toggle word wrap Toggle overflow This command will archive your Helm chart and convert it to a
.tgz
file format.
Procedure
You can run the full set of chart-verifier tool by using two methods:
26.2.1. By using Podman or Docker Link kopierenLink in die Zwischenablage kopiert!
Run all the available checks for a chart available remotely using a universal resource identifier (uri), assuming that the kube config file is available at the location
${HOME}/.kube:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow In this command, chart-uri is the location of the chart archive available on the https uri. Ensure that the archive must be in
.tgz
format.Run all the available checks for a chart available locally on your system, assuming that the chart is available on the current directory and the kube config file is available at the location
${HOME}/.kube
:Copy to Clipboard Copied! Toggle word wrap Toggle overflow In this command, chart-uri is the location of the chart archive available in your local directory. Ensure that the archive must be in
.tgz
format.Run the following verify command to get the list of available options associated with the command along with its usage:
podman run -it --rm quay.io/redhat-certification/chart-verifier verify --help
$ podman run -it --rm quay.io/redhat-certification/chart-verifier verify --help
Copy to Clipboard Copied! Toggle word wrap Toggle overflow The output of the command is similar to the following example:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Run a subset of the checks:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Run all the checks except a subset:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow NoteRunning a subset of checks is intended to reduce the feedback loop for development. To certify your chart, you must run all the required checks.
Provide chart-override values:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Provide chart-override values from a file located in the current directory:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
26.2.1.1. Configuring the timeout option Link kopierenLink in die Zwischenablage kopiert!
Increase the timeout value if the chart-testing process is delayed. By default, the chart-testing process takes about 30 minutes to complete.
If you observe a delay in the chart-testing process, Red Hat recommends you to submit the report to the Red Hat certification team for verification.
26.2.1.2. Saving the report Link kopierenLink in die Zwischenablage kopiert!
When the chart-testing process is complete, the report messages are displayed by default. You can save the report by redirecting it to a file.
For example:
Along with this command use the -w
option to write the report directly to the file ./chartverifier/report.yaml
. To get this file, you have to volume mount the file to /app/chartverifer
.
For example:
If the file already exists, it is overwritten by the new report.
26.2.1.3. Configuring the error log Link kopierenLink in die Zwischenablage kopiert!
By default, an error log is generated and saved to the file ./chartverifier/verify-<timestamp>.yaml
. It includes the error messages, the results of each check and additional information about chart testing. To get a copy of the error log you have to volume mount the file to /app/chartverifer
.
For example:
If you want to store multiple logs to the same directory, you can store a maximum of 10 log files at a time. When the maximum file limit is reached, older log files are automatically replaced with the newer log files.
Use the -E
or –suppress-error-log
option to suppress the error log output.
Error and warning messages are standard error output messages and are not suppressed by using the -E
or –suppress-error-log
option.
26.2.2. By using the binary file Link kopierenLink in die Zwischenablage kopiert!
This method is applicable only for Linux systems.
- Download and install the latest chart-verifier binary from the releases page.
Unzip the tarball binary by using the following command:
tar zxvf <tarball>
$ tar zxvf <tarball>
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Run the following command on the unzipped directory to perform all the Helm chart checks :
./chart-verifier verify <chart-uri>
$ ./chart-verifier verify <chart-uri>
Copy to Clipboard Copied! Toggle word wrap Toggle overflow In this command,
chart-uri
is the location of the chart archive available on your server. Ensure that the archive must be in.tgz
format. By default, the chart-verifier tool assumes that the kube config file is available at the default location$HOME/.kube
. Set the environment variable toKUBECONFIG
if the file is not available at the default location.The output of the chart-verifier includes the details of the tests executed along with a result status for each test. It also indicates whether each test is mandatory or recommended for Red Hat certification. For more detailed information, see Types of Helm chart checks.
Additional resources
To know more about the chart-verifier tool, see Helm chart checks for Red Hat OpenShift certification.