0

I am trying to move away from cloudsql proxy using it as a sidecar to separate service. Followed all the steps mentioned in here https://github.com/GoogleCloudPlatform/cloud-sql-proxy/tree/main/examples/k8s-serviceafter deploying in kubernetes cluster i am getting an error mentioned below

┌─────────────────────────────────────────────────────────── Logs(pygeno/pgbouncer-xxxxxxx-xxxxx:pgbouncer)[1m] ───────────────────────────────────────────────────────────┐
│                                                      Autoscroll:On     FullScreen:Off     Timestamps:Off     Wrap:Off                                                       │
│ pgbouncer 04:58:23.60                                                                                                                                                       │
│ pgbouncer 04:58:23.61 Welcome to the Bitnami pgbouncer container                                                                                                            │
│ pgbouncer 04:58:23.61 Subscribe to project updates by watching https://github.com/bitnami/containers                                                                        │
│ pgbouncer 04:58:23.62 Submit issues and feature requests at https://github.com/bitnami/containers/issues                                                                    │
│ pgbouncer 04:58:23.62                                                                                                                                                       │
│ pgbouncer 04:58:23.65 INFO  ==> ** Starting PgBouncer setup **                                                                                                              │
│ pgbouncer 04:58:23.67 INFO  ==> Validating settings in PGBOUNCER_* env vars...                                                                                              │
│ pgbouncer 04:58:23.69 INFO  ==> Initializing PgBouncer...                                                                                                                   │
│ pgbouncer 04:58:23.74 INFO  ==> Waiting for PostgreSQL backend to be accessible                                                                                             │
│ cannot resolve host "postgresql": lookup postgresql on xx.0.xx.xx:xx: no such host                                                                                          │
│ cannot resolve host "postgresql": lookup postgresql on xx.0.xx.xx:xx: no such host                                                                                          │
│ cannot resolve host "postgresql": lookup postgresql on xx.0.xx.xx:xx: no such host                                                                                          │
│ cannot resolve host "postgresql": lookup postgresql on xx.0.xx.xx:xx: no such host                                                                                          │
│ cannot resolve host "postgresql": lookup postgresql on xx.0.xx.xx:xx: no such host                                                                                          │
│ cannot resolve host "postgresql": lookup postgresql on xx.0.xx.xx:xx: no such host

i got struck here and not able to move further.

Taimoor Mirza
  • 1,093
  • 7
  • 19
explorer
  • 43
  • 1
  • 5

1 Answers1

0

I resolved it by adding environment variable POSTGRESQL_HOST and assigned value 127.0.0.1

explorer
  • 43
  • 1
  • 5