首页 > 解决方案 > Weavescope 仪表板显示集群中没有数据(成功安装后为空仪表板)

问题描述

我已经在本地集群上成功部署了 weavscope,可以访问 weavscope 仪表板。 问题是仪表板不显示数据,而只是如下所示的空白屏幕(测试了所有选项卡和视图)

我已经使用这个weavscope.yaml来部署

安装和端口转发的步骤我已确保使用的 IP 和命令没有语法错误。

$ wget https://cloud.weave.works/launch/k8s/weavescope.yaml
--2020-01-16 12:54:52--  https://cloud.weave.works/launch/k8s/weavescope.yaml
Resolving cloud.weave.works (cloud.weave.works)... 52.200.96.42, 34.231.197.104
Connecting to cloud.weave.works (cloud.weave.works)|52.200.96.42|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: /k8s/v1.13/scope.yaml [following]
--2020-01-16 12:54:53--  https://cloud.weave.works/k8s/v1.13/scope.yaml
Reusing existing connection to cloud.weave.works:443.
HTTP request sent, awaiting response... 200 OK
Length: 9964 (9.7K) [application/x-yaml]
Saving to: ‘weavescope.yaml’

weavescope.yaml                                      100%[====================================================================================================================>]   9.73K  --.-KB/s    in 0s

2020-01-16 12:54:53 (243 MB/s) - ‘weavescope.yaml’ saved [9964/9964]


$ ll
total 20
drwxrwxr-x 2 ubuntu ubuntu 4096 Jan 16 12:54 ./
drwxr-xr-x 8 ubuntu ubuntu 4096 Jan 16 12:54 ../
-rw-rw-r-- 1 ubuntu ubuntu 9964 Jan 16 12:54 weavescope.yaml



$ kubectl cluster-info
Kubernetes master is running at https://xx.xx.xx.xx:6443
KubeDNS is running at https://xx.xx.xx.xx:6443/api/v1/namespaces/kube-system/services/kube-dns:dns/proxy

To further debug and diagnose cluster problems, use 'kubectl cluster-info dump'.


$ kubectl create -f weavescope.yaml
namespace/weave created
serviceaccount/weave-scope created
clusterrole.rbac.authorization.k8s.io/weave-scope created
clusterrolebinding.rbac.authorization.k8s.io/weave-scope created
deployment.apps/weave-scope-app created
service/weave-scope-app created
deployment.apps/weave-scope-cluster-agent created
daemonset.apps/weave-scope-agent created


$ pod=$(kubectl get pod -n weave --selector=name=weave-scope-app -o jsonpath={.items..metadata.name})

$ kubectl expose pod $pod -n weave --external-ip="xx.xx.xx.xx" --port=4040 --target-port=4040

当我可以在端口转发后到达给定端口上的仪表板时,它陷入获取 pod 状态,无法弄清楚是什么阻止了数据获取

weavescope 仪表盘上没有数据

我已经检查了我的集群上正在运行 pod,并且集群端没有问题可以旋转新的 pod 等。

    $ kubectl get all
    NAME                          READY   STATUS    RESTARTS   AGE
    pod/busybox-c44c795b6-c424g   1/1     Running   0          16s
    pod/nginx-86c57db685-znqh2    1/1     Running   0          3d1h

    NAME                 TYPE        CLUSTER-IP   EXTERNAL-IP   PORT(S)   AGE
    service/kubernetes   ClusterIP   10.96.0.1    <none>        443/TCP   3d4h

    NAME                      READY   UP-TO-DATE   AVAILABLE   AGE
    deployment.apps/busybox   1/1     1            1           16s
    deployment.apps/nginx     1/1     1            1           3d1h

    NAME                                DESIRED   CURRENT   READY   AGE
    replicaset.apps/busybox-c44c795b6   1         1         1       16s
    replicaset.apps/nginx-86c57db685    1         1         1       3d1h


**More Logs** 

$ kubectl get pods -n weave
NAME                                        READY   STATUS    RESTARTS   AGE
weave-scope-agent-cshjf                     1/1     Running   0          59m
weave-scope-agent-ddcjv                     1/1     Running   0          59m
weave-scope-agent-krt6t                     1/1     Running   0          59m
weave-scope-agent-pvjcg                     1/1     Running   0          59m
weave-scope-app-848cd4d8b5-22qhv            1/1     Running   0          59m
weave-scope-cluster-agent-b4f45797c-sxtfb   1/1     Running   0          59m

    $ kubectl -n weave logs weave-scope-app-848cd4d8b5-22qhv
