Skip to content

Support hot-reloading of Ditto HOCON configuration via Kubernetes ConfigMap file watching#2369

Draft
thjaeckle wants to merge 1 commit into
eclipse-ditto:masterfrom
beyonnex-io:feature/dynamic-config-reload
Draft

Support hot-reloading of Ditto HOCON configuration via Kubernetes ConfigMap file watching#2369
thjaeckle wants to merge 1 commit into
eclipse-ditto:masterfrom
beyonnex-io:feature/dynamic-config-reload

Conversation

@thjaeckle
Copy link
Copy Markdown
Member

Adds a DynamicConfigWatcherActor that polls a ConfigMap-mounted file for changes, merges dynamic config with the static config, and notifies consumers via two patterns:

  • EventStream-based DynamicConfigChanged events for singleton/low-count actors
  • DynamicConfigPoller utility for high-volume sharded actors (version-polling pattern)

Config values that can now be changed without pod restart include namespace-scoped activity checks, custom metrics, entity creation restrictions, gateway authentication (OAuth issuers, DevOps auth, pre-authentication), streaming config, background sync, persistence cleanup, and WoT ThingModel validation.

Includes Helm chart changes to support a separate dynamic ConfigMap (without checksum annotation, so updates don't trigger pod restarts) and version-keyed parsed config caching in DynamicConfigWatcherExtension to minimize memory overhead across 500K+ sharded actor instances.

Resolves: #2366

@thjaeckle thjaeckle self-assigned this Mar 13, 2026
…figMap file watching

Adds a DynamicConfigWatcherActor that polls a ConfigMap-mounted file for changes,
merges dynamic config with the static config, and notifies consumers via two patterns:
- EventStream-based DynamicConfigChanged events for singleton/low-count actors
- DynamicConfigPoller utility for high-volume sharded actors (version-polling pattern)

Config values that can now be changed without pod restart include namespace-scoped
activity checks, custom metrics, entity creation restrictions, gateway authentication
(OAuth issuers, DevOps auth, pre-authentication), streaming config, background sync,
persistence cleanup, and WoT ThingModel validation.

Includes Helm chart changes to support a separate dynamic ConfigMap (without checksum
annotation, so updates don't trigger pod restarts) and version-keyed parsed config
caching in DynamicConfigWatcherExtension to minimize memory overhead across 500K+
sharded actor instances.

Closes: eclipse-ditto#2366

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@thjaeckle thjaeckle force-pushed the feature/dynamic-config-reload branch from da2497a to 9c78d24 Compare March 13, 2026 13:50
@kalinkostashki
Copy link
Copy Markdown
Contributor

@thjaeckle The scope of cluster settings would include number-of-shards.
Won't that require a full cluster restart to enforce?
From the pekko documentation:

The number-of-shards configuration value must be the same for all nodes in the cluster and that is verified by configuration check when joining. Changing the value requires stopping all nodes in the cluster.

@thjaeckle
Copy link
Copy Markdown
Member Author

@kalinkostashki that's right - this hot-reloading should only support ditto. config.
It is not safe to do that with pekko. config - as Pekko expects that config to be immutable and it is only loaded once at ActorSystem start.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

Support hot-reloading of Ditto-specific HOCON configuration via Kubernetes ConfigMap file watching

2 participants