0

我正在关注使用 Connect 将本地 kubernetes 集群连接到 Anthos 的教程:教程。我的集群基于在三个树莓派上运行的 microk8s,并以 ubuntu 笔记本电脑作为主节点。

一切似乎都正常,我可以部署 prometheus-to-sd yaml 文件,并且日志显示没有错误,但根据谷歌云平台上的 kubernetes 引擎,集群仍然无法访问。指标也不会出现在谷歌云指标查看器中。

当我运行端口转发命令时

kubectl -n ${AGENT_NS} port-forward svc/gke-connect-agent 8080,

我被击中

error: timed out waiting for the condition,

并尝试访问端口 8080 上的服务时

curl localhost:8080/metrics

我明白了

curl: (7) Failed to connect to localhost port 8080: Connection refused

问题可能是本教程特有的,但我什至不知道如何开始调试,因为日志显示没有问题:

kubectl -n ${AGENT_NS} logs prometheus-to-monitoring-67c5885455-hxp67
I0803 08:41:22.116692       1 gce_config.go:40] Using metadata all from flags
I0803 08:41:22.116757       1 main.go:114] GCE config: &{Project:tensile-jet-321114 Zone:europe-west1-a Cluster:raspi-membership ClusterLocation:europe-west1-a Instance:MyGkeConnectAgent MonitoredResourceTypes:k8s}
I0803 08:41:22.116786       1 main.go:165] Taking source configs from flags
I0803 08:41:22.116797       1 main.go:167] Taking source configs from kubernetes api server
I0803 08:41:22.116804       1 main.go:117] Built the following source configs: [0xc420140cc0]
I0803 08:41:22.117017       1 main.go:131] Created a client with the default credentials
I0803 08:41:22.117072       1 main.go:176] Running prometheus-to-sd, monitored target is gke-connect-agent http://gke-connect-agent:8080

我知道这是一个非常具体的问题,但似乎没有任何论坛可以直接向谷歌寻求帮助。

我不知道从哪里开始寻找,任何帮助将不胜感激。

4

0 回答 0