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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
@@ -31,10 +31,12 @@ If your repository doesn't require authentication, click 'Save' and you are done
For more details on adding extra Helm repositories see the [Helm integration page]({{site.baseurl}}/docs/integrations/helm/).
## Using a Helm Repository in a Codefresh pipeline
## Using Helm Repositories in a Codefresh pipeline
Once you have set up Helm integrations in Codefresh, you can inject single or multiple Helm repository contexts into your pipelines.
Select the **Import from shared configuration** option in the "Environment Variables" section, and then select the Helm repository or Helm repositories to inject into the pipeline.
The repository settings are injected as environment variables into the pipeline so you can use them as you wish.
Once connected, any Helm repository context can be injected into pipelines by selecting "Import from shared configuration" (under "Environment Variables" section) and selecting the name of the repository.
The repository settings will be injected as environment variables into the pipeline so you can use them as you wish.
{% include image.html
lightbox="true"
Expand All
@@ -45,7 +47,10 @@ caption="Connecting a Helm repository in the pipeline"
max-width="70%"
%}
If you are using the Helm step, it will use these settings to connect to your authenticated repository automatically. More info on the Codefresh Helm step can be found in the [Helm Usage Guide]({{site.baseurl}}/docs/new-helm/using-helm-in-codefresh-pipeline/).
If you are using the Helm step, the step uses the Helm repository context's settings to automatically connect to your authenticated repository.
If the pipeline has multiple Helm repository contexts, then you must specify the primary repsoitory context.
For more info on the Codefresh Helm step, see [Using Helm in Codefresh pipelines]({{site.baseurl}}/docs/new-helm/using-helm-in-codefresh-pipeline/).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
We have created a [special Helm step](https://codefresh.io/steps/step/helm) for easy integration of Helm in Codefresh pipelines. The Helm step facilitates authentication, configuration and execution of Helm commands.
We have created a [special Helm step](https://codefresh.io/steps/step/helm)for easy integration of Helm in Codefresh pipelines. The Helm step facilitates authentication, configuration and execution of Helm commands.
> You can always use the regular `helm` cli in a freestyle step, if you have a special use case that is not covered by the Codefresh Helm step. In this case, you can use the simpler container `codefresh/kube-helm` which includes only the 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/).
Expand All
@@ -34,7 +34,7 @@ chart for your application by following [the official documentation on charts](h
The example Codefresh application also comes with a [sample chart](https://github.com/codefresh-contrib/python-flask-sample-app/tree/with-helm/charts/python) that is used in the [Helm quick start guide]({{site.baseurl}}/docs/getting-started/helm-quick-start-guide/).
You can create the chart manually or by using the [helm create](https://helm.sh/docs/helm/#helm-create) command on your workstation. There are also several thirdpart tools that can create Helm packages for you such as [Draft](https://draft.sh/).
You can create the chart manually or by using the [helm create](https://helm.sh/docs/helm/#helm-create) command on your workstation. There are also several thirdparty tools that can create Helm packages for you such as [Draft](https://draft.sh/).
Once you have your Helm chart ready, commit it to the same git repository that contains the source code of your application. It should be in a folder called `charts`. Codefresh can also work with Helm charts that are in different Git repositories. We suggest however that you keep both the source code and the Helm chart of an application in the same git repository as this makes chart management much easier.
Expand All
@@ -54,9 +54,6 @@ caption="Name of Kubernetes cluster"
max-width="70%"
%}
If you are still using Helm 2 make sure also that your Kubernetes cluster has the server part of Helm installed (called Tiller).
The easiest way to do that is to run `helm init` from the command shell of your cloud provider or
any other terminal that has access to your cluster via `kubectl`. This process is not needed if you use Helm 3.
To verify that your cluster is setup for Helm select the *Helm Releases* item from the left sidebar in the Codefresh UI. You should see the [Helm releases]({{site.baseurl}}/docs/new-helm/helm-releases-management/) in your cluster or an empty screen if you just started using Helm.
Expand All
@@ -68,9 +65,14 @@ you should configure a Helm repository for the step to work with. Besides public
You will need to connect your repository with Codefresh as described [here]({{site.baseurl}}/docs/new-helm/add-helm-repository/), or obtain your managed Helm repository URL as described [here]({{site.baseurl}}/docs/new-helm/managed-helm-repository/#chart-repository-url).
### Step 4 (optional) - ImporttheHelmConfiguration in your pipeline definition
### Step 4 (optional) - Import Helmconfiguration(s) into your pipeline definition
Once you have a Helm repository connected, attach it to the pipeline. Do this by opening the advanced options (the gear icon) in the variables section in the right sidebard. Then click on *Import from shared configuration* and choose the `CF_HELM_DEFAULT` [shared configuration]({{site.baseurl}}/docs/configure-ci-cd-pipeline/shared-configuration/).
Once you have Helm repositories connected to Codefresh, you can import one or more of them into the pipeline. This step is needed in pipelines that actually upload/fetch Helm charts from/to Helm repositories. If you have a pipeline that directly installs a Helm chart from the Git filesystem, there is no need to import a Helm configuration.
1. Click the **Variables** tab on the right sidebar, and then click the **Settings** (gear) icon.
1. Click **Import from shared configuration**, and select the Helm context or contexts to import into the pipeline:
* To import a single context, select the context. The `CF_HELM_DEFAULT` is the default Helm rep provided by Codefresh. See also [shared configuration]({{site.baseurl}}/docs/configure-ci-cd-pipeline/shared-configuration/).
* To import multiple contexts, select each context to import.
{% include image.html
lightbox="true"
Expand All
@@ -81,18 +83,15 @@ caption="Connecting a Helm repository in the pipeline"
max-width="50%"
%}
You can also click on *Add shared configuration* directly from the three dots menu for the same functionality.
This concludes the Helm setup for Codefresh. Now you can use the Helm freestyle step in the pipeline `codefresh.yml` file.
> You can also click on *Add shared configuration* directly from the three dots menu for the same functionality.
Note that this step is only needed in pipelines that actually upload/fetchHelmcharts from/to Helm repositories. If youhave a pipeline that directly installs aHelmchart fromthegit filesystem, there is no need to import a Helm configuration.
This concludes theHelmsetup for Codefresh. Now youcan use theHelmfreestyle step inthepipeline `codefresh.yml` file.
>Currently only one Helm configuration can be used in the same pipeline. We are aware
of this limitation and will soon improve the way Codefresh works with multiple Helm configurations.
## Helm usage in a pipeline step
You can use the helm typed step from the [Step Marketplace](https://codefresh.io/steps/step/helm)
You can use the`helm` typed step from the [Step Marketplace](https://codefresh.io/steps/step/helm).
The Helm step can be configured using environment variables, which can be provided in any of the various ways supported by Codefresh as described [here]({{site.baseurl}}/docs/codefresh-yaml/variables/#user-provided-variables).
Expand All
@@ -112,17 +111,26 @@ deploy:
- 'STR_WITH_COMAS="one\,two\,three"'
```
For Helm 2, the Docker image tag refers to the version of Helm/Tiller you need. For Helm 3, just use the [newest Helm 3 image tag](https://hub.docker.com/r/codefresh/cfstep-helm/tags).
<!---For Helm 2, the Docker image tag refers to the version of Helm/Tiller you need. For Helm 3, just use the [newest Helm 3 image tag](https://hub.docker.com/r/codefresh/cfstep-helm/tags). -->
### Action modes
The Helm step can operate in one of 3 modes:
The Helm step can operate in one of three modes:
1. install: Installs the Helm chart into a Kubernetes cluster. This is the default mode, if a mode is not explicitly set.
1. push: Packages the Helm chart and pushes it to the repository.
1. authentication: Sets up authentication, and adds one or more Helm repos. This is useful if you want to write your own helm commands using the freestyle step's `commands` property, but you still want the step to handle authentication.
The operation mode is set by the `action` field, where the value can be `install`/`push`/`auth`.
**Multiple Helm contexts for pipeline**
If you have imported multiple Helm contexts into the same pipeline:
* For the `install` and `push` actions, you need to define the primary Helm context to use through the `primary_helm_context` argument.
* For the `auth` action, to use the repos from the helm contexts imported into the pipeline, add `use_repos_for_auth_action: 'true'`. Otherwise, imported contexts, if any, are ignored for the `auth` action.
1. install - will install the chart into a Kubernetes cluster. This is the default mode if not explicitly set.
2. push - will package chart and push it to the repository.
3. authentication only - will only setup authentication and add the repo to the helm. This is useful if you want to write your own helm commands using the freestyle step's `commands` property, but you still want the step to handle authentication.
For a description of these and other arguments, see [Configuration](#configuration).
The operation mode is set by the `action` field, where the value is `install`/`push`/`auth`.
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.
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
chart_subdir |optional | The subfolder where the chart is located in the JFrog Artifactory Helm repository.
chart_version|optional|Override or set the chart version
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.
commands|optional|commands to execute in plugin after auth action
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.
custom_value_files|optional|values file to provide to Helm as --values or -f
custom_values|optional|values to provide to Helm as --set
helm_repository_context | The name of the Helm repository integration configured in Codefresh.
helm_version|optional|version of [cfstep-helm image](https://hub.docker.com/r/codefresh/cfstep-helm/tags)
kube_context|required for install|Kubernetes context to use. The name of the cluster as [configured in Codefresh]({{site.baseurl}}/docs/deploy-to-kubernetes/add-kubernetes-cluster/)
namespace|optional|Target Kubernetes namespace to deploy to
release_name|required for install|Helm release name. If the release exists, it will be upgraded
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.
release_name|used for `install`|The Helm release name. If the release exists, it is upgraded.
repos|optional|array of custom repositories
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 (unnecessary for Helm 3)
timeout | optional | The maximum time, in seconds, to wait for Kubernetes commands to complete.
use_debian_image | optional | Use Debian-based `cfstep-helm` image.
use_repos_for_auth_action |optional | Required for the `auth` action to use repos from attached contexts. When required, set value to `true`.
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.
## Full Helm pipeline example
Expand Down
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.