Skip to main content

Custom helm-chart

IBM Industry Solutions Workbench is using pre-defined helm chart templates for the build and deployment of Service Projects. These helm charts can be adjusted or completely overridden for specific Service Projects depending on your needs and requirements.

warning

TechPreview Feature: Please note that this feature is a techpreview. That means the feature may not be fully supported, functionally complete and may introduce breaking changes with the next version.

ℹ️note

If you are using a customized helm chart in your service project, you are responsible for including updates into the helm chart.

Prerequisites

  • Good knowledge about:
    • kubernetes resources and deployments
    • CI/CD Pipelines
    • helm charts
  • Access to a Helm Repository configured as Component Repositories
  • helm CLI

Retrieve Helm Chart template

A good starting point to use own or adjust the pre-defined helm charts is to retrieve an already built helm chart from your configured Component Repository. That means after running your first Release Pipeline you can connect to the repository and retrieve the regarding helm chart.

For example:

helm repo add myrepo https://chartmuseum.my.openshift.knowis.cloud --username user --password password123
helm repo update
helm pull myrepo/myprojectacronym
ℹ️note

Some helm chart repositories do require the exact version to be given in order to download the helm-chart locally. To do so, you can browse for the desired version in the Solution Designer in teh Components browser. Then the last command is helm pull myrepo/myprojectacronym --version myExactVersion

Now you should be able to unpack the tgz-file and use/adjust the helm chart.

Add own Helm Chart to Service Project

To use the customized helm chart in your pipelines it must be copied and pushed into your git project (Service Project) at root level. The folder structure of your project should look like:

helm-chart
Chart.yaml
README.md
values.yaml
templates
_helpers.tpl
configmap.yaml
deployment.yaml
hpa.yaml
pdb.yaml
route-api.yaml
route-artifacts.yaml
rout-root.yaml
service.yaml
...
myprojectacronym-application
src
main
...
pom.xml
src-design
api
...
domain
...
schemas
...
solution.yml
ℹ️note

It is important that the helm-chart folder has exactly this name and structure.

Use dynamic values in the pipeline

The following placeholder can be used in the values.yaml to be updated/replaced via the pipelines:

  • %IMAGE_REGISTRY%: will be replaced by the configured image registry (e.g. my.registry.io/namespace)
  • %SOLUTION_IMAGE_TAG%: will be replaced by the service project version/tag (e.g. 1.0.0)
  • %SOLUTION_ACRONYM%: will be replaced by the service project acronym (e.g. myservice)
  • %SOLUTION_FULLNAME%: will be replaced by the service project name (e.g. My New Service)
ℹ️note

In the file Chart.yaml, the values for the properties appVersion, version and name are updated and set automatically.