Page History
YAML Schema
The YAML schema for HelmDeploy native step is as follows:
Code Block | ||||
---|---|---|---|---|
|
||||
pipelines: - name: |
Tags
name
Analphanumericstring (underscores are permitted) that identifies the step.
type
Must beHelmDeploy
for this step type.
configuration
Specifies all configuration selections for the step's execution environment.This step inherits theBash/PowerShellstep configuration tags, including these pertinenttags:
Tag |
Description of usage |
Required/Optional |
---|---|---|
integrations |
Must specify aKubernetes Integration. or Must specify anArtifactory Integrationwhen |
Required May be required |
inputResources |
Must specifyHelmChart,GitRepo,FileSpec,BuildInfoorReleaseBundleresource that contains a Helm chart. |
Required |
Info | ||
---|---|---|
|
||
本机所有步骤来自theBashstep. This means that all steps share the same base set of tags from Bash, while native steps have their own additional tags as well that support the step's particular function. So it's important to be familiar with theBashstep definition, since it's the core of the definition of all other steps. |
In addition, these tags can be defined to support the step's native operation:
Tag |
Description of usage |
Required/Optional | ||||||
---|---|---|---|---|---|---|---|---|
helmVersion |
A number representing the major version of Helm to use. Can be 2 or 3. Defaults to 2. | Optional | ||||||
namespace |
The namespace to which to deploy. This will be added to the deploy command as a--namespace parameter. |
Optional | ||||||
flags |
A flag string to be included in the Helm command. For example: "--set key=’value’ -f myTestValues.yaml" | Optional | ||||||
valueFilePaths |
Specifies values YAML file(s) for use with a--values (-f) option of the
All environment variable referenced in the specified file(s) are automatically replaced with values of matching runtime environment variables. |
Optional | ||||||
releaseName |
The release name. Equivalent to the --name (-n) option of the
|
Required | ||||||
chartPath |
The path to the Helm chart in the
|
May be required | ||||||
chartName |
The name of the Helm chart in the
|
May be required | ||||||
chartVersion |
The name of the Helm chart in the
|
May be required | ||||||
dryRun |
Whentrue, only deploys if the --dry-run install simulation is successful. Defaults to |
Optional | ||||||
lint |
When set totrue, performs a
Defaults to |
Optional | ||||||
lintFlags |
Flag string to pass to thehelm lint command. |
Optional | ||||||
test |
When set totrue, performs a
Defaults to |
Optional | ||||||
testFlags |
Flag string to pass to thehelm test command. |
Optional |
execution
Declares collections of shell command sequences to perform for pre- and post-execution phases:
Tag |
Description of usage |
Required/Optional |
---|---|---|
onStart |
Commands to execute in advance of the native operation | Optional |
onSuccess |
Commands to execute on successful completion | Optional |
onFailure |
Commands to execute on failed completion | Optional |
onComplete |
Commands to execute on any completion | Optional |
The actions performed for theonExecute
phase are inherent to this step type and may not be overridden.
Examples
下面的例子展示了如何配置一个冥界mDeploy step.
Helm 3 and HelmChart Resource Input
A HelmDeploy step using Helm 3 and a HelmChart resource input.
Code Block | ||||
---|---|---|---|---|
|
||||
管道:名称:helmDeployPipeline步骤:-南e: helmDeployStep type: HelmDeploy configuration: helmVersion: 3 namespace: my-namespace releaseName: myHelmRelease integrations: - name: kubernetes_integration inputResources: - name: helmChartResource |
Dry Run
A HelmDeploy step using Helm 3 and a HelmChart resource input with values files and a dry run before the deployment.
Code Block | ||||
---|---|---|---|---|
|
||||
管道:名称:helmDeployPipeline步骤:-南e: helmDeployStep type: HelmDeploy configuration: helmVersion: 3 namespace: my-namespace releaseName: myHelmRelease dryRun: true valueFilePaths: - values/values1.yaml - values/values2.yaml integrations: - name: kubernetes_integration inputResources: - name: helmChartResource |
GitRepo Input
A HelmDeploy step with a GitRepo input instead of a HelmChart and lint and test commands.
Code Block | ||||
---|---|---|---|---|
|
||||
管道:名称:helmDeployPipeline步骤:-南e: helmDeployStep type: HelmDeploy configuration: helmVersion: 3 namespace: my-namespace chartPath: "./myChart" releaseName: myHelmRelease lint: true lintFlags: "--strict" test: true testFlags: "--parallel" valueFilePaths: - values/values1.yaml - values/values2.yaml integrations: - name: kubernetes_integration inputResources: - name: gitRepoResource |
FileSpec Input
A HelmDeploy step with a FileSpec input resource. When using the FileSpec input resource, use thechartPath
property to specify where the Helm chart file is in the FileSpec resource. If the FileSpec represents a Generic repository in Artifactory that contains the Helm chart, use the following configuration as a reference:
Code Block | ||||
---|---|---|---|---|
|
||||
管道:名称:helmDeployPipeline步骤:-南e: helmDeployStep type: HelmDeploy configuration: helmVersion: 3 namespace: my-namespace chartPath: "./myChart" releaseName: myHelmRelease lint: true lintFlags: "--strict" test: true testFlags: "--parallel" valueFilePaths: - values/values1.yaml - values/values2.yaml integrations: - name: kubernetes_integration inputResources: - name: fileSpecResource |
If the FileSpec input resource represents a Helm repository in Artifactory, you will also need toprovide thechartName
andchartVersion
configuration properties:
Code Block | ||||
---|---|---|---|---|
|
||||
管道:名称:helmDeployPipeline步骤:-南e: helmDeployStep type: HelmDeploy configuration: helmVersion: 3 namespace: my-namespace chartPath: "./myChart" chartName: "myChartName" chartVersion: 0.0.1 releaseName: myHelmRelease lint: true lintFlags: "--strict" test: true testFlags: "--parallel" valueFilePaths: - values/values1.yaml - values/values2.yaml integrations: - name: kubernetes_integration inputResources: - name: fileSpecResource |
BuildInfo Input
A HelmDeploy step with a BuildInfo input resource. When using the BuildInfo input resource, use thechartPath
property to specify where the Helm chart file is in the BuildInfo resource. If the BuildInfo represents a Generic repository in Artifactory that contains the Helm chart, use the following configuration as a reference:
Code Block | ||||
---|---|---|---|---|
|
||||
管道:名称:helmDeployPipeline步骤:-南e: helmDeployStep type: HelmDeploy configuration: helmVersion: 3 namespace: my-namespace chartPath: "./myChart" releaseName: myHelmRelease lint: true lintFlags: "--strict" test: true testFlags: "--parallel" valueFilePaths: - values/values1.yaml - values/values2.yaml integrations: - name: kubernetes_integration inputResources: - name: buildInfoResource |
If the BuildInfo input resource represents a Helm repository in Artifactory, you will also need toprovide thechartName
andchartVersion
configuration properties:
Code Block | ||||
---|---|---|---|---|
|
||||
管道:名称:helmDeployPipeline步骤:-南e: helmDeployStep type: HelmDeploy configuration: helmVersion: 3 namespace: my-namespace chartPath: "./myChart" chartName: "myChartName" chartVersion: 0.0.1 releaseName: myHelmRelease lint: true lintFlags: "--strict" test: true testFlags: "--parallel" valueFilePaths: - values/values1.yaml - values/values2.yaml integrations: - name: kubernetes_integration inputResources: - name: buildInfoResource |
ReleaseBundle输入
A HelmDeploy step with a ReleaseBundle input resource. When using the ReleaseBundle input resource you will need to specify where the Helm chart file is in the ReleaseBundle resource using thechartPathproperty.
If the ReleaseBundle represents a Generic repository in Artifactory that contains the Helm chart, please use the following configuration as a reference:
Info | ||
---|---|---|
|
||
You must specify anArtifactory Integrationwhen |
Code Block | ||||
---|---|---|---|---|
|
||||
管道:名称:helmDeployPipeline步骤:-南e: helmDeployStep type: HelmDeploy configuration: helmVersion: 3 namespace: my-namespace chartPath: "./myChart" releaseName: myHelmRelease lint: true lintFlags: "--strict" test: true testFlags: "--parallel" valueFilePaths: - values/values1.yaml - values/values2.yaml integrations: - name: kubernetes_integration - name: artifactory_integration inputResources: - name: releaseBundleResource |
If the ReleaseBundle input resource represents a Helm repository in Artifactory, you will also have to specifychartNameandchartVersionconfiguration properties:
Code Block | ||||
---|---|---|---|---|
|
||||
管道:名称:helmDeployPipeline步骤:-南e: helmDeployStep type: HelmDeploy configuration: helmVersion: 3 namespace: my-namespace chartPath: "./myChart" chartName: "myChartName" chartVersion: 0.0.1 releaseName: myHelmRelease lint: true lintFlags: "--strict" test: true testFlags: "--parallel" valueFilePaths: - values/values1.yaml - values/values2.yaml integrations: - name: kubernetes_integration - name: artifactory_integration inputResources: - name: releaseBundleResource |
Helm 2
A HelmDeploy step using Helm 2.
Code Block | ||||
---|---|---|---|---|
|
||||
管道:名称:helmDeployPipeline步骤:-南e: helmDeployStep type: HelmDeploy configuration: helmVersion: 2 namespace: my-namespace releaseName: myHelmRelease integrations: - name: kubernetes_integration inputResources: - name: helmChartResource |
How it Works
When you use theHelmDeploynative step in a pipeline, it performs the following functions in the background:
- helm init --client-only (if the Helm version is 2)
- jfrog rt config (if there is a HelmChart resource input, to configure the JFrog CLI with the Artifactory credentials)
- jfrog rt use (if there is a HelmChart resource input, to set the current default Artifactory configuration)
- helm fetch(if there is a HelmChart resource input and the Helm version is 2, to fetch the chart)
- helm pull(if there is a HelmChart resource input and the Helm version is 3, to fetch the chart)
- replace_envs (if there are valueFilePaths, to replace variable placeholders)
- helm lint (if lint is true)
- helm --dry-run (if dryRun is true)
- helm (deploy)
- helm test (if test is true)