Skip to content

Commit 5951f55

Browse files
authored
Adding architecture details
1 parent 89105e8 commit 5951f55

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

Documentation/README.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,28 @@ Kube-router consists of 3 core controllers and multiple watchers as depicted in
88

99
![Arch](./img/kube-router-arch.png)
1010

11+
Each of the [controller](https://github.com/cloudnativelabs/kube-router/tree/master/app/controllers) follows below structure
12+
13+
```
14+
func Run() {
15+
for {
16+
Sync() // control loop that runs for ever and perfom sync at periodic interval
17+
}
18+
}
19+
20+
func OnUpdate() {
21+
Sync() // on receiving update of a watched API object (namespace, node, pod, network policy etc)
22+
}
23+
24+
Sync() {
25+
//re-concile any state changes
26+
}
27+
28+
Cleanup() {
29+
// cleanup any changes (to iptables, ipvs, network etc) done to the system
30+
}
31+
```
32+
1133
## See Kube-router in action
1234

1335
#### Network Services Controller

0 commit comments

Comments
 (0)