在Kubernetes中,Pods默认使用单个NIC分配,而在AWS中,如果我们使用AWS插件(默认情况下),则从分配给EC2实例的底层ENA接口(托管节点)的次要私有IP地址池中得到分配给pod的私有IP地址。我使用Multus CNI插件为EKS上的POD分配多个接口。我能够将第二个接口与macvlan、ipvlan、主机设备(pass身)类型的接口关联起来。
现在,我想将次要接口与使用AWS的pod,联系起来,这样我们就可以在VPC子网中获得一个私有IP地址到pods,这是可以路由的。不幸的是,当我使用上面提到的配置创建一个pod时,我得到了以下错误:
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那么,Multus CNI支持AWS类型吗?
以下是我的网络附件定义:
apiVersion: "k8s.cni.cncf.io/v1"
kind: NetworkAttachmentDefinition
metadata:
name: multus-aws-cni-network
spec:
config: '{
"cniVersion":"0.3.1",
"type":"aws-cni"
}'下面是我对Pod的定义:
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在托管节点上,我们有aws:
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 vlanhttps://stackoverflow.com/questions/60695176
复制相似问题