feat(config): integrate etcd for service discovery and config management

- Add etcd-client dependency for distributed configuration storage
- Implement EtcdConfig with priority: etcd > environment variables > defaults
- Add ServiceRegistry for service registration with lease keep-alive
- Integrate etcd-based service discovery for appks gRPC connections
- Add service watcher for real-time service instance updates
- Migrate Redis configuration from single URL to cluster node list
- Update Dockerfile with default IMKS_HOST and IMKS_PORT environment variables
- Add etcd bootstrap configuration through environment variables
- Implement Redis cluster URL building with optional authentication
This commit is contained in:
zhenyi
2026-06-11 16:22:23 +08:00
parent 1b300865d9
commit e72866db8d
9 changed files with 316 additions and 62 deletions
Generated
+20
View File
@@ -939,6 +939,24 @@ dependencies = [
"windows-sys 0.61.2",
]
[[package]]
name = "etcd-client"
version = "0.18.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5ed900ba953ca6bf1fadb75e0c6b73d8463b9e2bb6bdb7b4573e8e7295852fbe"
dependencies = [
"http 1.4.2",
"prost",
"tokio",
"tokio-stream",
"tonic",
"tonic-build",
"tonic-prost",
"tonic-prost-build",
"tower",
"tower-service",
]
[[package]]
name = "etcetera"
version = "0.11.0"
@@ -1612,6 +1630,7 @@ dependencies = [
"base64",
"chrono",
"dashmap",
"etcd-client",
"fred",
"futures-util",
"jsonwebtoken",
@@ -1629,6 +1648,7 @@ dependencies = [
"sqlx",
"thiserror 2.0.18",
"tokio",
"tokio-stream",
"tonic",
"tonic-build",
"tonic-health",