Giter Club home page Giter Club logo

chart-test-template's Introduction

chart-test-template

Clone this repo as a starting point for any new Helm Chart you'd like to create. This template supports one chart per repo.

asciicast

Delete the grafana directory which is used as an example.

Create a new chart by running helm create chartname.

When ready to test you can run make. This will start a K3s docker container, install helm and tiller, and execute helm upgrade --install on your chart directory.

By default make will also run helm lint and helm test on your installed chart.

You can leave the K3s docker container running and continue to iterate installation and tests by running make chart to upgrade the chart and make lint and make test.

To remove the chart from a running container use make chartrm. You can then install cleanly again using make chart.

To investigate chart problems you can run make ssh to log into the K3s container and run the usual kubectl and helm commands to troubleshoot.

To kill everything and start from scratch including terminating the K3s container use make clean.

Tests

We execute helm test inside the docker container against the release that was installed. This runs the tests defined in chartname/templates/tests. The Grafana chart included in this repo has some good examples that you can read.

Local chart value overrides

Sometimes it's useful to override the values.yaml for local testing. Put any overrides into the values.yaml in the root of this repo.

Gotchas

The Makefile works out the name of the chart based upon directories that exist in the repo. If you add more directories you'll need to exclude them.

For example to exclude a ci and docs directory that you want to add update this line in the Makefile.

CHARTNAME := $(shell ls -1d */ | sed 's\#/\#\#' | grep -v 'tools\|ci\|docs')

chart-test-template's People

Contributors

sacreman avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.