jtblin / kube2iam

kube2iam provides different AWS IAM roles for pods running on Kubernetes
BSD 3-Clause "New" or "Revised" License
1.98k stars 319 forks source link

| failed to run command: /sbin/iptables -t nat -N CONSUL_PROXY_INBOUND, err: exit status 3, output: modprobe: can't change directory to '/lib/modules': No such file or directory | iptables v1.8.8 (legacy): can't initialize iptables table `nat': Table does not exist (do you need to insmod?) | Perhaps iptables or your kernel needs to be upgraded. #375

Open shamaloy opened 4 months ago

shamaloy commented 4 months ago

| failed to run command: /sbin/iptables -t nat -N CONSUL_PROXY_INBOUND, err: exit status 3, output: modprobe: can't change directory to '/lib/modules': No such file or directory | iptables v1.8.8 (legacy): can't initialize iptables table `nat': Table does not exist (do you need to insmod?) | Perhaps iptables or your kernel needs to be upgraded.

shamaloy commented 4 months ago

Resolution: Add following code

     volumeMounts:
        - mountPath: /run/xtables.lock
          name: xtables-lock
          readOnly: false
        - mountPath: /lib/modules
          name: lib-modules
          readOnly: true
  volumes:
    - name: xtables-lock
      hostPath:
        path: /run/xtables.lock
        type: FileOrCreate
    - name: lib-modules
      hostPath:
        path: /lib/modules
        type: ""