Skip to content

Commit 06ed753

Browse files
committed
Extend 'Getting Started' section
1 parent bb44ea1 commit 06ed753

File tree

1 file changed

+20
-2
lines changed

1 file changed

+20
-2
lines changed

README.md

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,22 +71,40 @@ First of all you have to define how you want to route the incoming traffic. `dil
7171
```toml
7272
# /etc/dill/routing.toml
7373
[[services]]
74-
name = "foobar"
74+
name = "foo"
7575
listener = "any:1234"
7676
backends = ["192.168.10.1:5050"]
7777
```
7878
```shell
7979
$ dill -config /etc/dill/config.toml
8080
```
81-
And that's it! `dill` will bind service running on `192.168.10.1:5050` to `0.0.0.0:1234` on the host running the `dill`. Make sure to [read more](#listenersallowed-map) about interface labels, e.g., `any`, `local`
81+
And that's it! `dill` will accept the traffic on `0.0.0.0:1234` and load balance it between services running on `192.168.10.1:5050` and `192.168.10.2:4050`. Make sure to [read more](#listenersallowed-map) about interface labels, e.g., `any`, `local`
8282

83+
Now imagine that you spawned another service that accepts traffic on port `4444` and you'd like to expose it on running `dill` instance without any downtime to already load balanced services. It's dead simple, you just add a new entry:
84+
```toml
85+
# /etc/dill/routing.toml
86+
[[services]]
87+
name = "foobar"
88+
listener = "any:1234"
89+
backends = ["192.168.10.1:5050, 192.168.10.2:4050"]
90+
91+
[[services]]
92+
name = "bar"
93+
listener = "any:4321"
94+
backends = ["192.168.10.3:4444"]
95+
```
96+
`dill` will automatically pick up the changes and apply necessary modifications to its routing table. Service `bar` is now available on the host running the `dill` on port `4321`.
97+
98+
If you are using a modern workload scheduler like Nomad or Kubernetes this idea becomes very powerful. For instance, using [Consul routing provider](#consul) with just a few tags you can expose dynamically spawned backends with no proxy downtime.
8399

84100
## Routing
85101
### Providers
86102
`dill` offers multiple routing providers that allow you to apply live changes to the routing configuration.
87103
- [File](#file)
88104
- [HTTP](#http)
89105
- [Consul](#consul)
106+
107+
You can help build the project and implement your routing provider based on your needs. If you need guidance, make sure to create Pull Request.
90108
#### File
91109
It is the simplest way of defining routing. All routing logic is being kept in a separate [config file](#schema). By setting `routing.file.watch = true` you can also subscribe to changes made to the routing configuration file which would give you the full power of dill's dynamic routing capabilities.
92110
```toml

0 commit comments

Comments
 (0)