feat: pass LOG_LEVEL to the webhooks container, expose a CSI node metrics port - #210
Open
duckhawk wants to merge 1 commit into
Open
feat: pass LOG_LEVEL to the webhooks container, expose a CSI node metrics port#210duckhawk wants to merge 1 commit into
duckhawk wants to merge 1 commit into
Conversation
…rics port Two gaps that block the storage modules from moving onto one logger and one metrics endpoint. The webhooks container gets no environment at all, and there is no way to add any: a module wanting to set its log level has to override webhooksCommand, and because overriding the command means restating the TLS flags, it ends up restating webhooksCertMountPath too. LOG_LEVEL is now injected the same way the controller container gets it -- from helm_lib_module_controller_log_level, so the two containers of one Deployment cannot disagree about the level -- and additionalWebhooksEnvs covers anything else a module needs. helm_lib_csi_node_manifests exposes no container port. helm_lib_csi_controller_ manifests has additionalControllerPorts and helm_lib_module_controller_manifests has controllerMetricsPort, but a CSI node DaemonSet has neither, and it has no Service either, so scraping it means a PodMonitor on a numeric targetPort that silently follows the port if it ever moves. nodeMetricsPort renders a named "metrics" containerPort a PodMonitor can select by name. Both are additive: a chart that sets neither renders exactly as before. Signed-off-by: v.oleynikov <vasily.oleynikov@flant.com>
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Two additive parameters, both needed by the storage modules that are consolidating on one logger and one metrics endpoint.
helm_lib_module_controller_manifests— thewebhookscontainer now gets anenv:block:LOG_LEVEL, fromhelm_lib_module_controller_log_level, exactly as thecontrollercontainer already gets it.additionalWebhooksEnvs, the counterpart of the existingadditionalControllerEnvs.helm_lib_csi_node_manifests— newnodeMetricsPort, which renders a namedmetricscontainerPorton thenodecontainer.Why do we need it, and what problem does it solve?
The
webhookscontainer gets no environment at all, and there is no way to add any. A module that wants to set the webhook's log level has to overridewebhooksCommand; and because overriding the command means restating the TLS flags, it also has to restatewebhooksCertMountPath. The result is a chart carrying a copy of lib-helm's own default command purely to pass one variable, which then silently drifts from the library's. InjectingLOG_LEVELfrom the same helper the controller uses also means the two containers of one Deployment cannot disagree about the level.helm_lib_csi_node_manifestsexposes no container port.helm_lib_csi_controller_manifestshasadditionalControllerPortsandhelm_lib_module_controller_manifestshascontrollerMetricsPort, but a CSI node DaemonSet has neither — and it has no Service either, so the only way to scrape it today is a PodMonitor on a numerictargetPort, which silently follows the container's port if it ever moves. A named port lets the PodMonitor select it by name.What is the expected result?
Both parameters are additive. A chart that sets neither renders exactly as before, with one intended exception:
webhookEnabled: truenow addsLOG_LEVELto the webhooks container, so the controller Deployment rolls once on upgrade. The webhook binaries that do not read it are unaffected.With them set:
renders
LOG_LEVELplusMETRICS_BIND_ADDRESSon the webhooks container, and a namedmetricsport on the CSI node container that a PodMonitor can reference asport: metrics.Covered by four new cases in
helm_lib_module_controller_manifests_test.yamlandhelm_lib_csi_node_test.yaml: the level reaches the webhooks container as the numeric value,additionalWebhooksEnvsis appended after it, the named port renders whennodeMetricsPortis set, and noportskey appears when it is not.helm unittest ./tests/— 362 passed.Chart version bumped to 1.72.16; 1.72.15 is taken by the open VPA PR, so this leaves that one free to merge in either order.
Checklist