2023-02-08 02:56:15 +00:00
|
|
|
#!/bin/bash
|
2023-03-28 22:48:58 +00:00
|
|
|
# Copyright (c) HashiCorp, Inc.
|
|
|
|
# SPDX-License-Identifier: MPL-2.0
|
|
|
|
|
2023-02-08 02:56:15 +00:00
|
|
|
|
|
|
|
set -eEuo pipefail
|
|
|
|
|
|
|
|
upsert_config_entry primary '
|
|
|
|
Kind = "service-defaults"
|
|
|
|
Name = "s2"
|
|
|
|
Protocol = "http"
|
|
|
|
EnvoyExtensions = [
|
|
|
|
{
|
|
|
|
Name = "builtin/http/localratelimit",
|
|
|
|
Arguments = {
|
|
|
|
ProxyType = "connect-proxy"
|
|
|
|
MaxTokens = 1,
|
|
|
|
TokensPerFill = 1,
|
|
|
|
FillInterval = 120,
|
|
|
|
FilterEnabled = 100,
|
|
|
|
FilterEnforced = 100,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
|
|
|
'
|
|
|
|
|
|
|
|
upsert_config_entry primary '
|
|
|
|
Kind = "service-defaults"
|
|
|
|
Name = "s1"
|
|
|
|
Protocol = "tcp"
|
|
|
|
EnvoyExtensions = [
|
|
|
|
{
|
|
|
|
Name = "builtin/http/localratelimit",
|
|
|
|
Arguments = {
|
|
|
|
ProxyType = "connect-proxy"
|
|
|
|
MaxTokens = 1,
|
|
|
|
TokensPerFill = 1,
|
|
|
|
FillInterval = 120,
|
|
|
|
FilterEnabled = 100,
|
|
|
|
FilterEnforced = 100,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
|
|
|
'
|
|
|
|
|
|
|
|
register_services primary
|
|
|
|
|
|
|
|
gen_envoy_bootstrap s1 19000 primary
|
|
|
|
gen_envoy_bootstrap s2 19001 primary
|