Review Helm
Deploys a Helm chart as a GitLab review environment and removes it when the review environment stops.
The component expects a Helm chart artifact under release/charts/ from needs-start, renders any configured values files with environment substitution, and runs helm upgrade --install against the selected namespace. After a successful deploy, it reads the first Ingress host in the namespace and writes it to review.env as CI_ENVIRONMENT_HOST, so GitLab can set the environment URL from the dotenv report.
include:
- component: $CI_SERVER_FQDN/$CI_PROJECT_PATH/helm@$CI_COMMIT_SHA
inputs:
name: my-app
path: chart
- component: $CI_SERVER_FQDN/$CI_PROJECT_PATH/review-helm@$CI_COMMIT_SHA
inputs:
release: my-app
namespace: "$CI_ENVIRONMENT_SLUG"
create-namespace: true
value-files:
- chart/values.review.yaml
set-parameters:
- image.tag=$CI_COMMIT_SHA
needs-start:
- job: build:helm:my-app
artifacts: true
Set create-namespace: true when the component should create and delete the namespace for the review release. Keep it false when the namespace lifecycle is managed outside this component.
Kubernetes service account
The GitLab CI variable KUBECONFIG must point to a service account that can read the target namespace, manage the Helm release resources, and read Ingress resources so the component can discover the review URL.
Inputs
| Name | Description | Default | Type |
| --- | --- | --- | --- |
| context | Kubernetes context to use for the review release. | string | |
| create-namespace | Create and delete the namespace with the Helm test namespace helpers. | false | boolean |
| environment | GitLab environment prefix. | review | string |
| environment-identifier | GitLab environment suffix. | /$CI_PIPELINE_IID-$CI_COMMIT_SHORT_SHA | string |
| name | The name prefix for review Helm jobs. | review-helm | string |
| namespace | Kubernetes namespace for the review release. | $CI_ENVIRONMENT_SLUG | string |
| needs-start | Jobs that provide the Helm chart artifact. | [{"job":"build:helm:helm","artifacts":true}] | array |
| needs-stop | Jobs that the stop job depends on. | [] | array |
| release | Helm release name. | $CI_PROJECT_NAME | string |
| rules | Rules that control when review Helm jobs run. | [{"if":"$CI_PIPELINE_SOURCE == \"merge_request_event\"","when":"on_success"},{"when":"never"}] | array |
| set-parameters | Helm --set parameters as key=value entries. | [] | array |
| stage | Pipeline stage for review Helm jobs. | test | string |
| tag | string | ||
| timeout | Timeout for Helm install, upgrade, and stop operations. | 20m | string |
| value-files | Helm values files to pass to the review release. | [] | array |