OperationCode / operationcode_backend

This is the backend repo for the Operation Code website
https://operationcode.org
MIT License
62 stars 110 forks source link

Postgres env secrets #458

Closed apex-omontgomery closed 5 years ago

apex-omontgomery commented 5 years ago

Description of changes

This change should fix staging, instead of using harded username for production database we should be using the values listed in the kubernetes secrets which are namespaced.

Issue Resolved

Fixes Staging?

Summary:

Apparently both production and production-staging pods are using their own namespaced secrets storage. The secrets had a 2 values that were of importance: POSTGRES_HOST and POSTGRES_PASSWORD

POSTGRES_HOST contained a different value, and in AWS it was shown that both of those exist and were paired correctly.

But in AWS the username for each was different and the k8s secrets showed they both used the same name as indicated in the config file.

Additionally they both used the same POSTGRES_PASSWORD but after inspecting our credentials management it was seen that prod and staging have two different master passwords.

Prior to merging this I'm going to:

I don't know how to do 3. Modifying 1 and 2 will not affect either environment until this is merged and changing 2 on staging isn't going to hurt us since until we merge this the username won't be valid.

apex-omontgomery commented 5 years ago

Yeah if this works I'll try that.