【发布时间】:2021-03-01 18:07:06
【问题描述】:
我尝试按照以下示例在我的 kubernetes 集群中配置 envoy:https://www.envoyproxy.io/docs/envoy/latest/start/quick-start/configuration-dynamic-filesystem
我的静态特使配置:
node:
cluster: test-cluster
id: test-id
dynamic_resources:
cds_config:
path: /var/lib/envoy/cds.yaml
lds_config:
path: /var/lib/envoy/lds.yaml
admin:
access_log_path: "/dev/null"
address:
socket_address:
address: 0.0.0.0
port_value: 19000
来自 configmap 的动态配置被挂载到并包含文件。
我使用 configmap 将配置文件(cds.yaml 和 lds.yaml)挂载到 envoy pod(到 /var/lib/envoy/),但不幸的是,当我更改 configmap 中的配置时,envoy 配置没有改变。挂载的配置文件按预期更新。
我可以从日志中看到,envoy 监视配置文件:
[2021-03-01 17:50:21.063][1][debug][file] [source/common/filesystem/inotify/watcher_impl.cc:47] added watch for directory: '/var/lib/envoy' file: 'cds.yaml' fd: 1
[2021-03-01 17:50:21.063][1][debug][upstream] [source/common/upstream/cluster_manager_impl.cc:140] maybe finish initialize state: 1
[2021-03-01 17:50:21.063][1][debug][upstream] [source/common/upstream/cluster_manager_impl.cc:149] maybe finish initialize primary init clusters empty: true
[2021-03-01 17:50:21.063][1][info][config] [source/server/configuration_impl.cc:95] loading 0 listener(s)
[2021-03-01 17:50:21.063][1][info][config] [source/server/configuration_impl.cc:107] loading stats configuration
[2021-03-01 17:50:21.063][1][debug][file] [source/common/filesystem/inotify/watcher_impl.cc:47] added watch for directory: '/var/lib/envoy' file: 'lds.yaml' fd: 1
一旦我更新了 configmap,我也会得到一些改变的日志:
[2021-03-01 17:51:50.881][1][debug][file] [source/common/filesystem/inotify/watcher_impl.cc:72] notification: fd: 1 mask: 80 file: ..data
[2021-03-01 17:51:50.881][1][debug][file] [source/common/filesystem/inotify/watcher_impl.cc:72] notification: fd: 1 mask: 80 file: ..data
但 envoy 不会重新加载配置。
似乎 kubernetes 通过更改目录来更新配置文件,而 envoy 无法识别配置文件已更改。
有没有简单的方法来解决这个问题?我不想为我的测试运行 xDS 服务器,但热配置重新加载对我的测试非常有用????
谢谢!
【问题讨论】:
标签: kubernetes envoyproxy configmap