Skip to content

Latest commit

 

History

History
55 lines (43 loc) · 1.86 KB

README.md

File metadata and controls

55 lines (43 loc) · 1.86 KB

Testing helm charts

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

Providing test values

The chart test toolkit will use every *-values.yaml provided in the ci folder of the chart.

What is tested

  1. Lint helm chart

    The helm chart is linted according to the configuration.

  2. Prometheus alert- & aggregation rules

    If Prometheus alert- (*.alerts) or aggregation rules (*.rules) are part of the Helm chart, they are validated using the promtool.

Running the tests locally

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"