Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit2ddfaa6

Browse files
authored
Merge pull request#563 from codefresh-io/classic-helm-step-updates
Classic helm step updates
2 parents435c2dd +28259a6 commit2ddfaa6

File tree

2 files changed

+48
-25
lines changed

2 files changed

+48
-25
lines changed

‎_docs/new-helm/helm-charts-and-repositories.md‎

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,12 @@ If your repository doesn't require authentication, click 'Save' and you are done
3131

3232
For more details on adding extra Helm repositories see the[Helm integration page]({{site.baseurl}}/docs/integrations/helm/).
3333

34-
##Using a Helm Repository in a Codefresh pipeline
34+
##Using Helm Repositories in a Codefresh pipeline
35+
36+
Once you have set up Helm integrations in Codefresh, you can inject single or multiple Helm repository contexts into your pipelines.
37+
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.
38+
The repository settings are injected as environment variables into the pipeline so you can use them as you wish.
3539

36-
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.
37-
The repository settings will be injected as environment variables into the pipeline so you can use them as you wish.
3840

3941
{% include image.html
4042
lightbox="true"
@@ -45,7 +47,10 @@ caption="Connecting a Helm repository in the pipeline"
4547
max-width="70%"
4648
%}
4749

48-
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/).
50+
If you are using the Helm step, the step uses the Helm repository context's settings to automatically connect to your authenticated repository.
51+
If the pipeline has multiple Helm repository contexts, then you must specify the primary repsoitory context.
52+
53+
For more info on the Codefresh Helm step, see[Using Helm in Codefresh pipelines]({{site.baseurl}}/docs/new-helm/using-helm-in-codefresh-pipeline/).
4954

5055
##Install chart from your Helm repository
5156

‎_docs/new-helm/using-helm-in-codefresh-pipeline.md‎

Lines changed: 39 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ redirect_from:
88
toc:true
99
---
1010

11-
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.
11+
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.
1212

1313
>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/).
1414
@@ -34,7 +34,7 @@ chart for your application by following [the official documentation on charts](h
3434

3535
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/).
3636

37-
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/).
37+
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/).
3838

3939
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.
4040

@@ -54,9 +54,6 @@ caption="Name of Kubernetes cluster"
5454
max-width="70%"
5555
%}
5656

57-
If you are still using Helm 2 make sure also that your Kubernetes cluster has the server part of Helm installed (called Tiller).
58-
The easiest way to do that is to run`helm init` from the command shell of your cloud provider or
59-
any other terminal that has access to your cluster via`kubectl`. This process is not needed if you use Helm 3.
6057

6158
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.
6259

@@ -68,9 +65,14 @@ you should configure a Helm repository for the step to work with. Besides public
6865
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).
6966

7067

71-
###Step 4 (optional) - ImporttheHelmConfiguration in your pipeline definition
68+
###Step 4 (optional) - Import Helmconfiguration(s) into your pipeline definition
7269

73-
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/).
70+
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.
71+
72+
1. Click the**Variables** tab on the right sidebar, and then click the**Settings** (gear) icon.
73+
1. Click**Import from shared configuration**, and select the Helm context or contexts to import into the pipeline:
74+
* 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/).
75+
* To import multiple contexts, select each context to import.
7476

7577
{% include image.html
7678
lightbox="true"
@@ -81,18 +83,15 @@ caption="Connecting a Helm repository in the pipeline"
8183
max-width="50%"
8284
%}
8385

84-
You can also click on*Add shared configuration* directly from the three dots menu for the same functionality.
85-
This concludes the Helm setup for Codefresh. Now you can use the Helm freestyle step in the pipeline`codefresh.yml` file.
86+
>You can also click on*Add shared configuration* directly from the three dots menu for the same functionality.
8687
87-
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.
88+
This concludes theHelmsetup for Codefresh. Now youcan use theHelmfreestyle step inthepipeline`codefresh.yml` file.
8889

89-
>Currently only one Helm configuration can be used in the same pipeline. We are aware
90-
of this limitation and will soon improve the way Codefresh works with multiple Helm configurations.
9190

9291

9392
##Helm usage in a pipeline step
9493

95-
You can use the helm typed step from the[Step Marketplace](https://codefresh.io/steps/step/helm)
94+
You can use the`helm` typed step from the[Step Marketplace](https://codefresh.io/steps/step/helm).
9695

9796
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).
9897

@@ -112,17 +111,26 @@ deploy:
112111
-'STR_WITH_COMAS="one\,two\,three"'
113112
```
114113
115-
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).
114+
<!---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). -->
116115
117116
### Action modes
118117
119-
The Helm step can operate in one of 3 modes:
118+
The Helm step can operate in one of three modes:
119+
120+
1. install: Installs the Helm chart into a Kubernetes cluster. This is the default mode, if a mode is not explicitly set.
121+
1. push: Packages the Helm chart and pushes it to the repository.
122+
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.
123+
124+
The operation mode is set by the `action` field, where the value can be `install`/`push`/`auth`.
125+
126+
**Multiple Helm contexts for pipeline**
127+
128+
If you have imported multiple Helm contexts into the same pipeline:
129+
* For the `install` and `push` actions, you need to define the primary Helm context to use through the `primary_helm_context` argument.
130+
* 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.
120131

121-
1. install - will install the chart into a Kubernetes cluster. This is the default mode if not explicitly set.
122-
2. push - will package chart and push it to the repository.
123-
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.
132+
For a description of these and other arguments, see [Configuration](#configuration).
124133

125-
The operation mode is set by the `action` field, where the value is `install`/`push`/`auth`.
126134

127135
### Helm Values
128136

@@ -235,20 +243,30 @@ Notes:
235243

236244
Name|Required|Description
237245
---|---|---
238-
action|defaults to'install'|Operation mode:`install`/`push`/`auth`
246+
action|defaults to`install'|Operation mode:`install`/`push`/`auth`
239247
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.
240248
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
249+
chart_subdir |optional | The subfolder where the chart is located in the JFrog Artifactory Helm repository.
241250
chart_version|optional|Override or set the chart version
242251
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.
243252
commands|optional|commands to execute in plugin after auth action
253+
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.
244254
custom_value_files|optional|values file to provide to Helm as --values or -f
245255
custom_values|optional|values to provide to Helm as --set
256+
helm_repository_context | The name of the Helm repository integration configured in Codefresh.
246257
helm_version|optional|version of [cfstep-helm image](https://hub.docker.com/r/codefresh/cfstep-helm/tags)
247258
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/)
248259
namespace|optional|Target Kubernetes namespace to deploy to
249-
release_name|required for install|Helm release name. If the release exists, it will be upgraded
260+
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.
261+
release_name|used for `install`|The Helm release name. If the release exists, it is upgraded.
250262
repos|optional|array of custom repositories
263+
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.
264+
skip_cf_stable_helm_repo | optional | Don't add stable repository.
251265
tiller_namespace|optional|Kubernetes namespace where Tiller is installed (unnecessary for Helm 3)
266+
timeout | optional | The maximum time, in seconds, to wait for Kubernetes commands to complete.
267+
use_debian_image | optional | Use Debian-based `cfstep-helm` image.
268+
use_repos_for_auth_action |optional | Required for the `auth` action to use repos from attached contexts. When required, set value to `true`.
269+
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.
252270

253271
## Full Helm pipeline example
254272

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp