calico: Incompatible ipset protocol version (7) will cause problems

Expected Behavior

Calico can handle different ipset protocol versions. At least 6-7.

Current Behavior

If K8s upgrades to ipset >= v7.0 outgoing connects from pods fail.

Possible Solution

Upgrade the calico image to include ipset v7.x since it’s backward compatible.

Steps to Reproduce (for bugs)

  1. Make sure K8s is upgraded to use ipset v7.x (this is non-trivial if installed with kubeadm)
  2. Use proxy-mode=ipvs (uses ipset)
  3. Try an outgoing connect from a pod

The kube-proxy (v1.22.2) image includes ipset v6.38. It must be changed to some v7.x version. How that is done I can’t say. I start kube-proxy as a program (no container) so for me it’s simply to change the ipset on the node.

Context

While this isn’t a problem at the moment, it will be the day K8s upgrades to iset v7.x

Your Environment

  • Calico version: calico/cni:v3.19.1
  • Orchestrator version (e.g. kubernetes, mesos, rkt): K8s
  • Operating System and version: Own. But Ubuntu 20.04.3 LTS uses ipset v7.5 at the moment
  • Link to your project (optional):

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 8
  • Comments: 38 (16 by maintainers)

Commits related to this issue

Most upvoted comments

it will be [a problem] the day K8s upgrades to iset v7.x

Kubernetes v1.23.0 kube-proxy does use v.7.x now. Calico v3.21.x Pods show the OP’s error and will never be Ready. So the time has come.

ipset --version
ipset v7.10, protocol version: 7

Our distro marked Calico as not supported with Kuberntes v1.23 due to this incompatibility

FWIW, our overnight runs (on ubuntu 20.04) show Calico working just fine with k8s 1.23, so this isn’t a blanket incompatibility.

That’s probably because you’re using proxy-mode=iptables

FYI: The ipset changes is not part of v3.22.0 since it takes more time to get everything fully tested. It should be in v3.22.1.

Interesting, this kernel version doesn’t include bucketsize in all hash types for the ipset kernel module that’s why you seem to have no issues.

EDIT : Kernel >= 5.11 includes bucketsize in all hash types.

ipvs proxy mode SHOULD be disabled to make Calico work on kubernetes >= 1.23 AND host kernel >= 5.11

Hmm, I wonder what I do wrong that Calico v3.21.2 works fine for me with kube-proxy v1.23.1 in ipvs mode. Could it be that I miss some configuration, so kube-proxy is runing in ipvs mode while calico keeps using iptables?

Can you check calico-node logs and ipset version on host VS on calico-node pod ?

I got errors when using ipvs mode for dualstack use, iptables is fine on my 1.23 cluster