Helm install: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
(35 intermediate revisions by the same user not shown)
Line 17: Line 17:


==<span id='Installing_from_an_Unpacked_Chart_Directory'></span>Path to an Unpacked Chart==
==<span id='Installing_from_an_Unpacked_Chart_Directory'></span>Path to an Unpacked Chart==
The chart argument of the install command can be an unpacked chart directory:
The chart argument of the install command can be an unpacked local chart directory. [[Helm_Concepts#Chart_Name|The directory name must be identical with the chart name specified in Chart.yaml]]).
 
  helm install simplest ./playground/helm/simplest
  helm install simplest ./playground/helm/simplest


Line 32: Line 33:
==Chart Reference==
==Chart Reference==


A chart available in a chart repository represented locally can be specified by a chart reference when installed. There are two ways to specify a chart reference:
A chart available in a [[Helm_Concepts#Repository|chart repository]] can be specified by a [[Helm_Concepts#Chart_Reference|chart reference]] (which is the same thing as the [[Helm_Concepts#Chart_Name|chart name]]) when installed. There are two ways to specify a chart reference:


===Using a Repository Prefix===
===Using a Repository Prefix===
Line 38: Line 39:
  helm install postgresql example/postgresql
  helm install postgresql example/postgresql


Note that the "example" repository must have been previously added locally with helm repo add.
Note that the "example" is a name of a repository that has been previously added locally with [[Helm_repo#Add_a_New_Repository|helm repo add]]. If no other version specification is provided, the latest stable version of the chart will be installed. A specific version can be requested with [[#--version|--version]].


===Using an Explicit Repository URL with --repo===
===Using an Explicit Repository URL with --repo===


helm install --repo my-nginx nginx
A repository URL can be specified in-line in the install command line with --repo, without being previously added with [[Helm_repo#Add_a_New_Repository|helm repo add]]:


=Options=
helm install --repo https&#58;//example.com/charts/ mynginx nginx
==--generate-name==


Generate a release name. If used,  
=helm install and Dependencies=
<font color=darkgray>
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}}
TODO: [[#--dependency-update|--dependency-update]].
</font>


=<span id='Helm_install#Overriding_Default_Configuration'></span>Overriding Default Configuration or Providing New Cofiguration=


------------------
==-f|--values==


Default configuration can be overridden or new configuration can be specified with:


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


The chart may come from a [[Helm Concepts#Repository|repository]]:
The -f|--values flag can be specified multiple time on the command line, and the rightmost value will take precedence. For more details on Helm configuration see: {{Internal|Helm_Configuration#Values_Supplied_in_Files|Helm Configuration}}


helm install <''chart-name''>
==--set-file==
helm install stable/mysql


or from a local directory (note that the [[Helm_Concepts#Chart_Name|directory name must be identical with the chart name specified in Chart.yaml]]):
<font color=darkgray>TODO: Clarify use cases and file content syntax.</font>


helm install <''directory-name-that-must-match-chart-name''>
For more details on Helm configuration see: {{Internal|Helm_Configuration#Values_Supplied_in_Files|Helm Configuration}}


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.
==<span id='--set'></span>--set, --set--string==


<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.
Individual configuration options can be specified with --set or --set-string.


For more details on dependencies and how they work, see: {{Internal|Helm_Dependencies#How_Helm_Dependencies_Work|How Helm Dependencies Work}}
helm install --set size=10 <''chart name''>


=Dry Run=
--set can be specified multiple times. If specified multiple time for the same value, the priority will be given to the last (right-most) set specified. For more details on overriding or specifying configuration see: {{Internal|Helm_Configuration#--set_Command_Line_Arguments|Helm Configuration}}


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:
=Overriding Tags and Conditions=
Use --set to override default [[Helm Concepts#Tag|tag]] and  [[Helm Concepts#Condition|condition]] values at installation time.
 
=Options=
==--generate-name==


helm install <...> --debug --dry-run
Generate a release name:


Note that in this mode, it is not guaranteed that Kubernetes will accept the generated manifest.
helm install --generate-name <''chart''>


=<span id='Helm_install#Overriding_Default_Configuration'></span>Overriding Default Configuration or Providing New Cofiguration=
If used, the user-supplied name must be omitted from the command line, and a name based on the chart name will be generated. If the chart is named "simplest", the generated name is similar to "simplest-1-1575057340".
 
==<span id='Dry_Run'></span>--dry-run==


==-f|--values==
In this mode, the installation is simulated, without actually modifying anything on the Kubernetes cluster. Instead of installing the chart, the rendered template are sent to stdout so they can be inspected. Note that in this mode, it is not guaranteed that Kubernetes cluster will accept the generated manifest.


Default configuration can be overridden or new configuration can be specified with:
helm install --dry-run ...


helm install -f|--values <''configuration-overrides-file''.yaml> <''chart name''>
<code>--dry-run</code> can be combined with [[#--debug|--debug]] for more information:


The -f|--values flag can be specified multiple time on the command line, and the rightmost value will take precedence. For more details on Helm configuration see: {{Internal|Helm_Configuration#Values_Supplied_in_Files|Helm Configuration}}
helm install --dry-run --debug ...


==--set-file==
==--debug==
helm install --debug ...


<font color=darkgray>TODO: Clarify use cases and file content syntax.</font>
The --debug flag displays:
* [[Helm_Concepts#Effective_Values|user-supplied values and computed values]]


For more details on Helm configuration see: {{Internal|Helm_Configuration#Values_Supplied_in_Files|Helm Configuration}}
==--verify==


==<span id='--set'></span>--set, --set--string==
If --verify is used, the chart must have a provenance file, and the provenance file must pass all verification steps.


Individual configuration options can be specified with --set or --set-string.
==--atomic==


helm install --set size=10 <''chart name''>
Installation process purges chart on fail. The [[#--wait|--wait]] flag will be set automatically if --atomic is used.


For more details on overriding or specifying configuration see: {{Internal|Helm_Configuration#--set_Command_Line_Arguments|Helm Configuration}}
==--version==
Specify the exact chart version to install. If this is not specified, the latest version is installed.


=Debug=
==--dependency-update==


helm install --debug
Run [[Helm_dependency#Dependency_Update|helm dependency update]] before installing the chart. <font color=darkgray>TODO: more research here.</font>


The --debug flag displays:
==--name-template==
* [[Helm_Concepts#Effective_Values|user-supplied values and computed values]]


=Overriding Tags and Conditions=
<font color=darkgray>Specify template used to name the release.</font>
{{External|[https://helm.sh/docs/developing_charts/#using-the-cli-with-tags-and-conditions Using the CLI with Tags and Conditions]}}


Use --set to override default [[Helm Concepts#Tag|tag]] and [[Helm Concepts#Condition|condition]] values at installation time.
==--output==
<font color=darkgray>Prints the output in the specified format. Allowed values: table, json, yaml (default table).</font>
==--wait==
<font color=darkgray>If set, Helm will wait until all Pods, PVCs, Services, and minimum number of Pods of a Deployment, StatefulSet, or ReplicaSet are in a ready state before marking the release as successful. It will wait for as long as [[#--timeout|--timeout]].</font>
==--timeout==
<font color=darkgray>The time to wait for any individual Kubernetes operation. The default value is 5 minutes.</font>

Revision as of 20:23, 29 November 2019

External

Internal

Overview


Revised for Helm 3


helm install installs a chart archive and creates a release:

helm install <release-name> <chart> [options]

The release name must be specified explicitly. If it should be generated, --generate-name must be used instead of the release name. Charts may come from different sources.

Chart Sources

Path to an Unpacked Chart

The chart argument of the install command can be an unpacked local chart directory. The directory name must be identical with the chart name specified in Chart.yaml).

helm install simplest ./playground/helm/simplest

Path to a Packaged Chart

helm install simplest ./simplest-1.0.0.tgz

Charts can be packaged with helm package command.

Absolute URL

The absolute URL of a chart can be used as such:

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

Chart Reference

A chart available in a chart repository can be specified by a chart reference (which is the same thing as the chart name) when installed. There are two ways to specify a chart reference:

Using a Repository Prefix

helm install postgresql example/postgresql

Note that the "example" is a name of a repository that has been previously added locally with helm repo add. If no other version specification is provided, the latest stable version of the chart will be installed. A specific version can be requested with --version.

Using an Explicit Repository URL with --repo

A repository URL can be specified in-line in the install command line with --repo, without being previously added with helm repo add:

helm install --repo https://example.com/charts/ mynginx nginx

helm install and Dependencies

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

TODO: --dependency-update.

Overriding Default Configuration or Providing New Cofiguration

-f|--values

Default configuration can be overridden or new configuration can be specified 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. For more details on Helm configuration see:

Helm Configuration

--set-file

TODO: Clarify use cases and file content syntax.

For more details on Helm configuration see:

Helm Configuration

--set, --set--string

Individual configuration options can be specified with --set or --set-string.

helm install --set size=10 <chart name>

--set can be specified multiple times. If specified multiple time for the same value, the priority will be given to the last (right-most) set specified. For more details on overriding or specifying configuration see:

Helm Configuration

Overriding Tags and Conditions

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

Options

--generate-name

Generate a release name:

helm install --generate-name <chart>

If used, the user-supplied name must be omitted from the command line, and a name based on the chart name will be generated. If the chart is named "simplest", the generated name is similar to "simplest-1-1575057340".

--dry-run

In this mode, the installation is simulated, without actually modifying anything on the Kubernetes cluster. Instead of installing the chart, the rendered template are sent to stdout so they can be inspected. Note that in this mode, it is not guaranteed that Kubernetes cluster will accept the generated manifest.

helm install --dry-run ...

--dry-run can be combined with --debug for more information:

helm install --dry-run --debug ...

--debug

helm install --debug ...

The --debug flag displays:

--verify

If --verify is used, the chart must have a provenance file, and the provenance file must pass all verification steps.

--atomic

Installation process purges chart on fail. The --wait flag will be set automatically if --atomic is used.

--version

Specify the exact chart version to install. If this is not specified, the latest version is installed.

--dependency-update

Run helm dependency update before installing the chart. TODO: more research here.

--name-template

Specify template used to name the release.

--output

Prints the output in the specified format. Allowed values: table, json, yaml (default table).

--wait

If set, Helm will wait until all Pods, PVCs, Services, and minimum number of Pods of a Deployment, StatefulSet, or ReplicaSet are in a ready state before marking the release as successful. It will wait for as long as --timeout.

--timeout

The time to wait for any individual Kubernetes operation. The default value is 5 minutes.