我正在使用multus-cni在pod中创建多个接口。我已经配置了编织网CNI,因此Pod提供了群集ip10.32.x.x。使用下面的network-attachment-definition,我可以在IP地址为10.32.0.180-199的Pod中建立多个接口,但是这些IP地址是同一集群中其他Pod无法访问的。如果我将kubectl exec插入另一个Pod,并ping通10.32.0.180,则无法ping通该IP。
谁能告诉我需要做什么,以便集群中的Pod中的其他接口可以访问?
apiVersion: "k8s.cni.cncf.io/v1"
kind: NetworkAttachmentDefinition
metadata:
name: macvlan-conf
spec:
config: '{
"cniVersion": "0.3.0",
"type": "macvlan",
"master": "{{ .Values.global.interfaceName }}",
"mode": "bridge",
"ipam": {
"type": "host-local",
"subnet": "10.32.0.0/16",
"rangeStart": "10.32.0.180",
"rangeEnd": "10.32.0.199",
"routes": [
{ "dst": "0.0.0.0/0" }
],
"gateway": "10.32.0.1"
}
}'
kubectl version
Client Version: version.Info{Major:"1", Minor:"13", GitVersion:"v1.13.0", GitCommit:"ddf47ac13c1a9483ea035a79cd7c10005ff21a6d", GitTreeState:"clean", BuildDate:"2018-12-03T21:04:45Z", GoVersion:"go1.11.2", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"13", GitVersion:"v1.13.0", GitCommit:"ddf47ac13c1a9483ea035a79cd7c10005ff21a6d", GitTreeState:"clean", BuildDate:"2018-12-03T20:56:12Z", GoVersion:"go1.11.2", Compiler:"gc", Platform:"linux/amd64"}
答案 0 :(得分:-1)
我使用了似乎运行良好的主机设备
apiVersion: "k8s.cni.cncf.io/v1"
kind: NetworkAttachmentDefinition
metadata:
name: host-1
spec:
config: '{
"cniVersion": "0.3.1",
"type": "host-device",
"device": "enp0s8"
}'