Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Detailed explanation of Weave Scope, the monitoring weapon of K8s

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

Preface

Creating a kubernetes cluster and deploying containerized applications is only the first step. Once the cluster is running, we need to ensure that it is running properly, that all necessary components are in place and perform their duties, and that there are sufficient resources to meet the requirements of the application. Kubernetes is a complex system, and the operation and maintenance team needs a set of tools to help them know the real-time status of the cluster and provide timely and accurate data support for troubleshooting.

Common monitoring schemes for kubernetes:

First, brief introduction to Weave scope

Weave Scope is a visual monitoring tool for Docker and kubernetes. Scope provides a complete view of top-down cluster infrastructure and applications, and users can easily monitor and diagnose problems with distributed containerized applications in real time.

Features of Weave Scope:

View graph or table mode in topology mapping Scope flexible filtering powerful search real-time application and container metrics troubleshooting and management of containers using plug-in API to produce custom metrics

For more information on the functions, please refer to the official document: https://www.weave.works/docs/scope/latest/features/

Weave Sccope consists of App and Agent:

Agent is responsible for collecting container and host information and sending it to AppApp to process the information, generate corresponding reports, and display them in an interactive form. Second, Weave scope installation

Refer to the official document: https://www.weave.works/docs/scope/latest/installing/#k8s

Kubernetes cluster environment:

Master:172.16.1.30

Node01: 172.16.1.31

Node02:172.16.1.32

1, install Weave scope

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

2, resource view (make sure the resource is running properly)

Note: Service weave-scope-app defaults to type ClusterIP, and the parameter k8s-service-type=NodePort has been added to the command to perform the installation to change it to NodePort.

3. Log in to the web interface:

The browser accesses url: http://172.16.1.30:32688/ and displays all current Controller (Deployment,Daemonset, etc.) by default.

Third, the use of Weave Scope 1, two ways to view resources: * *

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

1) graphic method:

The graph also shows the topological relationship between pod:

2) tabular method:

Table way can be more clear, detailed view of all kinds of information of pod (clear at a glance)

Weave scope monitoring objects include processes, containers, pods, hosts, and so on.

Monitoring items include cpu, memory, average load and so on.

2. View the details of resource usage:

Clicking on a pod will show the status, resource usage, process and other details.

3Query Pod log view:

Click the pod you want to view, and click "Get logs" in the resource usage details.

What is viewed here is the log of the nginx service. When a user accesses the web service, all kinds of information will be output to the screen in real time.

4. View the details of pod

Click "describe" in the resource details of pod

5. Expansion and reduction of resources

Click Deployment or Controller of Daemonset type to scale and view resources.

Capacity expansion:

Scale down:

6, container operation

In the interface displayed by the container on the right, you can perform attch,exec shell,restart,paus and stop operations on the container, respectively.

Clicking to enter the terminal is the same as executing the exec command on the command line to enter the container, which is very convenient for managing and manipulating the container.

7. Selection of display conditions

The lower left corner can be displayed according to conditions: the type of container (system or application), the status of the container (stop, run, stop and run), the container is shown or hidden, and you can choose to view the container under that namespace.

8, powerful search function

Scope supports keyword search and location of resources

1) search by container name:

For example, check containers with CPU usage > 1%:

2) search by resource usage:

For example, check the pod with Memory usage > 100m:

Summary:

Weave scope works on port 4040, does not require the creation of administrator accounts, and has no restrictions on users, which is very dangerous. It is mainly used to visually display calls between containers, and can also be used for interactive operations with containers and hosts.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report