feat: add checksum support for external ConfigMap usage#708
Conversation
stevehipwell
left a comment
There was a problem hiding this comment.
Why not just use podAnnotations (this would work correctly with no changes)? This change just adds to the API surface for no real benefit.
|
I am subcharting, and therefore parent chart templates cannot inject dynamic values into the subchart's podAnnotations at render-time because subcharts are processed in a separate scope. |
@elimayost I'm not sure I follow your argument or your use case given that sub-charts are part of a single context with the parent chart. Your PR adds |
|
@stevehipwell That would work if I wanted to type the hash or annotation. But I want helm to calculate the hash.
|
|
@elimayost your PR only adds support for explicitly setting the annotation via a value, if
Correct, but why would you want to?
This is incorrect, templates all operate at a global scope (it's why the names are If you want to provide some more details about how you're setting the configuration that may shed a bit more light on how this should be handled. |
|
@stevehipwell Sure. I subchart your chart. In my parent chart I have a config folder with various config files:
In my values.yaml, fluentd.extraFilesConfigMapNameOverride: fluentd-future-conf, where fluentd-future-conf is:
I want to restart the pods every time a file changes in config directory. Hope that explains the issue clearly. |
|
@elimayost this PR doesn't do anything for you if you're not passing in an explicit config hash, which you've said you're not doing. So I'm trying to understand the purpose of this PR? The real fix for your use case is to add support for templating the values for the |
Removed the fluentd.configChecksum helper function to simplify the template. Signed-off-by: elimayost <eli.mayost@googlemail.com>
Signed-off-by: elimayost <eli.mayost@googlemail.com>
Removed checksum configuration for externally managed configMap files. Signed-off-by: elimayost <eli.mayost@googlemail.com>
Signed-off-by: elimayost <eli.mayost@googlemail.com>
Signed-off-by: elimayost <eli.mayost@googlemail.com>
|
@stevehipwell Makes sense. I've made a mess of this PR, so opened #709. |
|
@elimayost I'll close this out then. |
Summary
This PR adds support for triggering DaemonSet pod restarts when using
externally managed ConfigMaps via
extraFilesConfigMapNameOverride.Currently, the chart computes a checksum only from the internally
managed ConfigMap. When users override the ConfigMap name, there is no
mechanism to trigger a rollout when the external configuration changes.
Changes
fluentd.configChecksumextraFilesConfigMapChecksumis used
values.yamlto document:extraFilesConfigMapChecksumBehavior
Default (no override)
fluentd-configurations-cm.yamlchanges
External ConfigMap usage
When:
When override is set but checksum is not:
checksum/configannotation is renderedRationale
Helm charts typically rely on pod template annotations to trigger
rolling updates when configuration changes.
When using externally managed ConfigMaps, the chart cannot infer changes
automatically. This addition allows users to explicitly control rollout
behavior via a checksum value.
Backward compatibility
Testing
Verified with:
and combinations of:
Files changed