Commit 149a0a86 authored by Thong Kuah's avatar Thong Kuah

Merge branch '64101-override-helm-release-name' into 'master'

#64081 allow override of helm release name

See merge request gitlab-org/gitlab-ce!30360
parents 9e01240f a71da850
---
title: Allow multiple Auto DevOps projects to deploy to a single namespace within a k8s cluster
merge_request: 30360
author: James Keogh
type: added
...@@ -764,6 +764,7 @@ also be customized, and you can easily use a [custom buildpack](#custom-buildpac ...@@ -764,6 +764,7 @@ also be customized, and you can easily use a [custom buildpack](#custom-buildpac
| `ROLLOUT_RESOURCE_TYPE` | From GitLab 11.9, this variable allows specification of the resource type being deployed when using a custom helm chart. Default value is `deployment`. | | `ROLLOUT_RESOURCE_TYPE` | From GitLab 11.9, this variable allows specification of the resource type being deployed when using a custom helm chart. Default value is `deployment`. |
| `ROLLOUT_STATUS_DISABLED` | From GitLab 12.0, this variable allows to disable rollout status check because it doesn't support all resource types, for example, `cronjob`. | | `ROLLOUT_STATUS_DISABLED` | From GitLab 12.0, this variable allows to disable rollout status check because it doesn't support all resource types, for example, `cronjob`. |
| `HELM_UPGRADE_EXTRA_ARGS` | From GitLab 11.11, this variable allows extra arguments in `helm` commands when deploying the application. Note that using quotes will not prevent word splitting. **Tip:** you can use this variable to [customize the Auto Deploy helm chart](https://docs.gitlab.com/ee/topics/autodevops/index.html#custom-helm-chart) by applying custom override values with `--values my-values.yaml`. | | `HELM_UPGRADE_EXTRA_ARGS` | From GitLab 11.11, this variable allows extra arguments in `helm` commands when deploying the application. Note that using quotes will not prevent word splitting. **Tip:** you can use this variable to [customize the Auto Deploy helm chart](https://docs.gitlab.com/ee/topics/autodevops/index.html#custom-helm-chart) by applying custom override values with `--values my-values.yaml`. |
| `HELM_RELEASE_NAME` | From GitLab 12.1, this variable allows the `helm` release name to be overridden, this can be used to assign unique release names when deploying multiple projects to a single namespace |
TIP: **Tip:** TIP: **Tip:**
Set up the replica variables using a Set up the replica variables using a
......
...@@ -243,7 +243,8 @@ rollout 100%: ...@@ -243,7 +243,8 @@ rollout 100%:
.deploy_helpers: &deploy_helpers | .deploy_helpers: &deploy_helpers |
[[ "$TRACE" ]] && set -x [[ "$TRACE" ]] && set -x
auto_database_url=postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${CI_ENVIRONMENT_SLUG}-postgres:5432/${POSTGRES_DB} export RELEASE_NAME=${HELM_RELEASE_NAME:-$CI_ENVIRONMENT_SLUG}
auto_database_url=postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${RELEASE_NAME}-postgres:5432/${POSTGRES_DB}
export DATABASE_URL=${DATABASE_URL-$auto_database_url} export DATABASE_URL=${DATABASE_URL-$auto_database_url}
export TILLER_NAMESPACE=$KUBE_NAMESPACE export TILLER_NAMESPACE=$KUBE_NAMESPACE
...@@ -307,7 +308,7 @@ rollout 100%: ...@@ -307,7 +308,7 @@ rollout 100%:
} }
function deploy_name() { function deploy_name() {
name="$CI_ENVIRONMENT_SLUG" name="$RELEASE_NAME"
track="${1-stable}" track="${1-stable}"
if [[ "$track" != "stable" ]]; then if [[ "$track" != "stable" ]]; then
...@@ -372,7 +373,7 @@ rollout 100%: ...@@ -372,7 +373,7 @@ rollout 100%:
--set service.enabled="$service_enabled" \ --set service.enabled="$service_enabled" \
--set gitlab.app="$CI_PROJECT_PATH_SLUG" \ --set gitlab.app="$CI_PROJECT_PATH_SLUG" \
--set gitlab.env="$CI_ENVIRONMENT_SLUG" \ --set gitlab.env="$CI_ENVIRONMENT_SLUG" \
--set releaseOverride="$CI_ENVIRONMENT_SLUG" \ --set releaseOverride="$RELEASE_NAME" \
--set image.repository="$image_repository" \ --set image.repository="$image_repository" \
--set image.tag="$image_tag" \ --set image.tag="$image_tag" \
--set image.pullPolicy=IfNotPresent \ --set image.pullPolicy=IfNotPresent \
...@@ -413,7 +414,7 @@ rollout 100%: ...@@ -413,7 +414,7 @@ rollout 100%:
--set service.enabled="$service_enabled" \ --set service.enabled="$service_enabled" \
--set gitlab.app="$CI_PROJECT_PATH_SLUG" \ --set gitlab.app="$CI_PROJECT_PATH_SLUG" \
--set gitlab.env="$CI_ENVIRONMENT_SLUG" \ --set gitlab.env="$CI_ENVIRONMENT_SLUG" \
--set releaseOverride="$CI_ENVIRONMENT_SLUG" \ --set releaseOverride="$RELEASE_NAME" \
--set image.repository="$image_repository" \ --set image.repository="$image_repository" \
--set image.tag="$image_tag" \ --set image.tag="$image_tag" \
--set image.pullPolicy=IfNotPresent \ --set image.pullPolicy=IfNotPresent \
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment