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

Arktos-vm-runtime uses "virtlet-eth0" as IFname to CNI #1329

Open
yb01 opened this issue Feb 2, 2022 · 1 comment
Open

Arktos-vm-runtime uses "virtlet-eth0" as IFname to CNI #1329

yb01 opened this issue Feb 2, 2022 · 1 comment
Assignees
Labels

Comments

@yb01
Copy link
Collaborator

yb01 commented Feb 2, 2022

this ended up as the CNI call to the Mizar as below. currently mizar has issue and only allow "eth0" as the IFName. we need to see if we need to either fix the limitation in Mizar of workaround it in arktos-runtime, i.e. hard-coded eth0 in the cniRuntimeConfig.

 mizarcni.go:57] Network variables: {"Command":"ADD","ContainerID":"9fd465eb-8d8a-4fe2-bcea-c98f82db48fc","NetNS":"/var/run/netns/9fd465eb-8d8a-4fe2-bcea-c98f82db48fc","IfName":"virtlet-eth0","CniPath":"/opt/cni/bin","K8sPodNamespace":"default","K8sPodName":"vmdefault","K8sPodTenant":"system","CniVersion":"0.3.1","NetworkName":"mizarcni","Plugin":"mizarcni"}
func (c *realClient) cniRuntimeConf(podID, podName, podNs, podTenant, vpc, nics, cniArgs string) *libcni.RuntimeConf {
	r := &libcni.RuntimeConf{
		ContainerID: podID,
		NetNS:       PodNetNSPath(podID),
		IfName:      "virtlet-eth0",
	}
	if podName != "" && podNs != "" {
		r.Args = [][2]string{
			{"IgnoreUnknown", "1"},
			{"K8S_POD_TENANT", podTenant},
			{"K8S_POD_NAMESPACE", podNs},
			{"K8S_POD_NAME", podName},
			{"K8S_POD_INFRA_CONTAINER_ID", podID},
			{"VPC", vpc},
			{"NICs", nics},
		}

		if kvs, err := toCNIArgs(cniArgs); err == nil {
			for k, v := range kvs {
				r.Args = append(r.Args, [2]string{k, v})
			}
		}
	}
	return r
}

@yb01
Copy link
Collaborator Author

yb01 commented Feb 7, 2022

the hard-coded ifName is not ideal. but this is OK for CNI's perspective. so this is not a functionality issue.

@Sindica Sindica added the P2 label Feb 7, 2022
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

2 participants