uswitch / kiam

Integrate AWS IAM with Kubernetes
Apache License 2.0
1.15k stars 238 forks source link

agent.host.iptables=true doesn't work w/ helm chart deployment #442

Open jkroepke opened 3 years ago

jkroepke commented 3 years ago

Hi,

today i tried kiam first time using the helm chart.

I'm using the 5.9.0 version, but the 5.10 is affected, too.

After setting agent.host.iptables=true, the agents did not start anymore:

2020-11-23T22:11:50.295363147+01:00 {"level":"info","msg":"configuring iptables","time":"2020-11-23T21:11:50Z"}
2020-11-23T22:11:50.299331187+01:00 {"level":"error","msg":"error configuring iptables: running [/sbin/iptables -t nat -C PREROUTING -p tcp -d 169.254.169.254 --dport 80 -j DNAT --to-destination 10.240.1.23:8181 -i cali+ --wait]: exit status 3: DNAT: Could not determine whether revision 2 is supported, assuming it is.\nDNAT: Could not determine whether revision 2 is supported, assuming it is.\niptables v1.8.3 (legacy): can't initialize iptables table `nat': Permission denied (you must be root)\nPerhaps iptables or your kernel needs to be upgraded.\n","time":"2020-11-23T21:11:50Z"}
2020-11-23T22:11:50.299425318+01:00 {"level":"fatal","msg":"fatal error: running [/sbin/iptables -t nat -C PREROUTING -p tcp -d 169.254.169.254 --dport 80 -j DNAT --to-destination 10.240.1.23:8181 -i cali+ --wait]: exit status 3: DNAT: Could not determine whether revision 2 is supported, assuming it is.\nDNAT: Could not determine whether revision 2 is supported, assuming it is.\niptables v1.8.3 (legacy): can't initialize iptables table `nat': Permission denied (you must be root)\nPerhaps iptables or your kernel needs to be upgraded.\n","time":"2020-11-23T21:11:50Z"}

System Info:

Kubernetes was setup with kubeadm, no special security rules applied. SELinux is not available on Ubuntu.

What did I do wrong? Do I miss something?

wd commented 3 years ago

This is the root cause: iptables v1.8.3 (legacy): can't initialize iptables tablenat': Permission denied (you must be root)` ?

jkroepke commented 3 years ago

Sure, the chart miss some settings