istio: [Ambient] Failure in CNI with AWS EKS in a scale-to-zero scenario

Is this the right place to submit this?

  • This is not a security vulnerability or a crashing bug
  • This is not a question about how to use Istio

Bug Description

The issue took place on AWS EKS. At present, the pods are communicating effectively with each other. In an effort to reduce costs, I decided to scale in the node group during the night. To achieve this, I adjusted the Auto Scaling Group (ASG) to zero instances. Upon returning to work in the morning, I scaled out the node group back to three instances. However, all the pods in the ambient service mesh were unable to initiate the container, remaining in the ‘ContainerCreating’ state. When I attempted to describe one of them, I encountered the following error messages.

Events:
  Type     Reason                  Age                    From               Message
  ----     ------                  ----                   ----               -------
  Warning  FailedScheduling        25m                    default-scheduler  0/3 nodes are available: 1 node(s) had untolerated taint {node.kubernetes.io/not-ready: }, 2 node(s) had untolerated taint {node.kubernetes.io/network-unavailable: }. preemption: 0/3 nodes are available: 3 Preemption is not helpful for scheduling.
  Warning  FailedScheduling        14m (x2 over 19m)      default-scheduler  0/3 nodes are available: 3 node(s) had untolerated taint {node.kubernetes.io/network-unavailable: }. preemption: 0/3 nodes are available: 3 Preemption is not helpful for scheduling.
  Normal   Scheduled               12m                    default-scheduler  Successfully assigned namespace-ac/unchained-http-proxy-5cb9d54ddd-9cph9 to ip-xx-xxx-xx-xxx.region.compute.internal
  Warning  FailedCreatePodSandBox  12m                    kubelet            Failed to create pod sandbox: rpc error: code = Unknown desc = failed to setup network for sandbox "6b9a5001f515c72eb1d8d26150778f688ad2b7f59727a18e45adb0f9d1a3fb80": plugin type="calico" failed (add): stat /var/lib/calico/nodename: no such file or directory: check that the calico/node container is running and has mounted /var/lib/calico/
  Warning  FailedCreatePodSandBox  11m                    kubelet            Failed to create pod sandbox: rpc error: code = Unknown desc = failed to setup network for sandbox "3d03b422a0e53aae3c9476841e9acca2677816ee3975a07aae15c3585bf3cdd8": plugin type="istio-cni" name="istio-cni" failed (add): unable to push CNI event (status code 500): partial add error: no ztunnel connection
  Warning  FailedCreatePodSandBox  11m                    kubelet            Failed to create pod sandbox: rpc error: code = Unknown desc = failed to setup network for sandbox "4eac913e35dc5d796937ef5621bda1318931ef9d966cfeeb9b63e8175535ac39": plugin type="istio-cni" name="istio-cni" failed (add): unable to push CNI event (status code 500): partial add error: no ztunnel connection
  Warning  FailedCreatePodSandBox  11m                    kubelet            Failed to create pod sandbox: rpc error: code = Unknown desc = failed to setup network for sandbox "0fda94ac3a428f0dbe0bcd6622ddf94f0d949bdc1f13026f44bc74bab32c1b30": plugin type="istio-cni" name="istio-cni" failed (add): unable to push CNI event (status code 500): partial add error: no ztunnel connection
  Warning  FailedCreatePodSandBox  11m                    kubelet            Failed to create pod sandbox: rpc error: code = Unknown desc = failed to setup network for sandbox "591dae970568167483a450c5ce1949125afbfcb5e606847d183e9c99b777c911": plugin type="istio-cni" name="istio-cni" failed (add): unable to push CNI event (status code 500): partial add error: no ztunnel connection
  Warning  FailedCreatePodSandBox  11m                    kubelet            Failed to create pod sandbox: rpc error: code = Unknown desc = failed to setup network for sandbox "6fdad46e14774cc3e48c3217204f0ed4cb95b2e9444bcd0e989bbc0dc862ba31": plugin type="istio-cni" name="istio-cni" failed (add): unable to push CNI event (status code 500): failed to add IP ::ffff:10.100.214.85 with and proto 6 to ipset istio-inpod-probes: exist
  Warning  FailedCreatePodSandBox  11m                    kubelet            Failed to create pod sandbox: rpc error: code = Unknown desc = failed to setup network for sandbox "9582fbf6d2ecc2d64b328d5089ce7d13f5c1c2ef8f7bf45afcb35d4266b7dc51": plugin type="istio-cni" name="istio-cni" failed (add): unable to push CNI event (status code 500): failed to add IP ::ffff:10.100.214.102 with and proto 6 to ipset istio-inpod-probes: exist
  Warning  FailedCreatePodSandBox  11m                    kubelet            Failed to create pod sandbox: rpc error: code = Unknown desc = failed to setup network for sandbox "b2d4b1251beee67d2b126d03a3718d4ecdfdd9ae12b3e3d6cdc51a0414026be7": plugin type="istio-cni" name="istio-cni" failed (add): unable to push CNI event (status code 500): failed to add IP ::ffff:10.100.214.117 with and proto 6 to ipset istio-inpod-probes: exist
  Warning  FailedCreatePodSandBox  11m                    kubelet            Failed to create pod sandbox: rpc error: code = Unknown desc = failed to setup network for sandbox "30b7b633a31ae1deedd74b8579a4a487c52043f0b934e083ece6d56fda961cd8": plugin type="istio-cni" name="istio-cni" failed (add): unable to push CNI event (status code 500): failed to add IP ::ffff:10.100.214.127 with and proto 6 to ipset istio-inpod-probes: exist
  Normal   SandboxChanged          11m (x13 over 12m)     kubelet            Pod sandbox changed, it will be killed and re-created.
  Warning  FailedCreatePodSandBox  2m13s (x168 over 11m)  kubelet            (combined from similar events): Failed to create pod sandbox: rpc error: code = Unknown desc = failed to setup network for sandbox "0beeeef7f2cbb90c5526971675aca71d6b8bc42571fdf3ed83b91ef433a07847": plugin type="istio-cni" name="istio-cni" failed (add): unable to push CNI event (status code 500): failed to add IP ::ffff:10.100.214.115 with and proto 6 to ipset istio-inpod-probes: exist

