kube-ovn icon indicating copy to clipboard operation
kube-ovn copied to clipboard

Two staticIP using same subnet can not ping successfully to each other

Open JING21 opened this issue 2 years ago • 2 comments

Expected Behavior

Two staticIP pod can ping each other

Actual Behavior

Two pods can not ping each other

Steps to Reproduce the Problem

1.create statefulset-xyz 2.create statfulset-uvw 3.use xyz-pod ping uvw pod

Additional Info

  • Kubernetes version:
1.22.10
  • kube-ovn version:
v1.10.2
  • operation-system/kernel version:
4.19.0-193.1.13.el8

yaml file xyz

apiVersion: apps/v1
kind: StatefulSet
metadata:
  name: xyz
  namespace: c
spec:
  replicas: 1
  revisionHistoryLimit: 10
  serviceName: nginx
  selector:
    matchLabels:
      app: nginx
  template:
    metadata:
      annotations:
        cni.projectcalico.org/ipAddrs: "[\"10.244.0.117\"]"
        k8s.v1.cni.cncf.io/networks: c/c
        c.c.ovn.kubernetes.io/ip_pool: 166.17.16.77
      labels:
        app: nginx
    spec:
      containers:
      - name: nginx
        image: registry.cim/proxy/cmss/nginx-ping:latest
        imagePullPolicy: IfNotPresent
        ports:
        - containerPort: 80

yaml file uvw

apiVersion: apps/v1
kind: StatefulSet
metadata:
  name: uvw
  namespace: c
spec:
  replicas: 1
  revisionHistoryLimit: 10
  serviceName: nginx
  selector:
    matchLabels:
      app: nginx
  template:
    metadata:
      annotations:
        cni.projectcalico.org/ipAddrs: "[\"10.244.0.217\"]"
        k8s.v1.cni.cncf.io/networks: c/c
        c.c.ovn.kubernetes.io/ip_pool: 166.17.16.99
      labels:
        app: nginx
    spec:
      containers:
      - name: nginx
        image: registry.cim/proxy/cmss/nginx-ping:latest
        imagePullPolicy: IfNotPresent
        ports:
        - containerPort: 80

subnet file

apiVersion: kubeovn.io/v1
kind: Subnet
metadata:
  creationTimestamp: "2022-07-21T02:12:01Z"
  finalizers:
  - kube-ovn-controller
  generation: 2
  name: c
  resourceVersion: "2637126"
  selfLink: /apis/kubeovn.io/v1/subnets/c
  uid: 3428314d-3241-4719-9f92-07e27533ec52
spec:
  cidrBlock: 166.17.0.0/16
  default: false
  dhcpV4Options: ""
  dhcpV6Options: ""
  disableGatewayCheck: false
  disableInterConnection: false
  enableDHCP: false
  enableIPv6RA: false
  excludeIps:
  - 166.17.16.1
  gateway: 166.17.16.1
  gatewayNode: ""
  gatewayType: distributed
  ipv6RAConfigs: ""
  logicalGateway: false
  namespaces:
  - c
  natOutgoing: false
  private: false
  protocol: IPv4
  provider: c.c.ovn
  vpc: c-vpc

vpc

apiVersion: kubeovn.io/v1
kind: Vpc
metadata:
  creationTimestamp: "2022-07-21T02:12:00Z"
  generation: 1
  name: c-vpc
  resourceVersion: "2635509"
  selfLink: /apis/kubeovn.io/v1/vpcs/c-vpc
  uid: 5a49a251-d310-48e8-8b17-4379f6025749
spec:
  namespaces:
  - c
status:
  default: false
  defaultLogicalSwitch: ""
  router: c-vpc
  standby: true
  subnets:
  - c
  tcpLoadBalancer: vpc-c-vpc-tcp-load
  tcpSessionLoadBalancer: vpc-c-vpc-tcp-sess-load
  udpLoadBalancer: vpc-c-vpc-udp-load
  udpSessionLoadBalancer: vpc-c-vpc-udp-sess-load

Situation image

image

JING21 avatar Jul 21 '22 02:07 JING21

cni.projectcalico.org/ipAddrs: "[\"10.244.0.117\"]"

both kube-ovn and calico exist? if only kube-ovn, eth0 will use subnet which default in namespace.

xujunjie-cover avatar Jul 21 '22 06:07 xujunjie-cover

cni.projectcalico.org/ipAddrs: "[\"10.244.0.117\"]"

both kube-ovn and calico exist? if only kube-ovn, eth0 will use subnet which default in namespace.

Use calico as default cni and kube-ovn as Network-Attachment-Definition,Both set static ip。I tested it in two conditon. First is a static statefulset with static pod with calico and ovn , use same ippool and subent pod to ping the statefulset pod is successful. Second is two static ip statefulset pod with same ippool and subnet can not ping with each other.

JING21 avatar Jul 21 '22 07:07 JING21

Use kube-ovn as the secondary cni is not supported now.

oilbeater avatar May 05 '23 08:05 oilbeater