【发布时间】:2020-01-17 15:27:52
【问题描述】:
所以我目前正在本地 Kubernetes 集群上运行(在 docker 上运行)来自 helm 的 stable/consul 图表。
$ helm install -n wet-fish --namespace consul stable/consul
这会创建两个服务
==> v1/Service
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
wet-fish-consul ClusterIP None <none> 8500/TCP,8400/TCP,8301/TCP,8301/UDP,8302/TCP,8302/UDP,8300/TCP,8600/TCP,8600/UDP 0s
wet-fish-consul-ui NodePort 10.110.229.223 <none> 8500:30276/TCP
所以这意味着我可以运行 localhost:30276 并查看 consul ui。
现在我在本地机器上运行
$ consul agent -dev -config-dir=./consul.d -node=machine
$ consul join 127.0.0.1:30276
这只会导致:
Error joining address '127.0.0.1:30276': Unexpected response code: 500 (1 error occurred:
* Failed to join 127.0.0.1: received invalid msgType (72), expected pushPullMsg (6) from=127.0.0.1:30276
)
Failed to join any nodes.
和
2020/01/17 15:17:35 [WARN] agent: (LAN) couldn't join: 0 Err: 1 error occurred:
* Failed to join 127.0.0.1: received invalid msgType (72), expected pushPullMsg (6) from=127.0.0.1:30276
2020/01/17 15:17:35 [ERR] http: Request PUT /v1/agent/join/127.0.0.1:30276, error: 1 error occurred:
* Failed to join 127.0.0.1: received invalid msgType (72), expected pushPullMsg (6) from=127.0.0.1:30276
from=127.0.0.1:59693
一定有办法让本地consul代理运行,可以连接到k8s consul服务器……
这是在 Mac 上,所以网络不太好......
【问题讨论】:
标签: docker kubernetes kubernetes-helm consul