-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add http2 and grpc support to ingress gateways (#8458)
- Loading branch information
1 parent
f5e62f1
commit 2953580
Showing
13 changed files
with
386 additions
and
52 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,3 @@ | ||
```release-note:improvement | ||
connect: Add support for http2 and grpc to ingress gateways | ||
``` |
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
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
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
3 changes: 3 additions & 0 deletions
3
test/integration/connect/envoy/case-ingress-gateway-grpc/capture.sh
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 @@ | ||
#!/bin/bash | ||
|
||
snapshot_envoy_admin localhost:20000 ingress-gateway primary || true |
26 changes: 26 additions & 0 deletions
26
test/integration/connect/envoy/case-ingress-gateway-grpc/config_entries.hcl
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,26 @@ | ||
enable_central_service_config = true | ||
|
||
config_entries { | ||
bootstrap { | ||
kind = "service-defaults" | ||
name = "s1" | ||
protocol = "grpc" | ||
} | ||
bootstrap { | ||
kind = "ingress-gateway" | ||
name = "ingress-gateway" | ||
|
||
listeners = [ | ||
{ | ||
port = 9999 | ||
protocol = "grpc" | ||
services = [ | ||
{ | ||
name = "s1" | ||
hosts = ["localhost:9999"] | ||
} | ||
] | ||
} | ||
] | ||
} | ||
} |
4 changes: 4 additions & 0 deletions
4
test/integration/connect/envoy/case-ingress-gateway-grpc/gateway.hcl
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,4 @@ | ||
services { | ||
name = "ingress-gateway" | ||
kind = "ingress-gateway" | ||
} |
13 changes: 13 additions & 0 deletions
13
test/integration/connect/envoy/case-ingress-gateway-grpc/s1.hcl
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 @@ | ||
services { | ||
name = "s1" | ||
port = 8079 | ||
connect { | ||
sidecar_service { | ||
proxy { | ||
config { | ||
protocol = "grpc" | ||
} | ||
} | ||
} | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
test/integration/connect/envoy/case-ingress-gateway-grpc/setup.sh
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,10 @@ | ||
#!/bin/bash | ||
|
||
set -euo pipefail | ||
|
||
# wait for bootstrap to apply config entries | ||
wait_for_config_entry ingress-gateway ingress-gateway | ||
|
||
gen_envoy_bootstrap ingress-gateway 20000 primary true | ||
gen_envoy_bootstrap s1 19000 | ||
gen_envoy_bootstrap s2 19001 |
3 changes: 3 additions & 0 deletions
3
test/integration/connect/envoy/case-ingress-gateway-grpc/vars.sh
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 @@ | ||
#!/bin/bash | ||
|
||
export REQUIRED_SERVICES="$DEFAULT_REQUIRED_SERVICES ingress-gateway-primary" |
32 changes: 32 additions & 0 deletions
32
test/integration/connect/envoy/case-ingress-gateway-grpc/verify.bats
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,32 @@ | ||
#!/usr/bin/env bats | ||
|
||
load helpers | ||
|
||
@test "ingress proxy admin is up on :20000" { | ||
retry_default curl -f -s localhost:20000/stats -o /dev/null | ||
} | ||
|
||
@test "s1 proxy admin is up on :19000" { | ||
retry_default curl -f -s localhost:19000/stats -o /dev/null | ||
} | ||
|
||
@test "s2 proxy admin is up on :19001" { | ||
retry_default curl -f -s localhost:19001/stats -o /dev/null | ||
} | ||
|
||
@test "s1 proxy listener should be up and have right cert" { | ||
assert_proxy_presents_cert_uri localhost:21000 s1 | ||
} | ||
|
||
@test "ingress-gateway should have healthy endpoints for s1" { | ||
assert_upstream_has_endpoints_in_status 127.0.0.1:20000 s1 HEALTHY 1 | ||
} | ||
|
||
@test "ingress should be able to connect to s1 via grpc" { | ||
# This test also covers http2 since gRPC always uses http2 | ||
run fortio grpcping localhost:9999 | ||
|
||
echo "OUTPUT: $output" | ||
|
||
[ "$status" == 0 ] | ||
} |
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
Oops, something went wrong.