Skip to content

Instantly share code, notes, and snippets.

@Billy99
Billy99 / SPEC.md
Last active October 13, 2020 21:17

Device Information Specification

Network Plumbing Working Group

Version 0.1

This document describes the de-facto standard for sharing device information between Device Plugins, NPWG Implementations and CNI plugins in Kubernetes.

Kubernetes Network Plumbing Working Group

The Kubernetes Network Plumbing Working Group is an informal group working to enable flexible networking for Kubernetes.

Device Information Specification

This repository contains the officially approved versions of the Kubernetes Network Plumbing Working Group's Device Information Specification.

$ docker exec -ti ovn-worker /bin/sh
#
#
# iptables -t nat -L -n
Chain PREROUTING (policy ACCEPT)
target prot opt source destination
OVN-KUBE-EXTERNALIP all -- 0.0.0.0/0 0.0.0.0/0
OVN-KUBE-NODEPORT all -- 0.0.0.0/0 0.0.0.0/0
KUBE-SERVICES all -- 0.0.0.0/0 0.0.0.0/0 /* kubernetes service portals */
kubectl exec -c sb-ovsdb -n ovn-kubernetes $(< ~/scripts/ovnGetOvnDb.txt) -it -- ovn-trace ovn-worker2 'inport == "services-7355_execpod9m6dk" && eth.src == 0a:58:25:07:51:d2 && ip6.src == fd00:10:244:3::f && tcp.src == 6443 && eth.dst ==0a:58:71:75:e6:87 && ip6.dst == 2001:db8:1::242:ac11:3 && tcp.dst == 31461 && ip.ttl == 64'
# tcp6,reg14=0x6,vlan_tci=0x0000,dl_src=0a:58:25:07:51:d2,dl_dst=0a:58:71:75:e6:87,ipv6_src=fd00:10:244:3::f,ipv6_dst=2001:db8:1::242:ac11:3,ipv6_label=0x00000,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=6443,tp_dst=31461,tcp_flags=0
ingress(dp="ovn-worker2", inport="services-7355_execpod9m6dk")
--------------------------------------------------------------
0. ls_in_port_sec_l2 (ovn-northd.c:4754): inport == "services-7355_execpod9m6dk" && eth.src == {0a:58:25:07:51:d2}, priority 50, uuid 1f7247e6
next;
1. ls_in_port_sec_ip (ovn-northd.c:4438): inport == "services-7355_execpod9m6dk" && eth.src == 0a:58:25:07:51:d2 && ip6.src == {fe80::858:25ff:fe07:51d2, fd00:10:244:3::f}, priority 90,
-------------- **END HERE - TRACE-1 **
| eth0 |
--------------
| 02:42:ac:11:00:02
|
|
|
|
--------------
-------------- **END HERE - TRACE-1 **
| eth0 |
--------------
| 02:42:ac:11:00:03
|
|
|
|
--------------
$ kubectl exec -c sb-ovsdb -n ovn-kubernetes $(< ~/scripts/ovnGetOvnDb.txt) -it --
ovn-trace ovn-worker2 'inport == "default_test" &&
eth.src == 0a:58:71:90:19:61 &&
ip6.src == fd00:10:244:2::4 &&
tcp.src == 6443 &&
eth.dst == 0a:58:77:98:75:3e &&
ip6.dst == 2001:db8:1::242:ac11:2 &&
tcp.dst == 6443 &&
$ kubectl describe pod -n default sriov-pod-1
Name: sriov-pod-1
Namespace: default
Priority: 0
Node: 10.8.125.32/10.8.125.32
Start Time: Mon, 06 Jul 2020 15:05:19 -0400
Labels: <none>
Annotations: k8s.v1.cni.cncf.io/networks: sriov-net-a, sriov-net-b
Status: Running
IP: 172.17.0.3
------------------
Code Changes:
------------------
$ cd $GOPATH/src/github.com/openshift/app-netutil
$ git status
# On branch billy99-sriov-testing
# Changes not staged for commit:
# (use "git add <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working directory)
# cat /var/log/pods/$OVNKUBE_DB/nb-ovsdb/0.log
2020-06-03T20:18:28.431377862Z stdout F ================== ovnkube.sh --- version: 3 ================
2020-06-03T20:18:28.431435096Z stdout F ==================== command: nb-ovsdb-raft
2020-06-03T20:18:28.431471993Z stdout F =================== hostname: ovn-control-plane
2020-06-03T20:18:28.431481533Z stdout F =================== daemonset version 3
2020-06-03T20:18:28.432410334Z stdout F =================== Image built from ovn-kubernetes ref: refs/heads/billy99-ipv6-ci commit: 02755b12ddc35915cd6cd658869745f17aafa521
2020-06-03T20:18:28.433857688Z stdout F BILLY: ovn_db_host=fc00:f853:ccd:e793::4 K8S_APISERVER=https://[2620:52:0:87d:f878:fdd:2fd6:3197]:11337
2020-06-03T20:18:28.605927539Z stdout F =============== run nb-ovsdb-raft pod ovnkube-db-0 ==========
2020-06-03T20:18:28.606202498Z stdout F BILLY: ovnkube-db-0 - ovn_db_host=fc00:f853:ccd:e793::4
2020-06-03T20:18:28.606218696Z stdout F waiting for OVN_Northbound to join and connect to the cluster.