This plugin integrates CloudBees CD/RO with Helm, the Helm package manager for Kubernetes.
Three big concepts:
-
A chart is a Helm package. It contains all of the resource definitions necessary to run an application, tool, or service inside of a Kubernetes cluster. Think of it like the Kubernetes equivalent of a Homebrew formula, an Apt dpkg, or a Yum RPM file.
-
A repository is the place where charts can be collected and shared. It’s like the Perl CPAN archive or the Fedora Package Database, but for Kubernetes packages.
-
A release is an instance of a chart running in a Kubernetes cluster. One chart can often be installed many times into the same cluster. And each time it is installed, a new release is created. Consider a MySQL chart. If you want two databases running in your cluster, you can install that chart twice. Each one will have its own release, which will in turn have its own release name.
With these concepts in mind, we can now explain Helm like this: Helm installs charts into Kubernetes, creating a new release for each installation. And to find new charts, you can search Helm chart repositories.
Plugin version 1.5.1.2022041524
Revised on April 15, 2022
Plugin configurations
Plugin configurations are sets of parameters that apply across some or all of the plugin procedures. They reduce repetition of common values, create predefined parameter sets for end users, and securely store credentials where needed. Each configuration is given a unique name that is entered in designated parameters on procedures that use them.
Creating plugin configurations
To create plugin configurations in CloudBees CD, do these steps:
-
Go to
to open the Plugin Manager. -
Find the EC-Helm-1.5.1.2022041524 row.
-
Click Configure to open the Configurations page.
-
Click Create Configuration as per the description of parameters below.
Configuration procedure parameters
Parameter | Description |
---|---|
Configuration name | The name for the created configuration |
Description | Description for the configuration |
Helm executable path | An absolute or relative path to Helm executable. |
Kubectl executable path | An absolute path to the kubectl executable. Kubectl is only used as a fallback option to retrieve pod information in the microservice deployment when the helm generated manifest cannot be parsed with current Perl YAML libraries. If value is empty, executable will be looked up in the PATH environment variable. |
Helm version | Version of the Helm client. Actual version will be checked in Check Connection. |
options | Options to pass to Helm executable. Eg.: --option-name[=parameter]. |
Config file | Which configuration file will be used. * Default: /home/user/.kube/config * Use existing: Use an existing file via a specified path * Create new: Create a new temporary file with specific content. |
Config file location | Path to a kubectl config file. Eg.: /home/user/.kube/config |
Config file content | Content of kubectl configuration file to use to connect to the cluster. |
Check connection? | If checked, the connection endpoint and credentials entered as part of the configuration will be tested. If this option is checked, configuration will not be saved if the test fails. |
Check connection resource | A resource which is used for the checking connection. |
Check Connection? | If checked, the connection endpoint and credentials entered as part of the configuration will be tested. If this option is checked, configuration will not be saved if the test fails. |
Debug Level | This option sets debug level for logs. If info is selected, only summary information will be shown, for debug, there will be some debug information and for trace the whole requests and responses will be shown. |
Plugin procedures
Install Chart
This procedure installs a chart archive.
Install Chart parameters
Parameter | Description |
---|---|
Configuration Name | Previously defined configuration for the plugin |
Release name | Name of the release to deploy. |
Chart | A chart reference, a path to a packaged chart, a path to an unpacked chart directory or a URL. There are five different ways you can express the chart you want to install: * By chart reference:
stable/mariadb
* By path to a packaged chart: |
Options | Options to pass to Helm executable. Eg.: --option-name[=parameter]. |
Values | Specify content for a YAML file that will be passed to the command. |
Result property sheet | Results will be saved into this property/property sheet. |
Upgrade Release
This procedure upgrades a release to a specified version of a chart and/or updates chart values.
Upgrade Release parameters
Parameter | Description |
---|---|
Configuration Name | Previously defined configuration for the plugin |
Release name | The release name. |
Chart | A chart reference, a path to a packaged chart, a path to an unpacked chart directory or a URL. There are five different ways you can express the chart you want to install: * By chart reference:
stable/mariadb
* By path to a packaged chart: |
Options | Options to pass to Helm executable. Eg.: --option-name[=parameter]. |
Values | Specify content for a YAML file that will be passed to the command. |
Result property sheet | Results will be saved into this property/property sheet. |
Delete Release
This procedure takes a release name and then deletes the release from Kubernetes. It removes all of the resources associated with the last release of the chart.
Delete Release parameters
Parameter | Description |
---|---|
Configuration Name | Previously defined configuration for the plugin |
Release name | The release name. |
Options | Options to pass to Helm executable. Eg.: --option-name[=parameter]. |
Action on error | Allows ignoring errors when they are expected (repository already present, item to delete does not exist). |
Error value | Pattern that triggers "Action on error" condition. |
Result property sheet | Results will be saved into this property/property sheet. |
Rollback Release
This procedure rolls back a release to a previous revision.
Rollback Release parameters
Parameter | Description |
---|---|
Configuration Name | Previously defined configuration for the plugin |
Release name | The release name. |
Revision number | A revision (version) number of the release. |
Options | Options to pass to Helm executable. Eg.: --option-name[=parameter]. |
Result property sheet | Results will be saved into this property/property sheet. |
Run Custom Command
This procedure allows run any Helm’s command.
Run Custom Command parameters
Parameter | Description |
---|---|
Configuration Name | Previously defined configuration for the plugin |
Command | Name of the command. |
Arguments | Arguments to pass to Helm executable for the command. |
Options | Options to pass to Helm executable. Eg.: --option-name[=parameter]. |
Values | Specify content for a YAML file that will be passed to the command. |
Action on error | Allows ignoring errors when they are expected (repository already present, item to delete does not exist). |
Error value | Pattern that triggers "Action on error" condition. |
Result property sheet | Results will be saved into this property/property sheet. |
Microservice deployment
Plugin allows deploying Helm charts into Kubernetes clusters. Clusters should be part of an Environment and have 'Helm - Kubernetes' in the cluster definition.
Microservice deployment uses 'upgrade --install' command to support both fresh and upgrade deployments. Deployment parameter 'Additional Options' can be used to provide list of flags and options for the deployment command. Content of the 'Values' parameter will be saved to a file and passed to the command with the '-f <fileName>' option.
Parameters will be prepended to the command in following order, which means options that are prepended later can override values set in previous options.
-
File supplied by the deployment 'Values' parameter
-
Configuration 'Options'
-
Deployment 'Additional Options'
-
Cluster definition 'Namespace' parameter
-
Cluster definition 'Kubeconfig Context' parameter
Optionally, rollback can be enabled with a specified timeout. When rollback is enabled, the --atomic parameter is added to the 'upgrade --install' command.
After invoking 'upgrade --install' command, the plugin procedure invokes set of commands to retrieve the deployment details:
-
Release details: 'list -l <releaseName>'
-
Notes: 'get notes <releaseName>'
-
Values: 'get values <releaseName>'
-
Manifests: 'get manifest <releaseName>'
Release manifests are parsed in order to get list of containers that were deployed with this release. These containers are reported to the Environment Inventory.
Because different yaml libraries have different implementation of the YAML specification, some manifests accepted by Kubernetes may not be parsed by Perl libraries used in the plugin. If you have warnings about specific yaml file that has containers, and the chart is under your governance, you can provide proper formatting and linting for the chart template to fix parse error. For charts provided by a third party provider, please file an issue for the maintainer.
In case when plugin fails to parse manifest for one of the generated yaml files, and it contains container spec, this container will not be reported to the inventory.
Use cases
GCP: Deploy Core using Helm v2
The demo is based on the official documentation: * CloudBees CI installation on Google Kubernetes Engine (GKE). * Installing CloudBees CI on modern cloud platforms on Kubernetes
Pipeline

