Pods fail to deploy. Error: NetworkPlugin cni failed to set up pod. (v 1.10.3)
What happened: At random, both our clusters (nonprod and prod) have at some point failed to provision new pods upon applying a deployment. We've witnessed this issue 3 or 4 times now across 2 clusters.
The pods concerned were stuck in a 'Container Creating' state, and upon inspecting the pods concerned, the events showed this error:
Warning FailedCreatePodSandBox 3m kubelet, aks-agentpool-39249944-0 Failed create pod sandbox: rpc error: code = Unknown desc = NetworkPlugin cni failed to set up pod "appName-74c844749c-95z6c_int" network: runtime error: invalid memory address or nil pointer dereference; goroutine 1 [running]: github.com/Azure/azure-container-networking/cni.(*Plugin).Execute.func1(0xc4201c7ec0) /go/src/github.com/Azure/azure-container-networking/cni/plugin.go:94 +0xbc panic(0x69b3c0, 0x83ed90)
This error (stack omitted) was repeated over and over.
Once the error starts occurring, we seem unable to resolve it without resorting to restarting the node. We are running fairly well spec'd single nodes at present. Thus full down-time follows.
What you expected to happen:
I expect for the existing pods to be terminated, and for the new pods to be created in their place.
How to reproduce it (as minimally and precisely as possible):
Unable to reproduce.
I've tried pushing numerous deployments with increasing replica counts to exhaust the IP ranges as former posts implied an IP provisioning issue. At approx 75 pods my cluster ran out of CPU allowance before I could reach the IP limit.
Anything else we need to know?:
I'm using ASK version v1.10.3 I deployed it using ACS-Engine ARM template version: "2018-03-31" I have RBAC enabled. I've not witnessed this issues on my three non-RBAC enabled clusters so maybe worth mentioning I have maxpods set to 100. The issue occurring does not correlated with pods deployment. I cannot form any relationship here. In Azure, I can see that 101 IP addresses are reserved in my VNET. (1 for the node, 100 for the pods) I'm using a custom VNet and Subnet which I setup myself. My subnet has an address range providing 65430 IP Addresses
Environment:
- Kubernetes version: v1.10.3
- Size of cluster: 1.
- General description of workloads in the cluster: microservices
Allow me to extend the information I've provided in case it is useful.
The issue has just arisen again on one of my clusters.
We deployed successfully into the first namespace; but then seconds after the CNI error occurred when deploying into the second namespace.
We then progressed the deployment into the 2nd cluster and this deployed successfully.
Any repeated attempts to redeploy into the first cluster now fail. Alas I need to reboot this one.
Here are a few extracts of information concerning the status of things within;
Failed POD Details
Status:

Events:

Node Details
System Info:

Condition:

@MarkTopping Is this still happening for you. The bug was fixed in one of the later Azure CNI versions. The latest one should not have the issue?
Closing since it's AKS-Engine not AKS and this issue should be solved on later versions of k8s/CNI.