In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-29 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article shows you how to use Kubernetes monitoring, the content is concise and easy to understand, can definitely brighten your eyes, through the detailed introduction of this article, I hope you can get something.
What is Kubernetes?
Kubernetes is a portable, extensible, open source platform for managing containerized workloads and services that facilitate declarative configuration and automation. Kubernetes has a large and fast-growing ecosystem. Kubernetes's services, support, and tools are widely available. Kubernetes was open source by Google in 2014 and is based on Google's own experience of running containers in production. It is now managed by Cloud Native Computing Foundation (CNCF), and Kubernetes is the most popular container management tool in large enterprises, which was used by 83% of respondents in a recent CNCF survey. The word Kubernetes comes from the Greek word for "helmsman" or "pilot".
How Kubernetes becomes the Standard
To understand the value of Kubernetes, we must first review how enterprises have deployed applications over the years. In traditional deployments, applications run on physical servers, which can easily lead to resource allocation problems. For example, if you run multiple applications on a single server, one application may consume most of its resources, affecting the performance of other applications. One solution is to run each application on a separate physical server, but this approach is too expensive and leads to underutilization of resources. The next step is virtualization, which addresses the limitations of physical servers by running multiple virtual machines (VM) on top of the CPU of the physical server, each running its own components, including the operating system (OS) and applications. VM provides many benefits, including improved utilization of server resources, reduced hardware costs, simplified application upgrades, and other enhancements to scalability. Virtual machines have their disadvantages. For example, each VM with its own OS image means additional memory and storage requirements. This increases the complexity of the software development lifecycle and limits the portability of applications between public and private clouds and data centers.
Benefits of containers
A container is similar to a virtual machine in that it has its own software, libraries, memory, configuration files, and so on. But containers have many advantages most notably the ability to share operating systems (each VM has its own independent OS image) making them relatively lightweight fast and efficient. The benefits of containers include:
Increased efficiency: with containers, applications can be deployed, patched, or extended more quickly.
Better portability: it is easy to deploy applications running in containers to multiple operating systems and hardware platforms.
Consistent operation: container-based applications can run in the same way no matter where they are deployed.
Clearer observability: in addition to providing operating system-level metrics, they also show the health of the application.
Benefit from application development: containers support agile and DevOps development (to speed up development, testing, and production cycles).
The effect of Kubernetes on containers
Since containers are more efficient, fast, and lightweight than traditional virtualization, it is not surprising that enterprises with large application deployments can deploy multiple containers into one or more container clusters. However, because large distributed containerized applications are often difficult to coordinate, the environment faces a series of challenges. Kubernetes is an open source container orchestration tool that automates the deployment, extension, and operation of application containers across host clusters. The most popular container scheduling tool, Kubernetes, is used most frequently in conjunction with the leading containerization platform, Docker. But Kubernetes also supports other container systems that conform to the container image format and runtime standards set by the Open Container Initiative (OCI), an open source technology community overseen by Linux Foundation. Alternatives to Kubernetes include Docker Swarm and Apache Mesos.
How Kubernetes works
Kubernetes provides a framework to run resilient distributed systems. After deployment, you will have a Kubernetes cluster-a set of machines or nodes running containerized applications managed by Kubernees. The cluster has at least one:
Secondary node that hosts the Pod. (each pod is a set of one or more containers.)
The master node, which is used to manage the worker nodes and Pod in the cluster.
For the Kubernetes cluster to work, you need multiple main components, node components, and add-ons. We will discuss these components in the following section on Kubernetes monitoring.
Benefits of Kubernetes
Although Kubernetes has many advantages, its four main advantages include speed, scalability, infrastructure abstraction, and efficiency. "Kubernetes: Up and Running" (https://www.oreilly.com/library/view/kubernetes-up-and/9781491935668/) is written by Joe Beda,Brendan Burns and Kelsey Hightower.
Speed: Kubernetes provides tools that you need to release features quickly every hour or every day while maintaining high availability services.
Extensions: Kubernetes's configuration management tools make it easier to extend the containers that make up distributed applications and the clusters that support those containers.
Infrastructure abstraction: running distributed applications between multiple public clouds or in a hybrid cloud environment is challenging. Kubernetes has many plug-ins that simplify these tasks.
Efficiency: Kubernetes helps improve efficiency and cost management by automatically allocating applications across the cluster and ensuring higher utilization.
What is involved in Kubernetes monitoring?
What is Kubernetes monitoring? What does it involve? Let's start with what needs to be monitored in Kubernetes and why. Kubernetes can greatly simplify in-container and cross-cloud application deployment, but it brings its own complexity. As Google pointed out in its site Reliability Engineering Guide (https://landing.google.com/sre/sre-book/chapters/practical-alerting/)), monitoring large, complex systems faces two main challenges: the large number of components being monitored and the need to maintain a "reasonably low maintenance workload" for operators. These requirements require a monitoring system that not only issues alerts about advanced service targets, but also examines individual components. In order to extend the application and provide reliable services, you need to have an in-depth understanding of how the application behaves at deployment time. To monitor the performance of applications in a Kubernetes cluster, it is important to check the performance of containers, containers, and services, as well as the characteristics of the entire cluster. By providing information about application resource usage, Kubernetes allows you to evaluate application performance to detect and eliminate bottlenecks.
Kubernetes component: content to be monitored
The Kubernetes cluster architecture consists of a master node and a separate Kubernetes node. The main components include:
Etcd
Stores configuration information that can be used by each node in the cluster.
API server (kube-apiserver)
Validate and configure data for API objects such as Pod, services, replication controllers, etc.
Scheduler (kube-scheduler)
Manage workload utilization and assign pod to available nodes.
Kube-controller-manager
A daemon that collects information and sends it to the API server.
Cloud-controller-manager
Run the controller that interacts with the cloud provider. The Kubernotes node components include:
Container runtime (for example, Docker)
Kubelet: the primary node agent that monitors the pod specification through the API server; it also registers a node in the Kubernetes cluster and reports events, pod status, and resource utilization.
Kubernetes Agent (kube-proxy): an agent service that runs on each node to help make the service available to external hosts.
Kubernetes add-on
You have many Kubernetes add-ons to choose from, but here are some popular options. You can find a more comprehensive list of add-ins here.
Kubernetes dashboard: a Web-based UI of a Kubernetes cluster that can be used to monitor the health of workloads (deployments, pods, replica sets, etc.) and view aggregated CPU and memory usage metrics on all nodes. It has the functions of configuring, discovering, load balancing, storing, monitoring, and creating and managing workloads.
Cluster DNS: a DNS server that provides DNS records for the Kubernetes service.
ACI: provides integrated container network and network security through Cisco Application Centric Infrastructure (ACI) (https://github.com/noironetworks/aci-containers)).
Cluster-level logging: use the search / browse UI to save container logs to a central log store.
Kubernetes Monitoring Challen
Migrating traditional monolithic applications to Kubernetes is time-consuming and error-prone. However, companies are willing to take risks to achieve greater agility, innovation, cost advantage, scalability, and business growth in the cloud. But companies that migrate monolithic applications to microservices lack visibility into the Kubernetes environment. This makes it impossible to view the interaction of each microservice in real time.
Kubernetes is very complicated.
Dave Snyder, an integration engineer, points out that another reason Kubernetes is difficult to monitor is that the Kubernetes cluster is much more complex, with multiple servers and private and public cloud services. When the problem starts, there will be a lot of logs and other data and components to troubleshoot. The overall environment may require several log searches, but the Kubernetes environment may contain one or more logs about the problem being troubleshooting that requires multiple microservices.
Using APM for Kubernetes Monitoring
Kubernetes monitoring using application performance monitoring solutions enables organizations to view application and business performance, including a deeper understanding of containerized applications, Kubernetes clustering, Docker containers, and infrastructure metrics. This visibility allows enterprises to enhance container-level metrics and gain visibility on CPU, packet, memory, and network utilization. Users can then benchmark these metrics and associated health rules as well as their resource usage statistics on the container application monitored by APM. By comparing APM metrics with underlying container and server metrics, companies can quickly understand the performance of their containerized applications and potential obstacles in their infrastructure. For example, specific metrics can help identify bandwidth-consuming application and container-level network errors.
Full-stack visibility in Kubernetes environment
Visibility enables organizations to monitor containerized applications running in Kubernetes Pod and to identify container problems that hinder application performance. A comprehensive Kubernetes monitoring solution provides end-to-end visibility into every component of an organization's application (infrastructure, Kubernetes platform, container, and every microservice and end-user device).
What are Kubernetes monitoring best practices?
Kubernetes provides operational flow and complexity, many of which involve application performance monitoring. As you extend the use of Kubernetes to production environments, these challenges become even more important. By creating levels of abstraction such as Pod and Service, Kubernetes frees you from having to worry about where applications run or whether they have enough resources to run efficiently. But to ensure optimal performance, you must still monitor applications, the containers in which they are running, and even the Kubernetes itself. Here are some important Kubernetes monitoring best practices:
Use Kubernetes DaemonSets
When running Kubernetes, you may want to run a single pod on all nodes, for example, to collect logs when running a monitoring process such as the AppDynamics agent or the open source data collector Fluentd. DaemonSet is an Kubernetes workload object that ensures that a specific Pod runs on each node or some subset of nodes in the cluster. By using DaemonSet, you tell Kubernetes to ensure that there is an instance of pod on each node.
Tags and Labels Matter are important.
Using Kubernetes to manage container orchestration, tags become critical for monitoring, because tags are the only way you interact with containers and containers. To make metrics as useful as possible, you must use logical and consistent scheme definition labels.
Know the indicators to be monitored
According to Kubernetes.io, several key types of Kubernetes metrics should be closely tracked:
Run Pod and its deployment
Resource metrics, including CPU, memory usage and disk ID O
Container original index
Application index
Using service discovery
Because Kubernetes schedules the application dynamically according to the scheduling policy, you may not know where the application is running, but you must monitor it anyway. You will want to use a monitoring system with service discovery capabilities that automatically adapts metrics collection to mobile containers. This approach allows you to continuously monitor your application without interruption.
Kubernetes monitoring tool
Kubernetes has many benefits, but it also adds complexity. For example, its ability to distribute containerized applications across multiple data centers or even different cloud providers requires a comprehensive monitoring solution to collect and aggregate metrics across multiple different sources. Continuous monitoring of the health of systems and applications is critical, and many free commercial solutions provide real-time monitoring of Kubernetes clusters and their hosted applications. Here are several open source tools for Kubernetes monitoring:
Prometheus
This popular monitoring and alerting tool for Kubernetes and Docker provides detailed, feasible indicators and analysis. Prometheus was developed by SoundCloud and donated to the CNCF community and is specifically designed to monitor applications and micro-services running in containers. However, Prometheus is not a dashboard and is usually used in conjunction with Grafana (see below) to visualize data.
Grafana
Grafana is an open source platform for analysis and measurement visualization, including four dashboards: cluster, node, Pod/ container and deployment. Kubernetes administrators typically install Grafana and leverage Prometheus data sources to create informative dashboards.
Jaeger
Jaeger is a tracking system for troubleshooting and monitoring transactions in complex distributed systems. It solves the software problems in distributed context propagation, distributed transaction monitoring, waiting time optimization and so on.
Dashboard
The Kubernetes dashboard is a Web UI plug-in to the Kubernetes cluster that allows you to monitor the health of your workload.
Kubewatch
This add-on monitors changes in Kubernetes pod and sends notifications to Slack Channel. Kubewatch is written in Golang and uses the Kubernetes client library to interact with the Kubernetes API server and the Slack client library to interact with Slack.
Weave Scope
Weave Scope is a visualization and monitoring tool for Kubernetes and Docker that provides a top-down view of applications and the entire infrastructure. Developed by Weaveworks, Weave Scope generates mappings of processes, containers and hosts in the Kubernetes cluster. Its graphical user interface also allows you to manage and run diagnostic commands on the container.
EFK Stack
EFK Stack is actually a mixture of three tools that work well together: Elasticsearch,Fluentd and Kibana. Fluentd is a data collector that removes logs from the Pod running on the Kubernetes cluster node. It routes these logs to the Elasticsearch search engine, which extracts the data and stores it in a central repository. Kibana is a data visualization plug-in for Elasticsearch and a UI for EFK Stack that allows users to visualize collected logs and metrics and create custom dashboards.
InfluxDB
InfluxData's InfluxDB is a high-performance storage of time series data. It is built for monitoring large amounts of storage of records and provides horizontal scalability and high availability through clustering. InfluxDB is a good solution for long-term storage of Kubernetes monitoring data for historical or modeling purposes.
The above content is how to use Kubernetes monitoring, have you learned the knowledge or skills? If you want to learn more skills or enrich your knowledge reserve, you are welcome to follow the industry information channel.
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.