<app> INFO: 2020/01/16 12:55:42.641840 app starting, version 1.12.0, ID 27b9ceab0b49f8d7
<app> INFO: 2020/01/16 12:55:42.641879 command line args: --mode=app
<app> INFO: 2020/01/16 12:55:42.643881 Basic authentication disabled
<app> INFO: 2020/01/16 12:55:42.645552 listening on :4040


$ kubectl -n weave logs weave-scope-agent-cshjf
time="2020-01-16T12:55:33Z" level=info msg="publishing to: weave-scope-app.weave.svc.cluster.local:80"
<probe> INFO: 2020/01/16 12:55:33.746901 Basic authentication disabled
<probe> INFO: 2020/01/16 12:56:13.749823 command line args: --mode=probe --probe-only=true --probe.docker=true --probe.docker.bridge=docker0 --probe.kubernetes.role=host --probe.publish.interval=4.5s --probe.spy.interval=2s weave-scope-app.weave.svc.cluster.local:80
<probe> INFO: 2020/01/16 12:56:13.749871 probe starting, version 1.12.0, ID 1a14cbb93863dc96
<probe> WARN: 2020/01/16 12:56:13.751629 Cannot resolve 'scope.weave.local.': dial tcp 172.17.0.1:53: connect: connection refused
<probe> WARN: 2020/01/16 12:56:14.144400 Error collecting weave status, backing off 10s: Get http://127.0.0.1:6784/report: dial tcp 127.0.0.1:6784: connect: connection refused. If you are not running Weave Net, you may wish to suppress this warning by launching scope with the `--weave=false` option.
<probe> WARN: 2020/01/16 12:56:24.144816 Error collecting weave status, backing off 20s: Get http://127.0.0.1:6784/report: dial tcp 127.0.0.1:6784: connect: connection refused. If you are not running Weave Net, you may wish to suppress this warning by launching scope with the `--weave=false` option.
<probe> ERRO: 2020/01/16 12:56:43.814003 Error checking version: Get https://checkpoint-api.weave.works/v1/check/scope-probe?arch=amd64&flag_kernel-version=4.4.0-169-generic&flag_kubernetes_enabled=true&flag_os=linux&os=linux&signature=2irqD0pagYmnL6vzwsw6tNzZ2ASN1WIgEfUhtKbaJNM%3D&version=1.12.0: dial tcp: i/o timeout
<probe> WARN: 2020/01/16 12:56:44.145328 Error collecting weave status, backing off 40s: Get http://127.0.0.1:6784/report: dial tcp 127.0.0.1:6784: connect: connection refused. If you are not running Weave Net, you may wish to suppress this warning by launching scope with the `--weave=false` option.
<probe> WARN: 2020/01/16 12:56:53.752597 Cannot resolve 'weave-scope-app.weave.svc.cluster.local': lookup weave-scope-app.weave.svc.cluster.local on 10.96.0.10:53: read udp 131.160.200.108:42692->10.96.0.10:53: i/o timeout
<probe> ERRO: 2020/01/16 12:57:13.904958 Error checking version: Get https://checkpoint-api.weave.works/v1/check/scope-probe?arch=amd64&flag_kernel-version=4.4.0-169-generic&flag_kubernetes_enabled=true&flag_os=linux&os=linux&signature=2irqD0pagYmnL6vzwsw6tNzZ2ASN1WIgEfUhtKbaJNM%3D&version=1.12.0: dial tcp: i/o timeout



