Commit d061fed4 authored by Thong Kuah's avatar Thong Kuah

Merge branch 'update-ado-image-to-0-15-0' into 'master'

Update auto-deploy-image to v0.15.0

See merge request gitlab-org/gitlab!31799
parents 84b17662 63c377fc
---
title: Update auto-deploy-image to v0.15.0, with an upgraded PostgreSQL chart used
by default for Auto DevOps deployments
merge_request: 31799
author:
type: changed
...@@ -245,23 +245,19 @@ postgres://user:password@postgres-host:postgres-port/postgres-database ...@@ -245,23 +245,19 @@ postgres://user:password@postgres-host:postgres-port/postgres-database
CAUTION: **Deprecation** CAUTION: **Deprecation**
The variable `AUTO_DEVOPS_POSTGRES_CHANNEL` that controls default provisioned The variable `AUTO_DEVOPS_POSTGRES_CHANNEL` that controls default provisioned
PostgreSQL currently defaults to `1`. This value is scheduled to change to `2` in PostgreSQL was changed to `2` in [GitLab 13.0](https://gitlab.com/gitlab-org/gitlab/-/issues/210499).
[GitLab 13.0](https://gitlab.com/gitlab-org/gitlab/-/issues/210499). To keep using the old PostgreSQL, set the `AUTO_DEVOPS_POSTGRES_CHANNEL` variable to
`1`.
The version of the chart used to provision PostgreSQL: The version of the chart used to provision PostgreSQL:
- Is 8.2.1 in GitLab 13.0 and later, but can be set back to 0.7.1 if needed.
- Can be set to from 0.7.1 to 8.2.1 in GitLab 12.9 and 12.10.
- Is 0.7.1 in GitLab 12.8 and earlier. - Is 0.7.1 in GitLab 12.8 and earlier.
- Can be set to from 0.7.1 to 8.2.1 in GitLab 12.9 and later.
GitLab encourages users to [migrate their database](upgrading_postgresql.md) GitLab encourages users to [migrate their database](upgrading_postgresql.md)
to the newer PostgreSQL. to the newer PostgreSQL.
To use the new PostgreSQL:
- New projects can set the `AUTO_DEVOPS_POSTGRES_CHANNEL` variable to `2`.
- Old projects can be upgraded by following the guide to
[upgrading PostgresSQL](upgrading_postgresql.md).
### Using external PostgreSQL database providers ### Using external PostgreSQL database providers
While Auto DevOps provides out-of-the-box support for a PostgreSQL container for While Auto DevOps provides out-of-the-box support for a PostgreSQL container for
...@@ -352,7 +348,7 @@ The following table lists variables related to the database. ...@@ -352,7 +348,7 @@ The following table lists variables related to the database.
| `POSTGRES_USER` | The PostgreSQL user. Defaults to `user`. Set it to use a custom username. | | `POSTGRES_USER` | The PostgreSQL user. Defaults to `user`. Set it to use a custom username. |
| `POSTGRES_PASSWORD` | The PostgreSQL password. Defaults to `testing-password`. Set it to use a custom password. | | `POSTGRES_PASSWORD` | The PostgreSQL password. Defaults to `testing-password`. Set it to use a custom password. |
| `POSTGRES_DB` | The PostgreSQL database name. Defaults to the value of [`$CI_ENVIRONMENT_SLUG`](../../ci/variables/README.md#predefined-environment-variables). Set it to use a custom database name. | | `POSTGRES_DB` | The PostgreSQL database name. Defaults to the value of [`$CI_ENVIRONMENT_SLUG`](../../ci/variables/README.md#predefined-environment-variables). Set it to use a custom database name. |
| `POSTGRES_VERSION` | Tag for the [`postgres` Docker image](https://hub.docker.com/_/postgres) to use. Defaults to `11.7`. | | `POSTGRES_VERSION` | Tag for the [`postgres` Docker image](https://hub.docker.com/_/postgres) to use. Defaults to `9.6.16` for tests and deployments as of GitLab 13.0 (previously `9.6.2`). If `AUTO_DEVOPS_POSTGRES_CHANNEL` is set to `1`, deployments will use the default version `9.6.2`. |
### Disable jobs ### Disable jobs
......
...@@ -324,34 +324,40 @@ as it attempts to fetch the image using `CI_REGISTRY_PASSWORD`. ...@@ -324,34 +324,40 @@ as it attempts to fetch the image using `CI_REGISTRY_PASSWORD`.
> - [Introduced](https://gitlab.com/gitlab-org/charts/auto-deploy-app/-/merge_requests/51) in GitLab 12.8. > - [Introduced](https://gitlab.com/gitlab-org/charts/auto-deploy-app/-/merge_requests/51) in GitLab 12.8.
> - Support for deploying a PostgreSQL version that supports Kubernetes 1.16+ was [introduced](https://gitlab.com/gitlab-org/cluster-integration/auto-deploy-image/-/merge_requests/49) in GitLab 12.9. > - Support for deploying a PostgreSQL version that supports Kubernetes 1.16+ was [introduced](https://gitlab.com/gitlab-org/cluster-integration/auto-deploy-image/-/merge_requests/49) in GitLab 12.9.
> - Supported out of the box for new deployments as of GitLab 13.0.
CAUTION: **Deprecation** CAUTION: **Deprecation**
The default value of `extensions/v1beta1` for the `deploymentApiVersion` setting is The default value for the `deploymentApiVersion` setting was changed from
deprecated, and is scheduled to be changed to a new default of `apps/v1` in `extensions/v1beta` to `apps/v1` in [GitLab 13.0](https://gitlab.com/gitlab-org/charts/auto-deploy-app/issues/47).
[GitLab 13.0](https://gitlab.com/gitlab-org/charts/auto-deploy-app/issues/47).
In Kubernetes 1.16 and later, a number of In Kubernetes 1.16 and later, a number of
[APIs were removed](https://kubernetes.io/blog/2019/07/18/api-deprecations-in-1-16/), [APIs were removed](https://kubernetes.io/blog/2019/07/18/api-deprecations-in-1-16/),
including support for `Deployment` in the `extensions/v1beta1` version. including support for `Deployment` in the `extensions/v1beta1` version.
To use Auto Deploy on a Kubernetes 1.16+ cluster, you must opt-in to using a To use Auto Deploy on a Kubernetes 1.16+ cluster:
version of the PostgreSQL chart that supports Kubernetes 1.16 and higher:
1. Set the following in the [`.gitlab/auto-deploy-values.yaml` file](customize.md#customize-values-for-helm-chart): 1. If you are deploying your application for the first time on GitLab 13.0 or
newer, no configuration should be required.
1. On GitLab 12.10 or older, set the following in the [`.gitlab/auto-deploy-values.yaml` file](customize.md#customize-values-for-helm-chart):
```yml ```yml
deploymentApiVersion: apps/v1 deploymentApiVersion: apps/v1
``` ```
1. Set the: 1. If you have an in-cluster PostgreSQL database installed with
`AUTO_DEVOPS_POSTGRES_CHANNEL` set to `1`, follow the [guide to upgrade
PostgreSQL](upgrading_postgresql.md).
- `AUTO_DEVOPS_POSTGRES_CHANNEL` variable to `2`. 1. If you are deploying your application for the first time and are using
- `POSTGRES_VERSION` variable to `11.7` or higher. GitLab 12.9 or 12.10, set `AUTO_DEVOPS_POSTGRES_CHANNEL` to `2`.
DANGER: **Danger:** Opting into `AUTO_DEVOPS_POSTGRES_CHANNEL` version `2` deletes DANGER: **Danger:** On GitLab 12.9 and 12.10, opting into
the version `1` PostgreSQL database. Follow the `AUTO_DEVOPS_POSTGRES_CHANNEL` version `2` deletes the version `1` PostgreSQL
[guide to upgrading PostgreSQL](upgrading_postgresql.md) to back up and restore database. Follow the [guide to upgrading PostgreSQL](upgrading_postgresql.md)
your database before opting into version `2`. to back up and restore your database before opting into version `2` (On
GitLab 13.0, an additional variable is required to trigger the database
deletion).
### Migrations ### Migrations
......
...@@ -48,7 +48,6 @@ variables: ...@@ -48,7 +48,6 @@ variables:
POSTGRES_PASSWORD: testing-password POSTGRES_PASSWORD: testing-password
POSTGRES_ENABLED: "true" POSTGRES_ENABLED: "true"
POSTGRES_DB: $CI_ENVIRONMENT_SLUG POSTGRES_DB: $CI_ENVIRONMENT_SLUG
POSTGRES_VERSION: 9.6.2
DOCKER_DRIVER: overlay2 DOCKER_DRIVER: overlay2
......
.dast-auto-deploy: .dast-auto-deploy:
image: "registry.gitlab.com/gitlab-org/cluster-integration/auto-deploy-image:v0.10.0" image: "registry.gitlab.com/gitlab-org/cluster-integration/auto-deploy-image:v0.15.0"
dast_environment_deploy: dast_environment_deploy:
extends: .dast-auto-deploy extends: .dast-auto-deploy
......
.auto-deploy: .auto-deploy:
image: "registry.gitlab.com/gitlab-org/cluster-integration/auto-deploy-image:v0.14.0" image: "registry.gitlab.com/gitlab-org/cluster-integration/auto-deploy-image:v0.15.0"
review: review:
extends: .auto-deploy extends: .auto-deploy
......
test: test:
services:
- "postgres:${POSTGRES_VERSION}"
variables: variables:
POSTGRES_VERSION: 9.6.16
POSTGRES_DB: test POSTGRES_DB: test
services:
- "postgres:${POSTGRES_VERSION}"
stage: test stage: test
image: gliderlabs/herokuish:latest image: gliderlabs/herokuish:latest
needs: [] needs: []
......
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