weaveworks / scope

Monitoring, visualisation & management for Docker & Kubernetes
https://www.weave.works/oss/scope/
Apache License 2.0
5.85k stars 709 forks source link

weavescope installation on k3s not working #3805

Open milindchawre opened 4 years ago

milindchawre commented 4 years ago

BUG REPORT

What you expected to happen?

Expecting weavescope to work on k3s.

What happened?

How to reproduce it?

Versions:

$ kubectl version
Client Version: version.Info{Major:"1", Minor:"18", GitVersion:"v1.18.1", GitCommit:"7879fc12a63337efff607952a323df90cdc7a335", GitTreeState:"clean", BuildDate:"2020-04-08T17:38:50Z", GoVersion:"go1.13.9", Compiler:"gc", Platform:"windows/amd64"}
Server Version: version.Info{Major:"1", Minor:"16", GitVersion:"v1.16.3-k3s.2", GitCommit:"e7e6a3c4e9a7d80b87793612730d10a863a25980", GitTreeState:"clean", BuildDate:"2019-11-18T18:31:23Z", GoVersion:"go1.13.4", Compiler:"gc", Platform:"linux/amd64"}
milindchawre commented 4 years ago

There were couple of things missing. Thanks @bboreham for pointing out different options to override the cri endpoint. I need to make these changes to make the containers probing worked. Now I can see containers in weavescope UI.

            - '--probe.docker=false'
            - '--weave=false'
            - '--probe.cri=true'
            - '--probe.cri.endpoint=unix:///var/run/k3s/containerd/containerd.sock'

👆 These options were crucial. Disabling docker probe and enabling cri probe. In the end, pointing to your CRI endpoint. So if docker.sock is not present on your system then find socket file location for corresponding container runtime in my case its containerd.sock. Then override the CRi endpoint to point to this new socket file using above options.

milindchawre commented 4 years ago

Containers probing is working fine, but still weavescope is giving some RBAC errors.

2020-07-02T02:03:03.446759501+09:00 <probe> WARN: 2020/07/01 17:03:03.446413 Error Kubernetes reflector (namespaces), backing off 1m20s: github.com/weaveworks/scope/probe/kubernetes/client.go:279: Failed to list *v1.Namespace: namespaces is forbidden: User "system:serviceaccount:weave:weave-scope" cannot list resource "namespaces" in API group "" at the cluster scope
shreyansh96 commented 2 years ago

I am getting this error on following above steps.

Error generating CRI report: rpc error: code = Unavailable desc = all SubConns are in TransientFailure, latest connection error: connection error: desc = "transport: Error while dialing dial unix /var/run/k3s/containerd/containerd.sock: connect: no such file or directory"

In terminal, this is working. sudo crictl -r "unix:///var/run/k3s/containerd/containerd.sock" version

Version: 0.1.0 RuntimeName: containerd RuntimeVersion: v1.5.8-k3s1 RuntimeApiVersion: v1alpha2

bboreham commented 2 years ago

Can you try modifying the DaemonSet to mount that path inside the container?