$ kubectl -n weave logs weave-scope-agent-ddcjv
time="2020-01-16T12:55:26Z" level=info msg="publishing to: weave-scope-app.weave.svc.cluster.local:80"
<probe> INFO: 2020/01/16 12:55:26.417234 Basic authentication disabled
<probe> INFO: 2020/01/16 12:56:06.420120 command line args: --mode=probe --probe-only=true --probe.docker=true --probe.docker.bridge=docker0 --probe.kubernetes.role=host --probe.publish.interval=4.5s --probe.spy.interval=2s weave-scope-app.weave.svc.cluster.local:80
<probe> INFO: 2020/01/16 12:56:06.420160 probe starting, version 1.12.0, ID 5bee7195c53ead34
<probe> WARN: 2020/01/16 12:56:06.422164 Cannot resolve 'scope.weave.local.': dial tcp 172.17.0.1:53: connect: connection refused
<probe> WARN: 2020/01/16 12:56:06.810258 Error collecting weave status, backing off 10s: Get http://127.0.0.1:6784/report: dial tcp 127.0.0.1:6784: connect: connection refused. If you are not running Weave Net, you may wish to suppress this warning by launching scope with the `--weave=false` option.
<probe> WARN: 2020/01/16 12:56:16.810782 Error collecting weave status, backing off 20s: Get http://127.0.0.1:6784/report: dial tcp 127.0.0.1:6784: connect: connection refused. If you are not running Weave Net, you may wish to suppress this warning by launching scope with the `--weave=false` option.
<probe> ERRO: 2020/01/16 12:56:36.500739 Error checking version: Get https://checkpoint-api.weave.works/v1/check/scope-probe?arch=amd64&flag_kernel-version=4.4.0-169-generic&flag_kubernetes_enabled=true&flag_os=linux&os=linux&signature=4MV4m5TneqzOVfI9lTdXt8Lmjj0RBnU5u85Dx%2BO4cZ4%3D&version=1.12.0: dial tcp: i/o timeout
<probe> WARN: 2020/01/16 12:56:36.811255 Error collecting weave status, backing off 40s: Get http://127.0.0.1:6784/report: dial tcp 127.0.0.1:6784: connect: connection refused. If you are not running Weave Net, you may wish to suppress this warning by launching scope with the `--weave=false` option.
<probe> WARN: 2020/01/16 12:56:46.423041 Cannot resolve 'weave-scope-app.weave.svc.cluster.local': lookup weave-scope-app.weave.svc.cluster.local on 10.96.0.10:53: read udp 131.160.200.109:52151->10.96.0.10:53: i/o timeout
<probe> ERRO: 2020/01/16 12:57:06.564171 Error checking version: Get https://checkpoint-api.weave.works/v1/check/scope-probe?arch=amd64&flag_kernel-version=4.4.0-169-generic&flag_kubernetes_enabled=true&flag_os=linux&os=linux&signature=4MV4m5TneqzOVfI9lTdXt8Lmjj0RBnU5u85Dx%2BO4cZ4%3D&version=1.12.0: dial tcp: i/o timeout


$ kubectl -n weave logs weave-scope-agent-krt6t
time="2020-01-16T12:55:20Z" level=info msg="publishing to: weave-scope-app.weave.svc.cluster.local:80"
<probe> INFO: 2020/01/16 12:55:20.078069 Basic authentication disabled
<probe> INFO: 2020/01/16 12:55:20.081051 command line args: --mode=probe --probe-only=true --probe.docker=true --probe.docker.bridge=docker0 --probe.kubernetes.role=host --probe.publish.interval=4.5s --probe.spy.interval=2s weave-scope-app.weave.svc.cluster.local:80
<probe> INFO: 2020/01/16 12:55:20.081100 probe starting, version 1.12.0, ID 30049d92f78e0dd8
<probe> WARN: 2020/01/16 12:55:20.082543 Cannot resolve 'scope.weave.local.': dial tcp 172.17.0.1:53: connect: connection refused
<probe> WARN: 2020/01/16 12:55:20.427313 Error collecting weave status, backing off 10s: Get http://127.0.0.1:6784/report: dial tcp 127.0.0.1:6784: connect: connection refused. If you are not running Weave Net, you may wish to suppress this warning by launching scope with the `--weave=false` option.
<probe> ERRO: 2020/01/16 12:55:21.084863 Error fetching app details: Get http://10.96.86.6:80/api: dial tcp 10.96.86.6:80: connect: connection refused
<probe> ERRO: 2020/01/16 12:55:23.084173 Error fetching app details: Get http://10.96.86.6:80/api: dial tcp 10.96.86.6:80: connect: connection refused
<probe> ERRO: 2020/01/16 12:55:25.084261 Error fetching app details: Get http://10.96.86.6:80/api: dial tcp 10.96.86.6:80: connect: connection refused
<probe> ERRO: 2020/01/16 12:55:29.084329 Error fetching app details: Get http://10.96.86.6:80/api: dial tcp 10.96.86.6:80: connect: connection refused
<probe> WARN: 2020/01/16 12:55:30.427831 Error collecting weave status, backing off 20s: Get http://127.0.0.1:6784/report: dial tcp 127.0.0.1:6784: connect: connection refused. If you are not running Weave Net, you may wish to suppress this warning by launching scope with the `--weave=false` option.
<probe> ERRO: 2020/01/16 12:55:37.084216 Error fetching app details: Get http://10.96.86.6:80/api: dial tcp 10.96.86.6:80: connect: connection refused
<probe> INFO: 2020/01/16 12:55:49.089567 Control connection to weave-scope-app.weave.svc.cluster.local starting
<probe> WARN: 2020/01/16 12:55:50.428409 Error collecting weave status, backing off 40s: Get http://127.0.0.1:6784/report: dial tcp 127.0.0.1:6784: connect: connection refused. If you are not running Weave Net, you may wish to suppress this warning by launching scope with the `--weave=false` option.
<probe> INFO: 2020/01/16 12:55:51.938293 Publish loop for weave-scope-app.weave.svc.cluster.local starting