Version

$ istioctl version -n kube-system -i kube-system
client version: 1.22.3
control plane version: 1.22.3
data plane version: 1.22.3 (4 proxies)

Additional Information

No response

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 3
  • Comments: 33 (20 by maintainers)

Most upvoted comments

That all tracks. I’ll leave this issue open until 1.22.4 is out at least, keep us posted. (and apologies we didn’t catch this sooner).

Hello, we are also having a similar problem, we also use Karpenter, and randomly when a new node appears this issue happens, we can see the following:

  • Pods inside namespaces with Ambient mode enabled are stuck in ContainerCreating status:
Events:
  Type     Reason                  Age                   From     Message
  ----     ------                  ----                  ----     -------
  Warning  FailedCreatePodSandBox  13s (x768 over 168m)  kubelet  (combined from similar events): Failed to create pod sandbox: rpc error: code = Unknown desc = failed to setup network for sandbox "45989e4ef2e1af3a0cb350ce83395ab6da99e79b76a9cf169e42113ba603292a": plugin type="aws-cni" name="aws-cni" failed (add): add cmd: failed to assign an IP address to container
  • Other pods work fine.
  • I can see the following logs in istio-cni daemonset.
failed adding pod xxxxxxx to ipset istio-inpod-probes with ip ::ffff:10.158.84.162, error was failed to add IP ::ffff:10.158.84.162 with and proto 6 to ipset istio-inpod-probes: exist
failed to add pod to ipset: xxxxxx failed to add IP ::ffff:10.158.84.162 with and proto 6 to ipset istio-inpod-probes: exist	ns=xxxx name=xxxxx
failed to add pod to ztunnel: failed to add IP ::ffff:10.158.84.162 with and proto 6 to ipset istio-inpod-probes: exist
failed to handle add event: failed to add IP ::ffff:10.158.84.162 with and proto 6 to ipset istio-inpod-probes: exist	ns=ns name=xxxxx
cmdAdd failed to signal node Istio CNI agent: unable to push CNI event (status code 500): failed to add IP ::ffff:10.158.84.162 with and proto 6 to ipset istio-inpod-probes: exist	pod=xxxxx
istio-cni cmdAdd error: unable to push CNI event (status code 500): failed to add IP ::ffff:10.158.84.162 with and proto 6 to ipset istio-inpod-probe
istio-cni failed with: unable to push CNI event (status code 500): failed to add IP ::ffff:10.158.84.162 with and proto 6 to ipset istio-inpod-probes: exist

