You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: _docs/deployments/helm/using-helm-in-codefresh-pipeline.md
+42-40Lines changed: 42 additions & 40 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,10 +14,11 @@ toc: true
14
14
15
15
We created a [special Helm step](https://codefresh.io/steps/step/helm){:target="\_blank"} for easy integration of Helm in Codefresh pipelines. The Helm step facilitates authentication, configuration, and execution of Helm commands.
16
16
17
-
> If you have a special use case that is not covered by the Codefresh Helm step, you can always use the regular `helm` cli in a freestyle step.
18
-
In this case, you can use the simpler container `codefresh/kube-helm` which includes only Kubectl and helm tools. `kube-helm` is available on DockerHub: [https://hub.docker.com/r/codefresh/kube-helm/](https://hub.docker.com/r/codefresh/kube-helm/){:target="\_blank"}.
17
+
>**NOTE:**
18
+
If you have a special use case that is not covered by the Codefresh Helm step, you can always use the regular `helm` CLI command in a `freestyle` step.
19
+
In this case, you can use the simpler container `codefresh/kube-helm` which includes only Kubectl and helm tools. `kube-helm` is available on DockerHub: [https://hub.docker.com/r/codefresh/kube-helm/](https://hub.docker.com/r/codefresh/kube-helm/){:target="\_blank"}.
19
20
20
-
If you are just starting with Helm, refer to our [Helm quick start guide]({{site.baseurl}}/docs/quick-start/ci-quick-start/deploy-with-helm/) . And, if you prefer to work directly with code, see our [full Helm example]({{site.baseurl}}/docs/example-catalog/cd-examples/helm/).
21
+
If you are just starting with Helm, refer to our [Helm quick start guide]({{site.baseurl}}/docs/quick-start/ci-quick-start/deploy-with-helm/). If you prefer to work directly with code, see our [full Helm example]({{site.baseurl}}/docs/example-catalog/cd-examples/helm/).
21
22
22
23
## Helm setup
23
24
@@ -71,9 +72,8 @@ max-width="70%"
71
72
72
73
### Step 3: Define a Helm repository
73
74
74
-
To push your chart to a Helm repository, configure the target repository to work with.
75
-
Always a good practice to save Helm charts in Helm repositories, Codefresh supports a variety of private, authenticated Helm repositories
76
-
in addition to public HTTP repositories. Codefresh also provides a free, managed Helm repository for every account.
75
+
To push your chart to a Helm repository, configure the target repository to work with. It is always a good practice to save Helm charts in Helm repositories.
76
+
Codefresh supports a variety of private, authenticated Helm repositories, in addition to public HTTP repositories. Codefresh also provides a free, managed Helm repository for every account.
77
77
78
78
* Either [connect your repository with Codefresh]({{site.baseurl}}/docs/deployments/helm/helm-charts-and-repositories/)
79
79
OR
@@ -107,8 +107,9 @@ This concludes the Helm setup for Codefresh. Now you can use the Helm freestyle
107
107
108
108
You can now use the Helm freestyle step in the `codefresh.yml` file. This step is only needed in pipelines that actually upload/fetch Helm charts to/from Helm repositories. If your pipeline directly installs a Helm chart from the Git filesystem, there is no need to import a Helm configuration.
109
109
110
-
>Currently, you can use only one Helm configuration in the same pipeline. We are aware
111
-
of this limitation and will soon improve the way Codefresh works with multiple Helm configurations.
110
+
>**NOTE:**
111
+
Currently, you can use only one Helm configuration in the same pipeline. We are aware
112
+
of this limitation, and will soon improve the way Codefresh works with multiple Helm configurations.
112
113
113
114
114
115
@@ -135,7 +136,7 @@ deploy:
135
136
136
137
#### Helm step action modes
137
138
138
-
The Helm step can operate in one of three modes, as defined by the `action` field, which can be one of the following:
139
+
The Helm step can operate in one of three modes, as defined by the `action` argument, which can be one of the following:
139
140
140
141
1. `install`: Installs the Helm chart into a Kubernetes cluster. This is the default mode if one is not explicitly set.
141
142
2. `push`: Packages the Helm chart and pushes it to the repository.
@@ -153,7 +154,7 @@ For a description of these and other arguments, see [Helm step configuration fie
153
154
154
155
#### Helm values
155
156
156
-
* To supply a value file, add to the Helm step, `custom_values_file`, with the value pointing to an existing values file.
157
+
* To supply a `values` file, add to the Helm step, `custom_values_file`, with the value pointing to an existing values file.
157
158
* To override specific values, add to the Helm step, `custom_values` followed by the path to the value to set. For example, `myservice_imageTag`. Note that `.` (dot) should be replaced with `_` (underscore). The value of the variable is used to override or set the templated property.
158
159
159
160
Examples:
@@ -175,7 +176,8 @@ results in:
175
176
results in:
176
177
`--values values-prod.yaml`
177
178
178
-
If a variable already contains a `_` (underscore) in its name, replace it with `__` (double underscore).
179
+
If a variable already contains an underscore (`_`) in its name, replace it with a double underscore (`__`).
- Assumes that a Git repository with the Helm chart files was cloned as a part of the pipeline.
219
221
- The Git repository contains the chart files in the `chart` directory.
220
222
- `chart_repo_url`is optional. If a [Helm repository configuration](#step-4-optional-import-the-helm-configuration-into-your-pipeline-definition) is attached to the pipeline, this setting is ignored.
@@ -255,38 +257,38 @@ my_custom_helm_command:
255
257
{% endraw %}
256
258
{% endhighlight %}
257
259
258
-
> Notes:
259
-
-The directory that contains a chart MUST have the same name as the chart. Thus, a chart named `my-chart` MUST be created in a directory called `my-chart/`. This is a requirement of the [Helm Chart format](https://helm.sh/docs/chart_template_guide/){:target="\_blank"}.
260
+
> **NOTES**:
261
+
The directory that contains a chart MUST have the same name as the chart. Thus, a chart named `my-chart` MUST be created in a directory called `my-chart/`. This is a requirement of the [Helm Chart format](https://helm.sh/docs/chart_template_guide/){:target="\_blank"}.
260
262
261
263
## Helm step configuration fields
262
264
263
265
{: .table .table-bordered .table-hover}
264
-
|Name|Required|Description|
266
+
|Name|Description|Required|
265
267
|---|---|---|
266
-
|action|defaults to `install`| Operation mode: `install`/`push`/`auth`|
267
-
|chart_name|required for install/push|Chart reference to use, adhering to Helm's lookup rules (path to chart folder, or name of packaged chart). There's no need to prefix with `/reponame` if referencing a chart in a repository, this is handled automatically. a.k.a `CHART_NAME` but `CHART_NAME` shouldn't be used anymore. |
268
-
|chart_repo_url|optional|Helm chart repository URL. If a [Helm repository configuration](#step-4-optional---import-the-helm-configuration-in-your-pipeline-definition) is attached to the pipeline, this setting is ignored.|
269
-
|chart_subdir |optional | The subfolder where the chart is located in the JFrog Artifactory Helm repository.|
270
-
|chart_version|optional|Override or set the chart version.|
271
-
|cmd_ps|optional|Command Postscript - this will be appended as is to the generated helm command string. Can be used to set additional parameters supported by the command but not exposed as configuration options.|
272
-
|commands|optional|commands to execute in plugin after auth action.|
273
-
|credentials_in_arguments | optional | The username and password credentials to add to the Helm command as arguments. If not added to the Helm command, the credentials are passed in the URL `http(s)://username:password@url`. Should be enabled for JFrog Artifactory Helm repositories.|
274
-
|custom_value_files|optional|values file to provide to Helm as --values or -f.|
275
-
|custom_values|optional|values to provide to Helm as --set.|
276
-
|helm_repository_context | optional |The name of the Helm repository integration configured in Codefresh.|
277
-
|helm_version|optional|version of [cfstep-helm image](https://hub.docker.com/r/codefresh/cfstep-helm/tags).|
278
-
|kube_context|required for install|Kubernetes context to use. The name of the cluster as [configured in Codefresh]({{site.baseurl}}/docs/integrations/kubernetes/#connect-a-kubernetes-cluster).|
279
-
|namespace|optional|Target Kubernetes namespace to deploy to.|
280
-
|primary_helm_context |optional |Required for `install` and `push` actions when the pipeline has multiple Helm contexts. The Helm context to use for the Helm command. When omitted, the repo most recently added to the pipeline is used.|
281
-
|release_name|used for `install`|The Helm release name. If the release exists, it is upgraded.|
282
-
|repos|optional|array of custom repositories.|
283
-
|set_file | optional | Set values from the respective files specified by the command line in `key=value` format. To specify multiple key-value pairs, separate them with commas. |
|tiller_namespace|optional|Kubernetes namespace where Tiller is installed .|
286
-
|timeout | optional | The maximum time, in seconds, to wait for Kubernetes commands to complete.|
287
-
|use_debian_image | optional | Use Debian-based `cfstep-helm` image.|
288
-
|use_repos_for_auth_action |optional | Required for the `auth` action to use repos from attached contexts. When required, set value to `true`.|
289
-
wait |optional | When specified, waits until all pods are in state `ready` to mark the release as successful. Otherwise, release is marked as successful when the minimum number of pods are `ready` and the Services have IP addresses. |
268
+
|`action`|The operation performed by the Helm step, and can be of the following: {::nomarkdown} <ul><li><code class="highlighter-rouge">install</code>: The default, installs the Helm chart into a Kubernetes cluster.</li><li><code class="highlighter-rouge">push</code>: Packages the Helm chart and pushes it to the repository.</li><li><code class="highlighter-rouge">auth</code>: Sets up authentication, and adds one or more Helm repos. This mode is useful to write your own Helm commands using the freestyle step's <code class="highlighter-rouge">commands</code> property, but still allow the step to handle authentication.</li></ul>{:/}| Required|
269
+
|`chart_name`| The chart to use for the `install` and `push` actions. <br>The chart name can be either:{::nomarkdown} <ul><li>The name of a packaged Helm chart, for example, <code class="highlighter-rouge">myapp-1.0.0.tgz</code>.</li><li>The local directory path to the folder in which the Helm chart is stored, for example, <code class="highlighter-rouge">/home/user/charts/</code>. Helm will identify the chart name from the <code class="highlighter-rouge">chart.yaml</code> file in the folder. <br>When referencing a chart in a repository, `/reponame` prefix is not needed, as it is identified automatically.</li></ul>{:/}`CHART_NAME` should not be used anymore. | Required |
270
+
|`chart_repo_url`|Helm chart repository URL. If a [Helm repository configuration](#step-4-optional---import-the-helm-configuration-in-your-pipeline-definition) is attached to the pipeline, this setting is ignored.| Optional|
271
+
|`chart_subdir` | The subfolder where the chart is located in the JFrog Artifactory Helm repository.| Optional |
272
+
|`chart_version`|The version identifier used to track and communicate the version of the Helm chart itself, instead of the version of the application or service that the chart deploys. When not specified, uses the version in the `chart.yaml` file of the chart. |Optional |
273
+
|`cmd_ps`| The Postscript command to be appended as is to the generated Helm command string.<br>Use to set additional parameters supported by the command but not exposed as configuration options.|Optional |
274
+
|`commands`|Commands to execute in plugin after auth action.|Optional |
275
+
|`credentials_in_arguments` | The username and password credentials to add to the Helm command as arguments. If not added to the Helm command, the credentials are passed in the URL `http(s)://username:password@url`. <br>Should be enabled for JFrog Artifactory Helm repositories.| Optional|
276
+
|`custom_value_files`|The `values` file to provide to Helm as `--values` or `-f`.|Optional |
277
+
|`custom_values`|The values to provide to Helm as `--set`.|Optional |
278
+
|`helm_repository_context` |The name of the Helm repository integration configured in Codefresh.| Optional |
279
+
|`helm_version`|The version of the [cfstep-helm image](https://hub.docker.com/r/codefresh/cfstep-helm/tags).|Optional |
280
+
|`kube_context`|The Kubernetes context to use when the `action` for the Helm step is set to `install`. The name of the cluster as [configured in Codefresh]({{site.baseurl}}/docs/integrations/kubernetes/#connect-a-kubernetes-cluster).| Optional |
281
+
|`namespace`|The target Kubernetes namespace to deploy to.| Optional |
282
+
|`primary_helm_context` |The Helm context to use for the Helm command, when the Helm `action` is either `install` or `push`, and the pipeline has multiple Helm contexts. When omitted, uses the repo most recently added to the pipeline.| Optional |
283
+
|`release_name`|The Helm release name to use when the Helm `action` is set to `install`. If the release exists, it is upgraded.|Optional |
284
+
|`repos`|Array of custom repositories.|Optional|
285
+
|`set_file` | The values to set from the respective files specified by the command line in `key=value` format. To specify multiple key-value pairs, separate them with commas. | Optional |
286
+
|`skip_cf_stable_helm_repo` | When set to `true`, the default, does not add a stable repository.| Optional|
287
+
|`timeout` | The maximum time, in seconds, to wait for Kubernetes commands to complete.|Optional |
288
+
|`use_debian_image` | Use Debian-based `cfstep-helm` image.|Optional |
289
+
|`use_repos_for_auth_action` | Uses repos from attached contexts, and is required when the Helm step `action` is set to `auth` action. When required, set value to `true`.|Optional |
290
+
`wait`| When specified, waits until all pods are in state `ready` to mark the release as successful. Otherwise, release is marked as successful when the minimum number of pods are `ready` and the Services have IP addresses. |Optional |
291
+
|`tiller_namespace`|Deprecated. Kubernetes namespace where Tiller is installed . | Optional |
0 commit comments