$ kubectl -n weave logs weave-scope-agent-pvjcg
time="2020-01-16T12:55:33Z" level=info msg="publishing to: weave-scope-app.weave.svc.cluster.local:80"
<probe> INFO: 2020/01/16 12:55:33.880079 Basic authentication disabled
<probe> INFO: 2020/01/16 12:56:13.883365 command line args: --mode=probe --probe-only=true --probe.docker=true --probe.docker.bridge=docker0 --probe.kubernetes.role=host --probe.publish.interval=4.5s --probe.spy.interval=2s weave-scope-app.weave.svc.cluster.local:80
<probe> INFO: 2020/01/16 12:56:13.883410 probe starting, version 1.12.0, ID 4c0cce1880a52ef8
<probe> WARN: 2020/01/16 12:56:13.884834 Cannot resolve 'scope.weave.local.': dial tcp 172.17.0.1:53: connect: connection refused
<probe> WARN: 2020/01/16 12:56:14.240728 Error collecting weave status, backing off 10s: Get http://127.0.0.1:6784/report: dial tcp 127.0.0.1:6784: connect: connection refused. If you are not running Weave Net, you may wish to suppress this warning by launching scope with the `--weave=false` option.
<probe> WARN: 2020/01/16 12:56:24.241188 Error collecting weave status, backing off 20s: Get http://127.0.0.1:6784/report: dial tcp 127.0.0.1:6784: connect: connection refused. If you are not running Weave Net, you may wish to suppress this warning by launching scope with the `--weave=false` option.
<probe> ERRO: 2020/01/16 12:56:43.949173 Error checking version: Get https://checkpoint-api.weave.works/v1/check/scope-probe?arch=amd64&flag_kernel-version=4.4.0-169-generic&flag_kubernetes_enabled=true&flag_os=linux&os=linux&signature=e%2FbJ2Qy32Xq3WG0vkozjYngRMp%2B028dfFox%2F9vTLd%2BQ%3D&version=1.12.0: dial tcp: i/o timeout
<probe> WARN: 2020/01/16 12:56:44.241645 Error collecting weave status, backing off 40s: Get http://127.0.0.1:6784/report: dial tcp 127.0.0.1:6784: connect: connection refused. If you are not running Weave Net, you may wish to suppress this warning by launching scope with the `--weave=false` option.
<probe> WARN: 2020/01/16 12:56:53.885827 Cannot resolve 'weave-scope-app.weave.svc.cluster.local': lookup weave-scope-app.weave.svc.cluster.local on 10.96.0.10:53: read udp 131.160.200.110:54514->10.96.0.10:53: i/o timeout
<probe> ERRO: 2020/01/16 12:57:14.014110 Error checking version: Get https://checkpoint-api.weave.works/v1/check/scope-probe?arch=amd64&flag_kernel-version=4.4.0-169-generic&flag_kubernetes_enabled=true&flag_os=linux&os=linux&signature=e%2FbJ2Qy32Xq3WG0vkozjYngRMp%2B028dfFox%2F9vTLd%2BQ%3D&version=1.12.0: dial tcp: i/o timeout


