AKS icon indicating copy to clipboard operation
AKS copied to clipboard

Pods get stucked in status 'ContainerCreating'

Open mirwais27 opened this issue 8 years ago • 14 comments

Two days a ago we created a new AKS cluster with Kubernetes 1.9.6 and internal VNET in WestEurope. We often now have the case that pods get sucked in Status 'ContainerCreating'. Any idea?

mirwais27 avatar May 15 '18 17:05 mirwais27

You need to check the logs of the container itself, could be multiple reasons for not being able to start the container properly

c-mccutcheon avatar May 15 '18 18:05 c-mccutcheon

There are no logs for pods present. What I could see were only two 'Events' in the Kubernetes Dashboard for Pod:

  • 'Failed create pod sandbox.'
  • 'Pod sandbox changed, it will be killed and re-created.'

But the the pod was never recreated. I deleted the pod after 4 hours.

mirwais27 avatar May 15 '18 20:05 mirwais27

We have the same problem:

kubectl run nginx --image=nginx --port=80
kubectl expose deployment nginx --type=LoadBalancer
kubectl describe pod nginx
...
Events:
  Type     Reason                  Age   From                               Message
  ----     ------                  ----  ----                               -------
  Normal   Scheduled               10m   default-scheduler                  Successfully assigned nginx-7587c6fdb6-kc52r to aks-agentpool-88888888-8
  Normal   SuccessfulMountVolume   9m    kubelet, aks-agentpool-88888888-8  MountVolume.SetUp succeeded for volume "default-token-8nnn4"
  Warning  FailedCreatePodSandBox  9m    kubelet, aks-agentpool-88888888-8  Failed create pod sandbox.
  Warning  FailedSync              5m    kubelet, aks-agentpool-88888888-8  error determining status: rpc error: code = DeadlineExceeded desc = context deadline exceeded

xennialex avatar May 17 '18 09:05 xennialex

@AlexanderSchoenfeld @mirwais27 are all pods stuck creating, or just an occasional pod.

If you could check kubelet logs on the stuck node for any issues allocating Pod ips, that may be the source of trouble.

slack avatar May 17 '18 20:05 slack

Hello, We also have massive problems with this:

kubectl describe pod jenkins-slave
[...]
Events:
  Type     Reason                  Age                From                               Message
  ----     ------                  ----               ----                               -------
  Normal   Scheduled               6m                 default-scheduler                  Successfully assigned jenkins-slave-hcr7b-rnzx8 to aks-agentpool-17149307-0
  Normal   SuccessfulMountVolume   6m                 kubelet, aks-agentpool-17149307-0  MountVolume.SetUp succeeded for volume "workspace-volume"
  Normal   SuccessfulMountVolume   6m                 kubelet, aks-agentpool-17149307-0  MountVolume.SetUp succeeded for volume "volume-1"
  Normal   SuccessfulMountVolume   6m                 kubelet, aks-agentpool-17149307-0  MountVolume.SetUp succeeded for volume "volume-0"
  Normal   SuccessfulMountVolume   6m                 kubelet, aks-agentpool-17149307-0  MountVolume.SetUp succeeded for volume "volume-3"
  Normal   SuccessfulMountVolume   6m                 kubelet, aks-agentpool-17149307-0  MountVolume.SetUp succeeded for volume "volume-2"
  Normal   SuccessfulMountVolume   6m                 kubelet, aks-agentpool-17149307-0  MountVolume.SetUp succeeded for volume "default-token-gs645"
  Normal   SandboxChanged          5m (x9 over 5m)    kubelet, aks-agentpool-17149307-0  Pod sandbox changed, it will be killed and re-created.
  Warning  FailedCreatePodSandBox  1m (x145 over 5m)  kubelet, aks-agentpool-17149307-0  Failed create pod sandbox.

Unfortunately we do not have the possibility to check the kubelet logs to get more information.

One additional info: After a few minutes, it heals itself.

HoelscherD avatar May 18 '18 14:05 HoelscherD

Same problem here, what should we do to solve the "Failed create pod sandbox." error? How to get more log information?

peterwy01 avatar Jun 19 '18 15:06 peterwy01

We also encountered this problem. All of our clusters were provisioned before GA. Anyone experienced the problem with a post-GA cluster?

angrox avatar Jun 27 '18 06:06 angrox

There can be many reasons lead to this. Can you run: kubectl describe

with pod name being the pod stuck at ContainerCreating stage. Error message will be printed at the bottom of the description of the pod.

qike-ms avatar Jul 14 '18 06:07 qike-ms

We were hit with several of these errors today. Restarting the node seems to make the problem go away but that isn't a solution. Further errors/warnings:

"[microservice]" network: runtime error: invalid memory address or nil pointer dereference; goroutine 1 [running]: github.com/Azure/azure-container-networking/cni.(*Plugin).Execute.func1(0xc42019fec0) /go/src/github.com/Azure/azure-container-networking/cni/plugin.go:94 +0xbc panic(0x69b3c0, 0x83ed90) /usr/local/go/src/runtime/panic.go:489 +0x2cf

strtdusty avatar Sep 13 '18 15:09 strtdusty

Same issue over here, zie attached file for describe of the pod. It is a new cluster with vmss & calico enabled. I depoyed the cluster with the flag no ssh key and with vmss instances you cannot reset the password/ key anymore in the portal. So no option right now to view the kubelet log of that specific node.

describe.txt

bramvdklinkenberg avatar Mar 29 '19 08:03 bramvdklinkenberg

You can still add an ssh key to a node the way you would for a normal VM, it won't survive vm redeploy (eg some upgrades, scale events). https://docs.microsoft.com/en-us/azure/virtual-machines/extensions/vmaccess or https://docs.microsoft.com/en-us/azure/virtual-machines/linux/login-using-aad (latter is covered in preview warnings; worst case you can never login and have to redeploy the vm; maybe ok if vm is fungible).

ellieayla avatar Mar 29 '19 14:03 ellieayla

Closing as the original issue is stale

jnoller avatar Apr 03 '19 21:04 jnoller

still an issue for me with kubernetes version 1.13.5 :/

rivetmichael avatar Aug 27 '19 13:08 rivetmichael

Still an issue for me with EKS version v1.14.9-eks-502bfb...

3uzbcqje avatar Apr 02 '20 16:04 3uzbcqje