istio: ambient: "failed to add pod to ztunnel" on k3s cluster

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

When attempting to run Istio ambient mode on k3s cluster (arm64) using Calico, istio-cni reports the following error when attempting to add pods to the ambient mesh (adding ambient label to namespace):

2024-03-24T23:28:47.457136Z     error   Command error output: xtables other problem: line 2 failed
2024-03-24T23:28:47.457224Z     error   iptables        failed to restore iptables rules: exit status 1
2024-03-24T23:28:47.457330Z     error   ambient failed to update POD inpod: default/details-v1-698d88b-n42tz exit status 1
2024-03-24T23:28:47.457353Z     error   ambient failed to add pod to ztunnel: exit status 1

And the following error when attempting to remove a pod from the mesh (removing ambient label from namespace):

2024-03-24T23:29:01.150318Z     warn    ambient failed to find pod netns        ns=default name=details-v1-698d88b-n42tz
2024-03-24T23:29:01.150381Z     error   ambient failed to remove pod to ztunnel: failed to find pod netns       ns=default name=details-v1-698d88b-n42tz
2024-03-24T23:29:01.156068Z     warn    ambient failed to find pod netns        ns=default name=reviews-v3-5b9bd44f4-tmml8
2024-03-24T23:29:01.156133Z     error   ambient failed to remove pod to ztunnel: failed to find pod netns       ns=default name=reviews-v3-5b9bd44f4-tmml8

Full logs of each event attached, bug-report output attached below. add-pods.log remove-pods.log

I see mention of a similar issue in this PR: https://github.com/istio/istio/pull/49231

Istio installed in this example with istioctl install, same issue observed with helm install

Version

$ istioctl version
client version: 1.21.0
control plane version: 1.21.0
data plane version: 1.21.0 (6 proxies)
$ kubectl version
Client Version: v1.29.3
Kustomize Version: v5.0.4-0.20230601165947-6ce0bf390ce3
Server Version: v1.29.1+k3s2

Additional Information

bug-report.tar.gz

`istioctl bug-report` output
$ istioctl bug-report

Target cluster context: kubernetes-admin-pico@pico

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: 2024-03-24 19:30:22.269187089 -0400 EDT



Cluster endpoint: https://pi01.pico.home.arpa:6443
CLI version:
version.BuildInfo{Version:"1.21.0", GitRevision:"Homebrew", GolangVersion:"go1.22.1", BuildStatus:"Homebrew", GitTag:"1.21.0"}

The following Istio control plane revisions/versions were found in the cluster:
Revision default:
&version.MeshInfo{
    {
        Component: "pilot",
        Revision:  "default",
        Info:      version.BuildInfo{Version:"1.21.0", GitRevision:"2ca3e986a683fbdb82dffcd7b2e8d02076a42468", GolangVersion:"", BuildStatus:"Clean", GitTag:"1.21.0"},
    },
}

The following proxy revisions/versions were found in the cluster:
Revision default: Versions {1.21.0}


Fetching logs for the following containers:

calico-apiserver/calico-apiserver/calico-apiserver-7d78f674d6-9gxvb/calico-apiserver
calico-apiserver/calico-apiserver/calico-apiserver-7d78f674d6-nmr2b/calico-apiserver
calico-system/calico-kube-controllers/calico-kube-controllers-7978f6997b-bqs6w/calico-kube-controllers
calico-system/calico-node/calico-node-b5mq9/calico-node
calico-system/calico-node/calico-node-nkkpv/calico-node
calico-system/calico-node/calico-node-qrmxf/calico-node
calico-system/calico-node/calico-node-shzl8/calico-node
calico-system/calico-node/calico-node-v8kbf/calico-node
calico-system/calico-typha/calico-typha-86d697f799-8664w/calico-typha
calico-system/calico-typha/calico-typha-86d697f799-msdg4/calico-typha
calico-system/calico-typha/calico-typha-86d697f799-t7x4x/calico-typha
calico-system/csi-node-driver/csi-node-driver-gjdrm/calico-csi
calico-system/csi-node-driver/csi-node-driver-gjdrm/csi-node-driver-registrar
calico-system/csi-node-driver/csi-node-driver-mdcc9/calico-csi
calico-system/csi-node-driver/csi-node-driver-mdcc9/csi-node-driver-registrar
calico-system/csi-node-driver/csi-node-driver-tx2nk/calico-csi
calico-system/csi-node-driver/csi-node-driver-tx2nk/csi-node-driver-registrar
calico-system/csi-node-driver/csi-node-driver-w576d/calico-csi
calico-system/csi-node-driver/csi-node-driver-w576d/csi-node-driver-registrar
calico-system/csi-node-driver/csi-node-driver-wxvc2/calico-csi
calico-system/csi-node-driver/csi-node-driver-wxvc2/csi-node-driver-registrar
default/details-v1/details-v1-698d88b-n42tz/details
default/notsleep/notsleep-5c785bc478-wcnlk/notsleep
default/productpage-v1/productpage-v1-675fc69cf-p7t5z/productpage
default/ratings-v1/ratings-v1-6484c4d9bb-f6nhz/ratings
default/reviews-v1/reviews-v1-5b5d6494f4-6dfqg/reviews
default/reviews-v2/reviews-v2-5b667bcbf8-6m2xh/reviews
default/reviews-v3/reviews-v3-5b9bd44f4-tmml8/reviews
default/sleep/sleep-7656cf8794-cj8sc/sleep
istio-system/bookinfo-gateway-istio/bookinfo-gateway-istio-7755d4897c-lbk5l/istio-proxy
istio-system/istio-cni-node/istio-cni-node-9smjx/install-cni
istio-system/istio-cni-node/istio-cni-node-q99bw/install-cni
istio-system/istio-cni-node/istio-cni-node-wtpdn/install-cni
istio-system/istio-cni-node/istio-cni-node-wwzx8/install-cni
istio-system/istio-cni-node/istio-cni-node-xwgs7/install-cni
istio-system/istiod/istiod-7879855784-9tj5h/discovery
istio-system/ztunnel/ztunnel-4gsgd/istio-proxy
istio-system/ztunnel/ztunnel-5m78r/istio-proxy
istio-system/ztunnel/ztunnel-vwndw/istio-proxy
istio-system/ztunnel/ztunnel-x6xj5/istio-proxy
istio-system/ztunnel/ztunnel-xh6qz/istio-proxy
metallb-system/metallb-controller/metallb-controller-5bfcc7df68-27c6j/controller
metallb-system/metallb-speaker/metallb-speaker-2chn6/speaker
metallb-system/metallb-speaker/metallb-speaker-46zpg/speaker
metallb-system/metallb-speaker/metallb-speaker-fqw8l/speaker
metallb-system/metallb-speaker/metallb-speaker-rh9fm/speaker
metallb-system/metallb-speaker/metallb-speaker-xhlh6/speaker
tigera-operator/tigera-operator/tigera-operator-6d7bbc7b65-gpk6t/tigera-operator

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 calico-apiserver) The namespace is not enabled for Istio injection. Run 'kubectl label namespace calico-apiserver istio-injection=enabled' to enable it, or 'kubectl label namespace calico-apiserver istio-injection=disabled' to explicitly mark it as not needing injection.
Info [IST0102] (Namespace calico-system) The namespace is not enabled for Istio injection. Run 'kubectl label namespace calico-system istio-injection=enabled' to enable it, or 'kubectl label namespace calico-system istio-injection=disabled' to explicitly mark it as not needing injection.
Info [IST0102] (Namespace default) The namespace is not enabled for Istio injection. Run 'kubectl label namespace default istio-injection=enabled' to enable it, or 'kubectl label namespace default istio-injection=disabled' to explicitly mark it as not needing injection.
Info [IST0102] (Namespace metallb-system) The namespace is not enabled for Istio injection. Run 'kubectl label namespace metallb-system istio-injection=enabled' to enable it, or 'kubectl label namespace metallb-system istio-injection=disabled' to explicitly mark it as not needing injection.
Info [IST0102] (Namespace monitoring) The namespace is not enabled for Istio injection. Run 'kubectl label namespace monitoring istio-injection=enabled' to enable it, or 'kubectl label namespace monitoring istio-injection=disabled' to explicitly mark it as not needing injection.
Info [IST0102] (Namespace tigera-operator) The namespace is not enabled for Istio injection. Run 'kubectl label namespace tigera-operator istio-injection=enabled' to enable it, or 'kubectl label namespace tigera-operator istio-injection=disabled' to explicitly mark it as not needing injection.
Info [IST0118] (Service calico-apiserver/calico-api) Port name apiserver (port: 443, targetPort: 5443) doesn't follow the naming convention of Istio port.
Info [IST0118] (Service calico-system/calico-kube-controllers-metrics) Port name metrics-port (port: 9094, targetPort: 9094) doesn't follow the naming convention of Istio port.
Info [IST0118] (Service calico-system/calico-typha) Port name calico-typha (port: 5473, targetPort: calico-typha) doesn't follow the naming convention of Istio port.
Info [IST0118] (Service metallb-system/metallb-webhook-service) Port name  (port: 443, targetPort: 9443) doesn't follow the naming convention of Istio port.
Creating an archive at /home/gclawes/repos/github.com/istio/istio/bug-report.tar.gz.
Time used for creating the tar file is 429.97106ms.
Cleaning up temporary files in /tmp/bug-report.
Done.

Affected product area

  • Ambient
  • Docs
  • Dual Stack
  • Installation
  • Networking
  • Performance and Scalability
  • Extensions and Telemetry
  • Security
  • Test and Release
  • User Experience
  • Developer Infrastructure
  • Upgrade
  • Multi Cluster
  • Virtual Machine
  • Control Plane Revisions

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 27 (12 by maintainers)

Most upvoted comments

ok, if this or something related crops up again, let us know - thanks!

I’m not seeing this anymore on my setup on v1.24.1, though again my setup does not use the k3s CNI, so I do not believe the CNI path config for k3s was the source of this issue.

I disable the k3s built-in flannel with --flannel-backend=none --disable-network-policy and install calico via tigera-operator, which uses the standard CNI dirs:

ubuntu@pi01:~$ sudo ls -lah /etc/cni/net.d/
total 16K
drwx------ 2 root root 4.0K Dec  4 02:37 .
drwxr-xr-x 3 root root 4.0K Dec  4 02:20 ..
-rw-r--r-- 1 root root 1.4K Dec  4 02:37 10-calico.conflist
-rw------- 1 root root 2.1K Dec  4 02:34 calico-kubeconfig
ubuntu@pi01:~$ ls -lah /opt/cni/bin/
total 197M
drwxr-xr-x 2 root root 4.0K Dec  4 02:49 .
drwxr-xr-x 3 root root 4.0K Dec  4 02:29 ..
-rwxr-xr-x 1 root root 4.2M Dec  4 02:30 bandwidth
-rwxr-xr-x 1 root root  63M Dec  4 02:30 calico
-rwxr-xr-x 1 root root  63M Dec  4 02:30 calico-ipam
-rwxr-xr-x 1 root root 2.7M Dec  4 02:31 flannel
-rwxr-xr-x 1 root root 3.8M Dec  4 02:31 host-local
-rwxr-xr-x 1 root root  49M Dec  4 02:49 istio-cni
-rwxr-xr-x 1 root root 3.8M Dec  4 02:31 loopback
-rwxr-xr-x 1 root root 4.3M Dec  4 02:31 portmap
-rwxr-xr-x 1 root root 4.0M Dec  4 02:31 tuning

