-
Bug
-
Resolution: Unresolved
-
Major
-
None
-
4.21.0
-
None
-
False
-
-
None
-
Important
-
None
-
None
-
None
-
Proposed
-
None
-
None
-
None
-
None
-
None
-
None
-
None
-
None
Description of problem:
CUDN needs ipam: {mode: Enabled, lifecycle: Persistent} on configuration to detect MAC conflict in pod annotation but the above configuration is not needed, IP address conflict will still be detected.
Version-Release number of selected component (if applicable):
4.20
4.21
How reproducible:
Always
Steps to Reproduce:
- Create a CUDN with YAML after creating UDN namespace a1 with label cudn-group=l2-net
cat <<EOF | kubectl apply -f - apiVersion: k8s.ovn.org/v1 kind: ClusterUserDefinedNetwork metadata: name: l2-network spec: namespaceSelector: matchLabels: cudn-group: l2-net network: topology: Layer2 layer2: role: Primary subnets: ["192.168.40.0/24"] reservedSubnets: ["192.168.40.4/32", "192.168.40.5/32"] defaultGatewayIPs: - "192.168.40.3" EOF
2. Create a pod with annotation that is created successfully
cat <<EOF | kubectl apply -f - apiVersion: v1 kind: Pod metadata: annotations: v1.multus-cni.io/default-network: | [{ "name": "default", "namespace": "openshift-ovn-kubernetes", "ips": ["192.168.40.7/24"], "mac": "02:03:04:05:06:01" }] labels: name: hello-pod name: hello-pod namespace: a1 spec: containers: - name: hello-pod image: "quay.io/openshifttest/hello-sdn@sha256:c89445416459e7adea9a5a416b3365ed3d74f2491beb904d61dc8d1eb89a72a4" EOF
3. Create another pod
cat <<EOF | kubectl apply -f - apiVersion: v1 kind: Pod metadata: annotations: v1.multus-cni.io/default-network: | [{ "name": "default", "namespace": "openshift-ovn-kubernetes", "ips": ["192.168.40.8/24"], "mac": "02:03:04:05:06:01" }] labels: name: hello-pod name: hello-pod-1 namespace: a1 spec: containers: - name: hello-pod image: "quay.io/openshifttest/hello-sdn@sha256:c89445416459e7adea9a5a416b3365ed3d74f2491beb904d61dc8d1eb89a72a4" EOF
Actual results:
Pod is successfully created
Expected results:
Pod should not have been created successfully. There should have been event generated about MAC conflict.
Additional info:
With CUDN created in step 1 will ensure IP address conflict event is generated if pods with annotation are created.
Pod A
annotations: v1.multus-cni.io/default-network: | [{ "name": "default", "namespace": "openshift-ovn-kubernetes", "ips": ["192.168.40.7/24"], "mac": "02:03:04:05:06:01" }]
Pod B
annotations: v1.multus-cni.io/default-network: | [{ "name": "default", "namespace": "openshift-ovn-kubernetes", "ips": ["192.168.40.7/24"], "mac": "02:03:04:05:06:02" }]
Configure CUDN instead with YAML below to see MAC conflict event.
cat <<EOF | kubectl apply -f - apiVersion: k8s.ovn.org/v1 kind: ClusterUserDefinedNetwork metadata: name: l2-network spec: namespaceSelector: matchLabels: cudn-group: l2-net network: topology: Layer2 layer2: role: Primary subnets: ["192.168.40.0/24"] reservedSubnets: ["192.168.40.4/32", "192.168.40.5/32"] defaultGatewayIPs: - "192.168.40.3" ipam: {mode: Enabled, lifecycle: Persistent} EOF