Skip to content

Commit b74ba3c

Browse files
author
Krzysztof Slonka
committed
Import project
1 parent c0a584e commit b74ba3c

File tree

144 files changed

+9232
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

144 files changed

+9232
-0
lines changed

.editorconfig

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[*.kt]
2+
end_of_line = lf
3+
insert_final_newline = true
4+
indent_style = space
5+
indent_size = 4

.gitignore

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Intellij Idea project files
2+
.idea
3+
*.iml
4+
*.ipr
5+
*.iws
6+
7+
# gradle config
8+
.gradle
9+
10+
# project binaries
11+
build
12+
out
13+
classes
14+
15+
# sonar
16+
sonar-project.properties
17+
.sonar
18+
19+
# mac os x
20+
.DS_Store
21+
22+
# netbeans
23+
.nb-gradle
24+
25+
/config
26+
!/config/detekt/
27+
!/config/detekt/*
28+
29+
deployment.yml

build.gradle

Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
buildscript {
2+
repositories {
3+
mavenCentral()
4+
}
5+
dependencies {
6+
classpath group: 'pl.allegro.tech.build', name: 'axion-release-plugin', version: '1.10.2'
7+
}
8+
}
9+
10+
plugins {
11+
id 'pl.allegro.tech.build.axion-release' version '1.10.2'
12+
id 'org.jetbrains.kotlin.jvm' version '1.3.0'
13+
id 'org.jetbrains.kotlin.plugin.spring' version '1.3.0'
14+
id 'org.jetbrains.kotlin.plugin.allopen' version '1.3.0'
15+
id "org.jlleitschuh.gradle.ktlint" version "6.3.1"
16+
id "org.jlleitschuh.gradle.ktlint-idea" version "6.3.1"
17+
id "io.gitlab.arturbosch.detekt" version "1.0.0-RC11"
18+
}
19+
20+
scmVersion {
21+
tag {
22+
prefix = project.rootProject.name
23+
}
24+
versionCreator 'versionWithBranch'
25+
}
26+
27+
allprojects {
28+
29+
project.group = 'pl.allegro.tech.servicemesh'
30+
project.version = scmVersion.version
31+
32+
repositories {
33+
jcenter()
34+
mavenCentral()
35+
}
36+
37+
apply plugin: 'kotlin'
38+
apply plugin: 'pl.allegro.tech.build.axion-release'
39+
apply plugin: 'kotlin-spring'
40+
41+
project.ext.versions = [
42+
kotlin : '1.3.0',
43+
java_controlplane : '0.1.16',
44+
spring_boot : '2.1.5.RELEASE',
45+
grpc : '1.21.0',
46+
jaxb : '2.3.0',
47+
javaxactivation : '1.1.1',
48+
micrometer : '1.1.2',
49+
dropwizard : '4.0.5',
50+
ecwid_consul : '1.4.1',
51+
awaitility : '3.1.3',
52+
embedded_consul : '2.0.0',
53+
junit : '5.3.2',
54+
assertj : '3.11.1',
55+
jackson : '2.9.0',
56+
toxiproxy : '2.1.3',
57+
testcontainers : '1.10.6',
58+
reactor : '3.2.5.RELEASE',
59+
consul_recipes : '0.8.3',
60+
mockito : '2.23.0',
61+
cglib : '3.2.9',
62+
logback : '1.2.3',
63+
slf4j : '1.7.25'
64+
]
65+
}
66+
67+
subprojects {
68+
69+
apply plugin: 'maven-publish'
70+
apply plugin: 'pl.allegro.tech.build.axion-release'
71+
apply plugin: 'org.jlleitschuh.gradle.ktlint'
72+
apply plugin: 'io.gitlab.arturbosch.detekt'
73+
74+
sourceCompatibility = 1.8
75+
[compileJava, compileTestJava]*.options*.encoding = 'UTF-8'
76+
77+
test {
78+
useJUnitPlatform()
79+
testLogging {
80+
exceptionFormat = 'full'
81+
}
82+
}
83+
84+
publishing {
85+
publications {
86+
maven(MavenPublication) {
87+
from project.components.java
88+
}
89+
}
90+
}
91+
92+
configurations {
93+
compile.exclude group: 'commons-logging', module: 'commons-logging'
94+
compile.exclude group: 'org.slf4j', module: 'slf4j-log4j12'
95+
compile.exclude group: 'org.slf4j', module: 'slf4j-jcl'
96+
compile.exclude group: 'log4j', module: 'log4j'
97+
}
98+
99+
compileKotlin {
100+
kotlinOptions {
101+
jvmTarget = '1.8'
102+
}
103+
}
104+
105+
compileTestKotlin {
106+
kotlinOptions {
107+
jvmTarget = '1.8'
108+
}
109+
}
110+
111+
dependencies {
112+
testCompile group: 'org.junit.jupiter', name: 'junit-jupiter-api', version: versions.junit
113+
testCompile group: 'org.assertj', name: 'assertj-core', version: versions.assertj
114+
testRuntimeOnly group: 'org.junit.jupiter', name: 'junit-jupiter-engine', version: versions.junit
115+
}
116+
117+
detekt {
118+
toolVersion = "1.0.0-RC11"
119+
input = files("src/main/kotlin", "src/test/kotlin")
120+
filters = ".*/resources/.*,.*/build/.*"
121+
config = files("$rootDir/config/detekt/default-detekt-config.yml", "$rootDir/config/detekt/detekt-config.yml")
122+
}
123+
}
124+
125+
wrapper {
126+
gradleVersion = '5.2.1'
127+
}

