Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

macvlan why "master" field is required #432

Closed
ccmin opened this issue Dec 26, 2019 · 0 comments
Closed

macvlan why "master" field is required #432

ccmin opened this issue Dec 26, 2019 · 0 comments
Labels

Comments

@ccmin
Copy link

ccmin commented Dec 26, 2019

Accroding to macvlan README, the master is optional,as follows:
master (string, optional): name of the host interface to enslave. Defaults to default route interface.
But when i delete the "master" in the yaml

[root@master ~]# cat macvlan-conf-1.yaml
apiVersion: "k8s.cni.cncf.io/v1"
kind: NetworkAttachmentDefinition
metadata:
name: macvlan-conf-1
spec:
config: '{
"cniVersion": "0.3.0",
"type": "macvlan",
"mode": "bridge",
"ipam": {
"ranges": [
[ {
"subnet": "192.168.2.0/24",
"rangeStart": "192.168.2.82",
"rangeEnd": "192.168.2.86",
"gateway": "192.168.2.4"
} ]
]
}
}'
[root@master ~]#
Then i apply the pod, it'state is still ContainerCreating, and describe information is
Events:
Type Reason Age From Message
Normal Scheduled 7s default-scheduler Successfully assigned default/pod-case-02 to master
Warning FailedCreatePodSandBox 0s kubelet, master Failed create pod sandbox: rpc error: code = Unknown desc = [failed to set up sandbox container "5eef8919a1112abe8fdd108711c2629d77051cdf874ac714beea565c16774160" network for pod "pod-case-02": NetworkPlugin cni failed to set up pod "pod-case-02_default" network: Multus: Err adding pod to network "macvlan-conf-1": Multus: error in invoke Delegate add - "macvlan": "master" field is required. It specifies the host interface name to virtualize, failed to clean up sandbox container "5eef8919a1112abe8fdd108711c2629d77051cdf874ac714beea565c16774160" network for pod "pod-case-02": NetworkPlugin cni failed to teardown pod "pod-case-02_default" network: Multus: error in invoke Delegate del - "macvlan": "master" field is required. It specifies the host interface name to virtualize / Multus: error in invoke Conflist Del - "cbr0": error in getting result from DelNetworkList: failed to convert major version part "": strconv.Atoi: parsing "": invalid syntax]
Normal SandboxChanged 0s kubelet, master Pod sandbox changed, it will be killed and re-created.
i understanding the "master" should use the default route interface ens2f2
[root@master ~]# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 192.168.1.1 0.0.0.0 UG 100 0 0 ens2f2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant