我在 Virtual Box 上的本地机器上创建了一个 Minikube 实例。我有几个复制控制器,它们都指定了资源限制。首先,我为每个复制控制器 A 和 B 创建了一个实例。然后我将 rc B 的复制计数增加到 6。一旦扩展,我可以看到 rc A 创建的 Pod 被 Kubernetes 杀死。我只能在 kubeclt 日志中看到的日志是
/opt/app-server/bin/app-server.sh: line 159: 28 Killed $JAVA_HOME/bin/java -server $JVM_OPTS $XDEBUG $SERVER_OPTS -Djava.endorsed.dirs=$SERVER_ENDORSED -classpath $SERVER_CLASSPATH org.adroitlogic.appserver.AppServer
我不知道是什么导致了这个吊舱被驱逐。我猜这与 Pod 的资源分配和 VM 上的有限资源有关。但我需要确认这一点。我在哪里可以找到与该 pod 被驱逐原因相关的日志?我在 journalctl -u localkube 中搜索
Jan 09 11:00:55 minikube localkube[3421]: I0109 11:00:55.136114 3421 docker_manager.go:2524] checking backoff for container "ipsweb" in pod "ipsweb-m3234"
Jan 09 11:00:55 minikube localkube[3421]: I0109 11:00:55.136525 3421 docker_manager.go:2538] Back-off 5m0s restarting failed container=ipsweb pod=ipsweb-m3234_default(e6961157-d650-11e6-8bee-080027bc9720)
Jan 09 11:00:55 minikube localkube[3421]: E0109 11:00:55.136571 3421 pod_workers.go:184] Error syncing pod e6961157-d650-11e6-8bee-080027bc9720, skipping: failed to "StartContainer" for "ipsweb" with CrashLoopBackOff: "Back-off 5m0s restarting failed container=ipsweb pod=ipsweb-m3234_default(e6961157-d650-11e6-8bee-080027bc9720)"
kubectl describe pod 提供以下事件
Events:
FirstSeen LastSeen Count From SubobjectPath Type Reason Message
--------- -------- ----- ---- ------------- -------- ------ -------
1h 1h 1 {kubelet minikube} spec.containers{ipsweb} Normal Started Started container with docker id 2ca5ccaa11a1
1h 1h 1 {kubelet minikube} spec.containers{ipsweb} Normal Created Created container with docker id 2ca5ccaa11a1; Security:[seccomp=unconfined]
1h 1h 1 {kubelet minikube} spec.containers{ipsweb} Normal Started Started container with docker id 86d4bdfa014e
1h 1h 1 {kubelet minikube} spec.containers{ipsweb} Normal Created Created container with docker id 86d4bdfa014e; Security:[seccomp=unconfined]
50m 50m 1 {kubelet minikube} spec.containers{ipsweb} Normal Started Started container with docker id a570e4f59e96
50m 50m 1 {kubelet minikube} spec.containers{ipsweb} Normal Created Created container with docker id a570e4f59e96; Security:[seccomp=unconfined]
1h 49m 2 {kubelet minikube} Warning FailedSync Error syncing pod, skipping: failed to "StartContainer" for "ipsweb" with CrashLoopBackOff: "Back-off 10s restarting failed container=ipsweb pod=ipsweb-m3234_default(e6961157-d650-11e6-8bee-080027bc9720)"
49m 49m 1 {kubelet minikube} spec.containers{ipsweb} Normal Started Started container with docker id b91cc20a8bb3
49m 49m 1 {kubelet minikube} spec.containers{ipsweb} Normal Created Created container with docker id b91cc20a8bb3; Security:[seccomp=unconfined]
1h 48m 4 {kubelet minikube} Warning FailedSync Error syncing pod, skipping: failed to "StartContainer" for "ipsweb" with CrashLoopBackOff: "Back-off 20s restarting failed container=ipsweb pod=ipsweb-m3234_default(e6961157-d650-11e6-8bee-080027bc9720)"
48m 48m 1 {kubelet minikube} spec.containers{ipsweb} Normal Started Started container with docker id cf24faa31718
48m 48m 1 {kubelet minikube} spec.containers{ipsweb} Normal Created Created container with docker id cf24faa31718; Security:[seccomp=unconfined]
1h 46m 7 {kubelet minikube} Warning FailedSync Error syncing pod, skipping: failed to "StartContainer" for "ipsweb" with CrashLoopBackOff: "Back-off 40s restarting failed container=ipsweb pod=ipsweb-m3234_default(e6961157-d650-11e6-8bee-080027bc9720)"
但以上都没有给我一个关于原因和为什么会发生的提示。有什么建议吗?