Man, I found this project looking for a way to run k8s on Proxmox easily. I thought "hell yea! this guy did the work for me."
But then I tried it and failed despite not being new to any of this. My pods were unable to communicate with each other. I tried everything I could think of: using canal instead of calico, using flannel instead of canal, using vxlan, using udp, using host-gw. Nothing was working. I could maybe ping between nodes, but certainly not pods.
Then, I found it! Debian 10 / Buster is using iptables >= 1.8, which operates in NFT mode by default.
I found two solutions. One is to install arptables and ebtables as part of the base packages, and then use something like this to force legacy mode:
- name: Enabling iptables-legacy mode.
become: yes
shell: >
update-alternatives --set {{ item.name }} /usr/sbin/{{ item.name }}-legacy
with_items:
- { name: "iptables" }
- { name: "ip6tables" }
- { name: "arptables" }
- { name: "ebtables" }
The other requires Calico v3.8.1 which added support for this version of iptables. For this to work you must set FELIX_IPTABLESBACKEND=NFT
. I'm not great at Ansible, so I came up with this:
- name: Enable nftables backend for Calico.
blockinfile:
path: /tmp/calico.yml
insertbefore: '^\s*securityContext\:'
block: |4
- name: FELIX_IPTABLESBACKEND
value: "NFT"
That wouldn't work for like flannel though, I think. Either way, I tested both solutions and they both provide pod to pod communication. I deployed MetalLB on top and it could communicate with the apiserver (which it failed to do before, which is how I noticed all of this).