f759a48726
The DNS resolution will be handled by Envoy and defaults to LOGICAL_DNS. This discovery type can be overridden on a per-gateway basis with the envoy_dns_discovery_type Gateway Option. If a service contains an instance with a hostname as an address we set the Envoy cluster to use DNS as the discovery type rather than EDS. Since both mesh gateways and terminating gateways route to clusters using SNI, whenever there is a mix of hostnames and IP addresses associated with a service we use the hostname + CDS rather than the IPs + EDS. Note that we detect hostnames by attempting to parse the service instance's address as an IP. If it is not a valid IP we assume it is a hostname.
34 lines
957 B
Bash
34 lines
957 B
Bash
#!/usr/bin/env bats
|
|
|
|
load helpers
|
|
|
|
@test "terminating 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 "terminating-gateway-primary listener is up on :8443" {
|
|
retry_default nc -z localhost:8443
|
|
}
|
|
|
|
@test "terminating-gateway should have healthy endpoints for s4" {
|
|
assert_upstream_has_endpoints_in_status 127.0.0.1:20000 s4 HEALTHY 1
|
|
}
|
|
|
|
@test "s1 upstream should have healthy endpoints for s4" {
|
|
assert_upstream_has_endpoints_in_status 127.0.0.1:19000 s4.default.primary HEALTHY 1
|
|
}
|
|
|
|
@test "s1 upstream should be able to connect to s4" {
|
|
run retry_default curl -s -f -d hello localhost:5000
|
|
[ "$status" -eq 0 ]
|
|
[ "$output" = "hello" ]
|
|
}
|
|
|
|
@test "terminating-gateway is used for the upstream connection" {
|
|
assert_envoy_metric_at_least 127.0.0.1:20000 "s4.default.primary.*cx_total" 1
|
|
}
|