簡體   English   中英

無法通過 cloudsqlproxy sidecar 從我的 Kubere.netes 集群連接到 CloudSql

[英]Unable to connect to CloudSql from my Kuberernetes Cluster through cloudsqlproxy sidecar

在嘗試連接到我的 cloudsql 實例時出現此錯誤

{
errorno: "ETIMEDOUT",
code: "ETIMEDOUT",
syscall: "connect",
fatal: true
}

這是來自我的 cloudsqlproxy 容器的日志

2020/06/09 15:53:04 current FDs rlimit set to 1048576, wanted limit is 8500. Nothing to do here.
2020/06/09 15:53:04 using credential file for authentication; email=lion-db@estatelion-test-275318.iam.gserviceaccount.com
2020/06/09 15:53:04 Listening on 127.0.0.1:3306 for estatelion-test-275318:us-central1:estatelion
2020/06/09 15:53:04 Ready for new connections

但是我的 nodejs 應用程序無法連接到它

const connection = mysql.createPool({
    connectionLimit: 10,
    host: config.get("database").host, // localhost
    user: config.get("database").user, // cloud proxy user for my cloudsql instance
    password: config.get("database").password, // password
    database: config.get("database").db_name, // database 
});

好吧,我找到了解決方案,我剛剛將集群版本從 1.14.* 更新到 1.15.11-gke.15(我不記得 rest 了)並且工作正常。

我認為部署的默認 GKE 版本中存在一些錯誤。

感謝大家的寶貴時間和努力。 :-)

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM