Skip to content

Instantly share code, notes, and snippets.

@flavio-fernandes
Forked from kyrtapz/ovsdb-mon.yaml
Last active October 7, 2021 22:53
Show Gist options
  • Save flavio-fernandes/75a759c844ecde43423ad855dbc24d93 to your computer and use it in GitHub Desktop.
Save flavio-fernandes/75a759c844ecde43423ad855dbc24d93 to your computer and use it in GitHub Desktop.
apiVersion: v1
kind: Pod
metadata:
name: ovsdb-mon-ovn
spec:
containers:
- name: ovsdb-mon-ovn
image: quay.io/pdiak/fedora-ovn:latest
resources:
requests:
memory: "64Mi"
limits:
memory: "256Mi"
imagePullPolicy: IfNotPresent
env:
- name: OVS_RUNDIR
value: "/run/ovn"
command:
- /bin/bash
- -c
- "set -xe\n
\ git clone https://github.com/amorenoz/ovsdb-mon\n
\ pushd ovsdb-mon\n
\ #The following trick makes it work on upstream ovn-kubernetes as it uses different paths, it does nothing on openshift\"\n
\ ln -s /run/openvswitch/ovnnb_db.sock ${OVS_RUNDIR}/ovnnb_db.sock 2> /dev/null || true\n
\ ln -s /run/openvswitch/ovnsb_db.sock ${OVS_RUNDIR}/ovnsb_db.sock 2> /dev/null || true\n
\ ovsdb-client get-schema \"unix:${OVS_RUNDIR}/ovnnb_db.sock\" OVN_Northbound > ovnnb.schema\n
\ ovsdb-client get-schema \"unix:${OVS_RUNDIR}/ovnsb_db.sock\" OVN_Southbound > ovnsb.schema\n
\ SCHEMA=ovnnb.schema make && mv -v ./bin/ovsdb-mon /usr/local/bin/ovsdb-mon.nb\n
\ SCHEMA=ovnsb.schema make && mv -v ./bin/ovsdb-mon /usr/local/bin/ovsdb-mon.sb\n
\ popd\n
\ trap : TERM INT; sleep infinity & wait"
volumeMounts:
- mountPath: /run/ovn/
name: run-ovn
- mountPath: /run/openvswitch/
name: run-ovs
readinessProbe:
exec:
command:
- ls
- /usr/local/bin/ovsdb-mon.nb
- /usr/local/bin/ovsdb-mon.sb
initialDelaySeconds: 5
volumes:
- hostPath:
path: /run/ovn
type: ""
name: run-ovn
- hostPath:
path: /run/openvswitch
type: ""
name: run-ovs
tolerations:
- key: node-role.kubernetes.io/master
operator: Exists
hostNetwork: true
nodeSelector:
node-role.kubernetes.io/master: ""
@flavio-fernandes
Copy link
Author

oc apply -f ${THIS_URL}.yaml
alias ovsdb-mon='oc exec -it ovsdb-mon -- ovsdb-mon'

#Then, after the ovsdb-mon container in the default namespace is ready run:
ovsdb-mon

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment