ovsdb-etcd is an alternative ovsdb-server implementation, for use in conjunction with ovn-kubernetes, written in golang and using etcd as a backend. It is a fully compatible drop-in replacement for ovsdb-server and adheres to spec rfc7047 and spec extension ovsdb-server.
The objects are mapped to etcd as follows:
data: <prefix>/<service>/<dbName>/<table>/<uuid> --> <row>
comments: <prefix>/<service>/<dbName>/_comments/<timestamp> --> <comment>
locks: <prefix>/<service>/_/_locks/<lockid> --> nil
As ovsdb transactions have different semantics than etcd transactions, the initial implementation consists of:
- receiving the transaction-request in ovsdb semantics
- catching the global lock
- etcd get the pre-transaction tables
- process ovsdb semantics on memory
- etcd post the post-transaction rows
- releasing the global lock
- sending the transaction-response in ovsdb semantics
An ovsdb monitor enrollment is implemented as:
- receiving monitor-request in ovsdb semantics
- enrolling to get etcd events per entire database (to support cross tables consistency)
- sending monitor-response in ovsdb semantics
An ovsdb monitor event is implemented as:
- receiving monitor-event in etcd semantics
- extract from etcd database event all ovsdb table events (package as one update to support cross tables consistency)
- sending monitor-event is ovsdb semantics
You must have a working Go Environment.
Then clone ovn-kubernetes from our fork:
git clone https://github.com/ibm/ovn-kubernetes
pushd ovn-kubernetes
git checkout ovsdb-etcd2
export OVN_KUBERNETES_ROOT=$PWD
popd
Then clone ovsdb-etcd and build and push docker images:
git clone https://github.com/IBM/ovsdb-etcd
make docker-build
Setup your docker.io credentials:
export CR_PASSWORD=<DOCKER_PASSWORD>
export CR_USERNAME=<DOCKER_USENAME>
export OVSDB_ETCD_REPOSITORY=$CR_USERNAME
Login to docker and push (optional):
echo $CR_PASSWORD | docker login $CR_REPO -u $CR_USERNAME --password-stdin
make docker-push
Disable tcpdump logging (optional):
export OVNDB_ETCD_TCPDUMP='false'
Deploy onto a kind cluster:
make ovnk-deploy
make ovnk-status