Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
FROM quay.io/centos/centos:stream8
FROM quay.io/centos/centos:stream9

USER root

RUN dnf install -y centos-release-nfv-openvswitch
RUN INSTALL_PKGS=" \
openvswitch2.15 ovn-2021-host ovn-2021-central \
openvswitch2.17 ovn23.09-host ovn23.09-central \
iptables iproute iputils tcpdump socat procps \
make go git \
" && \
Expand Down
9 changes: 8 additions & 1 deletion dist/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,14 @@ pushd ovsdb-mon

declare -A db_schemas=( ["OVN_Northbound"]="ovnnb_db.sock" ["OVN_Southbound"]="ovnsb_db.sock" ["Open_vSwitch"]="db.sock")

declare -a ovs_runpaths=("/run/openvswitch" "/run/ovn" "/var/run/openvswitch" "/var/lib/ovn/" "/var/lib/openvswitch/ovn")
declare -a ovs_runpaths=("/run/openvswitch" \
"/var/run/openvswitch" \
"/run/ovn" \
"/run/ovn-ic" \
"/var/lib/ovn/" \
"/var/lib/ovn-ic/" \
"/var/lib/openvswitch/ovn" \
"/var/lib/openvswitch/ovn-ic")

for k in "${!db_schemas[@]}"; do
for path in "${ovs_runpaths[@]}"; do
Expand Down
14 changes: 10 additions & 4 deletions dist/ovsdb-mon-ds.yaml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: ovsdb-mon-ovs
name: ovsdb-mon
spec:
selector:
matchLabels:
name: ovsdb-mon-ovs
name: ovsdb-mon
template:
metadata:
labels:
name: ovsdb-mon-ovs
name: ovsdb-mon
spec:
tolerations:
- key: node-role.kubernetes.io/master
Expand All @@ -24,9 +24,11 @@ spec:
requests:
memory: "64Mi"
limits:
memory: "256Mi"
memory: "512Mi"
imagePullPolicy: IfNotPresent
volumeMounts:
- mountPath: /run/ovn-ic/
name: run-ovn-ic
- mountPath: /run/ovn/
name: run-ovn
- mountPath: /run/openvswitch/
Expand All @@ -42,6 +44,10 @@ spec:
path: /run/ovn
type: ""
name: run-ovn
- hostPath:
path: /run/ovn-ic
type: ""
name: run-ovn-ic
- hostPath:
path: /run/openvswitch
type: ""
Expand Down
7 changes: 7 additions & 0 deletions dist/ovsdb-mon-ovn-ic.source
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
if [ "${BASH_SOURCE[0]}" -ef "$0" ]
then
>&2 echo 'Please source this script, not execute it!'
exit 1
fi

source ./ovsdb-mon-ovs.source
2 changes: 1 addition & 1 deletion dist/ovsdb-mon-ovn.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ spec:
requests:
memory: "64Mi"
limits:
memory: "256Mi"
memory: "512Mi"
imagePullPolicy: IfNotPresent
volumeMounts:
- mountPath: /run/ovn/
Expand Down
5 changes: 4 additions & 1 deletion dist/ovsdb-mon-ovs.source
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ fi
kubectl apply -n ovsdb-mon -f ./ovsdb-mon-ds.yaml || { >&2 echo 'bad k8s?'; return; }

# create handy aliases for easy usage of ovsdb-mon.ovs
DS='ovsdb-mon-ovs'
DS='ovsdb-mon'
POD_TUPLES=$(
kubectl get pod -n ovsdb-mon \
-o jsonpath='{range .items[*]}{.spec.nodeName}{"/"}{.metadata.name}{" "}{end}' | grep ${DS} )
Expand All @@ -38,6 +38,8 @@ for POD_TUPLE in $POD_TUPLES ; do \
POD=$(echo $POD_TUPLE | cut -d/ -f2)
echo $NODE has pod ${POD} . Creating alias ovsdb-mon.ovs.$NODE
alias ovsdb-mon.ovs.$NODE="kubectl exec -n ovsdb-mon -it $POD -- ovsdb-mon.Open_vSwitch"
alias ovsdb-mon.nb.$NODE="kubectl exec -n ovsdb-mon -it $POD -- ovsdb-mon.OVN_Northbound"
alias ovsdb-mon.sb.$NODE="kubectl exec -n ovsdb-mon -it $POD -- ovsdb-mon.OVN_Southbound"
done

echo
Expand All @@ -46,6 +48,7 @@ echo
echo "to remove daemonset created, do: kubectl delete -n ovsdb-mon ds ${DS}"
echo 'commands to try (after pod becomes ready):'
echo " ovsdb-mon.ovs.${NODE} list Interface Name Ofport ExternalIDs"
echo " ovsdb-mon.nb.${NODE} list ACL"
echo " kubectl exec -n ovsdb-mon -it ${POD} -- ovs-vsctl show"
echo " kubectl exec -n ovsdb-mon -it ${POD} -- ovs-ofctl --names dump-flows br-int table=0 | cut -d',' -f3-"
echo
Loading