helmBuild¶
Executes helm3 functionality as the package manager for Kubernetes.
Description¶
Alpha version: please expect incompatible changes
Executes helm functionality as the package manager for Kubernetes.
- Helm is the package manager for Kubernetes.
- Helm documentation and best practices
- Helm Charts
Available Commands: `upgrade`, `lint`, `install`, `test`, `uninstall`, `dependency`, `publish` upgrade upgrade a release lint examine a chart for possible issues install install a chart test run tests for a release uninstall uninstall a release dependency package a chart directory into a chart archive publish package and publish a release
Note: piper supports only helm3 version, since helm2 is deprecated.
Usage¶
We recommend to define values of step parameters via .pipeline/config.yml file.
In this case, calling the step is essentially reduced to defining the step name.
Calling the step can be done either in an orchestrator specific way (e.g. via a Jenkins library step) or on the command line.
library('piper-lib-os')
helmBuild script: this
piper helmBuild
Outputs¶
| Output type | Details |
|---|---|
| commonPipelineEnvironment |
|
Parameters¶
Overview - Step¶
Overview - Execution Environment¶
Orchestrator-specific only
These parameters are relevant for orchestrator usage and not considered when using the command line option.
| Name | Mandatory | Additional information |
|---|---|---|
| containerCommand | no | |
| containerShell | no | |
| dockerEnvVars | no | |
| dockerImage | no | |
| dockerName | no | |
| dockerOptions | no | |
| dockerPullImage | no | |
| dockerVolumeBind | no | |
| dockerWorkspace | no | |
| stashContent | no |
Details¶
additionalParameters¶
Defines additional parameters for Helm like "helm install [NAME] [CHART] [flags]".
| Scope | Details |
|---|---|
| Aliases | helmDeploymentParameters |
| Type | []string |
| Mandatory | no |
| Default | $PIPER_additionalParameters (if set) |
| Secret | no |
| Configuration scope |
|
| Resource references | none |
appVersion¶
set the appVersion on the chart to this version
| Scope | Details |
|---|---|
| Aliases | - |
| Type | string |
| Mandatory | no |
| Default | $PIPER_appVersion (if set) |
| Secret | no |
| Configuration scope |
|
| Resource references | none |
buildSettingsInfo¶
Build settings info is typically filled by the step automatically to create information about the build settings that were used during the helm build. This information is typically used for compliance related processes.
| Scope | Details |
|---|---|
| Aliases | - |
| Type | string |
| Mandatory | no |
| Default | $PIPER_buildSettingsInfo (if set) |
| Secret | no |
| Configuration scope |
|
| Resource references | commonPipelineEnvironment: reference to: custom/buildSettingsInfo |
chartPath¶
Defines the chart path for helm. chartPath is mandatory for install/upgrade/publish commands.
| Scope | Details |
|---|---|
| Aliases | helmChartPath |
| Type | string |
| Mandatory | no |
| Default | $PIPER_chartPath (if set) |
| Secret | no |
| Configuration scope |
|
| Resource references | none |
containerCommand¶
Jenkins-specific: Used for proper environment setup.
Kubernetes only: Allows to specify start command for container created with dockerImage parameter to overwrite Piper default (/usr/bin/tail -f /dev/null).
| Scope | Details |
|---|---|
| Aliases | - |
| Type | string |
| Mandatory | no |
| Default | |
| Secret | no |
| Configuration scope |
|
| Resource references | none |
containerShell¶
Jenkins-specific: Used for proper environment setup.
Allows to specify the shell to be executed for container with containerName.
| Scope | Details |
|---|---|
| Aliases | - |
| Type | string |
| Mandatory | no |
| Default | |
| Secret | no |
| Configuration scope |
|
| Resource references | none |
customTlsCertificateLinks¶
List of download links to custom TLS certificates. This is required to ensure trusted connections to instances with repositories (like nexus) when publish flag is set to true.
| Scope | Details |
|---|---|
| Aliases | - |
| Type | []string |
| Mandatory | no |
| Default | $PIPER_customTlsCertificateLinks (if set) |
| Secret | no |
| Configuration scope |
|
| Resource references | none |
dependency¶
manage a chart's dependencies
| Scope | Details |
|---|---|
| Aliases | - |
| Type | string |
| Mandatory | no |
| Default | $PIPER_dependency (if set) |
| Possible values | - build- list- update |
| Secret | no |
| Configuration scope |
|
| Resource references | none |
dockerConfigJSON¶
Path to the file .docker/config.json - this is typically provided by your CI/CD system. You can find more details about the Docker credentials in the Docker documentation.
| Scope | Details |
|---|---|
| Aliases | - |
| Type | string |
| Mandatory | no |
| Default | $PIPER_dockerConfigJSON (if set) |
| Secret | yes |
| Configuration scope |
|
| Resource references | Jenkins credential id: id: dockerConfigJsonCredentialsIdVault resource: name: dockerConfigFileVaultSecretNamedefault value: docker-configVault paths:
|
dockerEnvVars¶
Environment variables to set in the container, e.g. [http_proxy: "proxy:8080"].
| Scope | Details |
|---|---|
| Aliases | - |
| Type | map[string]string |
| Mandatory | no |
| Default | |
| Secret | no |
| Configuration scope |
|
| Resource references | none |
dockerImage¶
Name of the docker image that should be used. If empty, Docker is not used and the command is executed directly on the Jenkins system.
| Scope | Details |
|---|---|
| Aliases | - |
| Type | string |
| Mandatory | no |
| Default | alpine/k8s:1.33.13 |
| Secret | no |
| Configuration scope |
|
| Resource references | none |
dockerName¶
Kubernetes only: Name of the container launching dockerImage. SideCar only: Name of the container in local network.
| Scope | Details |
|---|---|
| Aliases | - |
| Type | string |
| Mandatory | no |
| Default | |
| Secret | no |
| Configuration scope |
|
| Resource references | none |
dockerOptions¶
Docker options to be set when starting the container.
| Scope | Details |
|---|---|
| Aliases | - |
| Type | []string |
| Mandatory | no |
| Default | [{-u 0}] |
| Secret | no |
| Configuration scope |
|
| Resource references | none |
dockerPullImage¶
Set this to 'false' to bypass a docker image pull. Useful during development process. Allows testing of images which are available in the local registry only.
| Scope | Details |
|---|---|
| Aliases | - |
| Type | bool |
| Mandatory | no |
| Default | true |
| Possible values | - true- false |
| Secret | no |
| Configuration scope |
|
| Resource references | none |
dockerVolumeBind¶
Jenkins-specific: Used for proper environment setup.
Volumes that should be mounted into the docker container.
| Scope | Details |
|---|---|
| Aliases | - |
| Type | map[string]string |
| Mandatory | no |
| Default | |
| Secret | no |
| Configuration scope |
|
| Resource references | none |
dockerWorkspace¶
Jenkins-specific: Used for proper environment setup.
Kubernetes only: Specifies a dedicated user home directory for the container which will be passed as value for environment variable HOME.
| Scope | Details |
|---|---|
| Aliases | - |
| Type | string |
| Mandatory | no |
| Default | /config |
| Secret | no |
| Configuration scope |
|
| Resource references | none |
dumpLogs¶
dump the logs from test pods (this runs after all tests are complete, but before any cleanup)
| Scope | Details |
|---|---|
| Aliases | - |
| Type | bool |
| Mandatory | no |
| Default | false |
| Possible values | - true- false |
| Secret | no |
| Configuration scope |
|
| Resource references | none |
filterTest¶
specify tests by attribute (currently name) using attribute=value syntax or !attribute=value to exclude a test (can specify multiple or separate values with commas name=test1,name=test2)
| Scope | Details |
|---|---|
| Aliases | - |
| Type | string |
| Mandatory | no |
| Default | $PIPER_filterTest (if set) |
| Secret | no |
| Configuration scope |
|
| Resource references | none |
helmCommand¶
Helm: defines the command upgrade, lint, install, test, uninstall, dependency, publish.
| Scope | Details |
|---|---|
| Aliases | - |
| Type | string |
| Mandatory | no |
| Default | $PIPER_helmCommand (if set) |
| Possible values | - upgrade- lint- install- test- uninstall- dependency- publish |
| Secret | no |
| Configuration scope |
|
| Resource references | none |
helmDeployWaitSeconds¶
Number of seconds before helm deploy returns.
| Scope | Details |
|---|---|
| Aliases | - |
| Type | int |
| Mandatory | no |
| Default | 300 |
| Secret | no |
| Configuration scope |
|
| Resource references | none |
helmValues¶
List of helm values as YAML file reference or URL (as per helm parameter description for -f / --values)
| Scope | Details |
|---|---|
| Aliases | - |
| Type | []string |
| Mandatory | no |
| Default | $PIPER_helmValues (if set) |
| Secret | no |
| Configuration scope |
|
| Resource references | none |
image¶
Full name of the image to be deployed.
| Scope | Details |
|---|---|
| Aliases | deployImage |
| Type | string |
| Mandatory | yes |
| Default | $PIPER_image (if set) |
| Secret | no |
| Configuration scope |
|
| Resource references | commonPipelineEnvironment: reference to: container/imageNameTag |
keepFailedDeployments¶
Defines whether a failed deployment will be purged
| Scope | Details |
|---|---|
| Aliases | - |
| Type | bool |
| Mandatory | no |
| Default | false |
| Possible values | - true- false |
| Secret | no |
| Configuration scope |
|
| Resource references | none |
kubeConfig¶
Defines the path to the "kubeconfig" file.
| Scope | Details |
|---|---|
| Aliases | - |
| Type | string |
| Mandatory | no |
| Default | $PIPER_kubeConfig (if set) |
| Secret | yes |
| Configuration scope |
|
| Resource references | Jenkins credential id: id: kubeConfigFileCredentialsIdVault resource: name: kubeConfigFileVaultSecretNamedefault value: kube-configVault paths:
|
kubeContext¶
Defines the context to use from the "kubeconfig" file.
| Scope | Details |
|---|---|
| Aliases | - |
| Type | string |
| Mandatory | no |
| Default | $PIPER_kubeContext (if set) |
| Secret | no |
| Configuration scope |
|
| Resource references | none |
namespace¶
Defines the target Kubernetes namespace for the deployment.
| Scope | Details |
|---|---|
| Aliases | helmDeploymentNamespace |
| Type | string |
| Mandatory | no |
| Default | default |
| Secret | no |
| Configuration scope |
|
| Resource references | none |
packageDependencyUpdate¶
update dependencies from "Chart.yaml" to dir "charts/" before packaging
| Scope | Details |
|---|---|
| Aliases | - |
| Type | bool |
| Mandatory | no |
| Default | false |
| Possible values | - true- false |
| Secret | no |
| Configuration scope |
|
| Resource references | none |
publish¶
Configures helm to run the deploy command to publish artifacts to a repository.
| Scope | Details |
|---|---|
| Aliases | - |
| Type | bool |
| Mandatory | no |
| Default | false |
| Possible values | - true- false |
| Secret | no |
| Configuration scope |
|
| Resource references | none |
renderSubchartNotes¶
If set, render subchart notes along with the parent.
| Scope | Details |
|---|---|
| Aliases | - |
| Type | bool |
| Mandatory | no |
| Default | true |
| Possible values | - true- false |
| Secret | no |
| Configuration scope |
|
| Resource references | none |
renderValuesTemplate¶
A flag to turn templating value files on or off.
| Scope | Details |
|---|---|
| Aliases | - |
| Type | bool |
| Mandatory | no |
| Default | true |
| Possible values | - true- false |
| Secret | no |
| Configuration scope |
|
| Resource references | none |
script¶
The common script environment of the Jenkinsfile running. Typically the reference to the script calling the pipeline step is provided with the this parameter, as in script: this. This allows the function to access the commonPipelineEnvironment for retrieving, e.g. configuration parameters.
| Scope | Details |
|---|---|
| Aliases | - |
| Type | Jenkins Script |
| Mandatory | yes |
| Default | |
| Secret | no |
| Configuration scope |
|
| Resource references | none |
sourceRepositoryName¶
Set the name of the chart repository. The value might be required for fetching dependencies.
| Scope | Details |
|---|---|
| Aliases | - |
| Type | string |
| Mandatory | no |
| Default | $PIPER_sourceRepositoryName (if set) |
| Secret | no |
| Configuration scope |
|
| Resource references | none |
sourceRepositoryPassword¶
Password for the chart repository for fetching the dependencies.
| Scope | Details |
|---|---|
| Aliases | - |
| Type | string |
| Mandatory | no |
| Default | $PIPER_sourceRepositoryPassword (if set) |
| Secret | yes |
| Configuration scope |
|
| Resource references | Jenkins credential id: id: sourceRepositoryCredentialsIdreference to: passwordVault resource: name: sourceRepositoryPasswordSecretdefault value: dependenciesVault paths:
|
sourceRepositoryURL¶
URL of the source repository where the dependencies can be downloaded.
| Scope | Details |
|---|---|
| Aliases | - |
| Type | string |
| Mandatory | no |
| Default | $PIPER_sourceRepositoryURL (if set) |
| Secret | no |
| Configuration scope |
|
| Resource references | none |
sourceRepositoryUser¶
Username for the chart repository for fetching the dependencies.
| Scope | Details |
|---|---|
| Aliases | - |
| Type | string |
| Mandatory | no |
| Default | $PIPER_sourceRepositoryUser (if set) |
| Secret | yes |
| Configuration scope |
|
| Resource references | Jenkins credential id: id: sourceRepositoryCredentialsIdreference to: usernameVault resource: name: sourceRepositoryUserSecretNamedefault value: dependenciesVault paths:
|
stashContent¶
Jenkins-specific: Used for proper environment setup.
Specific stashes that should be considered for the step execution.
| Scope | Details |
|---|---|
| Aliases | - |
| Type | []string |
| Mandatory | no |
| Default | - deployDescriptor |
| Secret | no |
| Configuration scope |
|
| Resource references | none |
targetRepositoryName¶
set the chart repository. The value is required for install/upgrade/uninstall commands.
| Scope | Details |
|---|---|
| Aliases | - |
| Type | string |
| Mandatory | no |
| Default | $PIPER_targetRepositoryName (if set) |
| Secret | no |
| Configuration scope |
|
| Resource references | none |
targetRepositoryPassword¶
Password for the target repository where the compiled helm .tgz archive shall be uploaded - typically provided by the CI/CD environment.
| Scope | Details |
|---|---|
| Aliases | helmRepositoryPassword |
| Type | string |
| Mandatory | no |
| Default | $PIPER_targetRepositoryPassword (if set) |
| Secret | yes |
| Configuration scope |
|
| Resource references | Jenkins credential id: id: targetRepositoryCredentialsIdreference to: passwordVault resource: name: targetRepositoryPasswordSecretdefault value: publishingVault paths:
reference to: custom/helmRepositoryPasswordcommonPipelineEnvironment: reference to: custom/repositoryPassword |
targetRepositoryURL¶
URL of the target repository where the compiled helm .tgz archive shall be uploaded - typically provided by the CI/CD environment.
| Scope | Details |
|---|---|
| Aliases | - |
| Type | string |
| Mandatory | no |
| Default | $PIPER_targetRepositoryURL (if set) |
| Secret | no |
| Configuration scope |
|
| Resource references | commonPipelineEnvironment: reference to: custom/helmRepositoryURLcommonPipelineEnvironment: reference to: custom/repositoryUrl |
targetRepositoryUser¶
Username for the chart repository where the compiled helm .tgz archive shall be uploaded - typically provided by the CI/CD environment.
| Scope | Details |
|---|---|
| Aliases | helmRepositoryUsername |
| Type | string |
| Mandatory | no |
| Default | $PIPER_targetRepositoryUser (if set) |
| Secret | yes |
| Configuration scope |
|
| Resource references | Jenkins credential id: id: targetRepositoryCredentialsIdreference to: usernameVault resource: name: targetRepositoryUserSecretNamedefault value: publishingVault paths:
reference to: custom/helmRepositoryUsernamecommonPipelineEnvironment: reference to: custom/repositoryUsername |
templateEndDelimiter¶
When templating value files, use this end delimiter.
| Scope | Details |
|---|---|
| Aliases | - |
| Type | string |
| Mandatory | no |
| Default | }} |
| Secret | no |
| Configuration scope |
|
| Resource references | none |
templateStartDelimiter¶
When templating value files, use this start delimiter.
| Scope | Details |
|---|---|
| Aliases | - |
| Type | string |
| Mandatory | no |
| Default | {{ |
| Secret | no |
| Configuration scope |
|
| Resource references | none |
verbose¶
verbose output
| Scope | Details |
|---|---|
| Aliases | - |
| Type | bool |
| Mandatory | no |
| Default | false |
| Possible values | - true- false |
| Secret | no |
| Configuration scope |
|
| Resource references | none |
version¶
Defines the artifact version to use from helm package/publish commands.
| Scope | Details |
|---|---|
| Aliases | - |
| Type | string |
| Mandatory | no |
| Default | $PIPER_version (if set) |
| Secret | no |
| Configuration scope |
|
| Resource references | none |
kubeConfigFileCredentialsId¶
Jenkins 'Secret file' credentials ID containing kubeconfig file. Details can be found in the Kubernetes documentation.
| Scope | Details |
|---|---|
| Aliases | kubeCredentialsId (deprecated) |
| Type | string |
| Configuration scope |
|
dockerConfigJsonCredentialsId¶
Jenkins 'Secret file' credentials ID containing Docker config.json (with registry credential(s)).
| Scope | Details |
|---|---|
| Aliases | - |
| Type | string |
| Configuration scope |
|
sourceRepositoryCredentialsId¶
Jenkins 'Username Password' credentials ID containing username and password for the Helm Repository authentication (source repo)
| Scope | Details |
|---|---|
| Aliases | - |
| Type | string |
| Configuration scope |
|
targetRepositoryCredentialsId¶
Jenkins 'Username Password' credentials ID containing username and password for the Helm Repository authentication (target repo)
| Scope | Details |
|---|---|
| Aliases | - |
| Type | string |
| Configuration scope |
|