In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces "the basic troubleshooting method of K8s". In the daily operation, I believe that many people have doubts about the basic troubleshooting method of K8s. The editor consulted all kinds of materials and sorted out the simple and easy-to-use operation methods. I hope it will be helpful for you to answer the doubts about the basic troubleshooting method of K8s! Next, please follow the editor to study!
K8s basic troubleshooting
Kubectl is the most important tool in the process of troubleshooting and is usually the starting point for locating errors. Some commonly used commands are also listed here, which are often used in subsequent troubleshooting processes.
Troubleshooting Overview View Pod status and run node kubectl get pods-o widekubectl-n kube-system get pods-o wide View Pod event kubectl describe pod View Node status kubectl get nodeskubectl describe node kube-apiserver log PODNAME=$ (kubectl-n kube-system get pod-l component=kube-apiserver-o jsonpath=' {.items [0] .metadata.name}') kubectl-n kube-system logs $PODNAME-tail 10 operations assume that the control plane runs as Kubernetes static Pod. If kube-apiserver is managed with systemd, you need to log in to the master node and use journalctl-u kube-apiserver to view its logs. Kube-controller-manager log PODNAME=$ (kubectl-n kube-system get pod-l component=kube-controller-manager-o jsonpath=' {.items [0] .metadata.name}') kubectl-n kube-system logs $PODNAME-- the above command operation assumes that the control plane runs as Kubernetes static Pod. If kube-controller-manager is managed with systemd, you need to log in to the master node and use journalctl-u kube-controller-manager to view its logs. Kube-scheduler log PODNAME=$ (kubectl-n kube-system get pod-l component=kube-scheduler-o jsonpath=' {.items [0] .metadata.name}') kubectl-n kube-system logs $PODNAME-- the above command operation assumes that the control plane runs as Kubernetes static Pod. If kube-scheduler is managed with systemd, you need to log in to the master node and use journalctl-u kube-scheduler to view its logs. Kube-dns log
Kube-dns is usually deployed as Addon, and each Pod contains three containers. The most important thing is the log of the kubedns container:
PODNAME=$ (kubectl-n kube-system get pod-l k8s-app=kube-dns-o jsonpath=' {.items [0] .metadata.name}') kubectl-n kube-system logs $PODNAME-c kubednsKubelet log
Kubelet is usually managed by systemd. To view the Kubelet log, you need to log in to Node by SSH first. It is recommended to use kubectl-node-shell instead of assigning a public network IP address to each node. For example:
[root@localhost ~] # cat KubectlMutham NodeShield nsenter-$ [- z "$1"]; then echo "Please specify node name" exit 1fiNODE = "$1" IMAGE= "alpine" POD= "nsenter-$ (env LC_CTYPE=C tr-dc a-z0-9)
< /dev/urandom | head -c 6)"NAMESPACE=""# Check the nodekubectl get node "$NODE" >/ dev/null | | exit 1 overrides = "$(cat)
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.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.