GCP CloudSQL、IAM 和 Hasura
我正在 GKE 上推出 Hasura,我需要它通过 IAM 连接到 CloudSQL。
虽然大多数在线教程都描述了如何使用 k8s 密钥作为用户名和密码,但我希望 Hasura 通过 IAM 进行连接。这意味着没有密码。
制作 HASURA_GRAPHQL_DATABASE_URL
来实现这一目标的最佳方法是什么?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
所以最后是 postgres 的
paramspec
来救援。通过为HASURA_GRAPHQL_DATABASE_URL
制作连接字符串,如下所示:postgres://localhost:5432/[电子邮件受保护]
正如 @kurtisvg 建议的那样,我能够使用
workload-identity
和带有cloudsql-proxy
的 sidecar 成功连接So in the end it was postgres'
paramspec
to the rescue. By crafting the connection string as follows for theHASURA_GRAPHQL_DATABASE_URL
:postgres://localhost:5432/[email protected]
I was able connect successfully, with
workload-identity
and a sidecar withcloudsql-proxy
as @kurtisvg suggested我建议使用自动 IAM 数据库身份验证,使用 Cloud SQL Auth 代理。您可以按照从 GKE 连接说明进行操作,并且只需修改 sidecar 命令以使用
-enable_iam_login
而不是密码的秘密。I'd suggest using automatic IAM database authentication, using the Cloud SQL Auth proxy. You can follow the Connect from GKE instructions, and just modify the sidecar command to use the
-enable_iam_login
instead of a secret for the password.