helm-charts icon indicating copy to clipboard operation
helm-charts copied to clipboard

[nominatim] wait-for-db doesn't support an external database through a k8s secret

Open Longwelwind opened this issue 1 year ago • 2 comments

Hello,

Here's my values.yml:

externalDatabase:
  existingSecretDsn: external-database
  existingSecretDsnKey: POSTGRESQL_DSN
initJob:
  enabled: true
postgresql:
  enabled: false

The init job fails because of the wait-for-db init container:

wait-for-it: waiting 15 seconds for localhost:5432
wait-for-it: timeout occurred after waiting 15 seconds for localhost:5432

I may be mistaken, but I think it may be because the configuration of the wait-for-it init container doesn't take into account the possibility that the external database credentials were defined in an external secret, as defined here: https://github.com/robjuz/helm-charts/blob/master/charts/nominatim/templates/_helpers.tpl#L49

If it was defined in a external secret, this secret should be mounted inside the init container and should be used as part of the command.

Thanks in advance (if you find the time to fix it) and thanks a lot for the helm chart! 🙂

Longwelwind avatar Sep 03 '24 11:09 Longwelwind

Hi,

I had a similar issue, where i ran into the wait-for-it timeout everytime. You can increase the timeout, but you would need to modify the templates for that. This worked for me.

That would be adding this to the args (there: https://github.com/robjuz/helm-charts/blob/master/charts/nominatim/templates/initJob.yaml#L31)

            - t
            - "60"

It would be good to be able to set that from the values yaml, I think 15sec is kind of short for an database-init timeout.

I dont know if wait-for-it needs to know more than host an port https://images.chainguard.dev/directory/image/wait-for-it/overview

JakobHtz avatar Sep 12 '24 12:09 JakobHtz

I looked into it a bit more. You are right. The helper function does not get the host and port from the secret, but you can set them in the values.yaml Could be worth a try as a workaround

externalDatabase:
  existingSecretDsn: external-database
  existingSecretDsnKey: POSTGRESQL_DSN
  host: <Your DB Host>
  port: <Your DB Port>
initJob:
  enabled: true
postgresql:
  enabled: false

JakobHtz avatar Sep 12 '24 13:09 JakobHtz

Same here.

@robjuz, would you mind taking a look at this?

MatthiasLohr avatar Nov 16 '24 13:11 MatthiasLohr

I will take a look today

On Sat, 16 Nov 2024, 14:35 Matthias Lohr, @.***> wrote:

Same here.

@robjuz https://github.com/robjuz, would you mind taking a look at this?

— Reply to this email directly, view it on GitHub https://github.com/robjuz/helm-charts/issues/90#issuecomment-2480562905, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACFLPUD6ENZ4OXRN5BMVOQ32A5CZPAVCNFSM6AAAAABNR5KZVOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDIOBQGU3DEOJQGU . You are receiving this because you were mentioned.Message ID: @.***>

robjuz avatar Nov 16 '24 14:11 robjuz