2023-06-06 14:04:31 +00:00
|
|
|
#!/bin/bash
|
|
|
|
# Copyright (c) HashiCorp, Inc.
|
2023-08-11 13:12:13 +00:00
|
|
|
# SPDX-License-Identifier: BUSL-1.1
|
2023-06-06 14:04:31 +00:00
|
|
|
|
|
|
|
|
|
|
|
set -eEuo pipefail
|
|
|
|
|
|
|
|
upsert_config_entry primary '
|
|
|
|
Kind = "service-defaults"
|
|
|
|
Name = "s2"
|
|
|
|
Protocol = "http"
|
|
|
|
EnvoyExtensions = [
|
|
|
|
{
|
|
|
|
Name = "builtin/property-override"
|
|
|
|
Arguments = {
|
|
|
|
ProxyType = "connect-proxy"
|
|
|
|
Patches = [{
|
|
|
|
ResourceFilter = {
|
|
|
|
ResourceType = "listener"
|
|
|
|
TrafficDirection = "inbound"
|
|
|
|
}
|
|
|
|
Op = "add"
|
|
|
|
Path = "/stat_prefix"
|
|
|
|
Value = "custom.stats.s2"
|
|
|
|
}]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
|
|
|
'
|
|
|
|
|
2023-06-06 19:40:37 +00:00
|
|
|
upsert_config_entry primary '
|
|
|
|
Kind = "service-defaults"
|
|
|
|
Name = "s3"
|
|
|
|
Protocol = "http"
|
|
|
|
'
|
|
|
|
|
2023-06-06 14:04:31 +00:00
|
|
|
upsert_config_entry primary '
|
|
|
|
Kind = "service-defaults"
|
|
|
|
Name = "s1"
|
|
|
|
Protocol = "http"
|
|
|
|
EnvoyExtensions = [
|
|
|
|
{
|
|
|
|
Name = "builtin/property-override"
|
|
|
|
Arguments = {
|
|
|
|
ProxyType = "connect-proxy"
|
2023-06-06 19:40:37 +00:00
|
|
|
Patches = [
|
|
|
|
{
|
2023-06-06 14:04:31 +00:00
|
|
|
ResourceFilter = {
|
|
|
|
ResourceType = "cluster"
|
|
|
|
TrafficDirection = "outbound"
|
|
|
|
}
|
|
|
|
Op = "add"
|
|
|
|
Path = "/upstream_connection_options/tcp_keepalive/keepalive_probes"
|
|
|
|
Value = 1234
|
2023-06-06 19:40:37 +00:00
|
|
|
},
|
2023-06-20 14:00:01 +00:00
|
|
|
{
|
|
|
|
ResourceFilter = {
|
|
|
|
ResourceType = "cluster"
|
|
|
|
TrafficDirection = "outbound"
|
|
|
|
}
|
|
|
|
Op = "add"
|
|
|
|
Path = "/outlier_detection/max_ejection_time/seconds"
|
|
|
|
Value = 120
|
|
|
|
},
|
|
|
|
{
|
|
|
|
ResourceFilter = {
|
|
|
|
ResourceType = "cluster"
|
|
|
|
TrafficDirection = "outbound"
|
|
|
|
}
|
|
|
|
Op = "add"
|
|
|
|
Path = "/outlier_detection/max_ejection_time_jitter/seconds"
|
|
|
|
Value = 1
|
|
|
|
},
|
2023-06-06 19:40:37 +00:00
|
|
|
{
|
|
|
|
ResourceFilter = {
|
|
|
|
ResourceType = "cluster"
|
|
|
|
TrafficDirection = "outbound"
|
|
|
|
Services = [{
|
2023-06-20 14:00:01 +00:00
|
|
|
Name = "s3"
|
2023-06-06 19:40:37 +00:00
|
|
|
}]
|
|
|
|
}
|
|
|
|
Op = "remove"
|
|
|
|
Path = "/outlier_detection"
|
|
|
|
}
|
|
|
|
]
|
2023-06-06 14:04:31 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
|
|
|
'
|
|
|
|
|
|
|
|
register_services primary
|
|
|
|
|
|
|
|
gen_envoy_bootstrap s1 19000 primary
|
|
|
|
gen_envoy_bootstrap s2 19001 primary
|