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

Kubernetes uses Weave Scope to monitor clusters (XVII)

2025-03-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

Creating a Kubernetes cluster and deploying containerized applications is only the first step. Once the cluster is up and running, we need to make sure that we are working together, that all the necessary components are in place and that we have sufficient resources to meet the needs 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.

I. installation

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.

The way to install Scope in a K8s cluster is simple, using the following command:

[root@master ~] # 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 createddaemonset.extensions/weave-scope-agent created

After a successful deployment, there are the following related components:

[root@master] # kubectl get pod-n weaveNAME READY STATUS RESTARTS AGEweave-scope-agent-6l4wn 1 + 1 Running 0 4m55sweave-scope-agent-dfpdl 1 + 1 Running 0 4m55sweave-scope-agent-spxb4 1 + 1 Running 0 4m55sweave-scope-app-6979884cc6-hpkdz 1 + + 1 Running 0 4m55s [root@master ~] # kubectl get svc-n weaveNAME TYPE CLUSTER-IP EXTERNAL-IP PORT (S) AGEweave-scope-app NodePort 10.103.94.215 80:30229/TCP 5m [root@master ~] # kubectl get deploy-n weaveNAME READY UP-TO-DATE AVAILABLE AGEweave-scope-app 1 1 5m13sDaemonSet weave-scope-agent The scope agent program that runs on each node of the cluster is responsible for collecting data. The Deployment weave-scope-app,scope application, which takes data from agent, displays it through Web UI and interacts with users. Service weave-scope-app, which is ClusterIP by default, has been modified to NodePort by adding the parameter k8s-service-type=NodePort to the above command. Second, use Scope

Browsers access http://YOUR_MASTER_IP:30229/ http://YOUR_MASTER_IP:30229/ scope to display all current Controller (Deployment, DaemonSet, etc.) by default.

2.1. Topology

Scope automatically builds the logical topology of applications and clusters. For example, clicking on the top Pods shows the dependencies between all Pod and Pod.

Clicking Hosts shows the relationship between the nodes, and you can view the CPU and memory usage of the resource in the Scope.

2.2, online operation

Scope also provides convenient online operation features, such as selecting a Host and clicking the > _ button to open the command line terminal of the node directly in the browser:

Click the + of Deployment to perform Scale Up operation:

You can view Pod's log:

You can attach, restart, stop containers, and troubleshoot problems directly in Scope:

2.3. Powerful search function

Scope supports keyword search and location of resources.

You can also do conditional searches, such as finding and locating Pod with MEMORY > 100m.

The Weave Scope interface is extremely friendly, the operation is simple and smooth, and more features are left for you to explore.

Official document: https://www.weave.works/docs/scope/latest/installing/#k8s

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