diff options
author | Roberto Hidalgo <un@rob.mx> | 2023-05-05 16:18:24 -0600 |
---|---|---|
committer | Roberto Hidalgo <un@rob.mx> | 2023-05-22 08:57:15 -0600 |
commit | 02ba9016ab6eca5bb4964549de002573d5a3a07a (patch) | |
tree | 85fc01db2fa60605d2016f253da3a64ae8ef75d9 /src/util | |
parent | 9d833bb7efc2c166036db38da89b0b5ac8f466fe (diff) | |
download | garage-02ba9016ab6eca5bb4964549de002573d5a3a07a.tar.gz garage-02ba9016ab6eca5bb4964549de002573d5a3a07a.zip |
register consul services against local agent instead of catalog api
Diffstat (limited to 'src/util')
-rw-r--r-- | src/util/config.rs | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/src/util/config.rs b/src/util/config.rs index 95835bbb..4b32f8ba 100644 --- a/src/util/config.rs +++ b/src/util/config.rs @@ -56,6 +56,9 @@ pub struct Config { /// Configuration for automatic node discovery through Consul #[serde(default)] pub consul_discovery: Option<ConsulDiscoveryConfig>, + /// Configuration for automatic node discovery through Consul + #[serde(default)] + pub consul_service_discovery: Option<ConsulServiceConfig>, /// Configuration for automatic node discovery through Kubernetes #[serde(default)] pub kubernetes_discovery: Option<KubernetesDiscoveryConfig>, @@ -153,6 +156,24 @@ pub struct ConsulDiscoveryConfig { } #[derive(Deserialize, Debug, Clone)] +pub struct ConsulServiceConfig { + /// Consul http or https address to connect to to discover more peers + pub consul_http_addr: String, + /// Token to use for connecting to consul + pub consul_http_token: Option<String>, + /// Consul service name to use + pub service_name: String, + /// CA TLS certificate to use when connecting to Consul + pub ca_cert: Option<String>, + // Additional tags to add to the service + #[serde(default)] + pub tags: Vec<String>, + /// Skip TLS hostname verification + #[serde(default)] + pub tls_skip_verify: bool, +} + +#[derive(Deserialize, Debug, Clone)] pub struct KubernetesDiscoveryConfig { /// Kubernetes namespace the service discovery resources are be created in pub namespace: String, @@ -344,7 +365,7 @@ mod tests { replication_mode = "3" rpc_bind_addr = "[::]:3901" rpc_secret_file = "{}" - + [s3_api] s3_region = "garage" api_bind_addr = "[::]:3900" @@ -388,7 +409,7 @@ mod tests { rpc_bind_addr = "[::]:3901" rpc_secret= "dummy" rpc_secret_file = "dummy" - + [s3_api] s3_region = "garage" api_bind_addr = "[::]:3900" |