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

Accont for non-sandbox interfaces when specifying the default network #71

Conversation

maiqueb
Copy link
Contributor

@maiqueb maiqueb commented Sep 13, 2024

We only account for the sandox interfaces when reporting the interfaces in the network-status annotation; in case the CreateNetworkStatuses clients invoke it with a CNI result featuring non-sandbox interfaces as the first item in the list, the existing criteria would not work, and we would fail to report any interface as the default.

We only account for the sandox interfaces when reporting the interfaces
in the network-status annotation; in case the `CreateNetworkStatuses`
clients invoke it with a CNI result featuring non-sandbox interfaces
*before*, the existing criteria would not work, and we would fail to
report **any** inteface as the default one.

Signed-off-by: Miguel Duarte Barroso <[email protected]>
@maiqueb
Copy link
Contributor Author

maiqueb commented Sep 13, 2024

/cc @dougbtv

Copy link
Member

@dougbtv dougbtv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great catch, thank you!!!!

@dougbtv dougbtv merged commit 506cfda into k8snetworkplumbingwg:master Sep 13, 2024
1 check passed
RamLavi pushed a commit to RamLavi/ovn-kubernetes that referenced this pull request Sep 16, 2024
Before this commit, this was the network status we reported for a UDN
pod:
```
kubectl get pods pod -ojsonpath="{@.metadata.annotations.k8s\.v1\.cni\.cncf\.io\/network-status}" | jq
[
  {
    "name": "ovn-kubernetes",
    "interface": "eth0",
    "ips": [
      "10.244.1.9",
      "fd00:10:244:2::9"
    ],
    "mac": "0a:58:0a:f4:01:09",
    "default": true,
    "dns": {}
  }
]
```

With it, we now report:
```
[
 {
    "name": "ovn-kubernetes",
    "interface": "ovn-udn1",
    "ips": [
      "10.128.0.3"
    ],
    "mac": "0a:58:0a:80:00:03",
    "default": true,
    "dns": {}
  },
  {
    "name": "ovn-kubernetes",
    "interface": "eth0",
    "ips": [
      "10.244.1.6",
      "fd00:10:244:2::6"
    ],
    "mac": "0a:58:0a:f4:01:06",
    "default": false,
    "dns": {}
  }
 ]
```

This way, applications complying to the k8snetworkplumbingwg de-facto
standard can be aware of the UDN interface information.

We report the primary UDN first so the
network-attachment-definition-client can identify which of the 2
interfaces to report as primary [0].

[0] k8snetworkplumbingwg/network-attachment-definition-client#71

Signed-off-by: Miguel Duarte Barroso <[email protected]>
Signed-off-by: Ram Lavi <[email protected]>
RamLavi pushed a commit to RamLavi/ovn-kubernetes that referenced this pull request Sep 16, 2024
Before this commit, this was the network status we reported for a UDN
pod:
```
kubectl get pods pod -ojsonpath="{@.metadata.annotations.k8s\.v1\.cni\.cncf\.io\/network-status}" | jq
[
  {
    "name": "ovn-kubernetes",
    "interface": "eth0",
    "ips": [
      "10.244.1.9",
      "fd00:10:244:2::9"
    ],
    "mac": "0a:58:0a:f4:01:09",
    "default": true,
    "dns": {}
  }
]
```

With it, we now report:
```
[
 {
    "name": "ovn-kubernetes",
    "interface": "ovn-udn1",
    "ips": [
      "10.128.0.3"
    ],
    "mac": "0a:58:0a:80:00:03",
    "default": true,
    "dns": {}
  },
  {
    "name": "ovn-kubernetes",
    "interface": "eth0",
    "ips": [
      "10.244.1.6",
      "fd00:10:244:2::6"
    ],
    "mac": "0a:58:0a:f4:01:06",
    "default": false,
    "dns": {}
  }
 ]
```

This way, applications complying to the k8snetworkplumbingwg de-facto
standard can be aware of the UDN interface information.

We report the primary UDN first so the
network-attachment-definition-client can identify which of the 2
interfaces to report as primary [0].

[0] k8snetworkplumbingwg/network-attachment-definition-client#71

Signed-off-by: Miguel Duarte Barroso <[email protected]>
Signed-off-by: Ram Lavi <[email protected]>
RamLavi pushed a commit to RamLavi/ovn-kubernetes that referenced this pull request Sep 17, 2024
Before this commit, this was the network status we reported for a UDN
pod:
```
kubectl get pods pod -ojsonpath="{@.metadata.annotations.k8s\.v1\.cni\.cncf\.io\/network-status}" | jq
[
  {
    "name": "ovn-kubernetes",
    "interface": "eth0",
    "ips": [
      "10.244.1.9",
      "fd00:10:244:2::9"
    ],
    "mac": "0a:58:0a:f4:01:09",
    "default": true,
    "dns": {}
  }
]
```

With it, we now report:
```
[
 {
    "name": "ovn-kubernetes",
    "interface": "ovn-udn1",
    "ips": [
      "10.128.0.3"
    ],
    "mac": "0a:58:0a:80:00:03",
    "default": true,
    "dns": {}
  },
  {
    "name": "ovn-kubernetes",
    "interface": "eth0",
    "ips": [
      "10.244.1.6",
      "fd00:10:244:2::6"
    ],
    "mac": "0a:58:0a:f4:01:06",
    "default": false,
    "dns": {}
  }
 ]
```

This way, applications complying to the k8snetworkplumbingwg de-facto
standard can be aware of the UDN interface information.

We report the primary UDN first so the
network-attachment-definition-client can identify which of the 2
interfaces to report as primary [0].

[0] k8snetworkplumbingwg/network-attachment-definition-client#71

Signed-off-by: Miguel Duarte Barroso <[email protected]>
Signed-off-by: Ram Lavi <[email protected]>
RamLavi pushed a commit to RamLavi/ovn-kubernetes that referenced this pull request Sep 17, 2024
Before this commit, this was the network status we reported for a UDN
pod:
```
kubectl get pods pod -ojsonpath="{@.metadata.annotations.k8s\.v1\.cni\.cncf\.io\/network-status}" | jq
[
  {
    "name": "ovn-kubernetes",
    "interface": "eth0",
    "ips": [
      "10.244.1.9",
      "fd00:10:244:2::9"
    ],
    "mac": "0a:58:0a:f4:01:09",
    "default": true,
    "dns": {}
  }
]
```

With it, we now report:
```
[
 {
    "name": "ovn-kubernetes",
    "interface": "ovn-udn1",
    "ips": [
      "10.128.0.3"
    ],
    "mac": "0a:58:0a:80:00:03",
    "default": true,
    "dns": {}
  },
  {
    "name": "ovn-kubernetes",
    "interface": "eth0",
    "ips": [
      "10.244.1.6",
      "fd00:10:244:2::6"
    ],
    "mac": "0a:58:0a:f4:01:06",
    "default": false,
    "dns": {}
  }
 ]
```

This way, applications complying to the k8snetworkplumbingwg de-facto
standard can be aware of the UDN interface information.

We report the primary UDN first so the
network-attachment-definition-client can identify which of the 2
interfaces to report as primary [0].

[0] k8snetworkplumbingwg/network-attachment-definition-client#71

Signed-off-by: Miguel Duarte Barroso <[email protected]>
Signed-off-by: Ram Lavi <[email protected]>
RamLavi added a commit to RamLavi/ovn-kubernetes that referenced this pull request Sep 17, 2024
Before this commit, this was the network status we reported for a UDN
pod:
```
kubectl get pods pod
-ojsonpath="{@.metadata.annotations.k8s\.v1\.cni\.cncf\.io\/network-status}"
| jq
[
  {
    "name": "ovn-kubernetes",
    "interface": "eth0",
    "ips": [
      "10.244.1.9",
      "fd00:10:244:2::9"
    ],
    "mac": "0a:58:0a:f4:01:09",
    "default": true,
    "dns": {}
  }
]
```

With it, we now report:
```
[
 {
    "name": "ovn-kubernetes",
    "interface": "ovn-udn1",
    "ips": [
      "10.128.0.3"
    ],
    "mac": "0a:58:0a:80:00:03",
    "default": true,
    "dns": {}
  },
  {
    "name": "ovn-kubernetes",
    "interface": "eth0",
    "ips": [
      "10.244.1.6",
      "fd00:10:244:2::6"
    ],
    "mac": "0a:58:0a:f4:01:06",
    "default": false,
    "dns": {}
  }
 ]
```

This way, applications complying to the k8snetworkplumbingwg de-facto
standard can be aware of the UDN interface information.

We report the primary UDN first so the
network-attachment-definition-client can identify which of the 2
interfaces to report as primary [0].

[0]
k8snetworkplumbingwg/network-attachment-definition-client#71

Signed-off-by: Miguel Duarte Barroso <[email protected]>
Co-authored-by: Ram Lavi <[email protected]>
RamLavi added a commit to RamLavi/ovn-kubernetes that referenced this pull request Sep 17, 2024
Before this commit, this was the network status we reported for a UDN
pod:
```
kubectl get pods pod
-ojsonpath="{@.metadata.annotations.k8s\.v1\.cni\.cncf\.io\/network-status}"
| jq
[
  {
    "name": "ovn-kubernetes",
    "interface": "eth0",
    "ips": [
      "10.244.1.9",
      "fd00:10:244:2::9"
    ],
    "mac": "0a:58:0a:f4:01:09",
    "default": true,
    "dns": {}
  }
]
```

With it, we now report:
```
[
 {
    "name": "ovn-kubernetes",
    "interface": "ovn-udn1",
    "ips": [
      "10.128.0.3"
    ],
    "mac": "0a:58:0a:80:00:03",
    "default": true,
    "dns": {}
  },
  {
    "name": "ovn-kubernetes",
    "interface": "eth0",
    "ips": [
      "10.244.1.6",
      "fd00:10:244:2::6"
    ],
    "mac": "0a:58:0a:f4:01:06",
    "default": false,
    "dns": {}
  }
 ]
```

This way, applications complying to the k8snetworkplumbingwg de-facto
standard can be aware of the UDN interface information.

