istio: on mac m1 : error Command error output: xtables parameter problem: iptables-restore: unable to initialize table 'nat'
Bug Description
kubectl -n bookinfo apply -f istio-1.12.1/samples/bookinfo/networking/bookinfo-gateway.yaml
kubectl -n bookinfo logs details-v1-79f774bdb9-qpl74 istio-init
COMMIT 2022-01-09T05:13:59.789959Z info Running command: iptables-restore --noflush /tmp/iptables-rules-1641705239788335054.txt1249728033 2022-01-09T05:13:59.840113Z error Command error output: xtables parameter problem: iptables-restore: unable to initialize table ‘nat’
Error occurred at line: 1 Try `iptables-restore -h’ or ‘iptables-restore --help’ for more information. 2022-01-09T05:13:59.840711Z error Failed to execute: iptables-restore --noflush /tmp/iptables-rules-1641705239788335054.txt1249728033, exit status 2
Version
% istioctl version
client version: 1.12.1
control plane version: 1.12.1
data plane version: 1.12.1 (2 proxies)
Additional Information
mac m1 platform
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 20
- Comments: 49 (8 by maintainers)
I do not understand the problem, and cannot reproduce this error by running
iptables-restore
with the rules in a file in a privileged container. The rules from manual invocation are confirmed within thenat
table. The problem is not with the underlying Linux configuration.I have tested with the containers built by the querycap/istio project and can confirm them to be fully functional on
arm64
on my Apple M1 Max Macbook Pro ink3d
on Docker for Mac. The problem appears to be with the packaging of these images.As a workaround use the images provided by querycap/istio, either with their
IstioOperator
suggestion or by changing the instances ofdocker.io/istio
todocker.io/querycapistio
in the Istio manifests.EDIT:
querycap/istio
is no longer keeping current. See my comment below for current recommendations.This issue is still not resolved
This is still an issue.
@howardjohn My preliminary testing indicates that the development build
1.16-alpha.db637b3e4d3c09da0f8fc8f3222231e1834668ed
does indeed resolve the issue.The command I used to generate the manifests used for testing was:
I have the same problem and I hope istio can support mac apple silicon someday.😎
I can confirm that the querycap workaround pointed to by @oursland works in my Kind cluster running on Macbook M1.
Kind version: 0.12.0 Istio version: 1.13.2
This is my Istio config.yaml (ref from https://github.com/querycap/istio ):
Installed Istio using: istioctl install -f config.yaml.
I am able to see this example work:
kubectl exec "$(kubectl get pod -l app=sleep -n bar -o jsonpath={.items..metadata.name})" -c sleep -n bar -- curl http://httpbin.foo:8000/ip -s -o /dev/null -w "%{http_code}\n"
200I’ve also tried the above in an AWS EC2 Arm64 VM based Kind cluster. Istio runs and sidecars come up successfully, but httpbin or helloworld container samples do not come up because they are amd64 images. I think the Docker installation on Mac M1 allows amd64 images to cross-run on arm64 architecture, which means that I did not have a problem running the sample apps on M1/Kind clusters.
Rip m1 macs… 😦
Thanks @oursland ! If anyone else has issues on builds labeled 1.16-alpha.XYZ or 1.15.0+, please open an issue. thanks!
After having the error stated in this issue, I started minikube with “–network-plugin=cni”, then installed istio with “components.cni.enabled=true”, but now I get the following error:
Alright, there are two possibilities here I think
@scottleedavis @psloboda @myartemis @devutkarsh
querycapistio
is not keeping up with the latest releases, butresf/istio
is. You’ll find their images at the project’s GitHub Packages.If you’re using Istio Operator, then their instructions on the
README.md
will be get you set up.If you’re not (I use manifests), then point the hub and images to their image registry as outlined in this PR to the
README.md
.https://github.com/istio/istio/issues/23009#issuecomment-980864913
solved my problem. (virtualbox-almalinux8.5 in macos)
Same issue here would love to know an answer.
Running Minikube with Docker driver on my local Mac M1.
Issue is met after installing Istio on my cluster with
istioctl install
and deploying my pods givingInit:CrashLoopBackOff
status and the similar error withiptables
:Its in 1.15.0 - just wasn’t in the original 1.15 betas which is why we had 1.16 discussion above
Any pointers to what may be happening here? It doesn’t look like the init container fails to come up on an ARM based kind cluster, and it also doesn’t look like iptables is failing because of an arch issue, as the command basically runs but fails to initialize the ‘nat’ table.
I’ve also tried this with istio-cni enabled - the istio-validation container doesn’t initialize and keeps getting restarted. So I haven’t been able to collect logs from it.
Seeing the same issue as well on M1 Macbook Pro. Kubernetes provider: Kind v0.11.1 Kind Docker image kernel: 5.10.76-linuxkit #1 SMP PREEMPT Mon Nov 8 11:22:26 UTC 2021 aarch64 aarch64 aarch64 GNU/Linux
Istiod comes up in istio-system namespace. Istio version: 1.12.1
However sleep pod does not come up in a namespace marked with istio-injection=enabled, and fails at istio-init container with the same error reported above: iptables-restore v1.6.1: iptables-restore: unable to initialize table ‘nat’
Error occurred at line: 1 Try `iptables-restore -h’ or ‘iptables-restore --help’ for more information. iptables-save panic: exit status 2
IPtables modules seem to be installed in the Kind image kernel: `modprobe br_netfilter --first-time; modprobe nf_nat --first-time; modprobe xt_REDIRECT --first-time; modprobe xt_owner --first-time; modprobe iptable_nat --first-time; modprobe iptable_mangle --first-time; modprobe iptable_filter --first-time
modprobe: ERROR: could not insert ‘br_netfilter’: Module already in kernel modprobe: ERROR: could not insert ‘nf_nat’: Module already in kernel modprobe: ERROR: could not insert ‘xt_REDIRECT’: Module already in kernel modprobe: ERROR: could not insert ‘xt_owner’: Module already in kernel modprobe: ERROR: could not insert ‘iptable_nat’: Module already in kernel modprobe: ERROR: could not insert ‘iptable_mangle’: Module already in kernel modprobe: ERROR: could not insert ‘iptable_filter’: Module already in kernel`