cni-migration icon indicating copy to clipboard operation
cni-migration copied to clipboard

Using `cni-migration` for migration with "plain" Calico as CNI

Open brandshaide opened this issue 5 years ago • 3 comments

First of all thank you so much for your aweseome work 👍 and your blog post on the website of Cilium! I'd like to use cni-migration for migrating a k8s-cluster to Cilium as the only CNI (I'd like to avoid CNI-chaining) - as I'm having just Calico as CNI and not Canal (Calico on top of Flannel) as in your scenario.

If I understand it correcly, basically all I have to do is to adapt the resources (multus.yaml) and in particular:

  • ConfigMap multus-cni-config to reflect the definition of Calico by changing/adopting cni-conf-flannel.json:
cni_network_config: |-
    {
      "name": "k8s-pod-network",
      "cniVersion": "0.3.0",
      "plugins": [
        {
          "type": "calico",
          "log_level": "info",
          "datastore_type": "kubernetes",
          "nodename": "__KUBERNETES_NODE_NAME__",
          "mtu": __CNI_MTU__,
          "ipam": {
            "type": "host-local",
            "subnet": "usePodCidr"
          },
          "policy": {
              "type": "k8s"
          },
          "kubernetes": {
              "kubeconfig": "__KUBECONFIG_FILEPATH__"
          }
        },
        {
          "type": "portmap",
          "snat": true,
          "capabilities": {"portMappings": true}
        }
      ]
    }

As well as change DaemonSet for calico in the config.yaml

But not quite sure if there's more to it.

brandshaide avatar Nov 27 '20 11:11 brandshaide

Hi @brandshaide, although that seems sane, I won't be able to give you any guarantees that this will work. Please try this on demo clusters first and be confident it works. Use at your own risk :smile:

JoshVanL avatar Dec 01 '20 10:12 JoshVanL

Hi @brandshaide, although that seems sane, I won't be able to give you any guarantees that this will work. Please try this on demo clusters first and be confident it works. Use at your own risk 😄

Thanks for your answer @JoshVanL - of course I'll try on a sandbox cluster first 😝 I'll let you know...

brandshaide avatar Dec 02 '20 10:12 brandshaide

Hi @brandshaide, did you try the migration from plain calico with this tool and have any findings you like to share?

movd avatar Jun 30 '21 18:06 movd