Difference between revisions of "Helm install"

From NovaOrdis Knowledge Base
Jump to: navigation, search
(Overriding Array Elements)
(Overview)
 
(9 intermediate revisions by the same user not shown)
Line 12: Line 12:
 
=Overview=
 
=Overview=
  
Install a [[Helm Concepts#Chart_Archive|chart archive]], by [[Helm_Dependencies#Transitive_Dependencies_and_requirements.lock_File|discovering the transitive dependency tree]] of the chart, if the chart has dependencies, and creating a [[Helm Concepts#Release|release]] in the process.
+
<code>helm install</code> installs a [[Helm Concepts#Chart_Archive|chart archive]] and creates a [[Helm Concepts#Release|release]].
  
 
The chart may come from a [[Helm Concepts#Repository|repository]]:
 
The chart may come from a [[Helm Concepts#Repository|repository]]:
Line 23: Line 23:
  
 
  helm install <''directory-name-that-must-match-chart-name''>
 
  helm install <''directory-name-that-must-match-chart-name''>
 +
 +
If the chart has dependencies, they must be present in the [[Helm_Concepts#charts_Directory|charts/]] subdirectory at the time of the installation. <code>helm install</code> does not manage dependencies, <code>[[helm dependency]]</code> does.
 +
 +
<code>helm install</code> performs some sanity checks, such as comparing the content of [[Helm_Chart_requirements.yaml|requirements.yaml]] with the content of the charts/ subdirectory and failing if requirements.yaml contains dependencies that are not in charts/. However, if a dependency is present in charts/ but not in requirements.yaml, it will be installed.
 +
 +
For more details on dependencies and how they work, see: {{Internal|Helm_Dependencies#How_Helm_Dependencies_Work|How Helm Dependencies Work}}
  
 
=Dry Run=
 
=Dry Run=

Latest revision as of 00:59, 14 September 2019

External

Internal

Overview

helm install installs a chart archive and creates a release.

The chart may come from a repository:

helm install <chart-name>

helm install stable/mysql

or from a local directory (note that the directory name must be identical with the chart name specified in Chart.yaml):

helm install <directory-name-that-must-match-chart-name>

If the chart has dependencies, they must be present in the charts/ subdirectory at the time of the installation. helm install does not manage dependencies, helm dependency does.

helm install performs some sanity checks, such as comparing the content of requirements.yaml with the content of the charts/ subdirectory and failing if requirements.yaml contains dependencies that are not in charts/. However, if a dependency is present in charts/ but not in requirements.yaml, it will be installed.

For more details on dependencies and how they work, see:
How Helm Dependencies Work

Dry Run

In this mode, we send the templates to the Tiller server, which renders them, but instead of installing the chart, it returns the rendered template so it can be inspected:

helm install <...> --debug --dry-run

Note that in this mode, it is not guaranteed that Kubernetes will accept the generated manifest.

Specifying a Release Name

helm install --name <release-name> ...

Overriding Default Configuration

-f|--values

Default configuration - or just some values - can be overridden in bulk with:

helm install -f|--values <configuration-overrides-file.yaml> <chart name>

The -f|--values flag can be specified multiple time on the command line, and the rightmost value will take precedence.

--set

Individual configuration options can be specified with --set, --set-string and --set-file. If both --set and --values are used, the --set-specified configuration values are merged into the configuration values specified with --values, with higher precedence. Overrides specified with --set are persisted in a ConfigMap and can be viewed for a given release with helm get value <release-name>:

helm install --set size=10 ...

A value specified values.yaml can be effectively effectively eliminated, by setting that value to null with

... --set <key>=null ...
For more details on relative precedence of different sources of configuration data, see:
Values and Chart Configuration

Overriding Array Elements

If the value file contains array structures, individual elements of the arrays can be identified from command line and overridden using the [...] syntax. If values.yaml contains:

colors:
 - name: 'blue'
   shade: 'dark'
 - nane: 'red'
   shade: 'light'

the "name" of the first element of the array can be overridden with:

--set colors[0].name=green,colors[0].shade=faded 

The above is equivalent with:

--set colors[0].name=green \
--set colors[0].shade=faded 

Warning 1 If an array element contains more than on key/value mapping, replacing just one key/value mapping with --set will discard the other ones, so you will need to set all key/value pairs at the same time. For the above example, --set colors[0].name to green will yield an empty shade for element 0. This behavior was noticed with Helm 2.14.3.


Warning 2 Setting just one array element will discard all others, so all elements must be replaced. This behavior was noticed with Helm 2.14.3.

TODO: https://helm.sh/docs/using_helm/#the-format-and-limitations-of-set

Overriding Tags and Conditions

Using the CLI with Tags and Conditions

Use --set to override default tag and condition values at installation time.

Installing from Different Sources

The default option for the helm install command is to install from the default repository. However, the chart may come from different sources:

Installing from a File

helm install something-0.1.1.tgz

Installing from an Unpacked Chart Directory

helm install ./something

Installing from a URL

helm install https://example.com/charts/something-1.0.0.tgz