首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >CloudSQL在Kubernetes集群中将代理作为服务而不是侧代理。

CloudSQL在Kubernetes集群中将代理作为服务而不是侧代理。
EN

Stack Overflow用户
提问于 2022-09-20 05:14:57
回答 1查看 102关注 0票数 0

我试图摆脱cloudsql代理,使用它作为一个侧服务器来分离服务。按照这里提到的所有步骤,在kubernetes集群中部署https://github.com/GoogleCloudPlatform/cloud-sql-proxy/tree/main/examples/k8s-service后,我得到了下面提到的一个错误

代码语言:javascript
复制
┌─────────────────────────────────────────────────────────── 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

我在这里被击中了,不能再往前走了。

EN

回答 1

Stack Overflow用户

发布于 2022-09-21 15:58:21

我通过添加环境变量POSTGRESQL_HOST和赋值127.0.0.1来解决这个问题。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/73781910

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档