Hello community!! I´m trying to spin up a K8s clus...
# ask-community
r
Hello community!! I´m trying to spin up a K8s cluster using the helm chart provided by prefetc…amd I´m trying to use an external postgreSQL database. The thing is_ What should I have to write inside postgresql.externalHostname? the hole postresql url with user/password/url/port/ddbb ? or just the url?
Copy code
# externalHostname defines the address to contact an externally
  # managed postgres database instance at. This is not required if
  # `internalPostgres` is `true`
  externalHostname: ""
Copy code
--set postgresql.useSubChart=false --set postgresql.externalHostname=<http://prefecttesting.xxxxxxxxxxx.eu-west-1.rds.amazonaws.com|prefecttesting.xxxxxxxxxxx.eu-west-1.rds.amazonaws.com> --generate-name
or
Copy code
--set jobs.createTenant.enabled=true --set.postgresql.useSubChart=false --set.postgresql.externalHostname=<postgresql://usr:pass@prefecttesting.xxxxxxxxxxx.eu-west-1.rds.amazonaws.com:5432/prefect>
now…in both cases hasura, apollo and towel pods do not start ->
CreateContainerConfigError
m
Hello Raul! Just
<http://prefecttesting.xxxxxxxxxxx.eu-west-1.rds.amazonaws.com|prefecttesting.xxxxxxxxxxx.eu-west-1.rds.amazonaws.com>
should work 👍
Let me know if you'll still have errors
r
thanks Mariia! and the password should be set in postgresqlPassword and existingSecret?
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 set to a secret
  # containing the key `postgresql-password`
  existingSecret: null

  # postgresqlPassword sets the password to be used if
  # `existingSecret` is not set. This is the password for
  # `postgresqlUsername` and will be set within the secret at
  # the key `postgresql-password`
  # postgresqlPassword: use-a-strong-password
m
In this case, I would recommend to create a Kubernetes secret in your cluster with key
postgresql-password
. For example,
Copy code
apiVersion: v1
kind: Secret
metadata:
  name: mydbsecret
type: Opaque
data:
  postgresql-password: base64encodedsecret
and in your chart specify
existingSecret: mydbsecret
r
thanks a lot, goint to test it 🙂
m
Awesome, let me know how it goes 👍
r
Oh yeah, now it works…the key was using the secret!!! Awesome support Mariia!
m
I'm glad it worked 🙌
🙌 1
r
one last question @Mariia Kerimova …how am I supossed to write agent.prefectLabels to get them correct…if I wrote k8s or ‘k8s’ or “k8s” I get 3 labels… 8 - k - s
m
Did you include brackets
["k8s"]
? I think it takes array, and if you pass string, it will create label with each letter
r
I did one time but without “” yeah, looks like it is an array
if I write
--set agent.prefectLabels=["k8s"]
then
no matches found: agent.prefectLabels=[k8s]
m
I just tested with quotes and without brackets, it worked
r
😕 mine not…
Copy code
helm install prefecthq/prefect-server --set agent.enabled=true --set agent.prefectLabels="k8s" --set jobs.createTenant.enabled=true --set postgresql.useSubChart=false --set postgresql.externalHostname=<http://prefecttesting.XXXXXXXXX.eu-west-1.rds.amazonaws.com|prefecttesting.XXXXXXXXX.eu-west-1.rds.amazonaws.com> --set postgresql.existingSecret=mydbsecret --generate-name -n prefect
m
Hmm, I'm going to take another look in a few, and let you know what I'll find
Okay, this definitely should work
--set agent.prefectLabels={k8s, test}
(you might need to set quotes like this
--set "agent.prefectLabels={k8s, test}"
if you are on unix). Let me know if you'll still have the error.
Also, I personally would recommend to create a separate values config file for your chart, so all your changes are set in declarative way, and instead of appending
--set
flags to your install command, you can just provide
--values
flag with the file which contains your desired values.
r
Hi @Mariia Kerimova! Thanks for your answers… yes, definetely the labels work with
--set "agent.prefectLabels={k8s, test}"
And yes, I will create another file for my deploys. Thanks a lot for your assistance.
👍 1