Skip to content

Instantly share code, notes, and snippets.

Doug Smith dougbtv

Block or report user

Report or block dougbtv

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
dougbtv /
Created Oct 16, 2019
Bridge CNI + Static IPAM in OpenShift 4.2 demo

This is a demonstration of the Bridge CNI plugin, plus the static IPAM CNI plugin.


  • A recently installed OpenShift (4.2/4.3) installed cluster.


Firstly, we'll label a node so that we have two pods going to the same node.

dougbtv /
Created Oct 15, 2019
Running the cluster network operator against a running openshift cluster

Interactively running the cluster-network-operator

This describes how to run the cluster-network-operator for development purposes, using the ./hack/ script.

You'll need:

  • A recent install of openshift, here's Doug's cheat sheet
  • A clone of the cluster-network-operator.

Once that's in place you'll need to know:

dougbtv /
Created Aug 2, 2019
Installing cni-route-override and adding an additional route

Installation and usage of cni-route-override

Covers installing & configuring an example cni-route-override instance.

This example simply adds a static route.

Install route-override binaries

Install using the provided daemonset, this will copy the route-override binary to the /opt/cni/bin on each machine in your Kubernetes cluster.

dougbtv /
Last active Aug 1, 2019
Whereabouts with additional specified routes

Using Whereabouts + Multus to add an additional route on an additional network interface...

Install an etcd for data storage for Whereabouts.

$ git clone
$ cd etcd-operator/
$ example/rbac/
$ kubectl create -f example/deployment.yaml
$ watch -n1 kubectl get pods -o wide  --all-namespaces
dougbtv /
Created May 9, 2019
KubeVirt SR-IOV setup helper script
get_sriov_pci_root_addresses() {
for dir in $(find /sys/devices/ -name sriov_totalvfs -exec dirname {} \;); do
if [ $(cat $dir/sriov_numvfs) -gt 0 ]; then
# use perl because sed doesn't support non-greedy matching
basename $dir | perl -pe 's|(.*?:)(.*)|\2|'
dougbtv /
Last active Apr 26, 2019
Whereabouts Demo
dougbtv /
Last active Mar 20, 2019
Running custom cluster-network-operator in OpenShift

stop the cluster version operator

[core@ip-10-0-7-170 ~]$ oc get deployments --namespace=openshift-cluster-version
[core@ip-10-0-7-170 ~]$ oc scale deployment cluster-version-operator --replicas=0 --namespace=openshift-cluster-version

Edit our deployment

Check out the current deployment...

dougbtv /
Created Feb 5, 2019
Multus + Weave sketch

Multus with weave sketch.

Spin up Kubernetes without a network, then... install weave per the installation guide

In theory before CNI plugin install nodes should be not ready & the CNI net.d folder should be empty...

[centos@kube-nonetwork-master ~]$ kubectl get nodes
NAME                    STATUS     ROLES    AGE   VERSION
kube-nonetwork-master   NotReady   master   58s   v1.13.3
dougbtv /
Last active Aug 1, 2019
Daemonset for CNI DHCP process

Multus + DHCP IPAM example

Prerequisites: Multus + NetworkAttachmentDefinition CRD installed.

In order to have DHCP working as an IPAM plugin -- you'll need to have the DHCP CNI binary running.

In this example, we'll run this (as a daemonset) from the dougbtv/dhcp image, which is based on Tomo's dockerfile.

About my setup: In this setup, I use a macvlan plugin as the secondary interface for Multus. In my setup, I used an upstream Kubernetes running on KVM guests. The master device for macvlan is eth0 and that device is connected to a bridge in the network space, and has an already running DHCP server available.

dougbtv / virtdp-daemonset.yaml
Last active Oct 20, 2018
Modified virtual device plugin daemonset
View virtdp-daemonset.yaml
apiVersion: v1
kind: ServiceAccount
name: virt-device-plugin
namespace: kube-system
apiVersion: extensions/v1beta1
kind: DaemonSet
You can’t perform that action at this time.