Istio-cni daemonset is running image: docker.io/istio/install-cni:1.22.3-distroless.

Is there any dev build we can try to see if it solves the issue? Thanks!

I’m also experiencing a similar issue with EKS and istio 1.22.3 in ambient-mode. I also use Karpenter. I couldn’t find what went wrong exactly, but this cluster in particular spawns a lot of containers during the day.

I was able to make it “fix itself” on some attempts by restarting the istio-cni-node DaemonSet, but there were times that not even that would work. So, I’m not sure. (EDIT: actually, I probably restarted both DaemonSets, istio-cni and ztunnel, so, not so sure what restart helped more, but I couldn’t find anything super relevant in the ztunnel logs I could get.)

For the mean time, I disabled ambient-mode for this namespace and everything came back to working normally.

Thanks!

Here are the events I got for one of the pods:

Events:
 Type     Reason                  Age                 From               Message
 ----     ------                  ----                ----               -------
 Normal   Scheduled               16m                 default-scheduler  Successfully assigned redacted-ns/redacted-pod-b7bdf7584-89fst to ip-10-169-86-24.sa-east-1.compute.internal
 Warning  FailedCreatePodSandBox  16m                 kubelet            Failed to create pod sandbox: rpc error: code = Unknown desc = failed to setup network for sandbox "c3f83fc9974b73bafc76d511239dbdfe5e34d1ca27006504b691782db4d4c55b": plugin type="aws-cni" name="aws-cni" failed (add): add cmd: failed to assign an IP address to container
 Warning  FailedCreatePodSandBox  15m                 kubelet            Failed to create pod sandbox: rpc error: code = Unknown desc = failed to setup network for sandbox "d2bb5edbee3a2949c616062a49477d27b76e474a20619bcfbe94c095c17cba61": plugin type="aws-cni" name="aws-cni" failed (add): add cmd: failed to assign an IP address to container
 Warning  FailedCreatePodSandBox  15m                 kubelet            Failed to create pod sandbox: rpc error: code = Unknown desc = failed to setup network for sandbox "7249906ec2fd08734fce98a45be823f2fd1c20a76ee0e8f176a8abab321145e9": plugin type="aws-cni" name="aws-cni" failed (add): add cmd: failed to assign an IP address to container
 Warning  FailedCreatePodSandBox  15m                 kubelet            Failed to create pod sandbox: rpc error: code = Unknown desc = failed to setup network for sandbox "31a41ad1ba12c6c57e55018b2062fbf6209cd4fb91000866db49c195db4bb463": plugin type="istio-cni" name="istio-cni" failed (add): unable to push CNI event (status code 500): failed to add IP ::ffff:10.169.87.177 with and proto 6 to ipset istio-inpod-probes: exist
 Warning  FailedCreatePodSandBox  15m                 kubelet            Failed to create pod sandbox: rpc error: code = Unknown desc = failed to setup network for sandbox "d4c32234f967d7adf6765f4cd34a6e3154608c4970e625d10e26c2386e7eecca": plugin type="aws-cni" name="aws-cni" failed (add): add cmd: failed to assign an IP address to container
 Warning  FailedCreatePodSandBox  14m                 kubelet            Failed to create pod sandbox: rpc error: code = Unknown desc = failed to setup network for sandbox "ac462fce1e66a4c863193e1a5a496d5f4d922b71d683ae62cc27fcdc5502e67b": plugin type="istio-cni" name="istio-cni" failed (add): unable to push CNI event (status code 500): failed to add IP ::ffff:10.169.90.175 with and proto 6 to ipset istio-inpod-probes: exist
 Warning  FailedCreatePodSandBox  14m                 kubelet            Failed to create pod sandbox: rpc error: code = Unknown desc = failed to setup network for sandbox "c188bb429161da8138c30110080d56acdfefddbb29e26e2757f8b28f541f99d0": plugin type="aws-cni" name="aws-cni" failed (add): add cmd: failed to assign an IP address to container
 Warning  FailedCreatePodSandBox  14m                 kubelet            Failed to create pod sandbox: rpc error: code = Unknown desc = failed to setup network for sandbox "29f53b00d13d37a6e0bb6ad41771ec5c5dc3b7885cbbeb9353bc09b5a389684e": plugin type="aws-cni" name="aws-cni" failed (add): add cmd: failed to assign an IP address to container
 Warning  FailedCreatePodSandBox  14m                 kubelet            Failed to create pod sandbox: rpc error: code = Unknown desc = failed to setup network for sandbox "501ab0106869303ebab56341ac25d546398611e60cafecc39eafcaa16de085c4": plugin type="istio-cni" name="istio-cni" failed (add): unable to push CNI event (status code 500): failed to add IP ::ffff:10.169.87.93 with and proto 6 to ipset istio-inpod-probes: exist
 Warning  FailedCreatePodSandBox  57s (x56 over 13m)  kubelet            (combined from similar events): Failed to create pod sandbox: rpc error: code = Unknown desc = failed to setup network for sandbox "67de693f3360efb5d4f3d8b68906f9b17ab1972de663bd03d4110983fe2f3aba": plugin type="aws-cni" name="aws-cni" failed (add): add cmd: failed to assign an IP address to container

