Get the App
SLTechnology News&Howtos  ›  Servers  › 

K8s practice (10): detailed explanation of monitoring tool Weave Scope

Shulou Source: shulou.com Published: 2022-06-02 22:45:28 10月04日 Update

Environment description:

Hostname operating system version ipdocker versionkubelet version configuration remarks masterCentos 7.6.1810172.27.9.131Docker 18.09.6V1.14.22C2Gmaster host node01Centos 7.6.1810172.27.9.135Docker 18.09.6V1.14.22C2Gnode node node02Centos 7.6.1810172.27.9.136Docker 18.09.6V1.14.22C2Gnode node

For more information on k8s cluster deployment, please see Centos7.6 deployment k8s (v1.14.2) cluster.

For more information on K8s learning materials, see: basic concepts, kubectl commands and data sharing.

For more information on k8s high availability cluster deployment, please see Centos7.6 deployment k8s v1.16.4 high availability cluster (active / standby mode)

A brief introduction to Weave Scope

Weave Scope automatically generates mappings for applications, allowing you to visually 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. It can also enter the container for debugging directly through the browser. The features it provides include:

Interactive topology interface graphical mode and table mode filtering function search function real-time measurement container debugging plug-in extension

Weave Scope consists of App and Probe:

Probe is responsible for collecting container and host information, and sending it to AppApp to process the information, generate the corresponding report, and display it in the form of interactive interface. 2. Weave Scope installation 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 createdserviceaccount/weave-scope createdclusterrole.rbac.authorization.k8s.io/weave-scope createdclusterrolebinding.rbac.authorization.k8s.io/weave-scope createddeployment.apps/weave-scope-app createdservice/weave-scope-app createddeployment.apps/weave-scope-cluster-agent createddaemonset.apps/weave-scope-agent created

two。 Resources view [root@master ~] # kubectl get all-n weave NAME READY STATUS RESTARTS AGEpod/weave-scope-agent-hx4t2 1 103spod/weave-scope-agent-vmbqr 1 Running 0 103spod/weave-scope-agent-vmbqr 1 Running 0 103spod/weave-scope-agent-zd8x7 1 Running 0 103spod/weave-scope-app-b99fb9585-77rld 1 Running 0 104spod/weave-scope-cluster-agent-58f5b5454-vnckm 1 Running 0 103sNAME TYPE CLUSTER-IP EXTERNAL-IP PORT (S) AGEservice/weave-scope-app ClusterIP 10.99.31.182 80/TCP 105sNAME DESIRED CURRENT READY UP-TO-DATE AVAILABLE NODE SELECTOR AGEdaemonset.apps/weave-scope-agent 3 3 3 0 104sNAME READY UP-TO-DATE AVAILABLE AGEdeployment.apps/weave-scope- App 1/1 1 1 105sdeployment.apps/weave-scope-cluster-agent 1/1 1 1 105sNAME DESIRED CURRENT READY AGEreplicaset.apps/weave-scope-app-b99fb9585 1 1 1 105sreplicaset.apps/weave -scope-cluster-agent-58f5b5454 1 1 1 105s

3. External visit

Modify service/weave-scope-app to 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-appservice/weave-scope-app edited

4. Log in

Log in to url: http://172.27.9.131:30022/

Third, use Weave Scope1. Two ways to view resources

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

Graphic formality:

The graph will also show the topological relationship between pod.

Table form:

Weave Scope monitoring objects include processes, containers, pods, hosts, etc., and monitoring items include cpu, memory, average load, and so on.

two。 View details of resource usage

Clicking on a pod will show details such as status, resource usage, process, etc.

3.pod log view

Click 'Get logs'' in the resource usage details.

4.pod description View

5. Resource scaling

Click the Controllers of deployment type to scale and view the deployment

6. Container operation

You can perform attach, exec shell, restart, paus and stop operations on the container

Enter the container and perform the df-h operation

7. Selection of display conditions

The lower left corner can be displayed according to conditions, including container type (system or application), container status (stop or running), namespace, and so on.

8. Search function

Search by container name

Search by resource usage

Tags: Containers resources clusters functions forms patterns applications search monitoring hosts information topology methods status graphics applications conditions interfaces programs types Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Apple Redmi Shulou Technology Shulou Information MySQL