@@ -2,7 +2,6 @@ Sidecar 
2
2
=====
3
3
4
4
[ ![ ] ( https://travis-ci.com/NinesStack/sidecar.svg?branch=master )] ( https://travis-ci.com/NinesStack/sidecar )
5
- [ ![ ] ( https://images.microbadger.com/badges/version/gonitro/sidecar.svg )] ( https://microbadger.com/images/gonitro/sidecar " Get your own version badge on microbadger.com ")
6
5
7
6
** The main repo for this project is the [ NinesStack
8
7
fork] ( https://github.com/NinesStack/sidecar ) **
@@ -35,26 +34,18 @@ or can also leverage:
35
34
Also supports a number of extra features including Vault integration for
36
35
secrets management.
37
36
38
- * [ Superside] ( https://github.com/NinesStack/superside ) - A multi-environment
39
- console for Sidecar. Has a heads up display, event lists, and graphs
40
- showing what is happening in one or more Sidecar clusters on a live
41
- basis.
42
-
43
37
* [ sidecar-dns] ( https://github.com/relistan/sidecar-dns ) - a working, but
44
38
WIP, project to serve DNS SRV records from Sidecar services state.
45
39
46
- * [ Traefik plugin] ( https://github.com/NinesStack/traefik ) - A fork of Traefik
47
- that can be backed by Sidecar. Useful as a gateway from the outside world
48
- into a Sidecar-based services environment. Working to get this plugin
49
- pushed upstream.
50
-
51
40
Overview in Brief
52
41
-----------------
53
42
54
43
Services communicate to each other through a proxy (Envoy or HAproxy) instance
55
- on each host that is itself managed and configured by Sidecar. It is inspired
56
- by Airbnb's SmartStack. But, we believe it has a few advantages over
57
- SmartStack:
44
+ on each host that is itself managed and configured by Sidecar. This is, in
45
+ effect, a half service mesh where outbound connections go through the proxy,
46
+ but inbound requests do not. This has most of the advantages of service mesh
47
+ with a lot less complexity to manage. It is inspired by Airbnb's SmartStack.
48
+ But, we believe it has a few advantages over SmartStack:
58
49
59
50
* Eventually consistent model - a better fit for real world microservices
60
51
* Native support for Docker (works without Docker, too!)
@@ -78,21 +69,21 @@ Complete Overview and Theory
78
69
79
70
![ Sidecar Architecture] ( views/static/Sidecar%20Architecture.png )
80
71
81
- Sidecar is an eventually consistent service discovery platform where hosts learn
82
- about each others' state via a gossip protocol. Hosts exchange messages about
83
- which services they are running and which have gone away. All messages are
84
- timestamped and the latest timestamp always wins. Each host maintains its own
85
- local state and continually merges changes in from others. Messaging is over
86
- UDP except when doing anti-entropy transfers.
72
+ Sidecar is an eventually consistent service discovery platform where hosts
73
+ learn about each others' state via a gossip protocol. Hosts exchange messages
74
+ about which services they are running and which have gone away. All messages
75
+ are timestamped and the latest timestamp always wins. Each host maintains its
76
+ own local state and continually merges changes in from others. Messaging is
77
+ over UDP except when doing anti-entropy transfers.
87
78
88
79
There is an anti-entropy mechanism where full state exchanges take place
89
80
between peer nodes on an intermittent basis. This allows for any missed
90
81
messages to propagate, and helps keep state consistent across the cluster.
91
82
92
- Sidecar hosts join a cluster by having a set of cluster seed hosts passed to them
93
- on the command line at startup. Once in a cluster, the first thing a host does
94
- is merge the state directly from another host. This is a big JSON blob that is
95
- delivered over a TCP session directly between the hosts.
83
+ Sidecar hosts join a cluster by having a set of cluster seed hosts passed to
84
+ them on the command line at startup. Once in a cluster, the first thing a host
85
+ does is merge the state directly from another host. This is a big JSON blob
86
+ that is delivered over a TCP session directly between the hosts.
96
87
97
88
Now the host starts continuously polling its own services and reviewing the
98
89
services that it has in its own state, sleeping a couple of seconds in between.
@@ -110,25 +101,24 @@ There are lifespans assigned to both tombstone and alive records so that:
110
101
2 . We do not continually add to the tombstone state we are carrying
111
102
112
103
Because the gossip mechanism is UDP and a service going away is a higher
113
- priority message, each tombstone is sent twice initially, followed by
114
- once a second for 10 seconds. This delivers reliable messaging of service
115
- death.
104
+ priority message, each tombstone is sent twice initially, followed by once a
105
+ second for 10 seconds. This delivers reliable messaging of service death.
116
106
117
107
Timestamps are all local to the host that sent them. This is because we can
118
- have clock drift on various machines. But if we always look at the origin timestamp
119
- they will at least be comparable to each other by all hosts in the cluster. The
120
- one exception to this is that if clock drift is more than a second or two, the
121
- alive lifespan may be negatively impacted.
108
+ have clock drift on various machines. But if we always look at the origin
109
+ timestamp they will at least be comparable to each other by all hosts in the
110
+ cluster. The one exception to this is that if clock drift is more than a second
111
+ or two, the alive lifespan may be negatively impacted.
122
112
123
113
Running it
124
114
----------
125
115
126
116
You can download the latest release from the [ GitHub
127
117
Releases] ( https://github.com/NinesStack/sidecar/releases ) page.
128
118
129
- If you'd rather build it yourself, you should install the latest version of
130
- the Go compiler. Sidecar has not been tested with gccgo, only the mainstream
131
- Go compiler.
119
+ If you'd rather build it yourself, you should install the latest version of the
120
+ Go compiler. Sidecar has not been tested with gccgo, only the mainstream Go
121
+ compiler.
132
122
133
123
It's a Go application and the dependencies are all vendored into the ` vendor/ `
134
124
directory so you should be able to build it out of the box.
@@ -144,12 +134,13 @@ $ go run *.go --cluster-ip <boostrap_host>
144
134
```
145
135
146
136
You always need to supply at least one IP address or hostname with the
147
- ` --cluster-ip ` argument (or via the ` SIDECAR_SEEDS ` environment variable).
148
- If are running solo, or are the first member, this can be your own
149
- hostname. You may specify the argument multiple times to have
150
- multiple hosts. It is recommended to use more than one when possible.
137
+ ` --cluster-ip ` argument (or via the ` SIDECAR_SEEDS ` environment variable). If
138
+ are running solo, or are the first member, this can be your own hostname. You
139
+ may specify the argument multiple times to have multiple hosts. It is
140
+ recommended to use more than one when possible.
151
141
152
- Note: ` --cluster-ip ` will overwrite the values passed into the ` SIDECAR_SEEDS ` environment variable.
142
+ Note: ` --cluster-ip ` will overwrite the values passed into the ` SIDECAR_SEEDS `
143
+ environment variable.
153
144
154
145
### Running in a Container
155
146
@@ -237,8 +228,8 @@ Defaults are in bold at the end of the line:
237
228
238
229
### Ports
239
230
240
- Sidecar requires both TCP and UDP protocols be open on the port configured
241
- via SIDECAR_BIND_PORT (default 7946) through any network filters or firewalls
231
+ Sidecar requires both TCP and UDP protocols be open on the port configured via
232
+ SIDECAR_BIND_PORT (default 7946) through any network filters or firewalls
242
233
between it and any peers in the cluster. This is the port that the gossip
243
234
protocol (Memberlist) runs on.
244
235
0 commit comments