Helm charts used for the SAP Converged Cloud are validated the helm chart testing utility with the configuration provided in this folder and kube-score to make our charts more secure and resilient. Assuming a chart looks like this:
.
└── myChart
├── ci
│ └── test-values.yaml
├── aggregations
│ └── *.rules
├── alerts
│ └── *.alerts
├── templates
│ └── ...
...
├── Chart.yaml
└── values.yaml
A Chart.yaml
must have the following mandatory attributes:
apiVersion: v2
appVersion: "1.0"
description: mychart
name: chart-name
version: 0.1.0
maintainers:
- name: github-handle
The chart test toolkit will use every *-values.yaml
provided in the ci
folder of the chart.
-
Lint helm chart
The helm chart is linted according to the configuration.
-
Prometheus alert- & aggregation rules
If Prometheus alert- (
*.alerts
) or aggregation rules(*.rules)
are part of the Helm chart, they are validated using the promtool.
Tests can be done locally using the Docker image found in the sapcc/chart-testing
repository.
The tag $version-promtool
indicates a pre-installed promtool.
Example:
docker run --rm -v $helm-charts.git:/charts sapcc/chart-testing:latest sh -c "cd charts && ct lint --chart-yaml-schema ci/chart_schema.yaml --lint-conf ci/lintconf.yaml --config ci/config.yaml --charts openstack/nova"