istio: Ambient: iptables inconsistently missing for pod(s) upon node reboot
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
Upon enabling iptables reconciliation via https://github.com/istio/istio/issues/55347#issuecomment-2706951358 node reboots will sometimes cause applications to become unreachable. Digging into this more I found that the CNI agent is unable to reconcile the pod and simply gives up: 2025-04-16T04:53:28.049072Z error cni-agent failed to reconcile inpod rules for pod, try restarting the pod, or removing and re-adding it to the mesh: can't find netns for pod, this is ok if this is a newly created pod (netns not provided, but is needed as pod is not in cache) ns=gitea name=gitea-798d9777d4-grdfl. Later on in the logs 2025-04-16T04:53:32.224983Z info cni-agent netns is not available for pod, sending 'keep' to ztunnel uid=93693128-c323-43e6-b9d2-8e8d57f5f8e5 is seen.
In reconcileExistingPod getNetns is called and eventually stops here as seen in the log line I’ve shared above. Technically the pod is not “new” in this workflow, it retains its age and is just recovering from a lost connection to the API server (some restarts are seen as well). The assumption here doesn’t seem to hold true in the flow of rebooting a node.
When observing the above after a reboot looking at the iptables inside the pod’s network namespace reveals nothing:
kubectl debug gitea-798d9777d4-grdfl -it --image gcr.io/istio-release/base --profile=netadmin -n gitea -- iptables-nft-save
Defaulting debug container name to debugger-kxpdh.
kubectl debug gitea-798d9777d4-grdfl -it --image gcr.io/istio-release/base --profile=netadmin -n gitea -- iptables-nft-save -t nat
Defaulting debug container name to debugger-llj9c.
# Generated by iptables-nft-save v1.8.10 (nf_tables) on Wed Apr 16 05:17:21 2025
*nat
:PREROUTING ACCEPT [0:0]
:INPUT ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
:POSTROUTING ACCEPT [0:0]
COMMIT
# Completed on Wed Apr 16 05:17:21 2025
Either rebooting the app or istio-cni resolves the issue, and connectivity immediately starts working. Iptables are seen in the pod’s network namespace and there are no logs present in istio-cni regarding failed reconciliations or network namespaces being unknown. It seems to me there’s a reconciliation edge case that needs to be handled and that currently a very specific sequence of events causes that reconciliation to be dropped, concluding in a system that silently sits in an unrecoverable (without manual intervention) state.
Version
$ istioctl version
client version: 1.25.1
control plane version: 1.25.1
data plane version: 1.25.1 (13 proxies)
$ kubectl version
Client Version: v1.32.3+k3s1
Kustomize Version: v5.5.0
Server Version: v1.32.3+k3s1
Additional Information
Will attach the bug-report.tar.gz if requested. Currently my system is not in the broken state as I had restarted istio-cni very late last night. The archive would be more valuable if it were created when the system is in the broken state.
istioctl bug-report
Target cluster context: default
Running with the following config:
istio-namespace: istio-system
full-secrets: false
timeout (mins): 30
include: { }
exclude: { Namespaces: kube-node-lease,kube-public,kube-system,local-path-storage }
end-time: 2025-04-16 10:54:05.732379851 -0700 PDT
Cluster endpoint: https://127.0.0.1:6443
CLI version:
version.BuildInfo{Version:"1.25.1", GitRevision:"be4b14ad8be844c5f876a41ad4437217a2e03cf8", GolangVersion:"go1.23.7", BuildStatus:"Clean", GitTag:"1.25.1"}
The following Istio control plane revisions/versions were found in the cluster:
Revision default:
&version.MeshInfo{version.ServerInfo{Component:"pilot", Revision:"default", Info:version.BuildInfo{Version:"1.25.1", GitRevision:"be4b14ad8be844c5f876a41ad4437217a2e03cf8", GolangVersion:"", BuildStatus:"Clean", GitTag:"1.25.1"}}}
The following proxy revisions/versions were found in the cluster:
Revision default: Versions {1.25.1}
Fetching logs for the following containers:
argocd/argocd-applicationset-controller/argocd-applicationset-controller-848fd7f6d7-cj7s4/argocd-applicationset-controller
argocd/argocd-dex-server/argocd-dex-server-7c6677956c-djjzv/dex
argocd/argocd-notifications-controller/argocd-notifications-controller-6894645578-xwtz9/argocd-notifications-controller
argocd/argocd-redis/argocd-redis-7dd6fb7876-6wctl/redis
argocd/argocd-repo-server/argocd-repo-server-5bf46dddfc-6gptv/argocd-repo-server
argocd/argocd-server/argocd-server-6dcc9fbf95-x8sbl/argocd-server
argocd/waypoint/waypoint-5477b9774c-f9slj/istio-proxy
cert-manager/cert-manager-cainjector/cert-manager-cainjector-744f9f85ff-w7flh/cert-manager-cainjector
cert-manager/cert-manager-webhook/cert-manager-webhook-77f7f9cd64-z64d9/cert-manager-webhook
cert-manager/cert-manager/cert-manager-7d6c95dcff-mq86t/cert-manager-controller
cert-manager/waypoint/waypoint-6b5c84d4fd-p9vc5/istio-proxy
default/aaronjwood-istio/aaronjwood-istio-87ffcf7dd-d7wpx/istio-proxy
default/waypoint/waypoint-b4dccfbb5-rtq76/istio-proxy
gitea/gitea/gitea-798d9777d4-zbwf7/gitea
gitea/waypoint/waypoint-f455877d5-xg7s2/istio-proxy
istio-system/grafana/grafana-7564bf7cb9-5hd6p/grafana
istio-system/istio-cni-node/istio-cni-node-s74p4/install-cni
istio-system/istiod/istiod-c5dc8cbd4-wdc4j/discovery
istio-system/jaeger/jaeger-5ddbc567fc-w89lk/jaeger
istio-system/kiali/kiali-586c98cb7f-tnmk9/kiali
istio-system/prometheus/prometheus-6c9c59d87c-gd9dh/prometheus-server
istio-system/prometheus/prometheus-6c9c59d87c-gd9dh/prometheus-server-configmap-reload
istio-system/ztunnel/ztunnel-2zkpp/istio-proxy
REDACTED/waypoint/waypoint-7969fb499c-2dbd6/istio-proxy
REDACTED/waypoint/waypoint-65cfb8754b-cq8vt/istio-proxy
REDACTED/waypoint/waypoint-676b84c8db-qhtvq/istio-proxy
REDACTED/waypoint/waypoint-585b6598c7-pj7bv/istio-proxy
REDACTED/waypoint/waypoint-7bc9fdb9cd-8zght/istio-proxy
REDACTED/waypoint/waypoint-6f7477945f-fq2nn/istio-proxy
REDACTED/waypoint/waypoint-cd7fcd589-tkb2n/istio-proxy
Fetching Istio control plane information from cluster.
Fetching CNI logs from cluster.
Running Istio analyze on all namespaces and report as below:
Analysis Report:
Info [IST0102] (Namespace kube-node-lease) The namespace is not enabled for Istio injection. Run 'kubectl label namespace kube-node-lease istio-injection=enabled' to enable it, or 'kubectl label namespace kube-node-lease istio-injection=disabled' to explicitly mark it as not needing injection.
Info [IST0102] (Namespace kube-public) The namespace is not enabled for Istio injection. Run 'kubectl label namespace kube-public istio-injection=enabled' to enable it, or 'kubectl label namespace kube-public istio-injection=disabled' to explicitly mark it as not needing injection.
Info [IST0102] (Namespace kube-system) The namespace is not enabled for Istio injection. Run 'kubectl label namespace kube-system istio-injection=enabled' to enable it, or 'kubectl label namespace kube-system istio-injection=disabled' to explicitly mark it as not needing injection.
Info [IST0118] (Service argocd/argocd-applicationset-controller) Port name metrics (port: 8080, targetPort: metrics) doesn't follow the naming convention of Istio port.
Info [IST0118] (Service argocd/argocd-applicationset-controller) Port name webhook (port: 7000, targetPort: webhook) doesn't follow the naming convention of Istio port.
Info [IST0118] (Service argocd/argocd-dex-server) Port name metrics (port: 5558, targetPort: 5558) doesn't follow the naming convention of Istio port.
Info [IST0118] (Service argocd/argocd-metrics) Port name metrics (port: 8082, targetPort: 8082) doesn't follow the naming convention of Istio port.
Info [IST0118] (Service argocd/argocd-notifications-controller-metrics) Port name metrics (port: 9001, targetPort: 9001) doesn't follow the naming convention of Istio port.
Info [IST0118] (Service argocd/argocd-repo-server) Port name metrics (port: 8084, targetPort: 8084) doesn't follow the naming convention of Istio port.
Info [IST0118] (Service argocd/argocd-repo-server) Port name server (port: 8081, targetPort: 8081) doesn't follow the naming convention of Istio port.
Info [IST0118] (Service argocd/argocd-server-metrics) Port name metrics (port: 8083, targetPort: 8083) doesn't follow the naming convention of Istio port.
Info [IST0118] (Service cert-manager/cert-manager-webhook) Port name metrics (port: 9402, targetPort: http-metrics) doesn't follow the naming convention of Istio port.
Info [IST0118] (Service gitea/gitea-ssh) Port name ssh (port: 22, targetPort: 2222) doesn't follow the naming convention of Istio port.
Info [IST0118] (Service istio-system/grafana) Port name service (port: 3000, targetPort: 3000) doesn't follow the naming convention of Istio port.
Info [IST0118] (Service istio-system/jaeger-collector) Port name jaeger-collector-grpc (port: 14250, targetPort: 14250) doesn't follow the naming convention of Istio port.
Info [IST0118] (Service istio-system/jaeger-collector) Port name jaeger-collector-http (port: 14268, targetPort: 14268) doesn't follow the naming convention of Istio port.
Info [IST0118] (Service kube-system/kube-dns) Port name metrics (port: 9153, targetPort: 9153) doesn't follow the naming convention of Istio port.
Info [IST0118] (Service REDACTED/REDACTED) Port name REDACTED (port: REDACTED, targetPort: REDACTED) doesn't follow the naming convention of Istio port.
Info [IST0118] (Service REDACTED/REDACTED) Port name REDACTED (port: REDACTED, targetPort: REDACTED) doesn't follow the naming convention of Istio port.
Info [IST0118] (Service REDACTED/REDACTED) Port name REDACTED (port: REDACTED, targetPort: REDACTED) doesn't follow the naming convention of Istio port.
Info [IST0118] (Service REDACTED/REDACTED) Port name REDACTED (port: REDACTED, targetPort: REDACTED) doesn't follow the naming convention of Istio port.
Info [IST0118] (Service REDACTED/REDACTED) Port name REDACTED (port: REDACTED, targetPort: REDACTED) doesn't follow the naming convention of Istio port.
Info [IST0118] (Service REDACTED/REDACTED) Port name REDACTED (port: REDACTED, targetPort: REDACTED) doesn't follow the naming convention of Istio port.
Info [IST0118] (Service REDACTED/REDACTED) Port name REDACTED (port: REDACTED, targetPort: REDACTED) doesn't follow the naming convention of Istio port.
Creating an archive at /home/aaron/bug-report.tar.gz.
Time used for creating the tar file is 316.604082ms.
Cleaning up temporary files in /tmp/bug-report.
Done.
About this issue
- Original URL
- State: open
- Created 2 years ago
- Reactions: 2
- Comments: 29 (25 by maintainers)
@jaellio We investigated a bit on our side and from what we found out it is not easily feasible for us:
We’re looking into workarounds for this issue
Technically yes; this is where CNI hasn’t really kept pace to express the needs of Kubernetes. However, I’ll point out that Istio CNI tolerates the NoSchedule, CriticalAddonsOnly, and NoExecute taints and application pods should not. That means before the node is ready for scheduling by app pods, istio-cni will be there and will have rewritten the config. We also have the system-node-critical priorityclass so we won’t get evicted before app pods. With that in mind, it seems like a very small edge case where the app pod could get scheduled before istio-cni can write the config
Yep exactly that. We’ve hit the limits of the current CNI spec, and need to make upstream changes to get past it. I’m going to do what I can to get those changes plumbed through containerd and k/k and report here when I have an update