Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
connect, L7 traffic manager
- Loading branch information
0 parents
commit fd28f47
Showing
28 changed files
with
1,279 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/.vagrant |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
Vagrant.configure("2") do |config| | ||
|
||
config.vm.box = "centos/7" | ||
|
||
config.vm.network :private_network, ip: "192.168.33.10" | ||
config.vm.network "forwarded_port", guest: 8500, host: 8500 | ||
config.vm.network "forwarded_port", guest: 4646, host: 4646 | ||
config.vm.network "forwarded_port", guest: 3000, host: 3000 | ||
config.vm.network "forwarded_port", guest: 3001, host: 3001 | ||
config.vm.network "forwarded_port", guest: 9000, host: 9000 | ||
config.vm.network "forwarded_port", guest: 9001, host: 9001 | ||
config.vm.network "forwarded_port", guest: 19000, host: 19000 | ||
config.vm.network "forwarded_port", guest: 19001, host: 19001 | ||
|
||
config.vm.synced_folder "./", "/home/vagrant/app",create:"true" | ||
|
||
config.vm.provision "shell", inline: <<-SHELL | ||
sudo yum install -y yum-utils | ||
sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo | ||
sudo yum makecache fast | ||
sudo yum install -y docker-ce unzip | ||
sudo systemctl enable docker-ce | ||
sudo systemctl start docker-ce | ||
sudo curl -L https://github.com/docker/compose/releases/download/1.25.0/docker-compose-`uname -s`-`uname -m` > docker-compose | ||
sudo mv docker-compose /usr/local/bin/docker-compose | ||
sudo chmod +x /usr/local/bin/docker-compose | ||
sudo gpasswd -a vagrant docker | ||
sudo systemctl restart docker | ||
sudo curl -L https://releases.hashicorp.com/consul/1.6.2/consul_1.6.2_linux_amd64.zip -o /tmp/consul.zip | ||
sudo unzip -d /usr/local/bin/ /tmp/consul.zip | ||
sudo curl -L https://releases.hashicorp.com/nomad/0.10.1/nomad_0.10.1_linux_amd64.zip -o /tmp/nomad.zip | ||
sudo unzip -d /usr/local/bin/ /tmp/nomad.zip | ||
SHELL | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
server = true | ||
bootstrap_expect = 1 | ||
ports { | ||
http = 8500 | ||
grpc = 8502 | ||
} | ||
addresses { | ||
http = "0.0.0.0" | ||
} | ||
# set VMs ip | ||
bind_addr = "192.168.33.10" | ||
client_addr = "0.0.0.0" | ||
# set VMs ip | ||
start_join=["192.168.33.10"] | ||
ui = true | ||
connect { | ||
enabled = true | ||
} | ||
node_name = "server" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
kind = "proxy-defaults" | ||
name = "global" | ||
config { | ||
protocol = "http" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
kind = "service-router" | ||
name = "service_a" | ||
routes = [ | ||
{ | ||
match { | ||
http { | ||
path_prefix = "/hello_b" | ||
} | ||
} | ||
destination { | ||
service = "service_b" | ||
} | ||
}, | ||
# NOTE: a default catch-all will send unmatched traffic to "service_a" | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
kind = "service-resolver" | ||
name = "service_b" | ||
default_subset = "v1" | ||
subsets = { | ||
"v1" = { | ||
filter = "Service.Meta.version == v1" | ||
} | ||
"v2" = { | ||
filter = "Service.Meta.version == v2" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
|
||
kind = "service-splitter" | ||
name = "service_b" | ||
splits = [ | ||
{ | ||
weight = 85 | ||
service_subset = "v1" | ||
}, | ||
{ | ||
weight = 15 | ||
service_subset = "v2" | ||
}, | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
Kind = "service-defaults" | ||
Name = "service_a" | ||
Protocol = "http" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
Kind = "service-defaults" | ||
Name = "service_b" | ||
Protocol = "http" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
{ | ||
"ID": "service_a", | ||
"Name": "service_a", | ||
"Address": "127.0.0.1", | ||
"Port": 3000, | ||
"Meta": { | ||
"version": "v1" | ||
}, | ||
"Check": { | ||
"DeregisterCriticalServiceAfter": "90m", | ||
"HTTP": "http://127.0.0.1:3000/health", | ||
"Interval": "10s" | ||
}, | ||
"Connect": { | ||
"SidecarService":{ | ||
"Proxy":{ | ||
"upstreams": [{ | ||
"destination_name": "service_b", | ||
"local_bind_port": 9000 | ||
}] | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
{ | ||
"ID": "service_a", | ||
"Name": "service_a", | ||
"Address": "127.0.0.1", | ||
"Port": 3000, | ||
"Meta": { | ||
"version": "v1" | ||
}, | ||
"Check": { | ||
"DeregisterCriticalServiceAfter": "90m", | ||
"HTTP": "http://127.0.0.1:3000/health", | ||
"Interval": "10s" | ||
}, | ||
"Connect": { | ||
"SidecarService":{ | ||
"Proxy":{ | ||
"upstreams": [ | ||
{ | ||
"destination_name": "service_a", | ||
"local_bind_port": 9000 | ||
}, | ||
{ | ||
"destination_name": "service_b", | ||
"local_bind_port": 9001 | ||
} | ||
] | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"ID": "service_b", | ||
"Name": "service_b", | ||
"Address": "127.0.0.1", | ||
"Port": 3001, | ||
"Meta": { | ||
"version": "v1" | ||
}, | ||
"Check": { | ||
"DeregisterCriticalServiceAfter": "90m", | ||
"HTTP": "http://127.0.0.1:3001/health", | ||
"Interval": "10s" | ||
}, | ||
"connect": { | ||
"sidecar_service":{ | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"ID": "service_b_2", | ||
"Name": "service_b", | ||
"Address": "127.0.0.1", | ||
"Port": 3002, | ||
"Meta": { | ||
"version": "v2" | ||
}, | ||
"Check": { | ||
"DeregisterCriticalServiceAfter": "90m", | ||
"HTTP": "http://127.0.0.1:3002/health", | ||
"Interval": "10s" | ||
}, | ||
"connect": { | ||
"sidecar_service":{ | ||
} | ||
} | ||
} |
Oops, something went wrong.