Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Helm
Manage
Activity
Members
Plan
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Admin message
Gitlab 17.10.1 is available
Show more breadcrumbs
to be continuous...
Helm
Commits
53c02104
Commit
53c02104
authored
3 years ago
by
Gaël Bréard
Committed by
Pierre Smeyers
3 years ago
Browse files
Options
Downloads
Patches
Plain Diff
feat: add support for a common value file
parent
11e6a226
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
README.md
+1
-0
1 addition, 0 deletions
README.md
kicker.json
+4
-0
4 additions, 0 deletions
kicker.json
templates/gitlab-ci-helm.yml
+32
-5
32 additions, 5 deletions
templates/gitlab-ci-helm.yml
with
37 additions
and
5 deletions
README.md
+
1
−
0
View file @
53c02104
...
@@ -62,6 +62,7 @@ The Helm template uses some global configuration used throughout all jobs.
...
@@ -62,6 +62,7 @@ The Helm template uses some global configuration used throughout all jobs.
| --------------------- | -------------------------------------- | ----------------- |
| --------------------- | -------------------------------------- | ----------------- |
|
`HELM_CLI_IMAGE`
| The Docker image used to run Helm
<br/>
:warning:
**set the version required by your Kubernetes server**
|
`alpine/helm:latest`
|
|
`HELM_CLI_IMAGE`
| The Docker image used to run Helm
<br/>
:warning:
**set the version required by your Kubernetes server**
|
`alpine/helm:latest`
|
|
`HELM_CHART_DIR`
| The folder in which is stored the Helm chart |
`.`
|
|
`HELM_CHART_DIR`
| The folder in which is stored the Helm chart |
`.`
|
|
`HELM_COMMON_VALUES`
| Common values file (used for all environments, overridden by specific per-env values files) | undefined (none) |
|
`HELM_ENV_VALUE_NAME`
| The environment type variable set to helm |
`env`
|
|
`HELM_ENV_VALUE_NAME`
| The environment type variable set to helm |
`env`
|
|
`HELM_HOSTNAME_VALUE_NAME`
| The hostname variable set to helm |
`hostname`
|
|
`HELM_HOSTNAME_VALUE_NAME`
| The hostname variable set to helm |
`hostname`
|
...
...
This diff is collapsed.
Click to expand it.
kicker.json
+
4
−
0
View file @
53c02104
...
@@ -14,6 +14,10 @@
...
@@ -14,6 +14,10 @@
"description"
:
"The folder in which is stored the Helm chart"
,
"description"
:
"The folder in which is stored the Helm chart"
,
"default"
:
"."
"default"
:
"."
},
},
{
"name"
:
"HELM_COMMON_VALUES"
,
"description"
:
"Common values file (used for all environments, overridden by specific per-env values files)"
},
{
{
"name"
:
"HELM_DEPLOY_CHART"
,
"name"
:
"HELM_DEPLOY_CHART"
,
"description"
:
"The Helm [chart](https://helm.sh/docs/topics/charts/) to deploy. _Only required if you want to deploy an **external** chart._"
"description"
:
"The Helm [chart](https://helm.sh/docs/topics/charts/) to deploy. _Only required if you want to deploy an **external** chart._"
...
...
This diff is collapsed.
Click to expand it.
templates/gitlab-ci-helm.yml
+
32
−
5
View file @
53c02104
...
@@ -40,6 +40,8 @@ variables:
...
@@ -40,6 +40,8 @@ variables:
# KUBE_NAMESPACE: "default"
# KUBE_NAMESPACE: "default"
# KUBECONFIG: ""
# KUBECONFIG: ""
# HELM_COMMON_VALUES: "values-common.yml"
# HELM_REVIEW_DISABLED: "true"
# HELM_REVIEW_DISABLED: "true"
# HELM_REVIEW_VALUES: "values-review.yml"
# HELM_REVIEW_VALUES: "values-review.yml"
# HELM_REVIEW_NAMESPACE: ""
# HELM_REVIEW_NAMESPACE: ""
...
@@ -351,10 +353,16 @@ stages:
...
@@ -351,10 +353,16 @@ stages:
helm_opts=$(get_helm_config_opt)
helm_opts=$(get_helm_config_opt)
if [ -n "$HELM_COMMON_VALUES" ]; then
log_info "--- using \\e[32mcommon values\\e[0m file: \\e[33;1m${HELM_COMMON_VALUES}\\e[0m"
awkenvsubst < "$HELM_COMMON_VALUES" > generated-values-common.yml
helm_values_opt="--values generated-values-common.yml"
fi
if [ -n "$values_files" ]; then
if [ -n "$values_files" ]; then
log_info "--- using \\e[32mvalues\\e[0m file: \\e[33;1m${values_files}\\e[0m"
log_info "--- using \\e[32mvalues\\e[0m file: \\e[33;1m${values_files}\\e[0m"
awkenvsubst < "$values_files" > generated-values.yml
awkenvsubst < "$values_files" > generated-values.yml
helm_values_opt="--values generated-values.yml"
helm_values_opt="
$helm_values_opt
--values generated-values.yml"
fi
fi
if [ -f "$CI_PROJECT_DIR/.kubeconfig" ]; then
if [ -f "$CI_PROJECT_DIR/.kubeconfig" ]; then
...
@@ -529,6 +537,17 @@ helm-lint:
...
@@ -529,6 +537,17 @@ helm-lint:
-
"
**/Chart.yaml"
-
"
**/Chart.yaml"
# yamllint-job is used to check the syntax of the values files.
# yamllint-job is used to check the syntax of the values files.
helm-values-common-lint
:
extends
:
.helm-values-lint
script
:
-
awkenvsubst < "$HELM_COMMON_VALUES" > generated-values-common.yml
-
yamllint -d "$HELM_YAMLLINT_CONFIG" $HELM_YAMLLINT_ARGS generated-values-common.yml
rules
:
-
if
:
'
$CI_MERGE_REQUEST_ID
||
$HELM_YAMLLINT_DISABLED
==
"true"'
when
:
never
-
if
:
'
$HELM_COMMON_VALUES'
helm-values-review-lint
:
helm-values-review-lint
:
extends
:
.helm-values-lint
extends
:
.helm-values-lint
script
:
script
:
...
@@ -576,8 +595,10 @@ helm-values-prod-lint:
...
@@ -576,8 +595,10 @@ helm-values-prod-lint:
helm-review-score
:
helm-review-score
:
extends
:
.helm-score
extends
:
.helm-score
script
:
script
:
-
if [ -z "$HELM_COMMON_VALUES" ]; then HELM_COMMON_VALUES=/dev/null; fi
-
awkenvsubst < "$HELM_COMMON_VALUES" > generated-values-common.yml
-
awkenvsubst < "$HELM_REVIEW_VALUES" > generated-values-review.yml
-
awkenvsubst < "$HELM_REVIEW_VALUES" > generated-values-review.yml
-
helm template $HELM_CHART_DIR --values generated-values-review.yml | kube-score score ${HELM_KUBE_SCORE_ARGS} -
-
helm template $HELM_CHART_DIR --values
generated-values-common.yml --values
generated-values-review.yml | kube-score score ${HELM_KUBE_SCORE_ARGS} -
rules
:
rules
:
# exclude merge requests
# exclude merge requests
-
if
:
$CI_MERGE_REQUEST_ID
-
if
:
$CI_MERGE_REQUEST_ID
...
@@ -594,8 +615,10 @@ helm-review-score:
...
@@ -594,8 +615,10 @@ helm-review-score:
helm-integration-score
:
helm-integration-score
:
extends
:
.helm-score
extends
:
.helm-score
script
:
script
:
-
if [ -z "$HELM_COMMON_VALUES" ]; then HELM_COMMON_VALUES=/dev/null; fi
-
awkenvsubst < "$HELM_COMMON_VALUES" > generated-values-common.yml
-
awkenvsubst < "$HELM_INTEG_VALUES" > generated-values-integration.yml
-
awkenvsubst < "$HELM_INTEG_VALUES" > generated-values-integration.yml
-
helm template $HELM_CHART_DIR --values generated-values-integration.yml | kube-score score ${HELM_KUBE_SCORE_ARGS} -
-
helm template $HELM_CHART_DIR --values
generated-values-common.yml --values
generated-values-integration.yml | kube-score score ${HELM_KUBE_SCORE_ARGS} -
rules
:
rules
:
# exclude merge requests
# exclude merge requests
-
if
:
$CI_MERGE_REQUEST_ID
-
if
:
$CI_MERGE_REQUEST_ID
...
@@ -612,8 +635,10 @@ helm-integration-score:
...
@@ -612,8 +635,10 @@ helm-integration-score:
helm-staging-score
:
helm-staging-score
:
extends
:
.helm-score
extends
:
.helm-score
script
:
script
:
-
if [ -z "$HELM_COMMON_VALUES" ]; then HELM_COMMON_VALUES=/dev/null; fi
-
awkenvsubst < "$HELM_COMMON_VALUES" > generated-values-common.yml
-
awkenvsubst < "$HELM_STAGING_VALUES" > generated-values-staging.yml
-
awkenvsubst < "$HELM_STAGING_VALUES" > generated-values-staging.yml
-
helm template $HELM_CHART_DIR --values generated-values-staging.yml | kube-score score ${HELM_KUBE_SCORE_ARGS} -
-
helm template $HELM_CHART_DIR --values
generated-values-common.yml --values
generated-values-staging.yml | kube-score score ${HELM_KUBE_SCORE_ARGS} -
rules
:
rules
:
# exclude merge requests
# exclude merge requests
-
if
:
$CI_MERGE_REQUEST_ID
-
if
:
$CI_MERGE_REQUEST_ID
...
@@ -630,8 +655,10 @@ helm-staging-score:
...
@@ -630,8 +655,10 @@ helm-staging-score:
helm-prod-score
:
helm-prod-score
:
extends
:
.helm-score
extends
:
.helm-score
script
:
script
:
-
if [ -z "$HELM_COMMON_VALUES" ]; then HELM_COMMON_VALUES=/dev/null; fi
-
awkenvsubst < "$HELM_COMMON_VALUES" > generated-values-common.yml
-
awkenvsubst < "$HELM_PROD_VALUES" > generated-values-prod.yml
-
awkenvsubst < "$HELM_PROD_VALUES" > generated-values-prod.yml
-
helm template $HELM_CHART_DIR --values generated-values-prod.yml | kube-score score ${HELM_KUBE_SCORE_ARGS} -
-
helm template $HELM_CHART_DIR --values
generated-values-common.yml --values
generated-values-prod.yml | kube-score score ${HELM_KUBE_SCORE_ARGS} -
rules
:
rules
:
# exclude merge requests
# exclude merge requests
-
if
:
$CI_MERGE_REQUEST_ID
-
if
:
$CI_MERGE_REQUEST_ID
...
...
This diff is collapsed.
Click to expand it.
Ghost User
@ghost
mentioned in commit
90afdfb7
·
2 years ago
mentioned in commit
90afdfb7
mentioned in commit 90afdfb7e3f4ce49149e75dd0a805fee6026c1eb
Toggle commit list
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment