colima icon indicating copy to clipboard operation
colima copied to clipboard

Telepresence's new version v2.6.x doesn't work in colima

Open ventsislav-georgiev opened this issue 3 years ago • 14 comments

This project https://github.com/telepresenceio/telepresence allows for a pod/deployment in the cluster to forward all traffic to instance running on localhost. It seems to do it using sidecar container with iptables config.

Since updating telepresence to v2.6.x it stopped working and its container gives the following error on startup:

info    Traffic Agent Init v2.6.2
error   failed to clear chain TEL_INBOUND_TCP: running [/sbin/iptables -t nat -N TEL_INBOUND_TCP --wait]: exit status 3: iptables v1.8.7 (legacy): can't initialize iptables table `nat': iptables who? (do you need to insmod?) Perhaps iptables or your kernel needs to be upgraded.
error   quit: failed to clear chain TEL_INBOUND_TCP: running [/sbin/iptables -t nat -N TEL_INBOUND_TCP --wait]: exit status 3: iptables v1.8.7 (legacy): can't initialize iptables table `nat': iptables who? (do you need to insmod?) Perhaps iptables or your kernel needs to be upgraded.

I've tried one solution found from searching for the error. Running colima ssh and then:

sudo modprobe ip_tables
sudo echo 'ip_tables' >> /etc/modules

But it didn't help.

Any clue what is causing this and how to fix it?

ventsislav-georgiev avatar May 19 '22 14:05 ventsislav-georgiev

@ventsislav-georgiev can you upgrade to latest development version brew install --HEAD colima and see if changes anything?

PS: you can always experiment with a separate profile e.g. colima start test

abiosoft avatar May 19 '22 15:05 abiosoft

Got the same error when using brew install --HEAD colima.

ventsislav-georgiev avatar May 19 '22 19:05 ventsislav-georgiev

After more testing it seems to be an issue with telepresence v2.6 version: https://github.com/telepresenceio/telepresence/issues/2596

ventsislav-georgiev avatar May 20 '22 08:05 ventsislav-georgiev

Telepresence 2.6.x versions will use iptables in places where older versions didn't. That's why this problem surfaces in 2.6.x.

Telepresence 2.6.x runs fine with colima on my powerbook (amd64), but the exact same setup fails on my M1.

thallgren avatar May 24 '22 05:05 thallgren

Any reason why iptables doesn't work in Colima when using the arm architecture?

thallgren avatar May 27 '22 02:05 thallgren

@abiosoft starting colima has the following error msg:

msg="[hostagent] failed to parse macOS version \"12.4\": 12.4 is not in dotted-tri format"

although its probably not related to the iptables issue

ventsislav-georgiev avatar May 30 '22 16:05 ventsislav-georgiev

@ventsislav-georgiev it's a Lima issue that has been fixed https://github.com/lima-vm/lima/pull/869 https://github.com/lima-vm/lima/issues/868.

I am not sure if the fix has been released yet, but you can brew install --head lima for the meantime.

abiosoft avatar May 30 '22 16:05 abiosoft

@abiosoft who can help with this issue regarding the iptables on M1, should we create issue for lima-vm?

ventsislav-georgiev avatar Jun 01 '22 18:06 ventsislav-georgiev

@ventsislav-georgiev I am not sure it's a Lima issue, I am suspecting Alpine. I would have to do some tests to pinpoint the issue but it would take a day or two before I have time for proper troubleshooting.

abiosoft avatar Jun 01 '22 20:06 abiosoft

@abiosoft any progress or anything I can do to help?

ventsislav-georgiev avatar Jun 10 '22 20:06 ventsislav-georgiev

Trying to get my hands on an M1 device, this should happen this week. Emulating aarch64 is too slow on my Intel Mac to do anything meaningful with kubernetes.

abiosoft avatar Jun 13 '22 21:06 abiosoft

There are a couple fairly easy ways to do this. MacStadium offers an open-source machine, https://www.macstadium.com/opensource - they've been providing one to DDEV that is used for tests. Also Scaleway has M1 machines that you only have to rent for 24 hours, fair price. https://www.scaleway.com/en/

rfay avatar Jun 13 '22 21:06 rfay

FYI same issue in different projects: https://github.com/wojas/docker-mac-network/issues/16 https://github.com/nginxinc/nginx-service-mesh/issues/35

ventsislav-georgiev avatar Jun 25 '22 07:06 ventsislav-georgiev

@rfay thanks for the suggestions, I successfully got a free open source machine from macStadium. @ventsislav-georgiev I am still troubleshooting this.

abiosoft avatar Jun 29 '22 21:06 abiosoft