$ kubectl -n weave logs weave-scope-cluster-agent-b4f45797c-sxtfb
time="2020-01-16T12:55:38Z" level=info msg="publishing to: weave-scope-app.weave.svc.cluster.local:80"
<probe> INFO: 2020/01/16 12:55:38.759547 Basic authentication disabled
<probe> INFO: 2020/01/16 12:55:38.763837 command line args: --mode=probe --probe-only=true --probe.http.listen=:4041 --probe.kubernetes.role=cluster --probe.publish.interval=4.5s --probe.spy.interval=2s weave-scope-app.weave.svc.cluster.local:80
<probe> INFO: 2020/01/16 12:55:38.763869 probe starting, version 1.12.0, ID 41240071be33a064
<probe> ERRO: 2020/01/16 12:55:38.763946 Error getting docker bridge ip: route ip+net: no such network interface
<probe> INFO: 2020/01/16 12:55:38.765521 kubernetes: targeting api server https://10.96.0.1:443
<probe> ERRO: 2020/01/16 12:55:38.768123 plugins: problem loading: no such file or directory
<probe> INFO: 2020/01/16 12:55:38.769589 Profiling data being exported to :4041
<probe> INFO: 2020/01/16 12:55:38.769606 go tool pprof http://:4041/debug/pprof/{profile,heap,block}
<probe> WARN: 2020/01/16 12:55:38.770504 Error collecting weave status, backing off 10s: Get http://127.0.0.1:6784/report: dial tcp 127.0.0.1:6784: connect: connection refused. If you are not running Weave Net, you may wish to suppress this warning by launching scope with the `--weave=false` option.
<probe> INFO: 2020/01/16 12:55:38.785340 volumesnapshots are not supported by this Kubernetes version
<probe> INFO: 2020/01/16 12:55:38.790283 volumesnapshotdatas are not supported by this Kubernetes version
<probe> INFO: 2020/01/16 12:55:39.774173 Control connection to weave-scope-app.weave.svc.cluster.local starting
<probe> INFO: 2020/01/16 12:55:43.271912 Publish loop for weave-scope-app.weave.svc.cluster.local starting
<probe> WARN: 2020/01/16 12:55:48.771005 Error collecting weave status, backing off 20s: Get http://127.0.0.1:6784/report: dial tcp 127.0.0.1:6784: connect: connection refused. If you are not running Weave Net, you may wish to suppress this warning by launching scope with the `--weave=false` option.
<probe> WARN: 2020/01/16 12:56:08.771352 Error collecting weave status, backing off 40s: Get http://127.0.0.1:6784/report: dial tcp 127.0.0.1:6784: connect: connection refused. If you are not running Weave Net, you may wish to suppress this warning by launching scope with the `--weave=false` option.

标签: kuberneteskubectl

解决方案


我不确定我是否正确解决了它,但我得到的数据可以在以下部署更改中使用。

从“weave-scope-agent”“weave-scope-app”上看到的错误日志开始,结果是红鲱鱼,在那里花了很多时间后,我回到我的集群安装以检查我是否错过了(搞砸了)安装时的东西。这样做我在集群主节点上发现我打开了所有端口,但我的工作节点没有(即正在使用限制性安全组)只是当我几天前在创建 ubuntu vm 时创建 kubernetes 集群时,我应用了允许所有规则到我要设置主节点但为工作节点选择限制性安全组规则的机器。

因此,调试测试决定在我的工作节点上应用相同的安全组规则,以匹配主节点上使用的规则。在kubernetes 集群(master + worker)上的所有节点上拥有相同的规则之后,能够让仪表板加载数据。因此,可以将此问题归结为我这边的部署时间问题。

现在,数据已正确加载到仪表板上,并在所有节点上更正了集群安全组规则。

在此处输入图像描述

由于安全规则在我的私人网络上,我将只分享我添加的一个常见示例,以供其他用户在将来遇到此类问题时寻求参考

例子 :

Ingress IPv4    TCP 30000 - 32767   0.0.0.0/0

推荐阅读