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 after installing on openshift cluster not showing container and process details. #3881

Open cynosure711 opened 3 years ago

cynosure711 commented 3 years ago

Tried installing scope as mentioned in the https://cloud.weave.works/k8s/scope.yaml & also followed the additional commands mentioned in https://www.weave.works/docs/scope/latest/installing/#ose . But still, the error persists. Here are the logs for the weave-scope agent.

Logs: time="2021-08-02T09:18:52Z" level=info msg="publishing to: weave-scope-app.weave.svc.cluster.local:80"
<probe> INFO: 2021/08/02 09:18:52.738854 Basic authentication disabled
<probe> INFO: 2021/08/02 09:18:52.740880 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: 2021/08/02 09:18:52.740934 probe starting, version 1.13.2, ID 2cea6f9616d62d87
<probe> ERRO: 2021/08/02 09:18:52.741220 Error getting docker bridge ip: route ip+net: no such network interface
<probe> INFO: 2021/08/02 09:18:52.747158 kubernetes: targeting api server https://172.21.0.1:443
<probe> ERRO: 2021/08/02 09:18:52.751998 plugins: problem loading: no such file or directory
<probe> INFO: 2021/08/02 09:18:52.753349 Profiling data being exported to :4041
<probe> INFO: 2021/08/02 09:18:52.753385 go tool pprof http://:4041/debug/pprof/{profile,heap,block}
<probe> INFO: 2021/08/02 09:18:52.756441 Control connection to weave-scope-app.weave.svc.cluster.local starting
<probe> WARN: 2021/08/02 09:18:52.760840 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: 2021/08/02 09:18:53.087885 volumesnapshotdatas are not supported by this Kubernetes version
<probe> INFO: 2021/08/02 09:18:53.090218 volumesnapshots are not supported by this Kubernetes version
<probe> INFO: 2021/08/02 09:18:54.086165 Publish loop for weave-scope-app.weave.svc.cluster.local starting
<probe> WARN: 2021/08/02 09:19:02.763036 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: 2021/08/02 09:19:22.764105 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.
emveee commented 3 years ago

@cynosure711 try using this yaml instead:

apiVersion: v1
kind: List
items:
  - apiVersion: v1
    kind: Namespace
    metadata:
      name: weave
  - apiVersion: v1
    kind: ServiceAccount
    metadata:
      name: weave-scope
      labels:
        name: weave-scope
      namespace: weave
  - apiVersion: rbac.authorization.k8s.io/v1
    kind: ClusterRole
    metadata:
      labels:
        name: weave-scope
      name: weave-scope
      namespace: weave
    rules:
    - apiGroups:
      - ""
      resources:
      - pods
      - replicationcontrollers
      - services
      - nodes
      - namespaces
      verbs:
      - list
      - watch
    - apiGroups:
      - apps
      resources:
      - statefulsets
      verbs:
      - list
      - watch
    - apiGroups:
      - batch
      resources:
      - cronjobs
      - jobs
      verbs:
      - list
      - watch
    - apiGroups:
      - extensions
      resources:
      - daemonsets
      - deployments
      - replicasets
      verbs:
      - list
      - watch
  - apiVersion: rbac.authorization.k8s.io/v1
    kind: ClusterRoleBinding
    metadata:
      name: weave-scope
      labels:
        name: weave-scope
      namespace: weave
    roleRef:
      kind: ClusterRole
      name: weave-scope
      apiGroup: rbac.authorization.k8s.io
    subjects:
      - kind: ServiceAccount
        name: weave-scope
        namespace: weave
  - apiVersion: apps/v1
    kind: Deployment
    metadata:
      name: weave-scope-app
      labels:
        name: weave-scope-app
        app: weave-scope
        weave-cloud-component: scope
        weave-scope-component: app
      namespace: weave
    spec:
      replicas: 1
      revisionHistoryLimit: 2
      selector:
        matchLabels:
          name: weave-scope-app
          app: weave-scope
          weave-cloud-component: scope
          weave-scope-component: app
      template:
        metadata:
          labels:
            name: weave-scope-app
            app: weave-scope
            weave-cloud-component: scope
            weave-scope-component: app
        spec:
          containers:
            - name: app
              args:
                - '--no-probe'
                - '--weave=false'
              env: []
              image: weaveworks/scope:1.13.2
              imagePullPolicy: IfNotPresent
              ports:
                - containerPort: 4040
                  protocol: TCP
  - apiVersion: v1
    kind: Service
    metadata:
      name: weave-scope-app
      labels:
        name: weave-scope-app
        app: weave-scope
        weave-cloud-component: scope
        weave-scope-component: app
      namespace: weave
    spec:
      ports:
        - name: app
          port: 80
          protocol: TCP
          targetPort: 4040
      selector:
        name: weave-scope-app
        app: weave-scope
        weave-cloud-component: scope
        weave-scope-component: app
  - apiVersion: apps/v1
    kind: DaemonSet
    metadata:
      name: weave-scope-agent
      labels:
        name: weave-scope-agent
        app: weave-scope
        weave-cloud-component: scope
        weave-scope-component: agent
      namespace: weave
    spec:
      minReadySeconds: 5
      selector:
              matchLabels:
                name: weave-scope-agent
                app: weave-scope
                weave-cloud-component: scope
                weave-scope-component: agent
      template:
        metadata:
          labels:
            name: weave-scope-agent
            app: weave-scope
            weave-cloud-component: scope
            weave-scope-component: agent
        spec:
          containers:
            - name: scope-agent
              args:
                - '--no-app'
                - '--weave=false'
                - '--probe.docker=false'
                - '--probe.kubernetes=true'
                - '--probe.cri=true'
                - '--probe.cri.endpoint=unix:///var/run/crio/crio.sock'
                - 'weave-scope-app.weave.svc.cluster.local.:80'
              env:
                - name: KUBERNETES_NODENAME
                  valueFrom:
                    fieldRef:
                      apiVersion: v1
                      fieldPath: spec.nodeName
              image: weaveworks/scope:1.13.2
              imagePullPolicy: IfNotPresent
              securityContext:
                privileged: true
              volumeMounts:
                - name: cri-socket
                  mountPath: /var/run/crio/crio.sock
                - name: scope-plugins
                  mountPath: /var/run/scope/plugins
                - name: sys-kernel-debug
                  mountPath: /sys/kernel/debug
          dnsPolicy: ClusterFirstWithHostNet
          hostNetwork: true
          hostPID: true
          serviceAccountName: weave-scope
          tolerations:
            - effect: NoSchedule
              operator: Exists
          volumes:
            - name: cri-socket
              hostPath:
                path: /var/run/crio/crio.sock
            - name: scope-plugins
              hostPath:
                path: /var/run/scope/plugins
            - name: sys-kernel-debug
              hostPath:
                path: /sys/kernel/debug
      updateStrategy:
        rollingUpdate:
          maxUnavailable: 1
emveee commented 3 years ago

looks like there is still support issues with cri-o for container details, but the above yaml should get you more functionality.