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

Why does Kubernetes node always restart automatically?

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

Share

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

Anyone who knows Kubernetes knows that if we want to create a Deployment deployment in Kubernetes, we will create a Pod,Pod on Node, which is a collection of containers and container-related resources in Kubernetes. Containers in Pod share IP and port resources. While Pod always runs on Node, Node can be either a physical machine or a virtual machine.

However, many developers will encounter such a problem, Kubernetes node always restarts itself, what is the cause? How to find specific problem points?

For people with relevant experience, the first reaction is to watch log.

In a production environment, you can view the log of pod using the kubectl command; however, it is not convenient to view log. The container is unavailable for both standard output and standard error log. If you use kubernetes management, you also need to go to each container to check the logs on the disk. In the actual production environment, we need to use the officially recommended elasticsearch+kibana.

Like docker, Kubernetes's support for logging is mainly on standard output. A more common approach is to use ELK to operate. First, when you create a pod, you map a directory of the host to which the pod logs. Second, run a separate log collection process (logstash,fluentd) on the host, collect the logs under this directory tree uniformly, and then send them to the remote log server.

Docker daemon-- log-driver can modify log output, such as to log collection tools such as syslog. Syslog can send logs to logstash through TCP protocol, and then combined with elasticsearch+kibana, it is a log collection system.

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