We report the primary UDN first so the
network-attachment-definition-client can identify which of the 2
interfaces to report as primary [0].

[0]
k8snetworkplumbingwg/network-attachment-definition-client#71

Signed-off-by: Miguel Duarte Barroso <[email protected]>
Co-authored-by: Ram Lavi <[email protected]>
RamLavi added a commit to RamLavi/ovn-kubernetes that referenced this pull request Sep 17, 2024
Before this commit, this was the network status we reported for a UDN
pod:
```
kubectl get pods pod
-ojsonpath="{@.metadata.annotations.k8s\.v1\.cni\.cncf\.io\/network-status}"
| jq
[
  {
    "name": "ovn-kubernetes",
    "interface": "eth0",
    "ips": [
      "10.244.1.9",
      "fd00:10:244:2::9"
    ],
    "mac": "0a:58:0a:f4:01:09",
    "default": true,
    "dns": {}
  }
]
```

With it, we now report:
```
[
 {
    "name": "ovn-kubernetes",
    "interface": "ovn-udn1",
    "ips": [
      "10.128.0.3"
    ],
    "mac": "0a:58:0a:80:00:03",
    "default": true,
    "dns": {}
  },
  {
    "name": "ovn-kubernetes",
    "interface": "eth0",
    "ips": [
      "10.244.1.6",
      "fd00:10:244:2::6"
    ],
    "mac": "0a:58:0a:f4:01:06",
    "default": false,
    "dns": {}
  }
 ]
```

This way, applications complying to the k8snetworkplumbingwg de-facto
standard can be aware of the UDN interface information.

We report the primary UDN first so the
network-attachment-definition-client can identify which of the 2
interfaces to report as primary [0].

[0]
k8snetworkplumbingwg/network-attachment-definition-client#71

Signed-off-by: Miguel Duarte Barroso <[email protected]>
Co-authored-by: Ram Lavi <[email protected]>
jcaamano pushed a commit to ovn-kubernetes/ovn-kubernetes that referenced this pull request Sep 18, 2024
Before this commit, this was the network status we reported for a UDN
pod:
```
kubectl get pods pod
-ojsonpath="{@.metadata.annotations.k8s\.v1\.cni\.cncf\.io\/network-status}"
| jq
[
  {
    "name": "ovn-kubernetes",
    "interface": "eth0",
    "ips": [
      "10.244.1.9",
      "fd00:10:244:2::9"
    ],
    "mac": "0a:58:0a:f4:01:09",
    "default": true,
    "dns": {}
  }
]
```

With it, we now report:
```
[
 {
    "name": "ovn-kubernetes",
    "interface": "ovn-udn1",
    "ips": [
      "10.128.0.3"
    ],
    "mac": "0a:58:0a:80:00:03",
    "default": true,
    "dns": {}
  },
  {
    "name": "ovn-kubernetes",
    "interface": "eth0",
    "ips": [
      "10.244.1.6",
      "fd00:10:244:2::6"
    ],
    "mac": "0a:58:0a:f4:01:06",
    "default": false,
    "dns": {}
  }
 ]
```

This way, applications complying to the k8snetworkplumbingwg de-facto
standard can be aware of the UDN interface information.

We report the primary UDN first so the
network-attachment-definition-client can identify which of the 2
interfaces to report as primary [0].

[0]
k8snetworkplumbingwg/network-attachment-definition-client#71

Signed-off-by: Miguel Duarte Barroso <[email protected]>
Co-authored-by: Ram Lavi <[email protected]>
zeeke pushed a commit to zeeke/ovn-kubernetes-us that referenced this pull request Oct 22, 2024
Before this commit, this was the network status we reported for a UDN
pod:
```
kubectl get pods pod
-ojsonpath="{@.metadata.annotations.k8s\.v1\.cni\.cncf\.io\/network-status}"
| jq
[
  {
    "name": "ovn-kubernetes",
    "interface": "eth0",
    "ips": [
      "10.244.1.9",
      "fd00:10:244:2::9"
    ],
    "mac": "0a:58:0a:f4:01:09",
    "default": true,
    "dns": {}
  }
]
```

With it, we now report:
```
[
 {
    "name": "ovn-kubernetes",
    "interface": "ovn-udn1",
    "ips": [
      "10.128.0.3"
    ],
    "mac": "0a:58:0a:80:00:03",
    "default": true,
    "dns": {}
  },
  {
    "name": "ovn-kubernetes",
    "interface": "eth0",
    "ips": [
      "10.244.1.6",
      "fd00:10:244:2::6"
    ],
    "mac": "0a:58:0a:f4:01:06",
    "default": false,
    "dns": {}
  }
 ]
```

This way, applications complying to the k8snetworkplumbingwg de-facto
standard can be aware of the UDN interface information.

We report the primary UDN first so the
network-attachment-definition-client can identify which of the 2
interfaces to report as primary [0].

[0]
k8snetworkplumbingwg/network-attachment-definition-client#71

Signed-off-by: Miguel Duarte Barroso <[email protected]>
Co-authored-by: Ram Lavi <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants