简体   繁体   English

kubectl apply表示创建了pod,但是get pods没有显示

[英]kubectl apply says pod created however get pods shows nothing

I just ran kubectl apply -f and got a response that pod/mypod got created with no error messages or anything 我只是运行了kubectl apply -f ,得到的响应是创建了pod/mypod ,没有错误消息或其他任何信息

Then I did a kubectl get pods --all-namespaces and there is no trace of mypod! 然后我做了一个kubectl get pods --all-namespaces ,没有mypod的痕迹​​!

How can I troubleshoot the pod creation? 如何解决吊舱创建问题? Where would these logs be, if any? 这些日志在哪里(如果有)?

Thanks. 谢谢。

You can try to look at the logs from each of the Kubernetes components. 您可以尝试查看来自每个Kubernetes组件的日志。 You can start with the kube-apiserver to see what happened after the request was received. 您可以从kube-apiserver开始查看收到请求后发生了什么。 Then the kube-scheduler , and so forth. 然后是kube-scheduler ,依此类推。

This is likely due to Kubernetes not being able to find resources to run your pod. 这可能是由于Kubernetes无法找到资源来运行您的Pod。 Are your nodes healthy? 您的节点健康吗? You can check them: 您可以检查它们:

$ kubectl get nodes

You can also look at the logs of your kubelet on your nodes. 您还可以在节点上查看kubelet的日志。

Notice that when you get the message pod/mypod got created it means that the objects were created in the cluster's state store ( etcd ) 请注意,当您获得消息pod/mypod got created这意味着对象是在集群的状态存储( etcd )中创建的

kubectl get event -n name_space

is a good start to see what went wrong which showed me Volume mount issue 是一个很好的开始,看看出了什么问题向我显示了卷装入问题

An even better command to call is: 一个更好的调用命令是:

journalctl -u kubelet

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM