Raúl Mansilla

    Raúl Mansilla

    1 year ago
    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?
    # externalHostname defines the address to contact an externally
      # managed postgres database instance at. This is not required if
      # `internalPostgres` is `true`
      externalHostname: ""
    --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
    --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

    Mariia Kerimova

    1 year ago
    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
    Raúl Mansilla

    Raúl Mansilla

    1 year ago
    thanks Mariia! and the password should be set in postgresqlPassword and existingSecret?
    # 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

    Mariia Kerimova

    1 year ago
    In this case, I would recommend to create a Kubernetes secret in your cluster with key
    postgresql-password
    . For example,
    apiVersion: v1
    kind: Secret
    metadata:
      name: mydbsecret
    type: Opaque
    data:
      postgresql-password: base64encodedsecret
    and in your chart specify
    existingSecret: mydbsecret
    Raúl Mansilla

    Raúl Mansilla

    1 year ago
    thanks a lot, goint to test it 🙂
    m

    Mariia Kerimova

    1 year ago
    Awesome, let me know how it goes 👍
    Raúl Mansilla

    Raúl Mansilla

    1 year ago
    Oh yeah, now it works…the key was using the secret!!! Awesome support Mariia!
    m

    Mariia Kerimova

    1 year ago
    I'm glad it worked 🙌
    Raúl Mansilla

    Raúl Mansilla

    1 year ago
    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

    Mariia Kerimova

    1 year ago
    Did you include brackets
    ["k8s"]
    ? I think it takes array, and if you pass string, it will create label with each letter
    Raúl Mansilla

    Raúl Mansilla

    1 year ago
    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

    Mariia Kerimova

    1 year ago
    I just tested with quotes and without brackets, it worked
    Raúl Mansilla

    Raúl Mansilla

    1 year ago
    😕 mine not…
    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

    Mariia Kerimova

    1 year ago
    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.
    Raúl Mansilla

    Raúl Mansilla

    1 year ago
    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.