And some log lines from the istio-cni-node DaemonSet. This keeps printing for each pod experiencing the issue.

2024-07-23T20:23:26.990819Z	info	cni-agent	adding pod to the mesh	ns=redacted-ns name=redacted-pod-name-5dfdcd44cd-5blth
2024-07-23T20:23:26.990965Z	error	cni-agent	failed adding pod redacted-pod-name-5dfdcd44cd-5blth to ipset istio-inpod-probes with ip ::ffff:10.169.86.92, error was failed to add IP ::ffff:10.169.86.92 with and proto 6 to ipset istio-inpod-probes: exist
2024-07-23T20:23:26.990976Z	error	cni-agent	failed to add pod to ipset: redacted-ns/redacted-pod-name-5dfdcd44cd-5blth failed to add IP ::ffff:10.169.86.92 with and proto 6 to ipset istio-inpod-probes: exist	ns=redacted-ns name=redacted-pod-name-5dfdcd44cd-5blth
2024-07-23T20:23:26.990982Z	error	cni-agent	failed to add pod to ztunnel: failed to add IP ::ffff:10.169.86.92 with and proto 6 to ipset istio-inpod-probes: exist
2024-07-23T20:23:26.990987Z	error	cni-agent	failed to handle add event: failed to add IP ::ffff:10.169.86.92 with and proto 6 to ipset istio-inpod-probes: exist	ns=redacted-ns name=redacted-pod-name-5dfdcd44cd-5blth
2024-07-23T20:23:26.991106Z	error	cni	istio-cni cmdAdd failed to signal node Istio CNI agent: unable to push CNI event (status code 500): failed to add IP ::ffff:10.169.86.92 with and proto 6 to ipset istio-inpod-probes: exist	pod=redacted-ns/redacted-pod-name-5dfdcd44cd-5blth
2024-07-23T20:23:26.991139Z	error	cni	istio-cni cmdAdd error: unable to push CNI event (status code 500): failed to add IP ::ffff:10.169.86.92 with and proto 6 to ipset istio-inpod-probes: exist
2024-07-23T20:23:26.991149Z	error	cni	istio-cni failed with: unable to push CNI event (status code 500): failed to add IP ::ffff:10.169.86.92 with and proto 6 to ipset istio-inpod-probes: exist