[helm] [k8s] [blue/green] where are these postgres environment variables coming from?


#1

Hi,

I’m running Concourse v4.2.2 in Kubernetes, with Helm (Concourse chart v3.7.3).
I have deployed a second Concourse instance (let’s call it “blue”) alongside the previously running one (“green”), to perform smooth upgrade / switchover. I’ve realized that the blue instance is using the database from the green deployment. I am struggling to find out why.

When deploying with Helm, the configuration is passed via env vars. The database connection is configured with more than a few variables, it seems:
$ kubectl -n concourse exec -ti concourse-web-67fd4bf778-ljl4x env | grep POSTGR|cut -d’=’ -f1
CONCOURSE_POSTGRES_DATABASE
CONCOURSE_POSTGRES_PASSWORD
CONCOURSE_POSTGRES_USER
CONCOURSE_POSTGRES_HOST
CONCOURSE_POSTGRESQL_PORT_5432_TCP_PORT
CONCOURSE_POSTGRESQL_PORT_5432_TCP_PROTO
CONCOURSE_POSTGRESQL_SERVICE_PORT_POSTGRESQL
CONCOURSE_POSTGRESQL_PORT_5432_TCP
CONCOURSE_POSTGRESQL_SERVICE_HOST
CONCOURSE_POSTGRESQL_SERVICE_PORT
CONCOURSE_POSTGRESQL_PORT
CONCOURSE_POSTGRESQL_PORT_5432_TCP_ADDR

I have noticed that CONCOURSE_POSTGRES_HOST is inconsistent with CONCOURSE_POSTGRESQL_SERVICE_HOST in the blue instance - the CONCOURSE_POSTGRESQL_SERVICE_HOST variable points to the database of the green instance. It is consistent in the green instance of course.

Grepping the code or googling for CONCOURSE_POSTGRESQL_SERVICE_HOST or parts of that name gets me nowhere (unlike with CONCOURSE_POSTGRES_HOST).

Any help appreciated, thanks!