我在GCP上创建了一个kubernetes集群,其中vm实例具有ubuntu映像。我已经部署了一个postgres有状态集,但是当我尝试检查pod的日志时,我最终看到了以下内容。
kubectl logs pgset-1
Error from server: Get https://10.140.0.5:10250/containerLogs/default/pgset-1/pgset: No SSH tunnels currently open. Were the targets able to accept an ssh-key for user "gke-2bdc75f7d50bd7720226"?
kubectl get pods
NAME READY STATUS RESTARTS AGE
maya-apiserver-5b48756968-95887 1/1 Running 0 1h
openebs-provisioner-7b59878f76-9w5z8 1/1 Running 0 1h
pgset-0 1/1 Running 0 12m
pgset-1 1/1 Running 0 10m
pvc-8174e1f6-332f-11e8-85cd-42010af001b0-ctrl-fb5767469-jmjb2 2/2 Running 0 12m
pvc-8174e1f6-332f-11e8-85cd-42010af001b0-rep-8fd886589-tkvdq 1/1 Running 0 12m
pvc-8174e1f6-332f-11e8-85cd-42010af001b0-rep-8fd886589-wzr25 1/1 Running 0 12m
pvc-8174e1f6-332f-11e8-85cd-42010af001b0-rep-8fd886589-xvvfk 1/1 Running 0 12m
pvc-c34d6531-332f-11e8-85cd-42010af001b0-ctrl-6dd8948cbd-lz7dj 2/2 Running 0 10m
pvc-c34d6531-332f-11e8-85cd-42010af001b0-rep-64bdd45fc7-7fpnv 1/1 Running 0 10m
pvc-c34d6531-332f-11e8-85cd-42010af001b0-rep-64bdd45fc7-cf6w9 1/1 Running 0 10m
pvc-c34d6531-332f-11e8-85cd-42010af001b0-rep-64bdd45fc7-pg7bz 1/1 Running 0 10m
kubectl exec -it pgset-0 bash
Error from server: error dialing backend: No SSH tunnels currently open. Were the targets able to accept an ssh-key for user "gke-2bdc75f7d50bd7720226"?
这可能是什么问题。我做错了什么。
答案 0 :(得分:2)
可能是因为项目中没有防火墙规则允许从主服务器到节点的ssh流量。或者这是错的。这就是我要做的事情:
kubectl cluster-info
并记下主IP地址。希望它有效
答案 1 :(得分:0)
可能是防火墙规则的问题。但就我而言,我以前能够执行到 pod 中,有一天我遇到了以下问题:
“错误:错误升级连接:错误拨号后端:当前没有 SSH 隧道打开。目标是否能够接受用户“gke-***”的 ssh 密钥
我刚刚重新连接到 Kubernetes 集群并开始为我工作。