weaveworks / scope

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

Weave Scope not support containerd in GKS #3880

Open draconiun opened 3 years ago

draconiun commented 3 years ago

Hi, I currently have a kubernetes cluster deployed on GCP. The version is 1.19 and as an image type I use containerd. I have deployed weave scope version 1.13 and it does not show me the containers in the panel. And it is important to be able to visualize the CPU / Memory of my pods.

image

Pool in GKS:

image

I have checked this Weave Scope repository for CRI I tried to implement it but it still doesn't work. https://github.com/weaveworks/scope/blob/master/examples/cri/ds.yaml

I will be grateful for your responses. Thank you.

bboreham commented 2 years ago

I had a go at this today. (Sorry it is a long time since you asked!)

GKE, at least when I tested it today, is running containerd, and the CRI socket can be accessed at /var/run/containerd/containerd.sock. Therefore you need to change this argument on the agent:

            - '--probe.cri.endpoint=unix:///var/run/containerd/containerd.sock'

You need to mount this path from the host into the container, like this:

          volumeMounts:
            - name: cri-socket
              mountPath: /var/run/containerd/containerd.sock
      volumes:
        - name: cri-socket
          hostPath:
            path: /var/run/containerd/containerd.sock
            type: Socket

Once I did that, Scope knew about my containers, however it thought they were all stopped. I can make a PR to fix that.

(Also that ds.yaml file is out of date in other ways; it should use --probe.kubernetes.role=host and run a separate probe for Kuebrnetes like in the k8s directory)