docs/architecture.md

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# Architecture
2+
3+
## High level
4+
5+
This is high level view of Service Mesh system with Envoy Control
6+
7+
![high level architecture](assets/images/high_level_architecture.png)
8+
9+
In each data center, Envoy Control polls the services location from a discovery service system. Then, the state
10+
is propagated to Envoy instances running alongside service instances.
11+
12+
When _service-a_ wants to communicate with _service-b_ it sends a request to it, but the request is intercepted
13+
by Envoy, which will redirect the request to proper instance. Envoy can also add tracing headers, add encryption,
14+
circuit breaking and much more.
15+
16+
## Envoy control
17+
18+
Envoy Control is responsible for feeding Envoys with configuration of
19+
[CDS](https://www.envoyproxy.io/docs/envoy/latest/configuration/upstream/cluster_manager/cds),
20+
[EDS](https://www.envoyproxy.io/docs/envoy/latest/intro/arch_overview/upstream/service_discovery#arch-overview-service-discovery-types-eds),
21+
and [RDS](https://www.envoyproxy.io/docs/envoy/latest/configuration/http/http_conn_man/rds.html) data based on custom metadata.
22+
Right now CDS and EDS data comes from Consul service discovery,
23+
but there is nothing special about our integration with Consul and users can integrate as many sources as they want.
24+
25+
![envoy control modules drawing](assets/images/envoy-control-modules-drawing.png)
26+
27+
## Sources
28+
29+
Source is a stream of `cluster` and `endpoints` states.
30+
31+
There can be many sources, all they have to do is:
32+
33+
* implement `LocalServiceChanges`
34+
* be exposed as a bean - if you're using Envoy Control Runner then all of them will be combined in `GlobalServiceChanges`,
35+
if not - you have to combine them yourself
36+
37+
### Consul
38+
Implements a stream of service instance changes coming from Consul discovery service.
39+
40+
## Modules
41+
42+
### Envoy Control
43+
The core module that provides integration with Envoy and API to integrate Discovery Service system.
44+
45+
### Envoy Control Runner
46+
Example of the code that builds Control Plane and runs it. It uses [Spring Framework](https://spring.io/) to connect
47+
elements and serve HTTP endpoint and HTTP client for [Cross DC Synchronization](features/multi_dc_support.md) feature.
48+
49+
#### Why Spring?
50+
We've chosen Spring for Envoy Control Runner because it provides an easy way to create HTTP server and client.
51+
On top of that, it also provides Dependency Injection and property management.
52+
You can easily replace it with your framework of choice - Envoy Control module as well as source modules are framework-agnostic.
53+
54+
### Extensibility
55+
If you want to extend Envoy Control you can either depend on Envoy Control module and create your own Runner or you can
56+
depend on the Envoy Control Runner itself and provide only minimal modifications.

docs/assets/extra.js

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
// source: https://github.com/squidfunk/mkdocs-material/issues/767
2+
document.addEventListener("DOMContentLoaded", function() {
3+
load_navpane();
4+
});
5+
6+
function load_navpane() {
7+
var width = window.innerWidth;
8+
if (width <= 1200) {
9+
return;
10+
}
11+
12+
var nav = document.getElementsByClassName("md-nav");
13+
for(var i = 0; i < nav.length; i++) {
14+
if (typeof nav.item(i).style === "undefined") {
15+
continue;
16+
}
17+
18+
if (nav.item(i).getAttribute("data-md-level") && nav.item(i).getAttribute("data-md-component")) {
19+
nav.item(i).style.display = 'block';
20+
nav.item(i).style.overflow = 'visible';
21+
}
22+
}
23+
24+
var nav = document.getElementsByClassName("md-nav__toggle");
25+
for(var i = 0; i < nav.length; i++) {
26+
nav.item(i).checked = true;
27+
}
28+
}
29+
17.7 KB
Loading
27.6 KB
Loading

0 commit comments

Comments
 (0)