k8s practice: detailed explanation of the monitoring tool Weave Scope

Environmental description:

host name Operating system version ip docker version kubelet version To configure Remarks
master Centos 7.6.1810 Docker 18.09.6 V1.14.2 2C2G master host
node01 Centos 7.6.1810 Docker 18.09.6 V1.14.2 2C2G Node node
node02 Centos 7.6.1810 Docker 18.09.6 V1.14.2 2C2G Node node

I. Introduction to Weave Scope

Weave Scope automatically generates application mappings, enabling you to intuitively understand, monitor, and control applications based on containerized microservices.

Weave Scope can monitor the status, usage, application topology and scale of a series of resources in the kubernetes cluster, and can also directly enter the container through the browser for internal debugging. Its functions include:

  • Interactive topology interface
  • Graphic mode and table mode
  • Filtering function
  • Search function
  • Real-time measurement
  • Container troubleshooting
  • Plug-in extension

Weave Scope consists of App and Probe:

  • Probe is responsible for collecting container and host information and sending it to App
  • App is responsible for processing these information, generating corresponding reports and presenting them in the form of an interactive interface

2. Install Weave Scope

1. Install Weave Scopea

[root@master ~]# kubectl apply -f "https://cloud.weave.works/k8s/scope.yaml?k8s-version=$(kubectl version | base64 | tr -d '\n')"
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

2. View resources

[root@master ~]# kubectl get all -n weave 
NAME                                            READY   STATUS    RESTARTS   AGE
pod/weave-scope-agent-hx4t2                     1/1     Running   0          103s
pod/weave-scope-agent-vmbqr                     1/1     Running   0          103s
pod/weave-scope-agent-zd8x7                     1/1     Running   0          103s
pod/weave-scope-app-b99fb9585-77rld             1/1     Running   0          104s
pod/weave-scope-cluster-agent-58f5b5454-vnckm   1/1     Running   0          103s

NAME                      TYPE        CLUSTER-IP     EXTERNAL-IP   PORT(S)   AGE
service/weave-scope-app   ClusterIP   <none>        80/TCP    105s

daemonset.apps/weave-scope-agent   3         3         3       3            0           <none>          104s

NAME                                        READY   UP-TO-DATE   AVAILABLE   AGE
deployment.apps/weave-scope-app             1/1     1            1           105s
deployment.apps/weave-scope-cluster-agent   1/1     1            1           105s

NAME                                                  DESIRED   CURRENT   READY   AGE
replicaset.apps/weave-scope-app-b99fb9585             1         1         1       105s
replicaset.apps/weave-scope-cluster-agent-58f5b5454   1         1         1       105s

3. External visit

Modify service / weave scope app, change its mode from ClusterIP to NodePort, so that it can be accessed directly through NodeIP:Port

[root@master ~]# kubectl edit service -n weave weave-scope-app
service/weave-scope-app edited

4. login

Login url:

III. use Weave Scope

1. Two ways to view resources

Take pod as an example to view resources. Resources can be presented in two forms:

Figure formality:

The graphic mode also shows the topological relationship between pod s


The monitoring objects of Weave Scope include processes, containers, pods, hosts, etc., and the monitoring items include cpu, memory, average load, etc.

2. View resource usage details

Click a pod to display details of status, resource usage, process, etc

3.pod log view

Click 'Get logs' in resource usage details

4.pod description view

5. Resource expansion

Click Controllers of deployment type to expand and view the deployment

6. Container operation

You can attach, exec shell, restart, paus, and stop containers

Enter the container and perform df-h operation

7. Selection of exhibition conditions

The lower left corner can be displayed according to conditions, including container type (system or application), container state (stop or run), namespace, etc.

8. Search function

Search by container name

Search by resource usage



Tags: Linux Docker CentOS kubelet Kubernetes

Posted on Sat, 02 Nov 2019 23:56:41 -0700 by Stoneguard