versions:

$ kubectl version
Client Version: v1.31.3
Kustomize Version: v5.4.2
Server Version: v1.31.2+k3s1

$ calicoctl version
Client Version:    3.29.1
Git commit:        ddfc3b1ea
Cluster Version:   v3.29.1
Cluster Type:      typha,kdd,k8s,operator,bgp

$ istioctl version
client version: 1.24.1
control plane version: 1.24.1
data plane version: 1.24.1 (2 proxies)

Some strange behavior trying to debug with this last night.

I followed the Ambient Mode guide and just created the sleep pod and added it to the ambient mesh by labeling the namespace.

On 1.21.2 I see the iptables error (same as before):

istio-1.21.2-failure.txt sample (full file attached)
2024-06-03T03:12:38.790263Z	debug	controllers	handling update: default	controller=ambient
2024-06-03T03:12:38.790350Z	debug	ambient	Namespace default updated
2024-06-03T03:12:38.790388Z	info	ambient	Namespace default is enabled in ambient mesh
2024-06-03T03:12:38.790437Z	debug	ambient	Enqueuing pod default/sleep-7656cf8794-t4dzs
2024-06-03T03:12:38.790495Z	debug	controllers	handling update: default/sleep-7656cf8794-t4dzs	controller=ambient
2024-06-03T03:12:38.791981Z	debug	ambient	Pod sleep-7656cf8794-t4dzs events: &Pod{ObjectMeta:{sleep-7656cf8794-t4dzs sleep-7656cf8794- default  49c3772c-e54d-43b6-9a0f-cebf9e799840 4004 0 2024-06-03 03:12:06 +0000 UTC <nil> <nil> map[app:sleep pod-template-hash:7656cf8794] map[cni.projectcalico.org/containerID:9e65a4e99f6c7d3652f3307c70255be209101fd8682a263fdcbff351f3d38da9 cni.projectcalico.org/podIP:10.100.217.194/32 cni.projectcalico.org/podIPs:10.100.217.194/32] [{apps/v1 ReplicaSet sleep-7656cf8794 1cbe911c-4201-4337-a788-d93dbd567720 0x4000c13197 0x4000c13198}] [] []},Spec:PodSpec{Volumes:[]Volume{Volume{Name:secret-volume,VolumeSource:VolumeSource{HostPath:nil,EmptyDir:nil,GCEPersistentDisk:nil,AWSElasticBlockStore:nil,GitRepo:nil,Secret:&SecretVolumeSource{SecretName:sleep-secret,Items:[]KeyToPath{},DefaultMode:*420,Optional:*true,},NFS:nil,ISCSI:nil,Glusterfs:nil,PersistentVolumeClaim:nil,RBD:nil,FlexVolume:nil,Cinder:nil,CephFS:nil,Flocker:nil,DownwardAPI:nil,FC:nil,AzureFile:nil,ConfigMap:nil,VsphereVolume:nil,Quobyte:nil,AzureDisk:nil,PhotonPersistentDisk:nil,PortworxVolume:nil,ScaleIO:nil,Projected:nil,StorageOS:nil,CSI:nil,Ephemeral:nil,},},Volume{Name:kube-api-access-vgrdj,VolumeSource:VolumeSource{HostPath:nil,EmptyDir:nil,GCEPersistentDisk:nil,AWSElasticBlockStore:nil,GitRepo:nil,Secret:nil,NFS:nil,ISCSI:nil,Glusterfs:nil,PersistentVolumeClaim:nil,RBD:nil,FlexVolume:nil,Cinder:nil,CephFS:nil,Flocker:nil,DownwardAPI:nil,FC:nil,AzureFile:nil,ConfigMap:nil,VsphereVolume:nil,Quobyte:nil,AzureDisk:nil,PhotonPersistentDisk:nil,PortworxVolume:nil,ScaleIO:nil,Projected:&ProjectedVolumeSource{Sources:[]VolumeProjection{VolumeProjection{Secret:nil,DownwardAPI:nil,ConfigMap:nil,ServiceAccountToken:&ServiceAccountTokenProjection{Audience:,ExpirationSeconds:*3607,Path:token,},ClusterTrustBundle:nil,},VolumeProjection{Secret:nil,DownwardAPI:nil,ConfigMap:&ConfigMapProjection{LocalObjectReference:LocalObjectReference{Name:kube-root-ca.crt,},Items:[]KeyToPath{KeyToPath{Key:ca.crt,Path:ca.crt,Mode:nil,},},Optional:nil,},ServiceAccountToken:nil,ClusterTrustBundle:nil,},VolumeProjection{Secret:nil,DownwardAPI:&DownwardAPIProjection{Items:[]DownwardAPIVolumeFile{DownwardAPIVolumeFile{Path:namespace,FieldRef:&ObjectFieldSelector{APIVersion:v1,FieldPath:metadata.namespace,},ResourceFieldRef:nil,Mode:nil,},},},ConfigMap:nil,ServiceAccountToken:nil,ClusterTrustBundle:nil,},},DefaultMode:*420,},StorageOS:nil,CSI:nil,Ephemeral:nil,},},},Containers:[]Container{Container{Name:sleep,Image:curlimages/curl,Command:[/bin/sleep infinity],Args:[],WorkingDir:,Ports:[]ContainerPort{},Env:[]EnvVar{},Resources:ResourceRequirements{Limits:ResourceList{},Requests:ResourceList{},Claims:[]ResourceClaim{},},VolumeMounts:[]VolumeMount{VolumeMount{Name:secret-volume,ReadOnly:false,MountPath:/etc/sleep/tls,SubPath:,MountPropagation:nil,SubPathExpr:,},VolumeMount{Name:kube-api-access-vgrdj,ReadOnly:true,MountPath:/var/run/secrets/kubernetes.io/serviceaccount,SubPath:,MountPropagation:nil,SubPathExpr:,},},LivenessProbe:nil,ReadinessProbe:nil,Lifecycle:nil,TerminationMessagePath:/dev/termination-log,ImagePullPolicy:IfNotPresent,SecurityContext:nil,Stdin:false,StdinOnce:false,TTY:false,EnvFrom:[]EnvFromSource{},TerminationMessagePolicy:File,VolumeDevices:[]VolumeDevice{},StartupProbe:nil,ResizePolicy:[]ContainerResizePolicy{},RestartPolicy:nil,},},RestartPolicy:Always,TerminationGracePeriodSeconds:*0,ActiveDeadlineSeconds:nil,DNSPolicy:ClusterFirst,NodeSelector:map[string]string{},ServiceAccountName:sleep,DeprecatedServiceAccount:sleep,NodeName:pi03.pico.home.arpa,HostNetwork:false,HostPID:false,HostIPC:false,SecurityContext:&PodSecurityContext{SELinuxOptions:nil,RunAsUser:nil,RunAsNonRoot:nil,SupplementalGroups:[],FSGroup:nil,RunAsGroup:nil,Sysctls:[]Sysctl{},WindowsOptions:nil,FSGroupChangePolicy:nil,SeccompProfile:nil,},ImagePullSecrets:[]LocalObjectReference{},Hostname:,Subdomain:,Affinity:nil,SchedulerName:default-scheduler,InitContainers:[]Container{},AutomountServiceAccountToken:nil,Tolerations:[]Toleration{Toleration{Key:node.kubernetes.io/not-ready,Operator:Exists,Value:,Effect:NoExecute,TolerationSeconds:*300,},Toleration{Key:node.kubernetes.io/unreachable,Operator:Exists,Value:,Effect:NoExecute,TolerationSeconds:*300,},},HostAliases:[]HostAlias{},PriorityClassName:,Priority:*0,DNSConfig:nil,ShareProcessNamespace:nil,ReadinessGates:[]PodReadinessGate{},RuntimeClassName:nil,EnableServiceLinks:*true,PreemptionPolicy:*PreemptLowerPriority,Overhead:ResourceList{},TopologySpreadConstraints:[]TopologySpreadConstraint{},EphemeralContainers:[]EphemeralContainer{},SetHostnameAsFQDN:nil,OS:nil,HostUsers:nil,SchedulingGates:[]PodSchedulingGate{},ResourceClaims:[]PodResourceClaim{},},Status:PodStatus{Phase:Running,Conditions:[]PodCondition{PodCondition{Type:PodReadyToStartContainers,Status:True,LastProbeTime:0001-01-01 00:00:00 +0000 UTC,LastTransitionTime:2024-06-03 03:12:13 +0000 UTC,Reason:,Message:,},PodCondition{Type:Initialized,Status:True,LastProbeTime:0001-01-01 00:00:00 +0000 UTC,LastTransitionTime:2024-06-03 03:12:06 +0000 UTC,Reason:,Message:,},PodCondition{Type:Ready,Status:True,LastProbeTime:0001-01-01 00:00:00 +0000 UTC,LastTransitionTime:2024-06-03 03:12:13 +0000 UTC,Reason:,Message:,},PodCondition{Type:ContainersReady,Status:True,LastProbeTime:0001-01-01 00:00:00 +0000 UTC,LastTransitionTime:2024-06-03 03:12:13 +0000 UTC,Reason:,Message:,},PodCondition{Type:PodScheduled,Status:True,LastProbeTime:0001-01-01 00:00:00 +0000 UTC,LastTransitionTime:2024-06-03 03:12:06 +0000 UTC,Reason:,Message:,},},Message:,Reason:,HostIP:10.10.5.103,PodIP:10.100.217.194,StartTime:2024-06-03 03:12:06 +0000 UTC,ContainerStatuses:[]ContainerStatus{ContainerStatus{Name:sleep,State:ContainerState{Waiting:nil,Running:&ContainerStateRunning{StartedAt:2024-06-03 03:12:13 +0000 UTC,},Terminated:nil,},LastTerminationState:ContainerState{Waiting:nil,Running:nil,Terminated:nil,},Ready:true,RestartCount:0,Image:docker.io/curlimages/curl:latest,ImageID:docker.io/curlimages/curl@sha256:73e4d532ea62d7505c5865b517d3704966ffe916609bedc22af6833dc9969bcd,ContainerID:containerd://581dc8c2e8a5771840558d852def2d9cfb8d00370a51d127cee9e04272510080,Started:*true,AllocatedResources:ResourceList{},Resources:nil,},},QOSClass:BestEffort,InitContainerStatuses:[]ContainerStatus{},NominatedNodeName:,PodIPs:[]PodIP{PodIP{IP:10.100.217.194,},},EphemeralContainerStatuses:[]ContainerStatus{},Resize:,ResourceClaimStatuses:[]PodResourceClaimStatus{},HostIPs:[]HostIP{HostIP{IP:10.10.5.103,},},},}
2024-06-03T03:12:38.792124Z	debug	ambient	Pod sleep-7656cf8794-t4dzs now matches, adding to mesh
2024-06-03T03:12:38.792187Z	info	ambient	in pod mode - adding pod default/sleep-7656cf8794-t4dzs to ztunnel 
2024-06-03T03:12:38.792219Z	debug	ambient	pod netns was not found, trying to find it using procfs
2024-06-03T03:12:38.831120Z	debug	ambient	found pod to netns: 49c3772c-e54d-43b6-9a0f-cebf9e799840 4026532731
2024-06-03T03:12:38.831352Z	debug	ambient	netns: 4026532731 already processed. skipping
2024-06-03T03:12:38.837083Z	debug	ambient	adding pod sleep-7656cf8794-t4dzs probe to ipset istio-inpod-probes with ip 10.100.217.194
2024-06-03T03:12:38.837628Z	debug	ambient	calling CreateInpodRules
2024-06-03T03:12:38.838774Z	debug	iptables	Iterating netlink route : {Ifindex: 1 Dst: 0.0.0.0/0 Src: <nil> Gw: <nil> Flags: [] Table: 100 Realm: 0}
2024-06-03T03:12:38.839127Z	debug	iptables	Iterating netlink rule : ip rule 32764: from all to all table 100
2024-06-03T03:12:38.839475Z	debug	iptables	Adding iptables rules
2024-06-03T03:12:38.839649Z	info	iptables	Running iptables-restore with the following input:
* mangle
-N ISTIO_PRERT
-N ISTIO_OUTPUT
-A PREROUTING -j ISTIO_PRERT
-A OUTPUT -j ISTIO_OUTPUT
-A ISTIO_PRERT -m mark --mark 0x539/0xfff -j CONNMARK --set-xmark 0x111/0xfff
-A ISTIO_PRERT -s 169.254.7.127 -p tcp -m tcp -j ACCEPT
-A ISTIO_PRERT ! -d 127.0.0.1/32 -p tcp -i lo -j ACCEPT
-A ISTIO_PRERT -p tcp -m tcp --dport 15008 -m mark ! --mark 0x539/0xfff -j TPROXY --on-port 15008 --tproxy-mark 0x111/0xfff
-A ISTIO_PRERT -p tcp -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
-A ISTIO_PRERT ! -d 127.0.0.1/32 -p tcp -m mark ! --mark 0x539/0xfff -j TPROXY --on-port 15006 --tproxy-mark 0x111/0xfff
-A ISTIO_OUTPUT -m connmark --mark 0x111/0xfff -j CONNMARK --restore-mark --nfmask 0xffffffff --ctmask 0xffffffff
COMMIT
* nat
-N ISTIO_OUTPUT
-A OUTPUT -j ISTIO_OUTPUT
-A ISTIO_OUTPUT -d 169.254.7.127 -p tcp -m tcp -j ACCEPT
-A ISTIO_OUTPUT -p tcp -m mark --mark 0x111/0xfff -j ACCEPT
-A ISTIO_OUTPUT ! -d 127.0.0.1/32 -o lo -j ACCEPT
-A ISTIO_OUTPUT ! -d 127.0.0.1/32 -p tcp -m mark ! --mark 0x539/0xfff -j REDIRECT --to-ports 15001
COMMIT
2024-06-03T03:12:38.839839Z	info	Running command (without lock): iptables-restore --noflush -v
2024-06-03T03:12:38.922528Z	debug	ambient	notifying subscribed node proxies
2024-06-03T03:12:38.922746Z	debug	ambient	About to send added pod: 49c3772c-e54d-43b6-9a0f-cebf9e799840 to ztunnel: add:{uid:"49c3772c-e54d-43b6-9a0f-cebf9e799840"}
2024-06-03T03:12:38.922925Z	debug	ambient	got update to send to ztunnel
2024-06-03T03:12:38.926414Z	debug	ambient	ztunnel acked
2024-06-03T03:12:38.926539Z	debug	ambient	annotating pod sleep-7656cf8794-t4dzs
2024-06-03T03:12:38.948225Z	debug	ambient	AddPodToMesh(sleep-7656cf8794-t4dzs) returned <nil>
2024-06-03T03:12:38.951624Z	debug	controllers	handling update: default/sleep-7656cf8794-t4dzs	controller=ambient
2024-06-03T03:12:38.952127Z	debug	controllers	handling update: default/sleep-7656cf8794-t4dzs	controller=repair pods
2024-06-03T03:12:38.952906Z	debug	ambient	Pod sleep-7656cf8794-t4dzs events: &Pod{ObjectMeta:{sleep-7656cf8794-t4dzs sleep-7656cf8794- default  49c3772c-e54d-43b6-9a0f-cebf9e799840 4051 0 2024-06-03 03:12:06 +0000 UTC <nil> <nil> map[app:sleep pod-template-hash:7656cf8794] map[ambient.istio.io/redirection:enabled cni.projectcalico.org/containerID:9e65a4e99f6c7d3652f3307c70255be209101fd8682a263fdcbff351f3d38da9 cni.projectcalico.org/podIP:10.100.217.194/32 cni.projectcalico.org/podIPs:10.100.217.194/32] [{apps/v1 ReplicaSet sleep-7656cf8794 1cbe911c-4201-4337-a788-d93dbd567720 0x4000b5d52e 0x4000b5d52f}] [] []},Spec:PodSpec{Volumes:[]Volume{Volume{Name:secret-volume,VolumeSource:VolumeSource{HostPath:nil,EmptyDir:nil,GCEPersistentDisk:nil,AWSElasticBlockStore:nil,GitRepo:nil,Secret:&SecretVolumeSource{SecretName:sleep-secret,Items:[]KeyToPath{},DefaultMode:*420,Optional:*true,},NFS:nil,ISCSI:nil,Glusterfs:nil,PersistentVolumeClaim:nil,RBD:nil,FlexVolume:nil,Cinder:nil,CephFS:nil,Flocker:nil,DownwardAPI:nil,FC:nil,AzureFile:nil,ConfigMap:nil,VsphereVolume:nil,Quobyte:nil,AzureDisk:nil,PhotonPersistentDisk:nil,PortworxVolume:nil,ScaleIO:nil,Projected:nil,StorageOS:nil,CSI:nil,Ephemeral:nil,},},Volume{Name:kube-api-access-vgrdj,VolumeSource:VolumeSource{HostPath:nil,EmptyDir:nil,GCEPersistentDisk:nil,AWSElasticBlockStore:nil,GitRepo:nil,Secret:nil,NFS:nil,ISCSI:nil,Glusterfs:nil,PersistentVolumeClaim:nil,RBD:nil,FlexVolume:nil,Cinder:nil,CephFS:nil,Flocker:nil,DownwardAPI:nil,FC:nil,AzureFile:nil,ConfigMap:nil,VsphereVolume:nil,Quobyte:nil,AzureDisk:nil,PhotonPersistentDisk:nil,PortworxVolume:nil,ScaleIO:nil,Projected:&ProjectedVolumeSource{Sources:[]VolumeProjection{VolumeProjection{Secret:nil,DownwardAPI:nil,ConfigMap:nil,ServiceAccountToken:&ServiceAccountTokenProjection{Audience:,ExpirationSeconds:*3607,Path:token,},ClusterTrustBundle:nil,},VolumeProjection{Secret:nil,DownwardAPI:nil,ConfigMap:&ConfigMapProjection{LocalObjectReference:LocalObjectReference{Name:kube-root-ca.crt,},Items:[]KeyToPath{KeyToPath{Key:ca.crt,Path:ca.crt,Mode:nil,},},Optional:nil,},ServiceAccountToken:nil,ClusterTrustBundle:nil,},VolumeProjection{Secret:nil,DownwardAPI:&DownwardAPIProjection{Items:[]DownwardAPIVolumeFile{DownwardAPIVolumeFile{Path:namespace,FieldRef:&ObjectFieldSelector{APIVersion:v1,FieldPath:metadata.namespace,},ResourceFieldRef:nil,Mode:nil,},},},ConfigMap:nil,ServiceAccountToken:nil,ClusterTrustBundle:nil,},},DefaultMode:*420,},StorageOS:nil,CSI:nil,Ephemeral:nil,},},},Containers:[]Container{Container{Name:sleep,Image:curlimages/curl,Command:[/bin/sleep infinity],Args:[],WorkingDir:,Ports:[]ContainerPort{},Env:[]EnvVar{},Resources:ResourceRequirements{Limits:ResourceList{},Requests:ResourceList{},Claims:[]ResourceClaim{},},VolumeMounts:[]VolumeMount{VolumeMount{Name:secret-volume,ReadOnly:false,MountPath:/etc/sleep/tls,SubPath:,MountPropagation:nil,SubPathExpr:,},VolumeMount{Name:kube-api-access-vgrdj,ReadOnly:true,MountPath:/var/run/secrets/kubernetes.io/serviceaccount,SubPath:,MountPropagation:nil,SubPathExpr:,},},LivenessProbe:nil,ReadinessProbe:nil,Lifecycle:nil,TerminationMessagePath:/dev/termination-log,ImagePullPolicy:IfNotPresent,SecurityContext:nil,Stdin:false,StdinOnce:false,TTY:false,EnvFrom:[]EnvFromSource{},TerminationMessagePolicy:File,VolumeDevices:[]VolumeDevice{},StartupProbe:nil,ResizePolicy:[]ContainerResizePolicy{},RestartPolicy:nil,},},RestartPolicy:Always,TerminationGracePeriodSeconds:*0,ActiveDeadlineSeconds:nil,DNSPolicy:ClusterFirst,NodeSelector:map[string]string{},ServiceAccountName:sleep,DeprecatedServiceAccount:sleep,NodeName:pi03.pico.home.arpa,HostNetwork:false,HostPID:false,HostIPC:false,SecurityContext:&PodSecurityContext{SELinuxOptions:nil,RunAsUser:nil,RunAsNonRoot:nil,SupplementalGroups:[],FSGroup:nil,RunAsGroup:nil,Sysctls:[]Sysctl{},WindowsOptions:nil,FSGroupChangePolicy:nil,SeccompProfile:nil,},ImagePullSecrets:[]LocalObjectReference{},Hostname:,Subdomain:,Affinity:nil,SchedulerName:default-scheduler,InitContainers:[]Container{},AutomountServiceAccountToken:nil,Tolerations:[]Toleration{Toleration{Key:node.kubernetes.io/not-ready,Operator:Exists,Value:,Effect:NoExecute,TolerationSeconds:*300,},Toleration{Key:node.kubernetes.io/unreachable,Operator:Exists,Value:,Effect:NoExecute,TolerationSeconds:*300,},},HostAliases:[]HostAlias{},PriorityClassName:,Priority:*0,DNSConfig:nil,ShareProcessNamespace:nil,ReadinessGates:[]PodReadinessGate{},RuntimeClassName:nil,EnableServiceLinks:*true,PreemptionPolicy:*PreemptLowerPriority,Overhead:ResourceList{},TopologySpreadConstraints:[]TopologySpreadConstraint{},EphemeralContainers:[]EphemeralContainer{},SetHostnameAsFQDN:nil,OS:nil,HostUsers:nil,SchedulingGates:[]PodSchedulingGate{},ResourceClaims:[]PodResourceClaim{},},Status:PodStatus{Phase:Running,Conditions:[]PodCondition{PodCondition{Type:PodReadyToStartContainers,Status:True,LastProbeTime:0001-01-01 00:00:00 +0000 UTC,LastTransitionTime:2024-06-03 03:12:13 +0000 UTC,Reason:,Message:,},PodCondition{Type:Initialized,Status:True,LastProbeTime:0001-01-01 00:00:00 +0000 UTC,LastTransitionTime:2024-06-03 03:12:06 +0000 UTC,Reason:,Message:,},PodCondition{Type:Ready,Status:True,LastProbeTime:0001-01-01 00:00:00 +0000 UTC,LastTransitionTime:2024-06-03 03:12:13 +0000 UTC,Reason:,Message:,},PodCondition{Type:ContainersReady,Status:True,LastProbeTime:0001-01-01 00:00:00 +0000 UTC,LastTransitionTime:2024-06-03 03:12:13 +0000 UTC,Reason:,Message:,},PodCondition{Type:PodScheduled,Status:True,LastProbeTime:0001-01-01 00:00:00 +0000 UTC,LastTransitionTime:2024-06-03 03:12:06 +0000 UTC,Reason:,Message:,},},Message:,Reason:,HostIP:10.10.5.103,PodIP:10.100.217.194,StartTime:2024-06-03 03:12:06 +0000 UTC,ContainerStatuses:[]ContainerStatus{ContainerStatus{Name:sleep,State:ContainerState{Waiting:nil,Running:&ContainerStateRunning{StartedAt:2024-06-03 03:12:13 +0000 UTC,},Terminated:nil,},LastTerminationState:ContainerState{Waiting:nil,Running:nil,Terminated:nil,},Ready:true,RestartCount:0,Image:docker.io/curlimages/curl:latest,ImageID:docker.io/curlimages/curl@sha256:73e4d532ea62d7505c5865b517d3704966ffe916609bedc22af6833dc9969bcd,ContainerID:containerd://581dc8c2e8a5771840558d852def2d9cfb8d00370a51d127cee9e04272510080,Started:*true,AllocatedResources:ResourceList{},Resources:nil,},},QOSClass:BestEffort,InitContainerStatuses:[]ContainerStatus{},NominatedNodeName:,PodIPs:[]PodIP{PodIP{IP:10.100.217.194,},},EphemeralContainerStatuses:[]ContainerStatus{},Resize:,ResourceClaimStatuses:[]PodResourceClaimStatus{},HostIPs:[]HostIP{HostIP{IP:10.10.5.103,},},},}
2024-06-03T03:12:38.952973Z	debug	ambient	Pod sleep-7656cf8794-t4dzs now matches, adding to mesh
2024-06-03T03:12:38.952995Z	info	ambient	in pod mode - adding pod default/sleep-7656cf8794-t4dzs to ztunnel 
2024-06-03T03:12:38.953025Z	debug	ambient	adding pod sleep-7656cf8794-t4dzs probe to ipset istio-inpod-probes with ip 10.100.217.194
2024-06-03T03:12:38.953383Z	debug	ambient	calling CreateInpodRules
2024-06-03T03:12:38.954469Z	debug	iptables	Iterating netlink route : {Ifindex: 1 Dst: 0.0.0.0/0 Src: <nil> Gw: <nil> Flags: [] Table: 100 Realm: 0}
2024-06-03T03:12:38.955169Z	debug	iptables	Iterating netlink rule : ip rule 32764: from all to all table 100
2024-06-03T03:12:38.955440Z	debug	iptables	Ignoring exists error adding inpod mark ip rule: failed to configure netlink rule: file exists
2024-06-03T03:12:38.955783Z	debug	iptables	Adding iptables rules
2024-06-03T03:12:38.955984Z	info	iptables	Running iptables-restore with the following input:
* nat
-N ISTIO_OUTPUT
-A OUTPUT -j ISTIO_OUTPUT
-A ISTIO_OUTPUT -d 169.254.7.127 -p tcp -m tcp -j ACCEPT
-A ISTIO_OUTPUT -p tcp -m mark --mark 0x111/0xfff -j ACCEPT
-A ISTIO_OUTPUT ! -d 127.0.0.1/32 -o lo -j ACCEPT
-A ISTIO_OUTPUT ! -d 127.0.0.1/32 -p tcp -m mark ! --mark 0x539/0xfff -j REDIRECT --to-ports 15001
COMMIT
* mangle
-N ISTIO_PRERT
-N ISTIO_OUTPUT
-A PREROUTING -j ISTIO_PRERT
-A OUTPUT -j ISTIO_OUTPUT
-A ISTIO_PRERT -m mark --mark 0x539/0xfff -j CONNMARK --set-xmark 0x111/0xfff
-A ISTIO_PRERT -s 169.254.7.127 -p tcp -m tcp -j ACCEPT
-A ISTIO_PRERT ! -d 127.0.0.1/32 -p tcp -i lo -j ACCEPT
-A ISTIO_PRERT -p tcp -m tcp --dport 15008 -m mark ! --mark 0x539/0xfff -j TPROXY --on-port 15008 --tproxy-mark 0x111/0xfff
-A ISTIO_PRERT -p tcp -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
-A ISTIO_PRERT ! -d 127.0.0.1/32 -p tcp -m mark ! --mark 0x539/0xfff -j TPROXY --on-port 15006 --tproxy-mark 0x111/0xfff
-A ISTIO_OUTPUT -m connmark --mark 0x111/0xfff -j CONNMARK --restore-mark --nfmask 0xffffffff --ctmask 0xffffffff
COMMIT
2024-06-03T03:12:38.956184Z	info	Running command (without lock): iptables-restore --noflush -v
2024-06-03T03:12:38.963704Z	error	Command error output: xtables other problem: line 2 failed
2024-06-03T03:12:38.963821Z	error	iptables	failed to restore iptables rules: exit status 1
2024-06-03T03:12:38.963926Z	error	ambient	failed to update POD inpod: default/sleep-7656cf8794-t4dzs exit status 1
2024-06-03T03:12:38.963948Z	error	ambient	failed to add pod to ztunnel: exit status 1
2024-06-03T03:12:38.963979Z	debug	ambient	AddPodToMesh(sleep-7656cf8794-t4dzs) returned exit status 1

Notably, it appears to be running the info ambient in pod mode - adding pod default/sleep-7656cf8794-t4dzs to ztunnel operation twice (more on that below).

When I attempt to debug the failed iptables-restore via kubectl exec, it returns no error:

istio-1.21.2-debugging-exec.txt
$ kubectl -n istio-system exec -it istio-cni-node-dnpzh -- bash
root@pi03:/opt/cni/bin# echo -e "^C
root@pi03:/opt/cni/bin# cd
root@pi03:~# echo -e "* nat
-N ISTIO_OUTPUT
-A OUTPUT -j ISTIO_OUTPUT
-A ISTIO_OUTPUT -d 169.254.7.127 -p tcp -m tcp -j ACCEPT
-A ISTIO_OUTPUT -p tcp -m mark --mark 0x111/0xfff -j ACCEPT
-A ISTIO_OUTPUT ! -d 127.0.0.1/32 -o lo -j ACCEPT
-A ISTIO_OUTPUT ! -d 127.0.0.1/32 -p tcp -m mark ! --mark 0x539/0xfff -j REDIRECT --to-ports 15001
COMMIT
* mangle
-N ISTIO_PRERT
-N ISTIO_OUTPUT
-A PREROUTING -j ISTIO_PRERT
-A OUTPUT -j ISTIO_OUTPUT
-A ISTIO_PRERT -m mark --mark 0x539/0xfff -j CONNMARK --set-xmark 0x111/0xfff
-A ISTIO_PRERT -s 169.254.7.127 -p tcp -m tcp -j ACCEPT
-A ISTIO_PRERT ! -d 127.0.0.1/32 -p tcp -i lo -j ACCEPT
-A ISTIO_PRERT -p tcp -m tcp --dport 15008 -m mark ! --mark 0x539/0xfff -j TPROXY --on-port 15008 --tproxy-mark 0x111/0xfff
-A ISTIO_PRERT -p tcp -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
-A ISTIO_PRERT ! -d 127.0.0.1/32 -p tcp -m mark ! --mark 0x539/0xfff -j TPROXY --on-port 15006 --tproxy-mark 0x111/0xfff
-A ISTIO_OUTPUT -m connmark --mark 0x111/0xfff -j CONNMARK --restore-mark --nfmask 0xffffffff --ctmask 0xffffffff
COMMIT" > ~/istio-iptables.txt
root@pi03:~# iptables-restore --noflush -v ~/istio-iptables.txt
root@pi03:~# echo $?
0

This entire iptables-restore error does not appear when I update to 1.22.0 (clean cluster state, not in-place upgrade). I noticed in 1.22.0 this operation only attempts to run 1 iptables-restore command, not 2:

istio-1.22.0-success.txt sample (full file attached)
2024-06-03T03:56:04.667504Z	debug	controllers	handling update: default	controller=ambient
2024-06-03T03:56:04.667632Z	debug	ambient	Namespace default updated
2024-06-03T03:56:04.667673Z	info	ambient	Namespace default is enabled in ambient mesh
2024-06-03T03:56:04.667727Z	debug	ambient	Enqueuing pod default/sleep-7656cf8794-vsxwr
2024-06-03T03:56:04.667789Z	debug	controllers	handling update: default/sleep-7656cf8794-vsxwr	controller=ambient
2024-06-03T03:56:04.672379Z	debug	ambient	Pod sleep-7656cf8794-vsxwr events: wasAnnotated(false), isAnnotated(false), shouldBeEnabled(true), changeNeeded(true), oldPod(&Pod{ObjectMeta:{sleep-7656cf8794-vsxwr sleep-7656cf8794- default  d10a9e8c-f772-431b-bd76-8ab0ec8410f5 3965 0 2024-06-03 03:53:06 +0000 UTC <nil> <nil> map[app:sleep pod-template-hash:7656cf8794] map[cni.projectcalico.org/containerID:6df76c2f1cdf218c9e65fce8bc170ec442a584b830c31a664f2fbd67335b7afb cni.projectcalico.org/podIP:10.100.158.3/32 cni.projectcalico.org/podIPs:10.100.158.3/32] [{apps/v1 ReplicaSet sleep-7656cf8794 e2df1778-47a5-4fa4-a67d-1f02c272d9e5 0x4000a99807 0x4000a99808}] [] []},Spec:PodSpec{Volumes:[]Volume{Volume{Name:secret-volume,VolumeSource:VolumeSource{HostPath:nil,EmptyDir:nil,GCEPersistentDisk:nil,AWSElasticBlockStore:nil,GitRepo:nil,Secret:&SecretVolumeSource{SecretName:sleep-secret,Items:[]KeyToPath{},DefaultMode:*420,Optional:*true,},NFS:nil,ISCSI:nil,Glusterfs:nil,PersistentVolumeClaim:nil,RBD:nil,FlexVolume:nil,Cinder:nil,CephFS:nil,Flocker:nil,DownwardAPI:nil,FC:nil,AzureFile:nil,ConfigMap:nil,VsphereVolume:nil,Quobyte:nil,AzureDisk:nil,PhotonPersistentDisk:nil,PortworxVolume:nil,ScaleIO:nil,Projected:nil,StorageOS:nil,CSI:nil,Ephemeral:nil,},},Volume{Name:kube-api-access-bqspt,VolumeSource:VolumeSource{HostPath:nil,EmptyDir:nil,GCEPersistentDisk:nil,AWSElasticBlockStore:nil,GitRepo:nil,Secret:nil,NFS:nil,ISCSI:nil,Glusterfs:nil,PersistentVolumeClaim:nil,RBD:nil,FlexVolume:nil,Cinder:nil,CephFS:nil,Flocker:nil,DownwardAPI:nil,FC:nil,AzureFile:nil,ConfigMap:nil,VsphereVolume:nil,Quobyte:nil,AzureDisk:nil,PhotonPersistentDisk:nil,PortworxVolume:nil,ScaleIO:nil,Projected:&ProjectedVolumeSource{Sources:[]VolumeProjection{VolumeProjection{Secret:nil,DownwardAPI:nil,ConfigMap:nil,ServiceAccountToken:&ServiceAccountTokenProjection{Audience:,ExpirationSeconds:*3607,Path:token,},ClusterTrustBundle:nil,},VolumeProjection{Secret:nil,DownwardAPI:nil,ConfigMap:&ConfigMapProjection{LocalObjectReference:LocalObjectReference{Name:kube-root-ca.crt,},Items:[]KeyToPath{KeyToPath{Key:ca.crt,Path:ca.crt,Mode:nil,},},Optional:nil,},ServiceAccountToken:nil,ClusterTrustBundle:nil,},VolumeProjection{Secret:nil,DownwardAPI:&DownwardAPIProjection{Items:[]DownwardAPIVolumeFile{DownwardAPIVolumeFile{Path:namespace,FieldRef:&ObjectFieldSelector{APIVersion:v1,FieldPath:metadata.namespace,},ResourceFieldRef:nil,Mode:nil,},},},ConfigMap:nil,ServiceAccountToken:nil,ClusterTrustBundle:nil,},},DefaultMode:*420,},StorageOS:nil,CSI:nil,Ephemeral:nil,},},},Containers:[]Container{Container{Name:sleep,Image:curlimages/curl,Command:[/bin/sleep infinity],Args:[],WorkingDir:,Ports:[]ContainerPort{},Env:[]EnvVar{},Resources:ResourceRequirements{Limits:ResourceList{},Requests:ResourceList{},Claims:[]ResourceClaim{},},VolumeMounts:[]VolumeMount{VolumeMount{Name:secret-volume,ReadOnly:false,MountPath:/etc/sleep/tls,SubPath:,MountPropagation:nil,SubPathExpr:,RecursiveReadOnly:nil,},VolumeMount{Name:kube-api-access-bqspt,ReadOnly:true,MountPath:/var/run/secrets/kubernetes.io/serviceaccount,SubPath:,MountPropagation:nil,SubPathExpr:,RecursiveReadOnly:nil,},},LivenessProbe:nil,ReadinessProbe:nil,Lifecycle:nil,TerminationMessagePath:/dev/termination-log,ImagePullPolicy:IfNotPresent,SecurityContext:nil,Stdin:false,StdinOnce:false,TTY:false,EnvFrom:[]EnvFromSource{},TerminationMessagePolicy:File,VolumeDevices:[]VolumeDevice{},StartupProbe:nil,ResizePolicy:[]ContainerResizePolicy{},RestartPolicy:nil,},},RestartPolicy:Always,TerminationGracePeriodSeconds:*0,ActiveDeadlineSeconds:nil,DNSPolicy:ClusterFirst,NodeSelector:map[string]string{},ServiceAccountName:sleep,DeprecatedServiceAccount:sleep,NodeName:pi05.pico.home.arpa,HostNetwork:false,HostPID:false,HostIPC:false,SecurityContext:&PodSecurityContext{SELinuxOptions:nil,RunAsUser:nil,RunAsNonRoot:nil,SupplementalGroups:[],FSGroup:nil,RunAsGroup:nil,Sysctls:[]Sysctl{},WindowsOptions:nil,FSGroupChangePolicy:nil,SeccompProfile:nil,AppArmorProfile:nil,},ImagePullSecrets:[]LocalObjectReference{},Hostname:,Subdomain:,Affinity:nil,SchedulerName:default-scheduler,InitContainers:[]Container{},AutomountServiceAccountToken:nil,Tolerations:[]Toleration{Toleration{Key:node.kubernetes.io/not-ready,Operator:Exists,Value:,Effect:NoExecute,TolerationSeconds:*300,},Toleration{Key:node.kubernetes.io/unreachable,Operator:Exists,Value:,Effect:NoExecute,TolerationSeconds:*300,},},HostAliases:[]HostAlias{},PriorityClassName:,Priority:*0,DNSConfig:nil,ShareProcessNamespace:nil,ReadinessGates:[]PodReadinessGate{},RuntimeClassName:nil,EnableServiceLinks:*true,PreemptionPolicy:*PreemptLowerPriority,Overhead:ResourceList{},TopologySpreadConstraints:[]TopologySpreadConstraint{},EphemeralContainers:[]EphemeralContainer{},SetHostnameAsFQDN:nil,OS:nil,HostUsers:nil,SchedulingGates:[]PodSchedulingGate{},ResourceClaims:[]PodResourceClaim{},},Status:PodStatus{Phase:Running,Conditions:[]PodCondition{PodCondition{Type:PodReadyToStartContainers,Status:True,LastProbeTime:0001-01-01 00:00:00 +0000 UTC,LastTransitionTime:2024-06-03 03:53:22 +0000 UTC,Reason:,Message:,},PodCondition{Type:Initialized,Status:True,LastProbeTime:0001-01-01 00:00:00 +0000 UTC,LastTransitionTime:2024-06-03 03:53:06 +0000 UTC,Reason:,Message:,},PodCondition{Type:Ready,Status:True,LastProbeTime:0001-01-01 00:00:00 +0000 UTC,LastTransitionTime:2024-06-03 03:53:22 +0000 UTC,Reason:,Message:,},PodCondition{Type:ContainersReady,Status:True,LastProbeTime:0001-01-01 00:00:00 +0000 UTC,LastTransitionTime:2024-06-03 03:53:22 +0000 UTC,Reason:,Message:,},PodCondition{Type:PodScheduled,Status:True,LastProbeTime:0001-01-01 00:00:00 +0000 UTC,LastTransitionTime:2024-06-03 03:53:06 +0000 UTC,Reason:,Message:,},},Message:,Reason:,HostIP:10.10.5.105,PodIP:10.100.158.3,StartTime:2024-06-03 03:53:06 +0000 UTC,ContainerStatuses:[]ContainerStatus{ContainerStatus{Name:sleep,State:ContainerState{Waiting:nil,Running:&ContainerStateRunning{StartedAt:2024-06-03 03:53:21 +0000 UTC,},Terminated:nil,},LastTerminationState:ContainerState{Waiting:nil,Running:nil,Terminated:nil,},Ready:true,RestartCount:0,Image:docker.io/curlimages/curl:latest,ImageID:docker.io/curlimages/curl@sha256:73e4d532ea62d7505c5865b517d3704966ffe916609bedc22af6833dc9969bcd,ContainerID:containerd://5d477abf0008fe287a1e8769dd0aeff815e1088b77a754b0392d67191b9d6253,Started:*true,AllocatedResources:ResourceList{},Resources:nil,VolumeMounts:[]VolumeMountStatus{},},},QOSClass:BestEffort,InitContainerStatuses:[]ContainerStatus{},NominatedNodeName:,PodIPs:[]PodIP{PodIP{IP:10.100.158.3,},},EphemeralContainerStatuses:[]ContainerStatus{},Resize:,ResourceClaimStatuses:[]PodResourceClaimStatus{},HostIPs:[]HostIP{HostIP{IP:10.10.5.105,},},},}), newPod(&Pod{ObjectMeta:{sleep-7656cf8794-vsxwr sleep-7656cf8794- default  d10a9e8c-f772-431b-bd76-8ab0ec8410f5 3965 0 2024-06-03 03:53:06 +0000 UTC <nil> <nil> map[app:sleep pod-template-hash:7656cf8794] map[cni.projectcalico.org/containerID:6df76c2f1cdf218c9e65fce8bc170ec442a584b830c31a664f2fbd67335b7afb cni.projectcalico.org/podIP:10.100.158.3/32 cni.projectcalico.org/podIPs:10.100.158.3/32] [{apps/v1 ReplicaSet sleep-7656cf8794 e2df1778-47a5-4fa4-a67d-1f02c272d9e5 0x4000a99807 0x4000a99808}] [] []},Spec:PodSpec{Volumes:[]Volume{Volume{Name:secret-volume,VolumeSource:VolumeSource{HostPath:nil,EmptyDir:nil,GCEPersistentDisk:nil,AWSElasticBlockStore:nil,GitRepo:nil,Secret:&SecretVolumeSource{SecretName:sleep-secret,Items:[]KeyToPath{},DefaultMode:*420,Optional:*true,},NFS:nil,ISCSI:nil,Glusterfs:nil,PersistentVolumeClaim:nil,RBD:nil,FlexVolume:nil,Cinder:nil,CephFS:nil,Flocker:nil,DownwardAPI:nil,FC:nil,AzureFile:nil,ConfigMap:nil,VsphereVolume:nil,Quobyte:nil,AzureDisk:nil,PhotonPersistentDisk:nil,PortworxVolume:nil,ScaleIO:nil,Projected:nil,StorageOS:nil,CSI:nil,Ephemeral:nil,},},Volume{Name:kube-api-access-bqspt,VolumeSource:VolumeSource{HostPath:nil,EmptyDir:nil,GCEPersistentDisk:nil,AWSElasticBlockStore:nil,GitRepo:nil,Secret:nil,NFS:nil,ISCSI:nil,Glusterfs:nil,PersistentVolumeClaim:nil,RBD:nil,FlexVolume:nil,Cinder:nil,CephFS:nil,Flocker:nil,DownwardAPI:nil,FC:nil,AzureFile:nil,ConfigMap:nil,VsphereVolume:nil,Quobyte:nil,AzureDisk:nil,PhotonPersistentDisk:nil,PortworxVolume:nil,ScaleIO:nil,Projected:&ProjectedVolumeSource{Sources:[]VolumeProjection{VolumeProjection{Secret:nil,DownwardAPI:nil,ConfigMap:nil,ServiceAccountToken:&ServiceAccountTokenProjection{Audience:,ExpirationSeconds:*3607,Path:token,},ClusterTrustBundle:nil,},VolumeProjection{Secret:nil,DownwardAPI:nil,ConfigMap:&ConfigMapProjection{LocalObjectReference:LocalObjectReference{Name:kube-root-ca.crt,},Items:[]KeyToPath{KeyToPath{Key:ca.crt,Path:ca.crt,Mode:nil,},},Optional:nil,},ServiceAccountToken:nil,ClusterTrustBundle:nil,},VolumeProjection{Secret:nil,DownwardAPI:&DownwardAPIProjection{Items:[]DownwardAPIVolumeFile{DownwardAPIVolumeFile{Path:namespace,FieldRef:&ObjectFieldSelector{APIVersion:v1,FieldPath:metadata.namespace,},ResourceFieldRef:nil,Mode:nil,},},},ConfigMap:nil,ServiceAccountToken:nil,ClusterTrustBundle:nil,},},DefaultMode:*420,},StorageOS:nil,CSI:nil,Ephemeral:nil,},},},Containers:[]Container{Container{Name:sleep,Image:curlimages/curl,Command:[/bin/sleep infinity],Args:[],WorkingDir:,Ports:[]ContainerPort{},Env:[]EnvVar{},Resources:ResourceRequirements{Limits:ResourceList{},Requests:ResourceList{},Claims:[]ResourceClaim{},},VolumeMounts:[]VolumeMount{VolumeMount{Name:secret-volume,ReadOnly:false,MountPath:/etc/sleep/tls,SubPath:,MountPropagation:nil,SubPathExpr:,RecursiveReadOnly:nil,},VolumeMount{Name:kube-api-access-bqspt,ReadOnly:true,MountPath:/var/run/secrets/kubernetes.io/serviceaccount,SubPath:,MountPropagation:nil,SubPathExpr:,RecursiveReadOnly:nil,},},LivenessProbe:nil,ReadinessProbe:nil,Lifecycle:nil,TerminationMessagePath:/dev/termination-log,ImagePullPolicy:IfNotPresent,SecurityContext:nil,Stdin:false,StdinOnce:false,TTY:false,EnvFrom:[]EnvFromSource{},TerminationMessagePolicy:File,VolumeDevices:[]VolumeDevice{},StartupProbe:nil,ResizePolicy:[]ContainerResizePolicy{},RestartPolicy:nil,},},RestartPolicy:Always,TerminationGracePeriodSeconds:*0,ActiveDeadlineSeconds:nil,DNSPolicy:ClusterFirst,NodeSelector:map[string]string{},ServiceAccountName:sleep,DeprecatedServiceAccount:sleep,NodeName:pi05.pico.home.arpa,HostNetwork:false,HostPID:false,HostIPC:false,SecurityContext:&PodSecurityContext{SELinuxOptions:nil,RunAsUser:nil,RunAsNonRoot:nil,SupplementalGroups:[],FSGroup:nil,RunAsGroup:nil,Sysctls:[]Sysctl{},WindowsOptions:nil,FSGroupChangePolicy:nil,SeccompProfile:nil,AppArmorProfile:nil,},ImagePullSecrets:[]LocalObjectReference{},Hostname:,Subdomain:,Affinity:nil,SchedulerName:default-scheduler,InitContainers:[]Container{},AutomountServiceAccountToken:nil,Tolerations:[]Toleration{Toleration{Key:node.kubernetes.io/not-ready,Operator:Exists,Value:,Effect:NoExecute,TolerationSeconds:*300,},Toleration{Key:node.kubernetes.io/unreachable,Operator:Exists,Value:,Effect:NoExecute,TolerationSeconds:*300,},},HostAliases:[]HostAlias{},PriorityClassName:,Priority:*0,DNSConfig:nil,ShareProcessNamespace:nil,ReadinessGates:[]PodReadinessGate{},RuntimeClassName:nil,EnableServiceLinks:*true,PreemptionPolicy:*PreemptLowerPriority,Overhead:ResourceList{},TopologySpreadConstraints:[]TopologySpreadConstraint{},EphemeralContainers:[]EphemeralContainer{},SetHostnameAsFQDN:nil,OS:nil,HostUsers:nil,SchedulingGates:[]PodSchedulingGate{},ResourceClaims:[]PodResourceClaim{},},Status:PodStatus{Phase:Running,Conditions:[]PodCondition{PodCondition{Type:PodReadyToStartContainers,Status:True,LastProbeTime:0001-01-01 00:00:00 +0000 UTC,LastTransitionTime:2024-06-03 03:53:22 +0000 UTC,Reason:,Message:,},PodCondition{Type:Initialized,Status:True,LastProbeTime:0001-01-01 00:00:00 +0000 UTC,LastTransitionTime:2024-06-03 03:53:06 +0000 UTC,Reason:,Message:,},PodCondition{Type:Ready,Status:True,LastProbeTime:0001-01-01 00:00:00 +0000 UTC,LastTransitionTime:2024-06-03 03:53:22 +0000 UTC,Reason:,Message:,},PodCondition{Type:ContainersReady,Status:True,LastProbeTime:0001-01-01 00:00:00 +0000 UTC,LastTransitionTime:2024-06-03 03:53:22 +0000 UTC,Reason:,Message:,},PodCondition{Type:PodScheduled,Status:True,LastProbeTime:0001-01-01 00:00:00 +0000 UTC,LastTransitionTime:2024-06-03 03:53:06 +0000 UTC,Reason:,Message:,},},Message:,Reason:,HostIP:10.10.5.105,PodIP:10.100.158.3,StartTime:2024-06-03 03:53:06 +0000 UTC,ContainerStatuses:[]ContainerStatus{ContainerStatus{Name:sleep,State:ContainerState{Waiting:nil,Running:&ContainerStateRunning{StartedAt:2024-06-03 03:53:21 +0000 UTC,},Terminated:nil,},LastTerminationState:ContainerState{Waiting:nil,Running:nil,Terminated:nil,},Ready:true,RestartCount:0,Image:docker.io/curlimages/curl:latest,ImageID:docker.io/curlimages/curl@sha256:73e4d532ea62d7505c5865b517d3704966ffe916609bedc22af6833dc9969bcd,ContainerID:containerd://5d477abf0008fe287a1e8769dd0aeff815e1088b77a754b0392d67191b9d6253,Started:*true,AllocatedResources:ResourceList{},Resources:nil,VolumeMounts:[]VolumeMountStatus{},},},QOSClass:BestEffort,InitContainerStatuses:[]ContainerStatus{},NominatedNodeName:,PodIPs:[]PodIP{PodIP{IP:10.100.158.3,},},EphemeralContainerStatuses:[]ContainerStatus{},Resize:,ResourceClaimStatuses:[]PodResourceClaimStatus{},HostIPs:[]HostIP{HostIP{IP:10.10.5.105,},},},})
2024-06-03T03:56:04.672873Z	debug	ambient	Pod sleep-7656cf8794-vsxwr now matches, adding to mesh
2024-06-03T03:56:04.673071Z	info	ambient	in pod mode - adding pod default/sleep-7656cf8794-vsxwr to ztunnel 
2024-06-03T03:56:04.673272Z	debug	ambient	pod netns was not found, trying to find it using procfs
2024-06-03T03:56:04.705832Z	debug	ambient	found pod to netns: d10a9e8c-f772-431b-bd76-8ab0ec8410f5 4026532810
2024-06-03T03:56:04.706057Z	debug	ambient	netns: 4026532810 already processed. skipping
2024-06-03T03:56:04.713052Z	debug	ambient	adding pod sleep-7656cf8794-vsxwr probe to ipset istio-inpod-probes with ip 10.100.158.3
2024-06-03T03:56:04.713363Z	debug	ambient	calling CreateInpodRules
2024-06-03T03:56:04.714315Z	debug	iptables	Iterating netlink route : {Ifindex: 1 Dst: 0.0.0.0/0 Src: <nil> Gw: <nil> Flags: [] Table: 100 Realm: 0}
2024-06-03T03:56:04.714637Z	debug	iptables	Iterating netlink rule : ip rule 32764: from all to all table 100
2024-06-03T03:56:04.714865Z	debug	iptables	Adding iptables rules
2024-06-03T03:56:04.714958Z	info	iptables	Running iptables-restore with the following input:
* nat
-N ISTIO_OUTPUT
-A OUTPUT -j ISTIO_OUTPUT
-A ISTIO_OUTPUT -d 169.254.7.127 -p tcp -m tcp -j ACCEPT
-A ISTIO_OUTPUT -p tcp -m mark --mark 0x111/0xfff -j ACCEPT
-A ISTIO_OUTPUT ! -d 127.0.0.1/32 -o lo -j ACCEPT
-A ISTIO_OUTPUT ! -d 127.0.0.1/32 -p tcp -m mark ! --mark 0x539/0xfff -j REDIRECT --to-ports 15001
COMMIT
* mangle
-N ISTIO_PRERT
-N ISTIO_OUTPUT
-A PREROUTING -j ISTIO_PRERT
-A OUTPUT -j ISTIO_OUTPUT
-A ISTIO_PRERT -m mark --mark 0x539/0xfff -j CONNMARK --set-xmark 0x111/0xfff
-A ISTIO_PRERT -s 169.254.7.127 -p tcp -m tcp -j ACCEPT
-A ISTIO_PRERT ! -d 127.0.0.1/32 -p tcp -i lo -j ACCEPT
-A ISTIO_PRERT -p tcp -m tcp --dport 15008 -m mark ! --mark 0x539/0xfff -j TPROXY --on-port 15008 --tproxy-mark 0x111/0xfff
-A ISTIO_PRERT -p tcp -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
-A ISTIO_PRERT ! -d 127.0.0.1/32 -p tcp -m mark ! --mark 0x539/0xfff -j TPROXY --on-port 15006 --tproxy-mark 0x111/0xfff
-A ISTIO_OUTPUT -m connmark --mark 0x111/0xfff -j CONNMARK --restore-mark --nfmask 0xffffffff --ctmask 0xffffffff
COMMIT
2024-06-03T03:56:04.715101Z	debug	running with lock
2024-06-03T03:56:04.715123Z	info	Running command (with wait lock): iptables-restore --noflush -v --wait=30
2024-06-03T03:56:04.729003Z	debug	ambient	notifying subscribed node proxies
2024-06-03T03:56:04.729154Z	info	ambient	About to send added pod: d10a9e8c-f772-431b-bd76-8ab0ec8410f5 to ztunnel: add:{uid:"d10a9e8c-f772-431b-bd76-8ab0ec8410f5"  workload_info:{name:"sleep-7656cf8794-vsxwr"  namespace:"default"  service_account:"sleep"  trust_domain:"cluster.local"}}
2024-06-03T03:56:04.729252Z	debug	ambient	got update to send to ztunnel
2024-06-03T03:56:04.731049Z	debug	ambient	ztunnel acked
2024-06-03T03:56:04.731398Z	debug	ambient	annotating pod sleep-7656cf8794-vsxwr
2024-06-03T03:56:04.751549Z	debug	ambient	AddPodToMesh(sleep-7656cf8794-vsxwr) returned <nil>
2024-06-03T03:56:04.753762Z	debug	controllers	handling update: default/sleep-7656cf8794-vsxwr	controller=repair pods
2024-06-03T03:56:04.755669Z	debug	controllers	handling update: default/sleep-7656cf8794-vsxwr	controller=ambient
2024-06-03T03:56:04.758629Z	debug	ambient	Pod sleep-7656cf8794-vsxwr events: wasAnnotated(false), isAnnotated(true), shouldBeEnabled(true), changeNeeded(false), oldPod(&Pod{ObjectMeta:{sleep-7656cf8794-vsxwr sleep-7656cf8794- default  d10a9e8c-f772-431b-bd76-8ab0ec8410f5 3965 0 2024-06-03 03:53:06 +0000 UTC <nil> <nil> map[app:sleep pod-template-hash:7656cf8794] map[cni.projectcalico.org/containerID:6df76c2f1cdf218c9e65fce8bc170ec442a584b830c31a664f2fbd67335b7afb cni.projectcalico.org/podIP:10.100.158.3/32 cni.projectcalico.org/podIPs:10.100.158.3/32] [{apps/v1 ReplicaSet sleep-7656cf8794 e2df1778-47a5-4fa4-a67d-1f02c272d9e5 0x4000a99807 0x4000a99808}] [] []},Spec:PodSpec{Volumes:[]Volume{Volume{Name:secret-volume,VolumeSource:VolumeSource{HostPath:nil,EmptyDir:nil,GCEPersistentDisk:nil,AWSElasticBlockStore:nil,GitRepo:nil,Secret:&SecretVolumeSource{SecretName:sleep-secret,Items:[]KeyToPath{},DefaultMode:*420,Optional:*true,},NFS:nil,ISCSI:nil,Glusterfs:nil,PersistentVolumeClaim:nil,RBD:nil,FlexVolume:nil,Cinder:nil,CephFS:nil,Flocker:nil,DownwardAPI:nil,FC:nil,AzureFile:nil,ConfigMap:nil,VsphereVolume:nil,Quobyte:nil,AzureDisk:nil,PhotonPersistentDisk:nil,PortworxVolume:nil,ScaleIO:nil,Projected:nil,StorageOS:nil,CSI:nil,Ephemeral:nil,},},Volume{Name:kube-api-access-bqspt,VolumeSource:VolumeSource{HostPath:nil,EmptyDir:nil,GCEPersistentDisk:nil,AWSElasticBlockStore:nil,GitRepo:nil,Secret:nil,NFS:nil,ISCSI:nil,Glusterfs:nil,PersistentVolumeClaim:nil,RBD:nil,FlexVolume:nil,Cinder:nil,CephFS:nil,Flocker:nil,DownwardAPI:nil,FC:nil,AzureFile:nil,ConfigMap:nil,VsphereVolume:nil,Quobyte:nil,AzureDisk:nil,PhotonPersistentDisk:nil,PortworxVolume:nil,ScaleIO:nil,Projected:&ProjectedVolumeSource{Sources:[]VolumeProjection{VolumeProjection{Secret:nil,DownwardAPI:nil,ConfigMap:nil,ServiceAccountToken:&ServiceAccountTokenProjection{Audience:,ExpirationSeconds:*3607,Path:token,},ClusterTrustBundle:nil,},VolumeProjection{Secret:nil,DownwardAPI:nil,ConfigMap:&ConfigMapProjection{LocalObjectReference:LocalObjectReference{Name:kube-root-ca.crt,},Items:[]KeyToPath{KeyToPath{Key:ca.crt,Path:ca.crt,Mode:nil,},},Optional:nil,},ServiceAccountToken:nil,ClusterTrustBundle:nil,},VolumeProjection{Secret:nil,DownwardAPI:&DownwardAPIProjection{Items:[]DownwardAPIVolumeFile{DownwardAPIVolumeFile{Path:namespace,FieldRef:&ObjectFieldSelector{APIVersion:v1,FieldPath:metadata.namespace,},ResourceFieldRef:nil,Mode:nil,},},},ConfigMap:nil,ServiceAccountToken:nil,ClusterTrustBundle:nil,},},DefaultMode:*420,},StorageOS:nil,CSI:nil,Ephemeral:nil,},},},Containers:[]Container{Container{Name:sleep,Image:curlimages/curl,Command:[/bin/sleep infinity],Args:[],WorkingDir:,Ports:[]ContainerPort{},Env:[]EnvVar{},Resources:ResourceRequirements{Limits:ResourceList{},Requests:ResourceList{},Claims:[]ResourceClaim{},},VolumeMounts:[]VolumeMount{VolumeMount{Name:secret-volume,ReadOnly:false,MountPath:/etc/sleep/tls,SubPath:,MountPropagation:nil,SubPathExpr:,RecursiveReadOnly:nil,},VolumeMount{Name:kube-api-access-bqspt,ReadOnly:true,MountPath:/var/run/secrets/kubernetes.io/serviceaccount,SubPath:,MountPropagation:nil,SubPathExpr:,RecursiveReadOnly:nil,},},LivenessProbe:nil,ReadinessProbe:nil,Lifecycle:nil,TerminationMessagePath:/dev/termination-log,ImagePullPolicy:IfNotPresent,SecurityContext:nil,Stdin:false,StdinOnce:false,TTY:false,EnvFrom:[]EnvFromSource{},TerminationMessagePolicy:File,VolumeDevices:[]VolumeDevice{},StartupProbe:nil,ResizePolicy:[]ContainerResizePolicy{},RestartPolicy:nil,},},RestartPolicy:Always,TerminationGracePeriodSeconds:*0,ActiveDeadlineSeconds:nil,DNSPolicy:ClusterFirst,NodeSelector:map[string]string{},ServiceAccountName:sleep,DeprecatedServiceAccount:sleep,NodeName:pi05.pico.home.arpa,HostNetwork:false,HostPID:false,HostIPC:false,SecurityContext:&PodSecurityContext{SELinuxOptions:nil,RunAsUser:nil,RunAsNonRoot:nil,SupplementalGroups:[],FSGroup:nil,RunAsGroup:nil,Sysctls:[]Sysctl{},WindowsOptions:nil,FSGroupChangePolicy:nil,SeccompProfile:nil,AppArmorProfile:nil,},ImagePullSecrets:[]LocalObjectReference{},Hostname:,Subdomain:,Affinity:nil,SchedulerName:default-scheduler,InitContainers:[]Container{},AutomountServiceAccountToken:nil,Tolerations:[]Toleration{Toleration{Key:node.kubernetes.io/not-ready,Operator:Exists,Value:,Effect:NoExecute,TolerationSeconds:*300,},Toleration{Key:node.kubernetes.io/unreachable,Operator:Exists,Value:,Effect:NoExecute,TolerationSeconds:*300,},},HostAliases:[]HostAlias{},PriorityClassName:,Priority:*0,DNSConfig:nil,ShareProcessNamespace:nil,ReadinessGates:[]PodReadinessGate{},RuntimeClassName:nil,EnableServiceLinks:*true,PreemptionPolicy:*PreemptLowerPriority,Overhead:ResourceList{},TopologySpreadConstraints:[]TopologySpreadConstraint{},EphemeralContainers:[]EphemeralContainer{},SetHostnameAsFQDN:nil,OS:nil,HostUsers:nil,SchedulingGates:[]PodSchedulingGate{},ResourceClaims:[]PodResourceClaim{},},Status:PodStatus{Phase:Running,Conditions:[]PodCondition{PodCondition{Type:PodReadyToStartContainers,Status:True,LastProbeTime:0001-01-01 00:00:00 +0000 UTC,LastTransitionTime:2024-06-03 03:53:22 +0000 UTC,Reason:,Message:,},PodCondition{Type:Initialized,Status:True,LastProbeTime:0001-01-01 00:00:00 +0000 UTC,LastTransitionTime:2024-06-03 03:53:06 +0000 UTC,Reason:,Message:,},PodCondition{Type:Ready,Status:True,LastProbeTime:0001-01-01 00:00:00 +0000 UTC,LastTransitionTime:2024-06-03 03:53:22 +0000 UTC,Reason:,Message:,},PodCondition{Type:ContainersReady,Status:True,LastProbeTime:0001-01-01 00:00:00 +0000 UTC,LastTransitionTime:2024-06-03 03:53:22 +0000 UTC,Reason:,Message:,},PodCondition{Type:PodScheduled,Status:True,LastProbeTime:0001-01-01 00:00:00 +0000 UTC,LastTransitionTime:2024-06-03 03:53:06 +0000 UTC,Reason:,Message:,},},Message:,Reason:,HostIP:10.10.5.105,PodIP:10.100.158.3,StartTime:2024-06-03 03:53:06 +0000 UTC,ContainerStatuses:[]ContainerStatus{ContainerStatus{Name:sleep,State:ContainerState{Waiting:nil,Running:&ContainerStateRunning{StartedAt:2024-06-03 03:53:21 +0000 UTC,},Terminated:nil,},LastTerminationState:ContainerState{Waiting:nil,Running:nil,Terminated:nil,},Ready:true,RestartCount:0,Image:docker.io/curlimages/curl:latest,ImageID:docker.io/curlimages/curl@sha256:73e4d532ea62d7505c5865b517d3704966ffe916609bedc22af6833dc9969bcd,ContainerID:containerd://5d477abf0008fe287a1e8769dd0aeff815e1088b77a754b0392d67191b9d6253,Started:*true,AllocatedResources:ResourceList{},Resources:nil,VolumeMounts:[]VolumeMountStatus{},},},QOSClass:BestEffort,InitContainerStatuses:[]ContainerStatus{},NominatedNodeName:,PodIPs:[]PodIP{PodIP{IP:10.100.158.3,},},EphemeralContainerStatuses:[]ContainerStatus{},Resize:,ResourceClaimStatuses:[]PodResourceClaimStatus{},HostIPs:[]HostIP{HostIP{IP:10.10.5.105,},},},}), newPod(&Pod{ObjectMeta:{sleep-7656cf8794-vsxwr sleep-7656cf8794- default  d10a9e8c-f772-431b-bd76-8ab0ec8410f5 3997 0 2024-06-03 03:53:06 +0000 UTC <nil> <nil> map[app:sleep pod-template-hash:7656cf8794] map[ambient.istio.io/redirection:enabled cni.projectcalico.org/containerID:6df76c2f1cdf218c9e65fce8bc170ec442a584b830c31a664f2fbd67335b7afb cni.projectcalico.org/podIP:10.100.158.3/32 cni.projectcalico.org/podIPs:10.100.158.3/32] [{apps/v1 ReplicaSet sleep-7656cf8794 e2df1778-47a5-4fa4-a67d-1f02c272d9e5 0x4000b6b17e 0x4000b6b17f}] [] []},Spec:PodSpec{Volumes:[]Volume{Volume{Name:secret-volume,VolumeSource:VolumeSource{HostPath:nil,EmptyDir:nil,GCEPersistentDisk:nil,AWSElasticBlockStore:nil,GitRepo:nil,Secret:&SecretVolumeSource{SecretName:sleep-secret,Items:[]KeyToPath{},DefaultMode:*420,Optional:*true,},NFS:nil,ISCSI:nil,Glusterfs:nil,PersistentVolumeClaim:nil,RBD:nil,FlexVolume:nil,Cinder:nil,CephFS:nil,Flocker:nil,DownwardAPI:nil,FC:nil,AzureFile:nil,ConfigMap:nil,VsphereVolume:nil,Quobyte:nil,AzureDisk:nil,PhotonPersistentDisk:nil,PortworxVolume:nil,ScaleIO:nil,Projected:nil,StorageOS:nil,CSI:nil,Ephemeral:nil,},},Volume{Name:kube-api-access-bqspt,VolumeSource:VolumeSource{HostPath:nil,EmptyDir:nil,GCEPersistentDisk:nil,AWSElasticBlockStore:nil,GitRepo:nil,Secret:nil,NFS:nil,ISCSI:nil,Glusterfs:nil,PersistentVolumeClaim:nil,RBD:nil,FlexVolume:nil,Cinder:nil,CephFS:nil,Flocker:nil,DownwardAPI:nil,FC:nil,AzureFile:nil,ConfigMap:nil,VsphereVolume:nil,Quobyte:nil,AzureDisk:nil,PhotonPersistentDisk:nil,PortworxVolume:nil,ScaleIO:nil,Projected:&ProjectedVolumeSource{Sources:[]VolumeProjection{VolumeProjection{Secret:nil,DownwardAPI:nil,ConfigMap:nil,ServiceAccountToken:&ServiceAccountTokenProjection{Audience:,ExpirationSeconds:*3607,Path:token,},ClusterTrustBundle:nil,},VolumeProjection{Secret:nil,DownwardAPI:nil,ConfigMap:&ConfigMapProjection{LocalObjectReference:LocalObjectReference{Name:kube-root-ca.crt,},Items:[]KeyToPath{KeyToPath{Key:ca.crt,Path:ca.crt,Mode:nil,},},Optional:nil,},ServiceAccountToken:nil,ClusterTrustBundle:nil,},VolumeProjection{Secret:nil,DownwardAPI:&DownwardAPIProjection{Items:[]DownwardAPIVolumeFile{DownwardAPIVolumeFile{Path:namespace,FieldRef:&ObjectFieldSelector{APIVersion:v1,FieldPath:metadata.namespace,},ResourceFieldRef:nil,Mode:nil,},},},ConfigMap:nil,ServiceAccountToken:nil,ClusterTrustBundle:nil,},},DefaultMode:*420,},StorageOS:nil,CSI:nil,Ephemeral:nil,},},},Containers:[]Container{Container{Name:sleep,Image:curlimages/curl,Command:[/bin/sleep infinity],Args:[],WorkingDir:,Ports:[]ContainerPort{},Env:[]EnvVar{},Resources:ResourceRequirements{Limits:ResourceList{},Requests:ResourceList{},Claims:[]ResourceClaim{},},VolumeMounts:[]VolumeMount{VolumeMount{Name:secret-volume,ReadOnly:false,MountPath:/etc/sleep/tls,SubPath:,MountPropagation:nil,SubPathExpr:,RecursiveReadOnly:nil,},VolumeMount{Name:kube-api-access-bqspt,ReadOnly:true,MountPath:/var/run/secrets/kubernetes.io/serviceaccount,SubPath:,MountPropagation:nil,SubPathExpr:,RecursiveReadOnly:nil,},},LivenessProbe:nil,ReadinessProbe:nil,Lifecycle:nil,TerminationMessagePath:/dev/termination-log,ImagePullPolicy:IfNotPresent,SecurityContext:nil,Stdin:false,StdinOnce:false,TTY:false,EnvFrom:[]EnvFromSource{},TerminationMessagePolicy:File,VolumeDevices:[]VolumeDevice{},StartupProbe:nil,ResizePolicy:[]ContainerResizePolicy{},RestartPolicy:nil,},},RestartPolicy:Always,TerminationGracePeriodSeconds:*0,ActiveDeadlineSeconds:nil,DNSPolicy:ClusterFirst,NodeSelector:map[string]string{},ServiceAccountName:sleep,DeprecatedServiceAccount:sleep,NodeName:pi05.pico.home.arpa,HostNetwork:false,HostPID:false,HostIPC:false,SecurityContext:&PodSecurityContext{SELinuxOptions:nil,RunAsUser:nil,RunAsNonRoot:nil,SupplementalGroups:[],FSGroup:nil,RunAsGroup:nil,Sysctls:[]Sysctl{},WindowsOptions:nil,FSGroupChangePolicy:nil,SeccompProfile:nil,AppArmorProfile:nil,},ImagePullSecrets:[]LocalObjectReference{},Hostname:,Subdomain:,Affinity:nil,SchedulerName:default-scheduler,InitContainers:[]Container{},AutomountServiceAccountToken:nil,Tolerations:[]Toleration{Toleration{Key:node.kubernetes.io/not-ready,Operator:Exists,Value:,Effect:NoExecute,TolerationSeconds:*300,},Toleration{Key:node.kubernetes.io/unreachable,Operator:Exists,Value:,Effect:NoExecute,TolerationSeconds:*300,},},HostAliases:[]HostAlias{},PriorityClassName:,Priority:*0,DNSConfig:nil,ShareProcessNamespace:nil,ReadinessGates:[]PodReadinessGate{},RuntimeClassName:nil,EnableServiceLinks:*true,PreemptionPolicy:*PreemptLowerPriority,Overhead:ResourceList{},TopologySpreadConstraints:[]TopologySpreadConstraint{},EphemeralContainers:[]EphemeralContainer{},SetHostnameAsFQDN:nil,OS:nil,HostUsers:nil,SchedulingGates:[]PodSchedulingGate{},ResourceClaims:[]PodResourceClaim{},},Status:PodStatus{Phase:Running,Conditions:[]PodCondition{PodCondition{Type:PodReadyToStartContainers,Status:True,LastProbeTime:0001-01-01 00:00:00 +0000 UTC,LastTransitionTime:2024-06-03 03:53:22 +0000 UTC,Reason:,Message:,},PodCondition{Type:Initialized,Status:True,LastProbeTime:0001-01-01 00:00:00 +0000 UTC,LastTransitionTime:2024-06-03 03:53:06 +0000 UTC,Reason:,Message:,},PodCondition{Type:Ready,Status:True,LastProbeTime:0001-01-01 00:00:00 +0000 UTC,LastTransitionTime:2024-06-03 03:53:22 +0000 UTC,Reason:,Message:,},PodCondition{Type:ContainersReady,Status:True,LastProbeTime:0001-01-01 00:00:00 +0000 UTC,LastTransitionTime:2024-06-03 03:53:22 +0000 UTC,Reason:,Message:,},PodCondition{Type:PodScheduled,Status:True,LastProbeTime:0001-01-01 00:00:00 +0000 UTC,LastTransitionTime:2024-06-03 03:53:06 +0000 UTC,Reason:,Message:,},},Message:,Reason:,HostIP:10.10.5.105,PodIP:10.100.158.3,StartTime:2024-06-03 03:53:06 +0000 UTC,ContainerStatuses:[]ContainerStatus{ContainerStatus{Name:sleep,State:ContainerState{Waiting:nil,Running:&ContainerStateRunning{StartedAt:2024-06-03 03:53:21 +0000 UTC,},Terminated:nil,},LastTerminationState:ContainerState{Waiting:nil,Running:nil,Terminated:nil,},Ready:true,RestartCount:0,Image:docker.io/curlimages/curl:latest,ImageID:docker.io/curlimages/curl@sha256:73e4d532ea62d7505c5865b517d3704966ffe916609bedc22af6833dc9969bcd,ContainerID:containerd://5d477abf0008fe287a1e8769dd0aeff815e1088b77a754b0392d67191b9d6253,Started:*true,AllocatedResources:ResourceList{},Resources:nil,VolumeMounts:[]VolumeMountStatus{},},},QOSClass:BestEffort,InitContainerStatuses:[]ContainerStatus{},NominatedNodeName:,PodIPs:[]PodIP{PodIP{IP:10.100.158.3,},},EphemeralContainerStatuses:[]ContainerStatus{},Resize:,ResourceClaimStatuses:[]PodResourceClaimStatus{},HostIPs:[]HostIP{HostIP{IP:10.10.5.105,},},},})
2024-06-03T03:56:04.758763Z	debug	ambient	Pod sleep-7656cf8794-vsxwr update event skipped, no change needed

I’m still unable to get traffic to flow between pods on 1.22.0 following the Ambient Getting Started guide, but I suspect that may be a different problem, I’ll keep debugging that.

istio-1.21.2-failure.txt istio-1.22.0-success.txt

And I am using 1.21.1 everywhere (helm charts):

$ helm ls --all-namespaces | grep istio | grep -v istio-prometheus-crs
istio-base                      istio-system    1               2024-04-16 23:58:42.397900198 -0400 EDT deployed        base-1.21.1                     1.21.1
istio-cni                       istio-system    1               2024-04-16 23:58:43.557971264 -0400 EDT deployed        cni-1.21.1                      1.21.1
istiod                          istio-system    1               2024-04-17 00:00:16.802439698 -0400 EDT deployed        istiod-1.21.1                   1.21.1
ztunnel                         istio-system    1               2024-04-17 00:00:54.827586801 -0400 EDT deployed        ztunnel-1.21.1                  1.21.1

Value files:

$ cat helm/istio-cni-values.yaml
profile: ambient
$ cat helm/istiod-values.yaml
profile: ambient

## Discovery Settings
pilot:
  tolerations:
  - key: node-role.kubernetes.io/master
    effect: NoSchedule
    operator: Exists
  - key: node-role.kubernetes.io/control-plane
    effect: NoSchedule
    operator: Exists

  resources:
    requests:
      cpu: 250m
      memory: 2048Mi
$ kubectl -n istio-system exec -it istio-cni-node-xjqj7 -- bash
root@pi02:/opt/cni/bin# which -a iptables
/usr/sbin/iptables
/sbin/iptables
root@pi02:/opt/cni/bin# ls -lah /usr/sbin/iptables /sbin/iptables
lrwxrwxrwx 1 root root 26 Mar 28 19:05 /sbin/iptables -> /etc/alternatives/iptables
lrwxrwxrwx 1 root root 26 Mar 28 19:05 /usr/sbin/iptables -> /etc/alternatives/iptables
root@pi02:/opt/cni/bin# iptables --version
iptables v1.8.7 (legacy)

I run Istio ambient mode on k3s cluster (amd64) using Calico, It works fine. The commands are:

curl -sfL https://rancher-mirror.rancher.cn/k3s/k3s-install.sh | INSTALL_K3S_MIRROR=cn \
  INSTALL_K3S_EXEC='--flannel-backend=none --cluster-cidr=192.168.0.0/16' \
  K3S_KUBECONFIG_OUTPUT=/root/.kube/config sh -s - \
  --disable-network-policy \
  --disable "traefik"
kubectl apply -f https://raw.githubusercontent.com/projectcalico/calico/v3.27.0/manifests/calico.yaml
istioctl install --set profile=ambient --set "components.ingressGateways[0].enabled=true" \
--set "components.ingressGateways[0].name=istio-ingressgateway" \
--skip-confirmation

I believe this works because you are not installing K3S with any CNI, and then installing Calico on top with defaults, which would use its own, more standard default CNI directory.

If you let K3S manage the CNI with one of its bundled offerings, you need the overrides, as it uses nonstandard paths. If you do not, it happens to work, because the K3S nonstandard path is being ignored by the primary CNI you have installed, and the primary CNI’s path happens to be the standard one that Istio expects by default.

I’ll enhance the docs and we can close this out.

Fyi: When I install k3s with this command:

curl -fL https://get.k3s.io | INSTALL_K3S_VERSION=v1.29.3+k3s1 \
    sh -s - server \
    --disable traefik

I need to install istio-cni with these values included to startup successfully:

helm upgrade --install istio-base istio/base -n istio-system --create-namespace
helm upgrade --install istio-cni istio/cni -n istio-system \
  --set profile=ambient \
  --set cni.cniBinDir=/var/lib/rancher/k3s/data/current/bin/ \
  --set cni.cniConfDir=/var/lib/rancher/k3s/agent/etc/cni/net.d

Based on this install, my k3s runs fine with ambient mode 😃

@bleggett Maybe worth to document as well?