Stage: Installation
Step: get release status

STDOUT:
LAST DEPLOYED: Tue Jan 21 12:47:29 2020
NAMESPACE: cloudbees-core
STATUS: DEPLOYED
RESOURCES:
==> v1/ClusterRole
NAME AGE
cjoc-master-management-cloudbees-core 59s
==> v1/ClusterRoleBinding
NAME AGE
cjoc-role-binding-cloudbees-core 59s
==> v1/ConfigMap
NAME AGE
cjoc-configure-jenkins-groovy 60s
jenkins-agent 60s
==> v1/Pod(related)
NAME AGE
cjoc-0 56s
==> v1/Role
NAME AGE
cjoc-agents 58s
cjoc-master-management 58s
==> v1/RoleBinding
NAME AGE
cjoc-master-role-binding 57s
cjoc-role-binding 57s
==> v1/Service
NAME AGE
cjoc 57s
==> v1/ServiceAccount
NAME AGE
cjoc 60s
jenkins 60s
==> v1/StatefulSet
NAME AGE
cjoc 56s
==> v1beta1/Ingress
NAME AGE
cjoc 55s
NOTES: * Once Operations Center is up and running, get your initial admin user password by running:
+
kubectl rollout status sts cjoc
kubectl exec cjoc-0 -- sh -c "until cat /var/jenkins_home/secrets/initialAdminPassword 2>&-; do sleep 5; done"
-
Visit http://35.196.144.25.xip.io/cjoc
-
Login with tthe admin user password.
For more information on running CloudBees CI on Kubernetes, see the CloudBees CI on modern cloud platforms administration guide. Configure the Kubernetes plugin in Jenkins to use the following Service Account name cjoc using the following steps: . Create a Jenkins credential of type Kubernetes service account with service account name cjoc. . Under configure Jenkins — Update the credentials config in the cloud section to use the service account credential you created in the step above.
OpenShift: Deploy Jenkins using Helm v3
Demonstrating how Microservices can be deployed to OpenShift cluster. In this example we will deploy Jenkins on OpenShift cluster.
Create and define environment

Define a cluster in the created environment:


Add and define Utility Resource in the environment:



Created and defined environment:

Check inventory

You can check deploy status via oc CLI
$ oc status
In project default on server https://xx.xx.xxx.xxx
svc/myrelease-jenkins-agent - 10.7.253.124:50000
svc/myrelease-jenkins - 10.7.248.179:8080
statefulset/myrelease-jenkins manages jenkins/jenkins:2.277.3-jdk11,kiwigrid/k8s-sidecar:0.1.275
created 9 minutes ago - 1 pod
$ oc get pods
NAME READY STATUS RESTARTS AGE
myrelease-jenkins-0 2/2 Running 0 13m
Known issues
Release notes
EC-Helm 1.5.1
-
Fixed application deployment on agents version 10.5.
-
Fixed removing duplicate parameters in the microservice definition form.
EC-Helm 1.3.0
-
Added optional auto-rollback support for Microservices.
-
Cosmetic UI changes in CreateConfiguration procedure.
-
Improved keeping environment inventory in actual state.
-
Added "Chart Version" parameter to the microservice definition form.
-
Documentation: added the use-case "OpenShift: Deploy Jenkins using Helm v3"