Auto Deploy encounters an error when Legacy PostgreSQL instance exists
Situation
Originally, reported by @jeffersonmartin at https://gitlab.slack.com/archives/C016VFJJ761/p1601875084018700 (Internal Only)
In the past, when an application was deployed by Auto DevOps, we were creating PostgerSQL deployment in the same release with the application release (auto-deploy-app). This legacy postgres dependency was/is defined in requirements.yaml and it was deployed with auto-deploy-app chart.
This legacy installation is no longer used in the current auto-deploy-image. In the current architecture, we skip the legacy PostgreSQL installation, and instead, we install PostgreSQL in a separate release detached from the application release.
Today, some users still using the legacy PostgreSQL, we provide this upgrade documentation for upgrading from legacy installation to the latest installation (i.e. Upgrade AUTO_DEVOPS_POSTGRES_CHANNEL
from 1
to 2
).
The demo project explicitly specifies AUTO_DEVOPS_POSTGRES_CHANNEL
to 1
, in order to continue the legacy-style deployment.
Problem
When Kubernetes Cluster is upgraded to 1.16, the legacy PostgreSQL chart stops working because it still uses apiVersion: extensions/v1beta1
with kind: Deployment
, which already dropped support in 1.16.
For example, in this demo project, users see the following error:
UPGRADE FAILED
Error: failed decoding reader into objects: unable to recognize "": no matches for kind "Deployment" in version "extensions/v1beta1"
Who is affected?
This problem happens when:
- Users runs Auto DevOps pipeline and perform Auto Deploy (
staging
,production
, review apps, etc), AND - There was already a deployment exists in the environment. (e.g.
production
env is being there for a while), AND - The environment still using legacy PostgreSQL instance e.g.
AUTO_DEVOPS_POSTGRES_CHANNEL
is1
, AND - The Kubernetes Cluster is v1.16+
Workaround
Upgrade PostgreSQL instance according to the upgrade guide and removes AUTO_DEVOPS_POSTGRES_CHANNEL
environment variables override.