Skip to content
Vojtech Mašek edited this page Aug 19, 2019 · 2 revisions

General information

Helm is package manager for Kubernetes. Helm allows to create Kubernetes resource templates which are rendered before deploy with user provided values. This allows us to create reusable configurations across multiple environments.

Helm supports common control directives, in particular if, range, with. Thus, control over the configuration template is great.

Resources

Documentation

Common CLI commands

  • helm init - installs tiller into the cluster
  • helm install - installs Helm chart into the cluster with tiller
  • helm upgrade - upgrades chart already installed in the cluster (upgrade of whole package or upgrade of values)
  • helm template - renders template and prints it to console
  • helm del --purge - uninstalls installation from the cluster

Best practices

Official best practies are here.

Microservice projects

Best way to create charts for microservice projects is to have one chart that contains chart of other services as dependencies. There are two ways to solve provision of values to dependencies:

  • values that should be changed in all dependencies by changing one value can be configured using global values
  • in other cases, we can use values specific for each service and main chart values.yaml will contain scope for each dependency for specific values

Upgrade in Continuous Integration

Best way to do upgrade in CI is to use command helm upgrade --install. This ensures that helm chart will be installed if not present.

Multiple environments

Multiple environments can be set up by creating multiple values:

  • values.yaml for staging environment
  • values-prod.yaml for production environment

To make upgrade of staging environment, run:

helm upgrade --install -n release-name helm-chart/

To make upgrade of production environment, run:

helm upgrade --install -n release-name -f helm-chart/values-prod.yaml helm-chart/
Clone this wiki locally