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

[BUG] ip is released, but subnet v4usingipRange not updated #4051

Closed
bobz965 opened this issue May 20, 2024 · 3 comments
Closed

[BUG] ip is released, but subnet v4usingipRange not updated #4051

bobz965 opened this issue May 20, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@bobz965
Copy link
Collaborator

bobz965 commented May 20, 2024

Kube-OVN Version

v1.12-mc, master

Kubernetes Version

v1.21.5

Operation-system/Kernel Version

4.19

Description

image

image

Steps To Reproduce

  1. 基于bridge 模式创建一个虚拟机,虚拟机pod有两张网卡,虚拟机内部只能看到一张网卡
  2. 然后直接变更eth0这个网卡对应的子网,设计上,复用之前的网卡 ip 名,先删除旧的 ip,然后重新从另一个 subnet 分配 ip

虚拟机直接变更子网的变更方式如下,通过控制 vm template annotation 的 ovn logical switch 直接修改子网

# vm pod annotation 如下

apiVersion: v1
kind: Pod
metadata:
  annotations:
    attachnet.default.ovn.kubernetes.io/allocated: "true"
    attachnet.default.ovn.kubernetes.io/allow_live_migration: "true"
    attachnet.default.ovn.kubernetes.io/cidr: 10.251.210.128/26
    attachnet.default.ovn.kubernetes.io/default_route: "true"
    attachnet.default.ovn.kubernetes.io/gateway: 10.251.210.190
    attachnet.default.ovn.kubernetes.io/ip_address: 10.251.210.132
    attachnet.default.ovn.kubernetes.io/logical_switch: subnet2095 
# 直接变更子网名为 subnet2095,之前是 subnet 2020
    attachnet.default.ovn.kubernetes.io/mac_address: 00:00:00:F5:92:DC
    attachnet.default.ovn.kubernetes.io/pod_nic_type: veth-pair
    attachnet.default.ovn.kubernetes.io/provider_network: managenet
    attachnet.default.ovn.kubernetes.io/routed: "true"
    attachnet.default.ovn.kubernetes.io/virtualmachine: cn0514-vm-001
    attachnet.default.ovn.kubernetes.io/vlan_id: "2095"
    eis.io/hostname: cn0514-vm-001
    k8s.v1.cni.cncf.io/network-status: |-
      [{
          "name": "kube-ovn",
          "interface": "eth0",
          "ips": [
              "10.222.1.71",
              "fd11:1111:1111::147"
          ],
          "mac": "00:00:00:8A:2E:4A",
          "default": true,
          "dns": {},
          "gateway": [
              "10.222.0.1",
              "fd11:1111:1111::1"
          ]
      },{
          "name": "default/attachnet",
          "interface": "net1",
          "ips": [
              "10.251.210.132"
          ],
          "mac": "00:00:00:F5:92:DC",
          "dns": {},
          "gateway": [
              "10.251.210.190"
          ]
      }]
    k8s.v1.cni.cncf.io/networks: default/attachnet # 这个保持不变
    kubectl.kubernetes.io/default-container: compute
    kubevirt.io/domain: cn0514-vm-001
    kubevirt.io/latest-observed-api-version: v1
    kubevirt.io/migrationTransportUnix: "true"
    kubevirt.io/storage-observed-api-version: v1alpha3
    ovn.kubernetes.io/allocated: "true"
    ovn.kubernetes.io/allow_live_migration: "true"
    ovn.kubernetes.io/cidr: 10.222.0.0/18,fd11:1111:1111::/48
    ovn.kubernetes.io/gateway: 10.222.0.1,fd11:1111:1111::1
    ovn.kubernetes.io/ip_address: 10.222.1.71,fd11:1111:1111::147
    ovn.kubernetes.io/logical_router: ovn-cluster
    ovn.kubernetes.io/logical_switch: ovn-default
    ovn.kubernetes.io/mac_address: 00:00:00:8A:2E:4A
    ovn.kubernetes.io/pod_nic_type: veth-pair
    ovn.kubernetes.io/routed: "true"
    ovn.kubernetes.io/virtualmachine: cn0514-vm-001

原因: 这个逻辑中没有触发 ip 所在的旧的 subnet 更新状态

Current Behavior

subnet v4 ip using not updated

Expected Behavior

subnet v4 ip using should update after ip released

@bobz965 bobz965 added the bug Something isn't working label May 20, 2024
@bobz965
Copy link
Collaborator Author

bobz965 commented May 20, 2024

image

@zhangzujian 请问一下, subnet 的 ip pool 数据结构是用于什么用途的呢? 和 ip pool crd 有关系么? 我这个场景的 ip 都是子网直接分配的,没有使用 ip pool

@zcq98
Copy link
Member

zcq98 commented May 21, 2024

image

@bobz965
Copy link
Collaborator Author

bobz965 commented May 22, 2024

1.11 也需要修复

e2e 需要补充覆盖

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants