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

multus网卡配置不生效 #1160

Closed
tiezhuoyu opened this issue Dec 9, 2021 · 4 comments · Fixed by #1188 or #1214
Closed

multus网卡配置不生效 #1160

tiezhuoyu opened this issue Dec 9, 2021 · 4 comments · Fixed by #1188 or #1214
Assignees

Comments

@tiezhuoyu
Copy link

tiezhuoyu commented Dec 9, 2021

Expected Behavior

使用multus配置网卡attachnet1,并指定attachnet1的子网为net1

Actual Behavior

配置不生效,attachnet1网卡最后分配到默认子网

Steps to Reproduce the Problem

  1. 创建测试pod
    cat centos-tools-pod.yaml
    apiVersion: v1
    kind: Pod
    metadata:
    name: centos-tools
    annotations:
    v1.multus-cni.io/default-network: default/attachnet1
    attachnet1.default.ovn.kubernetes.io/logical_switch: net1
    spec:
    containers:
    - name: centos
    image: centos/tools
    command:
    - /sbin/init
    ports:
    - containerPort: 80

kubectl apply -f centos-tools-pod.yaml

  1. 查看pod ip处于默认子网10.16.0.0/16,而不是指定子网net1
    kubectl get po -owide centos-tools

Additional Info

  • Kubernetes version:
    Client Version: version.Info{Major:"1", Minor:"20", GitVersion:"v1.20.4", GitCommit:"e87da0bd6e03ec3fea7933c4b5263d151aafd07c", GitTreeState:"clean", BuildDate:"2021-02-18T16:12:00Z", GoVersion:"go1.15.8", Compiler:"gc", Platform:"linux/amd64"}
    Server Version: version.Info{Major:"1", Minor:"20", GitVersion:"v1.20.4", GitCommit:"e87da0bd6e03ec3fea7933c4b5263d151aafd07c", GitTreeState:"clean", BuildDate:"2021-02-18T16:03:00Z", GoVersion:"go1.15.8", Compiler:"gc", Platform:"linux/amd64"}

  • kube-ovn version:
    1.8.1

  • operation-system/kernel version:
    "CentOS Linux 7 (Core)"
    4.16.13-1.el7.elrepo.x86_64

@oilbeater
Copy link
Collaborator

pod ip 显示的是主网卡 ip,需要进到容器里去看附属网卡ip

@tiezhuoyu
Copy link
Author

image
只有这一张网卡的,我通过“v1.multus-cni.io/default-network: default/attachnet1”这个配置设置默认网卡

@oilbeater
Copy link
Collaborator

@tiezhuoyu 能不能把 attach-network 和 subnet 等 yaml 发一下,我们复现一下

@tiezhuoyu
Copy link
Author

tiezhuoyu commented Dec 14, 2021

@tiezhuoyu 能不能把 attach-network 和 subnet 等 yaml 发一下,我们复现一下

cat vpc-subnet-attch.yaml
---
kind: Vpc
apiVersion: kubeovn.io/v1
metadata:
name: test-vpc-1
spec: {}
---
kind: Subnet
apiVersion: kubeovn.io/v1
metadata:
name: net1
spec:
vpc: test-vpc-1
cidrBlock: 10.3.0.0/16
default: false
natOutgoing: false
---
apiVersion: "k8s.cni.cncf.io/v1"
kind: NetworkAttachmentDefinition
metadata:
name: attachnet1
namespace: default
spec:
config: '{
"cniVersion": "0.3.0",
"type": "kube-ovn",
"server_socket": "/run/openvswitch/kube-ovn-daemon.sock",
"provider": "attachnet1.default.ovn"

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