https://prefect.io logo
#prefect-server
Title
# prefect-server
r

Ryan Sattler

11/25/2021, 3:40 AM
Hi, I’m trying to connect the Prefect Server Helm Chart to an existing postgres database. I’ve configured the username and password fields inside the values file. However my pods fail to start with this error:
Error: secret "prefect-server-postgresql" not found
. I thought this secret would be created automatically? Am I supposed to create it manually and if so how?
The comments in the yaml imply that this should be created automatically:
Copy code
This is the password for
  # `postgresqlUsername` and will be set within the secret at
  # the key `postgresql-password`
I did create something manually using
kubectl create secret generic prefect-server-postgresql --from-literal=postgresql-password=mypassword
and that got a bit further though the auth is failing (investigating why)
k

Kevin Kho

11/25/2021, 4:12 AM
I think this thread may be relevant here. Have you seen it?
r

Ryan Sattler

11/25/2021, 5:15 AM
I saw that which inspired the above fix but IMO this really ought to be created automatically or else what purpose does the password field in the yaml even serve?
or if not the comments could be improved to make it clear what needs to be done
a

Anna Geller

11/25/2021, 9:16 AM
@Ryan Sattler did you see this answer? https://prefect-community.slack.com/archives/C014Z8DPDSR/p1636481320343000?thread_ts=1636470024.336600&cid=C014Z8DPDSR perhaps just the format of the secret is wrong?
r

Ryan Sattler

11/25/2021, 9:28 PM
Yes Anna that’s what I did (and it worked), but if that’s what’s needed then the comments in the yaml file should make that clear instead of implying that this secret will be created automatically
👍 1
a

Anna Geller

11/25/2021, 9:48 PM
@Ryan Sattler can you confirm that this is what would you expect to see in the docs?
Copy code
# existingSecret configures which secret should be referenced
  # for access to the database. If null and `useSubChart` is
  # enabled, the secret will be generated. If using an external
  # postgres service, this value should be explicitly set to 
  # the name of a Kubernetes secret. This secret must be a 
  # key-value pair containing the key `postgresql-password`.
  # e.g.: kubectl create secret generic prefect-postgresql-pwd 
  # --from-literal='postgresql-password=YOUR_POSTGRES_PWD'
  # Helm chart value: existingSecret: prefect-postgresql-pwd
  existingSecret: null
r

Ryan Sattler

11/25/2021, 10:02 PM
thanks Anna, looks mostly correct except that the name of the secret must be
<helm-release-name>-postgresql
also I think the field
postgresqlPassword
should be removed as it is not used as far as I can tell
a

Anna Geller

11/25/2021, 10:07 PM
correct, postgresqlPassword is currently commented out. Are you sure that the secret name must have the helm release name within it
<helm-release-name>-postgresql
? I understood as long as you reference the name, it should work?
Copy code
existingSecret: prefect-postgresql-pwd
but thanks anyway
r

Ryan Sattler

11/25/2021, 10:20 PM
oh true that should work
👍 1
2 Views