@@ -8,62 +8,72 @@ This repository contains two programs:
8
8
9
9
The whole idea of this project is to test / demonstrate the goodies of the improvements that are being developed in go-ovn and libovsdb.
10
10
11
- ## How to use it
12
- Generate the native go-ovn model:
11
+ ## ovnmon
12
+ ### Building ovnmon
13
+ By default, ovnmon uses the * ovn-nb.ovsschema* provided in the repo will be used. If you want to use your own,
14
+ simply download it from your ovsdb server and replace the existing one
13
15
14
- make model
16
+ ovsdb-client get-schema ${SERVER} ${DATABASE} > ovn-nb.ovsschema
15
17
16
- This will use the * ovn-nb.ovsschema* provided in the repo. If you want to use your own schema run:
18
+ Then, just build the programs
19
+
20
+ make
21
+
22
+ This will use modelgen to generate a native model of the DB and use it to build ovnmon
23
+
24
+
25
+ ### Using ovnmon
26
+ Usage of ovnmon:
27
+
28
+ ./bin/ovnmon [FLAGS] [COMMAND]
29
+ FLAGS:
30
+ -auto
31
+ Autostart: If set to true, it will start monitoring from the begining
32
+ -db string
33
+ Database connection. Default: unix:/${OVS_RUNDIR}/ovnnb_db.sock
34
+ COMMAND:
35
+ If provided, it will run the command and exit. If not, it will enter interactive mode
36
+ For a full description of available commands use the command 'help'
17
37
18
- make modelgen
19
- ovsdb-client get-schema ${SERVER} ${DATABASE} > myDB.ovsschema
20
- ./bin/modelgen -o model -p model myDB.ovsschema
21
38
22
- Build the simple monitoring app :
39
+ By default it will open an interactive terminal where you can monitor the activity of the DB and inspect it :
23
40
24
- make
41
+ ./bin/ovnmon --db tcp:172.19.0.4:6641
42
+ OVN Monitoring Shell
43
+ >>> help
25
44
26
- Run the app against the database:
45
+ Commands:
46
+ clear clear the screen
47
+ exit exit the program
48
+ help display help
49
+ list List the content of a specific table
50
+ show Print available tables
51
+ start Start monitoring activity of the OVN DB
52
+ stop Stop monitoring activity of the OVN DB
27
53
28
- ./bin/ovnmon --db tcp:172.18.0.4:6641
29
54
30
55
The result looks like this:
31
56
32
- A "Logical_Switch" has been added!
33
- &model.LogicalSwitch{
34
- UUID: "421d4947-0ea0-4f00-b412-b11f46664e4b",
35
- Acls: []string{
36
- "3bc7d4ff-955d-4abd-843a-a46684c053bd",
37
- },
38
- ExternalIds: map[string]string{},
39
- LoadBalancer: []string{
40
- "243fc1d3-2eef-4da2-8853-d57389e63881",
41
- "5d5f5d9c-0c28-4565-b288-747d69058f9f",
42
- "7ef402bf-a4b3-4f5e-8faa-9b4ee8e30578",
43
- "803a08dd-9fa5-4d7d-8f79-bdb36e7fe007",
44
- "9c70db1c-4254-4825-ad1a-969d32fd860e",
45
- "c3c7d07e-ee86-4b73-abc6-665a83f791c2",
46
- },
47
- DnsRecords: []string{},
48
- ForwardingGroups: []string{},
49
- Name: "ovn-control-plane",
50
- OtherConfig: map[string]string{
51
- "subnet": "10.244.1.0/24",
52
- },
53
- Ports: []string{
54
- "680148d5-f99f-4330-9d30-937caae8318c",
55
- "f2d58d9c-9832-41b5-a30f-19710dcc7c1b",
56
- },
57
- QosRules: []string{},
58
- }
59
- A "Address_Set" has been added!
60
- &model.AddressSet{
61
- UUID: "6e8efd17-8377-4ce7-907f-5d40fad3b845",
62
- Addresses: []string{},
63
- ExternalIds: map[string]string{
64
- "name": "kube-public_v4",
65
- },
66
- Name: "a18363165982804349389",
67
- }
57
+ ![ Demo] ( doc/images/demo.gif )
68
58
69
59
60
+ ## modelgen
61
+ ### Building modelgen
62
+
63
+ make modelgen
64
+
65
+ ### Using modelgen
66
+ modelgen can be used to generate a model of any OVSDB database:
67
+
68
+ Usage of modelgen:
69
+ modelgen [flags] OVS_SCHEMA
70
+ Flags:
71
+ -d Dry run
72
+ -o string
73
+ Directory where the generated files shall be stored (default ".")
74
+ -p string
75
+ Package name (default "modelgen")
76
+
77
+ ### Example
78
+
79
+ ./bin/modelgen -o model -p model myDB.ovsschema
0 commit comments