Does MULTUS CNI has the support for AWS-CNI type?

3/15/2020

In Kubernetes, Pods are allocated with a single NIC by default, and in AWS EKS, if we are using AWS-CNI plugin(which comes by default), we get a private IP address allocated to the pod, which is from the pool of secondary private IP addresses allocated to underlying ENA interface of the EC2 instance(the managed node). I'm using Multus CNI plugin for allocating multiple interfaces to the POD on EKS. I'm able to associate a secondary interface to the pod of the type macvlan, ipvlan, host-device(passthrough).

Now, I want to associate the secondary interface to the pod, which uses the AWS-CNI, so that we get a private IP address to the pods, which is route-able in the VPC-subnet. Unfortunately, I'm getting the following error when I create a pod with the above said configuration:

 Failed create pod sandbox: rpc error: code = Unknown desc = failed to set up sandbox container "8afa07a666201b50fad5c773e2aa0b8221eb4e9e0dd0a7cd944e4633684dd0c6" network for pod "samplepod-2": NetworkPlugin cni failed to set up pod "samplepod-2_default" network: Multus: [default/samplepod-2]: error adding container to network "multus-aws-cni-network": delegateAdd: error invoking DelegateAdd - "aws-cni": error in getting result from AddNetwork: add cmd: failed to assign an IP address to container

So, does Multus CNI support AWS-CNI type?

Here is my network attachment definition :

apiVersion: "k8s.cni.cncf.io/v1"
kind: NetworkAttachmentDefinition
metadata:
  name: multus-aws-cni-network
spec:
  config: '{
          "cniVersion":"0.3.1",
          "type":"aws-cni"
    }'

And here is my Pod definition :

apiVersion: v1
kind: Pod
metadata:
  name: samplepod-2
  annotations:
    k8s.v1.cni.cncf.io/networks: multus-aws-cni-network
spec:
  containers:
  - name: samplepod
    command: ["/bin/ash", "-c", "trap : TERM INT; sleep infinity & wait"]
    image: alpine

On the managed node, we have the aws-cni :

ls  /opt/cni/bin
aws-cni  aws-cni-support.sh  bridge  cnitool  dhcp  flannel  host-device  host-local  ipvlan  loopback  macvlan  multus  noop  portmap  ptp  sample  tuning  vlan
-- Shreyas N D
amazon-web-services
aws-eks
docker
kubernetes
kubernetes-pod

0 Answers